├── docs └── .gitignore ├── tmp └── .gitignore ├── tests ├── report │ └── .gitignore ├── Bootstrap.php └── EvaOAuthTest │ ├── OAuth1 │ ├── Token │ │ ├── RequestTokenTest.php │ │ └── AccessTokenTest.php │ ├── Signature │ │ ├── PlainTextTest.php │ │ └── HmacTest.php │ └── ConsumerTest.php │ ├── User │ └── UserTest.php │ ├── Utils │ ├── ResponseParserTest.php │ └── TextTest.php │ ├── Events │ ├── LogSubscriberTest.php │ └── FormatterTest.php │ ├── AuthorizedHttpClientTest.php │ ├── OAuth2 │ ├── Token │ │ └── AccessTokenTest.php │ ├── ClientTest.php │ └── GrantStrategy │ │ └── AuthorizationCodeTest.php │ └── ServiceTest.php ├── examples ├── .gitignore ├── request.php ├── access.php ├── config.php ├── service.php ├── index.php └── css │ ├── main.css │ └── normalize.css ├── .gitignore ├── .coveralls.yml ├── .scrutinizer.yml ├── .travis.yml ├── src └── EvaOAuth │ ├── Exception │ ├── ExceptionInterface.php │ ├── VerifyException.php │ ├── RequestException.php │ ├── BadMethodCallException.php │ └── InvalidArgumentException.php │ ├── OAuth2 │ ├── AuthorizationServerInterface.php │ ├── Providers │ │ ├── Hundsun.php │ │ ├── Weibo.php │ │ ├── Tencent.php │ │ ├── Facebook.php │ │ ├── Douban.php │ │ └── AbstractProvider.php │ ├── Token │ │ ├── AccessTokenInterface.php │ │ └── AccessToken.php │ ├── ResourceServerInterface.php │ ├── GrantStrategy │ │ ├── GrantStrategyInterface.php │ │ └── AuthorizationCode.php │ └── Client.php │ ├── User │ ├── UserProviderInterface.php │ ├── UserInterface.php │ └── StandardUser.php │ ├── Events │ ├── EventsManager.php │ ├── BeforeAuthorize.php │ ├── BeforeGetAccessToken.php │ ├── BeforeGetRequestToken.php │ ├── LogSubscriber.php │ └── Formatter.php │ ├── HttpClient.php │ ├── Token │ ├── AccessTokenInterface.php │ └── TokenTrait.php │ ├── OAuth1 │ ├── Signature │ │ ├── SignatureInterface.php │ │ ├── PlainText.php │ │ └── Hmac.php │ ├── Token │ │ ├── RequestTokenInterface.php │ │ ├── AccessTokenInterface.php │ │ ├── RequestToken.php │ │ └── AccessToken.php │ ├── ServiceProviderInterface.php │ ├── Providers │ │ ├── Twitter.php │ │ ├── Flickr.php │ │ └── AbstractProvider.php │ └── Consumer.php │ ├── Utils │ ├── Text.php │ └── ResponseParser.php │ ├── AdapterTrait.php │ ├── AuthorizedHttpClient.php │ └── Service.php ├── makefile ├── phpunit.xml.dist ├── phpdoc.xml ├── composer.json ├── LICENSE ├── README_CN.md └── README.md /docs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tmp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/report/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | oauth1/* 2 | config.local.php 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | vendor/* 3 | config.local.php 4 | config/access_token* 5 | tests/report/* 6 | .idea 7 | -------------------------------------------------------------------------------- /examples/request.php: -------------------------------------------------------------------------------- 1 | '; 5 | $service->requestAuthorize(); 6 | -------------------------------------------------------------------------------- /.coveralls.yml: -------------------------------------------------------------------------------- 1 | src_dir: . 2 | coverage_clover: ./tmp/clover.xml 3 | json_path: ./tmp/coveralls.json 4 | exclude_no_stmt: true 5 | -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | checks: 2 | php: true 3 | 4 | filter: 5 | excluded_paths: 6 | - tests/* 7 | - examples/* 8 | -------------------------------------------------------------------------------- /tests/Bootstrap.php: -------------------------------------------------------------------------------- 1 | addPsr4('Eva\EvaOAuthTest\\', __DIR__ . '/EvaOAuthTest'); 6 | -------------------------------------------------------------------------------- /examples/access.php: -------------------------------------------------------------------------------- 1 | '; 5 | $token = $service->getAccessToken(); 6 | var_dump($token); 7 | 8 | $httpClient = new \Eva\EvaOAuth\AuthorizedHttpClient($token); 9 | $response = $httpClient->get('https://graph.facebook.com/me'); 10 | echo $response; 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.4 5 | - 5.5 6 | - 5.6 7 | - 7.0 8 | 9 | matrix: 10 | fast_finish: true 11 | allow_failures: 12 | - php: 7.0 13 | 14 | before_script: 15 | - composer self-update 16 | - composer install --dev --prefer-source 17 | 18 | script: 19 | phpunit -v 20 | 21 | after_script: 22 | - ./vendor/bin/coveralls -v 23 | -------------------------------------------------------------------------------- /src/EvaOAuth/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ./tests 5 | 6 | 7 | 8 | 9 | src/ 10 | 11 | vendor/ 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/EvaOAuth/User/UserProviderInterface.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'key' => '', 6 | 'secret' => '', 7 | ], 8 | 'flickr' => [ 9 | 'key' => '', 10 | 'secret' => '', 11 | ], 12 | 'facebook' => [ 13 | 'key' => '', 14 | 'secret' => '', 15 | ], 16 | 'tencent' => [ 17 | 'key' => '', 18 | 'secret' => '', 19 | ], 20 | 'weibo' => [ 21 | 'key' => '', 22 | 'secret' => '', 23 | ], 24 | 'hundsun' => [ 25 | 'key' => '', 26 | 'secret' => '' 27 | ], 28 | 'douban' => [ 29 | 'key' => '', 30 | 'secret' => '' 31 | ] 32 | ]; 33 | -------------------------------------------------------------------------------- /phpdoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | EvaEngine 4 | 5 | tmp 6 | utf-8 7 | 8 | 9 | docs 10 | 11 | 12 | warn 13 | 14 | docs/log/{DATE}.log 15 | docs/log/{DATE}.errors.log 16 | 17 | 18 | 19 |