├── README.md ├── src └── Apio │ └── Oauth │ ├── Response │ ├── Response.php │ ├── ResponseAbstract.php │ └── ResponseInterface.php │ ├── Request │ ├── RequestBuilder.php │ ├── RequestInterface.php │ ├── Request.php │ └── RequestAbstract.php │ ├── Adapter │ ├── Vk.php │ ├── Disqus.php │ ├── Github.php │ ├── Google.php │ ├── MailRu.php │ ├── OpenID.php │ ├── Paypal.php │ ├── Reddit.php │ ├── Steam.php │ ├── Twitch.php │ ├── Yahoo.php │ ├── Blogger.php │ ├── Draugiem.php │ ├── Facebook.php │ ├── Instagram.php │ ├── Linkedin.php │ ├── SkyRock.php │ ├── Youtube.php │ ├── Amazon.php │ ├── Foursquare.php │ ├── LiveJournal.php │ ├── WindowsLive.php │ ├── Wordpress.php │ ├── Odnoklassniki.php │ ├── StackExchange.php │ └── LoginAdapterAbstract.php │ ├── Exception │ ├── ResponseError.php │ └── UnknowErrorCode.php │ ├── LoginInterface.php │ ├── Config │ ├── README.md │ └── Config.php │ └── Login.php ├── composer.json └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # apio 2 | Apio , consolidate all API requests 3 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Response/Response.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Request/RequestBuilder.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Request/RequestInterface.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Response/ResponseAbstract.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Response/ResponseInterface.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Request/Request.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Request/RequestAbstract.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Vk.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Exception/ResponseError.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Disqus.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Github.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Google.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/MailRu.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/OpenID.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Paypal.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Reddit.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Steam.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Twitch.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Yahoo.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Exception/UnknowErrorCode.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Blogger.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Draugiem.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Facebook.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Instagram.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Linkedin.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/SkyRock.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Youtube.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Amazon.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Foursquare.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/LiveJournal.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/WindowsLive.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Wordpress.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/Odnoklassniki.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/StackExchange.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Adapter/LoginAdapterAbstract.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /src/Apio/Oauth/LoginInterface.php: -------------------------------------------------------------------------------- 1 | =5.4.0", 15 | "guzzle/guzzle": "5.2.0", 16 | "symfony/yaml" : "dev-master" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Config/README.md: -------------------------------------------------------------------------------- 1 | ##Config 2 | 3 | Example config yaml format: 4 | ```yaml 5 | Adapters: 6 | Facebook: 7 | ApiID: 'facebook_api_id' 8 | SecretKey: 'facebook_api_secret_key' 9 | ``` 10 | 11 | Example config php format: 12 | ```php 13 | return array( 14 | 'Adapters' => array( 15 | 'Facebook' => array( 16 | 'ApiID' => 'facebook_api_id', 17 | 'SecretKey' => 'facebook_api_secret_key' 18 | ) 19 | ); 20 | ); 21 | ``` 22 | 23 | 24 | ```php 25 | getAdapterConfig('Facebook'); 32 | 33 | ``` -------------------------------------------------------------------------------- /src/Apio/Oauth/Login.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/Apio/Oauth/Config/Config.php: -------------------------------------------------------------------------------- 1 | values = $arrayValues; 19 | $this->configPath = $configPath; 20 | } 21 | 22 | public static function fromYaml($configPath) { 23 | if (!empty($configPath) && file_exists($configPath)) { 24 | $file = file_get_contents($configPath); 25 | $fileParams = Yaml::parse($file); 26 | if (is_array($fileParams)) { 27 | return new static($fileParams, $configPath); 28 | }else throw new \RuntimeException(sprintf('File \'%s\' must be valid YML!', $configPath)); 29 | }else throw new \InvalidArgumentException(sprintf('Config path \'%s\' must be a file!', $configPath)); 30 | } 31 | 32 | public static function fromPhp($configPath) { 33 | if (!empty($configPath) && file_exists($configPath)) { 34 | $fileParams = require($configPath); 35 | if (is_array($fileParams)) { 36 | return new static($fileParams, $configPath); 37 | }else throw new \RuntimeException(sprintf('File \'%s\' must be valid PhpArray Format!'), $configPath); 38 | }else throw new \InvalidArgumentException(sprintf('Config path \'%s\' must be a file!', $configPath)); 39 | } 40 | 41 | public function getConfigPath() { 42 | return $this->configPath; 43 | } 44 | 45 | public function getValues() { 46 | return $this->values; 47 | } 48 | 49 | public function getAdapterConfig($adapterName) { 50 | return (isset($this->values['Adapters'][$adapterName]) && !empty($this->values['Adapters'][$adapterName])) ? 51 | $this->values['Adapters'][$adapterName] : false; 52 | } 53 | } --------------------------------------------------------------------------------