├── tweet.txt ├── vendor ├── abraham │ └── twitteroauth │ │ ├── tests │ │ ├── fixtures │ │ │ ├── testResetLastResponse.json │ │ │ ├── testPostStatusUpdateWithInvalidMediaThrowsException.json │ │ │ ├── testOauth2Token.json │ │ │ ├── testOauthRequestTokenException.json │ │ │ ├── testOauth2TokenInvalidate.json │ │ │ ├── testDeleteDirectMessagesEventsDestroy.json │ │ │ ├── testOauthRequestToken.json │ │ │ ├── testPostDirectMessagesEventsNew.json │ │ │ ├── testOauthAccessTokenTokenException.json │ │ │ ├── testSetOauthToken.json │ │ │ ├── testSetProxy.json │ │ │ ├── testPostFavoritesCreate.json │ │ │ ├── testPostFavoritesDestroy.json │ │ │ ├── testPostStatusesDestroy.json │ │ │ ├── testPostStatusesUpdateUtf8.json │ │ │ └── testGetAccountVerifyCredentials.json │ │ ├── video.mp4 │ │ ├── kitten.jpg │ │ ├── bootstrap.php │ │ ├── mocks.php │ │ ├── ConsumerTest.php │ │ ├── TokenTest.php │ │ ├── vars.php │ │ ├── HmacSha1Test.php │ │ ├── Util │ │ │ └── JsonDecoderTest.php │ │ ├── AbstractSignatureMethodTest.php │ │ └── TwitterOAuthTest.php │ │ ├── .prettierignore │ │ ├── .gitignore │ │ ├── .prettierrc.json │ │ ├── src │ │ ├── TwitterOAuthException.php │ │ ├── Util │ │ │ └── JsonDecoder.php │ │ ├── Consumer.php │ │ ├── Token.php │ │ ├── HmacSha1.php │ │ ├── SignatureMethod.php │ │ ├── Response.php │ │ ├── Config.php │ │ ├── Util.php │ │ ├── Request.php │ │ └── TwitterOAuth.php │ │ ├── .github │ │ ├── workflows │ │ │ ├── lint.yaml │ │ │ └── test.yaml │ │ └── dependabot.yml │ │ ├── phpunit.xml │ │ ├── phpmd.xml │ │ ├── autoload.php │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── package.json │ │ ├── composer.json │ │ ├── CODE_OF_CONDUCT.md │ │ └── package-lock.json ├── composer │ ├── ca-bundle │ │ ├── phpstan.neon.dist │ │ ├── LICENSE │ │ ├── composer.json │ │ ├── README.md │ │ └── src │ │ │ └── CaBundle.php │ ├── autoload_classmap.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_static.php │ ├── autoload_real.php │ ├── LICENSE │ ├── installed.json │ └── ClassLoader.php └── autoload.php ├── composer.json ├── tweet.php └── composer.lock /tweet.txt: -------------------------------------------------------------------------------- 1 | Join guys @friend1 @friend2 @friend3 -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testResetLastResponse.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/.prettierignore: -------------------------------------------------------------------------------- 1 | vendor 2 | composer.lock 3 | tests/fixtures 4 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "abraham/twitteroauth": "^2.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | vendor 3 | env 4 | *.cache 5 | node_modules 6 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testPostStatusUpdateWithInvalidMediaThrowsException.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /vendor/composer/ca-bundle/phpstan.neon.dist: -------------------------------------------------------------------------------- 1 | parameters: 2 | level: 8 3 | paths: 4 | - src 5 | - tests 6 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsec7/twitdrop/master/vendor/abraham/twitteroauth/tests/video.mp4 -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/kitten.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsec7/twitdrop/master/vendor/abraham/twitteroauth/tests/kitten.jpg -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "phpVersion": "7.2", 4 | "trailingCommaPHP": true, 5 | "braceStyle": "psr-2" 6 | } 7 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | setStorage('json'); 10 | \VCR\VCR::turnOn(); 11 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/TwitterOAuthException.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class TwitterOAuthException extends \Exception 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/.github/workflows/lint.yaml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | on: push 3 | jobs: 4 | lint: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v2 8 | - uses: actions/setup-node@v1 9 | with: 10 | node-version: 12 11 | - run: npm ci 12 | - run: npm run lint 13 | -------------------------------------------------------------------------------- /vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/composer/ca-bundle/src'), 10 | 'Abraham\\TwitterOAuth\\' => array($vendorDir . '/abraham/twitteroauth/src'), 11 | ); 12 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: '/' 5 | schedule: 6 | interval: daily 7 | time: '11:00' 8 | open-pull-requests-limit: 10 9 | - package-ecosystem: composer 10 | directory: '/' 11 | schedule: 12 | interval: daily 13 | time: '11:00' 14 | open-pull-requests-limit: 10 15 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/mocks.php: -------------------------------------------------------------------------------- 1 | assertEquals( 19 | "Consumer[key=$key,secret=$secret]", 20 | $consumer->__toString() 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: push 3 | jobs: 4 | run: 5 | runs-on: ubuntu-latest 6 | strategy: 7 | fail-fast: false 8 | matrix: 9 | php-versions: ['7.2', '7.3', '7.4', '8.0'] 10 | name: PHP ${{ matrix.php-versions }} 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: shivammathur/setup-php@v2 14 | with: 15 | php-version: ${{ matrix.php-versions }} 16 | - run: composer validate --no-interaction --strict 17 | - run: composer install --no-interaction --prefer-dist 18 | - run: npm test 19 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | ./tests/ 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/phpmd.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | Keep TwitterOAuth source code clean. 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/Util/JsonDecoder.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class JsonDecoder 9 | { 10 | /** 11 | * Decodes a JSON string to stdObject or associative array 12 | * 13 | * @param string $string 14 | * @param bool $asArray 15 | * 16 | * @return array|object 17 | */ 18 | public static function decode(string $string, bool $asArray) 19 | { 20 | if ( 21 | version_compare(PHP_VERSION, '5.4.0', '>=') && 22 | !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4) 23 | ) { 24 | return json_decode($string, $asArray, 512, JSON_BIGINT_AS_STRING); 25 | } 26 | 27 | return json_decode($string, $asArray); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/Consumer.php: -------------------------------------------------------------------------------- 1 | key = $key; 32 | $this->secret = $secret; 33 | $this->callbackUrl = $callbackUrl; 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function __toString() 40 | { 41 | return "Consumer[key=$this->key,secret=$this->secret]"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/TokenTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($expected, $token->__toString()); 20 | } 21 | 22 | public function tokenProvider() 23 | { 24 | return [ 25 | ['oauth_token=key&oauth_token_secret=secret', 'key', 'secret'], 26 | [ 27 | 'oauth_token=key%2Bkey&oauth_token_secret=secret', 28 | 'key+key', 29 | 'secret', 30 | ], 31 | [ 32 | 'oauth_token=key~key&oauth_token_secret=secret', 33 | 'key~key', 34 | 'secret', 35 | ], 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/Token.php: -------------------------------------------------------------------------------- 1 | key = $key; 26 | $this->secret = $secret; 27 | } 28 | 29 | /** 30 | * Generates the basic string serialization of a token that a server 31 | * would respond to request_token and access_token calls with 32 | * 33 | * @return string 34 | */ 35 | public function __toString(): string 36 | { 37 | return sprintf( 38 | 'oauth_token=%s&oauth_token_secret=%s', 39 | Util::urlencodeRfc3986($this->key), 40 | Util::urlencodeRfc3986($this->secret) 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/composer/ca-bundle/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016 Composer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | 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 THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/autoload.php: -------------------------------------------------------------------------------- 1 | TwitterOAuth [![Build Status](https://github.com/abraham/twitteroauth/workflows/Test/badge.svg)](https://github.com/abraham/twitteroauth/actions) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/abraham/twitteroauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/abraham/twitteroauth/?branch=master) [![Issues Count](https://img.shields.io/github/issues/abraham/twitteroauth.svg)](https://github.com/abraham/twitteroauth/issues) [![Latest Version](https://img.shields.io/packagist/v/abraham/twitteroauth.svg)](https://packagist.org/packages/abraham/twitteroauth) [![Downloads this Month](https://img.shields.io/packagist/dm/abraham/twitteroauth.svg)](https://packagist.org/packages/abraham/twitteroauth) 2 | 3 | --- 4 | 5 |

The most popular PHP library for Twitter's OAuth REST API.

6 | 7 | See documentation at https://twitteroauth.com. 8 | 9 | PHP versions [listed](https://secure.php.net/supported-versions.php) as "active support" or "security fixes only" are supported. 10 | 11 | Twitter bird 12 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | 11 | array ( 12 | 'Composer\\CaBundle\\' => 18, 13 | ), 14 | 'A' => 15 | array ( 16 | 'Abraham\\TwitterOAuth\\' => 21, 17 | ), 18 | ); 19 | 20 | public static $prefixDirsPsr4 = array ( 21 | 'Composer\\CaBundle\\' => 22 | array ( 23 | 0 => __DIR__ . '/..' . '/composer/ca-bundle/src', 24 | ), 25 | 'Abraham\\TwitterOAuth\\' => 26 | array ( 27 | 0 => __DIR__ . '/..' . '/abraham/twitteroauth/src', 28 | ), 29 | ); 30 | 31 | public static function getInitializer(ClassLoader $loader) 32 | { 33 | return \Closure::bind(function () use ($loader) { 34 | $loader->prefixLengthsPsr4 = ComposerStaticInit9b3848761fb300e4dbd12202639d92f4::$prefixLengthsPsr4; 35 | $loader->prefixDirsPsr4 = ComposerStaticInit9b3848761fb300e4dbd12202639d92f4::$prefixDirsPsr4; 36 | 37 | }, null, ClassLoader::class); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/vars.php: -------------------------------------------------------------------------------- 1 | getSignatureBaseString(); 38 | 39 | $parts = [$consumer->secret, null !== $token ? $token->secret : '']; 40 | 41 | $parts = Util::urlencodeRfc3986($parts); 42 | $key = implode('&', $parts); 43 | 44 | return base64_encode(hash_hmac('sha1', $signatureBase, $key, true)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/HmacSha1Test.php: -------------------------------------------------------------------------------- 1 | getRequest(), 24 | $this->getConsumer(), 25 | $this->getToken(), 26 | ], 27 | [ 28 | 'EBw0gHngam3BTx8kfPfNNSyKem4=', 29 | $this->getRequest(), 30 | $this->getConsumer('key', 'secret'), 31 | $this->getToken(), 32 | ], 33 | [ 34 | 'kDsHFZzws2a5M6cAQjfpdNBo+v8=', 35 | $this->getRequest(), 36 | $this->getConsumer('key', 'secret'), 37 | $this->getToken('key', 'secret'), 38 | ], 39 | [ 40 | 'EBw0gHngam3BTx8kfPfNNSyKem4=', 41 | $this->getRequest(), 42 | $this->getConsumer('key', 'secret'), 43 | null, 44 | ], 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twitteroauth", 3 | "version": "0.0.0", 4 | "description": "The most popular PHP library for use with the Twitter OAuth REST API.", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/abraham/twitteroauth.git" 9 | }, 10 | "author": "Abraham Williams ", 11 | "homepage": "https://github.com/abraham/twitteroauth#readme", 12 | "bugs": { 13 | "url": "https://github.com/abraham/twitteroauth/issues" 14 | }, 15 | "scripts": { 16 | "fix": "concurrently npm:fix:*", 17 | "fix:phpcbf": "./vendor/bin/phpcbf src tests --standard=PSR12", 18 | "fix:prettier": "prettier . --write", 19 | "lint": "concurrently npm:lint:*", 20 | "lint:phpcs": "./vendor/bin/phpcs src tests --standard=PSR12", 21 | "lint:prettier": "prettier . --check", 22 | "postinstall": "composer install --no-interaction", 23 | "test": "./vendor/bin/phpunit" 24 | }, 25 | "keywords": [ 26 | "twitter", 27 | "api", 28 | "oauth", 29 | "rest", 30 | "social", 31 | "twitter-api", 32 | "twitter-oauth" 33 | ], 34 | "dependencies": {}, 35 | "devDependencies": { 36 | "@prettier/plugin-php": "0.16.0", 37 | "concurrently": "^5.3.0", 38 | "prettier": "2.2.1", 39 | "prettier-plugin-package": "1.3.0" 40 | }, 41 | "directories": { 42 | "test": "tests" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "abraham/twitteroauth", 3 | "type": "library", 4 | "description": "The most popular PHP library for use with the Twitter OAuth REST API.", 5 | "keywords": [ 6 | "twitter", 7 | "api", 8 | "oauth", 9 | "rest", 10 | "social", 11 | "twitter api", 12 | "twitter oauth" 13 | ], 14 | "license": "MIT", 15 | "homepage": "https://twitteroauth.com", 16 | "authors": [ 17 | { 18 | "name": "Abraham Williams", 19 | "email": "abraham@abrah.am", 20 | "homepage": "https://abrah.am", 21 | "role": "Developer" 22 | } 23 | ], 24 | "support": { 25 | "source": "https://github.com/abraham/twitteroauth", 26 | "issues": "https://github.com/abraham/twitteroauth/issues" 27 | }, 28 | "repositories": [ 29 | { 30 | "type": "git", 31 | "url": "https://github.com/morozov/php-vcr" 32 | }, 33 | { 34 | "type": "git", 35 | "url": "https://github.com/abraham/phpunit-testlistener-vcr" 36 | } 37 | ], 38 | "require": { 39 | "php": "^7.2 || ^7.3 || ^7.4 || ^8.0", 40 | "ext-curl": "*", 41 | "composer/ca-bundle": "^1.2" 42 | }, 43 | "require-dev": { 44 | "phpunit/phpunit": "^8", 45 | "squizlabs/php_codesniffer": "^3", 46 | "phpmd/phpmd": "^2", 47 | "php-vcr/php-vcr": "^1", 48 | "php-vcr/phpunit-testlistener-vcr": "dev-php-8" 49 | }, 50 | "autoload": { 51 | "psr-4": { 52 | "Abraham\\TwitterOAuth\\": "src" 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/Util/JsonDecoderTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($expected, JsonDecoder::decode($input, $asArray)); 16 | } 17 | 18 | public function jsonProvider() 19 | { 20 | return [ 21 | ['[]', true, []], 22 | ['[1,2,3]', true, [1, 2, 3]], 23 | [ 24 | '[{"id": 556179961825226750}]', 25 | true, 26 | [['id' => 556179961825226750]], 27 | ], 28 | ['[]', false, []], 29 | ['[1,2,3]', false, [1, 2, 3]], 30 | [ 31 | '[{"id": 556179961825226750}]', 32 | false, 33 | [ 34 | $this->getClass(function ($object) { 35 | $object->id = 556179961825226750; 36 | return $object; 37 | }), 38 | ], 39 | ], 40 | ]; 41 | } 42 | 43 | /** 44 | * @param callable $callable 45 | * 46 | * @return stdClass 47 | */ 48 | private function getClass(\Closure $callable) 49 | { 50 | $object = new \stdClass(); 51 | 52 | return $callable($object); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/composer/ca-bundle/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "composer/ca-bundle", 3 | "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", 4 | "type": "library", 5 | "license": "MIT", 6 | "keywords": [ 7 | "cabundle", 8 | "cacert", 9 | "certificate", 10 | "ssl", 11 | "tls" 12 | ], 13 | "authors": [ 14 | { 15 | "name": "Jordi Boggiano", 16 | "email": "j.boggiano@seld.be", 17 | "homepage": "http://seld.be" 18 | } 19 | ], 20 | "support": { 21 | "irc": "irc://irc.freenode.org/composer", 22 | "issues": "https://github.com/composer/ca-bundle/issues" 23 | }, 24 | "require": { 25 | "ext-openssl": "*", 26 | "ext-pcre": "*", 27 | "php": "^5.3.2 || ^7.0 || ^8.0" 28 | }, 29 | "require-dev": { 30 | "symfony/phpunit-bridge": "^4.2 || ^5", 31 | "phpstan/phpstan": "^0.12.55", 32 | "psr/log": "^1.0", 33 | "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" 34 | }, 35 | "autoload": { 36 | "psr-4": { 37 | "Composer\\CaBundle\\": "src" 38 | } 39 | }, 40 | "autoload-dev": { 41 | "psr-4": { 42 | "Composer\\CaBundle\\": "tests" 43 | } 44 | }, 45 | "extra": { 46 | "branch-alias": { 47 | "dev-main": "1.x-dev" 48 | } 49 | }, 50 | "scripts": { 51 | "test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit", 52 | "phpstan": "vendor/bin/phpstan analyse" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/AbstractSignatureMethodTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($this->name, $this->getClass()->getName()); 24 | } 25 | 26 | /** 27 | * @dataProvider signatureDataProvider 28 | */ 29 | public function testBuildSignature($expected, $request, $consumer, $token) 30 | { 31 | $this->assertEquals( 32 | $expected, 33 | $this->getClass()->buildSignature($request, $consumer, $token) 34 | ); 35 | } 36 | 37 | protected function getRequest() 38 | { 39 | return $this->getMockBuilder('Abraham\TwitterOAuth\Request') 40 | ->disableOriginalConstructor() 41 | ->getMock(); 42 | } 43 | 44 | protected function getConsumer( 45 | $key = null, 46 | $secret = null, 47 | $callbackUrl = null 48 | ) { 49 | return $this->getMockBuilder('Abraham\TwitterOAuth\Consumer') 50 | ->setConstructorArgs([$key, $secret, $callbackUrl]) 51 | ->getMock(); 52 | } 53 | 54 | protected function getToken($key = null, $secret = null) 55 | { 56 | return $this->getMockBuilder('Abraham\TwitterOAuth\Token') 57 | ->setConstructorArgs([$key, $secret]) 58 | ->getMock(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /tweet.php: -------------------------------------------------------------------------------- 1 | get('account/verify_credentials'); 34 | 35 | if ($conn->getLastHttpCode() == 200) { 36 | 37 | $conn->post('friendships/create', ['screen_name' => $data[3]]); 38 | if ($conn->getLastHttpCode() == 200) { 39 | echo "[+] Follow @". $data[3]." : Success\n"; 40 | } else { 41 | echo "[+] Follow @". $data[3]." : Failed\n"; 42 | } 43 | 44 | $conn->post('favorites/create', ['id' => $data[5]]); 45 | if ($conn->getLastHttpCode() == 200) { 46 | echo "[+] Like : Success\n"; 47 | } else { 48 | echo "[+] Like : Failed\n"; 49 | } 50 | 51 | $rt = $conn->post('statuses/update', ['status' => $q]); 52 | if ($conn->getLastHttpCode() == 200) { 53 | echo "[+] RT Link : https://twitter.com/" . $rt->user->screen_name . "/status/" .$rt->id."\n"; 54 | } else { 55 | echo "[+] RT : Failed\n"; 56 | } 57 | 58 | } else { 59 | echo 'Invalid API Key!'; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInit9b3848761fb300e4dbd12202639d92f4::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | return $loader; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/SignatureMethod.php: -------------------------------------------------------------------------------- 1 | buildSignature($request, $consumer, $token); 60 | 61 | // Check for zero length, although unlikely here 62 | if (strlen($built) == 0 || strlen($signature) == 0) { 63 | return false; 64 | } 65 | 66 | if (strlen($built) != strlen($signature)) { 67 | return false; 68 | } 69 | 70 | // Avoid a timing leak with a (hopefully) time insensitive compare 71 | $result = 0; 72 | for ($i = 0; $i < strlen($signature); $i++) { 73 | $result |= ord($built[$i]) ^ ord($signature[$i]); 74 | } 75 | 76 | return $result == 0; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testOauth2Token.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/oauth2\/token", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==", 9 | "Expect": null 10 | }, 11 | "body": "grant_type=client_credentials" 12 | }, 13 | "response": { 14 | "status": { 15 | "http_version": "2", 16 | "code": "200", 17 | "message": "" 18 | }, 19 | "headers": { 20 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 21 | "content-disposition": "attachment; filename=json.json", 22 | "content-encoding": "gzip", 23 | "content-length": "152", 24 | "content-type": "application\/json;charset=utf-8", 25 | "date": "Sun, 26 Apr 2020 00:31:09 GMT", 26 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 27 | "last-modified": "Sun, 26 Apr 2020 00:31:09 GMT", 28 | "ml": "A", 29 | "pragma": "no-cache", 30 | "server": "tsa_b", 31 | "set-cookie": "personalization_id=\"v1_NF00blSG9GZe8w8KpZvUDA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786106988547101; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 32 | "status": "200 OK", 33 | "strict-transport-security": "max-age=631138519", 34 | "x-connection-hash": "34e2373c53e7f9e0e80fe6af071dd6b8", 35 | "x-content-type-options": "nosniff", 36 | "x-frame-options": "DENY", 37 | "x-response-time": "20", 38 | "x-transaction": "007d4d19009f7a59", 39 | "x-tsa-request-body-time": "0", 40 | "x-twitter-response-tags": "BouncerCompliant", 41 | "x-ua-compatible": "IE=edge,chrome=1", 42 | "x-xss-protection": "0" 43 | }, 44 | "body": "{\"token_type\":\"bearer\",\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}" 45 | } 46 | }] -------------------------------------------------------------------------------- /vendor/composer/ca-bundle/README.md: -------------------------------------------------------------------------------- 1 | composer/ca-bundle 2 | ================== 3 | 4 | Small utility library that lets you find a path to the system CA bundle, 5 | and includes a fallback to the Mozilla CA bundle. 6 | 7 | Originally written as part of [composer/composer](https://github.com/composer/composer), 8 | now extracted and made available as a stand-alone library. 9 | 10 | 11 | Installation 12 | ------------ 13 | 14 | Install the latest version with: 15 | 16 | ```bash 17 | $ composer require composer/ca-bundle 18 | ``` 19 | 20 | 21 | Requirements 22 | ------------ 23 | 24 | * PHP 5.3.2 is required but using the latest version of PHP is highly recommended. 25 | 26 | 27 | Basic usage 28 | ----------- 29 | 30 | ### `Composer\CaBundle\CaBundle` 31 | 32 | - `CaBundle::getSystemCaRootBundlePath()`: Returns the system CA bundle path, or a path to the bundled one as fallback 33 | - `CaBundle::getBundledCaBundlePath()`: Returns the path to the bundled CA file 34 | - `CaBundle::validateCaFile($filename)`: Validates a CA file using openssl_x509_parse only if it is safe to use 35 | - `CaBundle::isOpensslParseSafe()`: Test if it is safe to use the PHP function openssl_x509_parse() 36 | - `CaBundle::reset()`: Resets the static caches 37 | 38 | 39 | #### To use with curl 40 | 41 | ```php 42 | $curl = curl_init("https://example.org/"); 43 | 44 | $caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath(); 45 | if (is_dir($caPathOrFile)) { 46 | curl_setopt($curl, CURLOPT_CAPATH, $caPathOrFile); 47 | } else { 48 | curl_setopt($curl, CURLOPT_CAINFO, $caPathOrFile); 49 | } 50 | 51 | $result = curl_exec($curl); 52 | ``` 53 | 54 | #### To use with php streams 55 | 56 | ```php 57 | $opts = array( 58 | 'http' => array( 59 | 'method' => "GET" 60 | ) 61 | ); 62 | 63 | $caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath(); 64 | if (is_dir($caPathOrFile)) { 65 | $opts['ssl']['capath'] = $caPathOrFile; 66 | } else { 67 | $opts['ssl']['cafile'] = $caPathOrFile; 68 | } 69 | 70 | $context = stream_context_create($opts); 71 | $result = file_get_contents('https://example.com', false, $context); 72 | ``` 73 | 74 | #### To use with Guzzle 75 | 76 | ```php 77 | $client = new \GuzzleHttp\Client([ 78 | \GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath() 79 | ]); 80 | ``` 81 | 82 | License 83 | ------- 84 | 85 | composer/ca-bundle is licensed under the MIT License, see the LICENSE file for details. 86 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestTokenException.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/oauth\/request_token", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"CONSUMER_KEY\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"wOUt6ZyVGpWnQhsHNWqcr%2BpOWAw%3D\"", 9 | "Expect": null 10 | } 11 | }, 12 | "response": { 13 | "status": { 14 | "http_version": "2", 15 | "code": "401", 16 | "message": "" 17 | }, 18 | "headers": { 19 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 20 | "content-disposition": "attachment; filename=json.json", 21 | "content-encoding": "gzip", 22 | "content-length": "89", 23 | "content-type": "application\/json; charset=utf-8", 24 | "date": "Sun, 26 Apr 2020 00:31:11 GMT", 25 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 26 | "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", 27 | "pragma": "no-cache", 28 | "server": "tsa_b", 29 | "set-cookie": "personalization_id=\"v1_Vz8Os736+fzUwkQGIeIKuw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107116335546; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 30 | "status": "401 Unauthorized", 31 | "strict-transport-security": "max-age=631138519", 32 | "www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\", api_error_code=32", 33 | "x-connection-hash": "d620dbb5b35e124662532c3ef8e89c88", 34 | "x-content-type-options": "nosniff", 35 | "x-frame-options": "SAMEORIGIN", 36 | "x-response-time": "6", 37 | "x-transaction": "00bf1248004cdafa", 38 | "x-twitter-response-tags": "BouncerCompliant", 39 | "x-xss-protection": "0" 40 | }, 41 | "body": "{\"errors\":[{\"code\":32,\"message\":\"Could not authenticate you.\"}]}" 42 | } 43 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testOauth2TokenInvalidate.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/oauth2\/invalidate_token", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==", 9 | "Expect": null 10 | }, 11 | "body": "access_token=AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0" 12 | }, 13 | "response": { 14 | "status": { 15 | "http_version": "2", 16 | "code": "200", 17 | "message": "" 18 | }, 19 | "headers": { 20 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 21 | "content-disposition": "attachment; filename=json.json", 22 | "content-encoding": "gzip", 23 | "content-length": "135", 24 | "content-type": "application\/json;charset=utf-8", 25 | "date": "Sun, 26 Apr 2020 00:31:10 GMT", 26 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 27 | "last-modified": "Sun, 26 Apr 2020 00:31:10 GMT", 28 | "ml": "A", 29 | "pragma": "no-cache", 30 | "server": "tsa_b", 31 | "set-cookie": "personalization_id=\"v1_8Iv+DqoXk8DVAVDoUVltSA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107054950627; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 32 | "status": "200 OK", 33 | "strict-transport-security": "max-age=631138519", 34 | "x-connection-hash": "18b7327592f746230c1c016c344dd14d", 35 | "x-content-type-options": "nosniff", 36 | "x-frame-options": "DENY", 37 | "x-response-time": "19", 38 | "x-transaction": "00c5257f00b7d371", 39 | "x-tsa-request-body-time": "0", 40 | "x-twitter-response-tags": "BouncerCompliant", 41 | "x-ua-compatible": "IE=edge,chrome=1", 42 | "x-xss-protection": "0" 43 | }, 44 | "body": "{\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}" 45 | } 46 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/Response.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class Response 13 | { 14 | /** @var string|null API path from the most recent request */ 15 | private $apiPath; 16 | /** @var int HTTP status code from the most recent request */ 17 | private $httpCode = 0; 18 | /** @var array HTTP headers from the most recent request */ 19 | private $headers = []; 20 | /** @var array|object Response body from the most recent request */ 21 | private $body = []; 22 | /** @var array HTTP headers from the most recent request that start with X */ 23 | private $xHeaders = []; 24 | 25 | /** 26 | * @param string $apiPath 27 | */ 28 | public function setApiPath(string $apiPath): void 29 | { 30 | $this->apiPath = $apiPath; 31 | } 32 | 33 | /** 34 | * @return string|null 35 | */ 36 | public function getApiPath(): ?string 37 | { 38 | return $this->apiPath; 39 | } 40 | 41 | /** 42 | * @param array|object $body 43 | */ 44 | public function setBody($body) 45 | { 46 | $this->body = $body; 47 | } 48 | 49 | /** 50 | * @return array|object|string 51 | */ 52 | public function getBody() 53 | { 54 | return $this->body; 55 | } 56 | 57 | /** 58 | * @param int $httpCode 59 | */ 60 | public function setHttpCode(int $httpCode): void 61 | { 62 | $this->httpCode = $httpCode; 63 | } 64 | 65 | /** 66 | * @return int 67 | */ 68 | public function getHttpCode(): int 69 | { 70 | return $this->httpCode; 71 | } 72 | 73 | /** 74 | * @param array $headers 75 | */ 76 | public function setHeaders(array $headers): void 77 | { 78 | foreach ($headers as $key => $value) { 79 | if (substr($key, 0, 1) == 'x') { 80 | $this->xHeaders[$key] = $value; 81 | } 82 | } 83 | $this->headers = $headers; 84 | } 85 | 86 | /** 87 | * @return array 88 | */ 89 | public function getsHeaders(): array 90 | { 91 | return $this->headers; 92 | } 93 | 94 | /** 95 | * @param array $xHeaders 96 | */ 97 | public function setXHeaders(array $xHeaders = []): void 98 | { 99 | $this->xHeaders = $xHeaders; 100 | } 101 | 102 | /** 103 | * @return array 104 | */ 105 | public function getXHeaders(): array 106 | { 107 | return $this->xHeaders; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testDeleteDirectMessagesEventsDestroy.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "DELETE", 4 | "url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/destroy.json?id=1254206523385032714", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"dY4KEaTg5Y6Bv4JlofNCjoArx%2F4%3D\"", 9 | "Expect": null 10 | } 11 | }, 12 | "response": { 13 | "status": { 14 | "http_version": "2", 15 | "code": "204", 16 | "message": "" 17 | }, 18 | "headers": { 19 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 20 | "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVSG2%3D%3D%3D&ro=false;", 21 | "content-type": "text\/html;charset=utf-8", 22 | "date": "Sun, 26 Apr 2020 00:31:52 GMT", 23 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 24 | "last-modified": "Sun, 26 Apr 2020 00:31:52 GMT", 25 | "pragma": "no-cache", 26 | "server": "tsa_b", 27 | "set-cookie": "personalization_id=\"v1_asAbLVWtv6V2+ARemo0VNA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111220677678; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 28 | "status": "204 No Content", 29 | "strict-transport-security": "max-age=631138519", 30 | "x-access-level": "read-write-directmessages", 31 | "x-connection-hash": "5cbff6bc4105c0040c4738daac7adcf4", 32 | "x-content-type-options": "nosniff", 33 | "x-frame-options": "SAMEORIGIN", 34 | "x-response-time": "37", 35 | "x-transaction": "00f02f6c00e12e76", 36 | "x-twitter-response-tags": "BouncerCompliant", 37 | "x-xss-protection": "0" 38 | } 39 | } 40 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestToken.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/oauth\/request_token", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"LR7ZVqY%2Fcdisw1w3zssKI6Yjbls%3D\"", 9 | "Expect": null 10 | } 11 | }, 12 | "response": { 13 | "status": { 14 | "http_version": "2", 15 | "code": "200", 16 | "message": "" 17 | }, 18 | "headers": { 19 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 20 | "content-encoding": "gzip", 21 | "content-length": "127", 22 | "content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;", 23 | "content-type": "text\/html;charset=utf-8", 24 | "date": "Sun, 26 Apr 2020 00:31:10 GMT", 25 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 26 | "last-modified": "Sun, 26 Apr 2020 00:31:10 GMT", 27 | "ml": "A", 28 | "pragma": "no-cache", 29 | "server": "tsa_b", 30 | "set-cookie": "personalization_id=\"v1_mrnWVDThJvkLcAe4hmX0ng==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107085601318; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 31 | "status": "200 OK", 32 | "strict-transport-security": "max-age=631138519", 33 | "x-connection-hash": "bf00d267c647790cd34d8cd4a28f9895", 34 | "x-content-type-options": "nosniff", 35 | "x-frame-options": "SAMEORIGIN", 36 | "x-response-time": "24", 37 | "x-transaction": "0095391f006dd965", 38 | "x-twitter-response-tags": "BouncerCompliant", 39 | "x-ua-compatible": "IE=edge,chrome=1", 40 | "x-xss-protection": "0" 41 | }, 42 | "body": "oauth_token=CE545gAAAAAAABtaAAABcbPlJBQ&oauth_token_secret=tTVYBva8AlQu0JxVudzbf9oHXAbIARg5&oauth_callback_confirmed=true" 43 | } 44 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testPostDirectMessagesEventsNew.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/new.json", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"3457NqeumGmcalZLF091L9lt7F8%3D\"", 9 | "Expect": null, 10 | "Content-type": "application\/json" 11 | }, 12 | "body": "{\"event\":{\"type\":\"message_create\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"message_data\":{\"text\":\"Hello World!\"}}}}" 13 | }, 14 | "response": { 15 | "status": { 16 | "http_version": "2", 17 | "code": "200", 18 | "message": "" 19 | }, 20 | "headers": { 21 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 22 | "content-disposition": "attachment; filename=json.json", 23 | "content-encoding": "gzip", 24 | "content-length": "206", 25 | "content-type": "application\/json;charset=utf-8", 26 | "date": "Sun, 26 Apr 2020 00:31:51 GMT", 27 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 28 | "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", 29 | "pragma": "no-cache", 30 | "server": "tsa_b", 31 | "set-cookie": "personalization_id=\"v1_Tfqxs0gur2QR4FFIZ3Wq6w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111185015666; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 32 | "status": "200 OK", 33 | "strict-transport-security": "max-age=631138519", 34 | "x-access-level": "read-write-directmessages", 35 | "x-connection-hash": "bb4f30d1c6406b2cd5d25f20fccfdc1a", 36 | "x-content-type-options": "nosniff", 37 | "x-frame-options": "SAMEORIGIN", 38 | "x-response-time": "70", 39 | "x-transaction": "0057fa4c00fb95a1", 40 | "x-tsa-request-body-time": "0", 41 | "x-twitter-response-tags": "BouncerCompliant", 42 | "x-xss-protection": "0" 43 | }, 44 | "body": "{\"event\":{\"type\":\"message_create\",\"id\":\"1254206523385032714\",\"created_timestamp\":\"1587861111862\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"sender_id\":\"93915746\",\"message_data\":{\"text\":\"Hello World!\",\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]}}}}}" 45 | } 46 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testOauthAccessTokenTokenException.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/oauth\/access_token", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"CE545gAAAAAAABtaAAABcbPlJBQ\", oauth_verifier=\"fake_oauth_verifier\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"0bcdtKs3nffzbE5abwaVjCI1HPw%3D\"", 9 | "Expect": null 10 | } 11 | }, 12 | "response": { 13 | "status": { 14 | "http_version": "2", 15 | "code": "401", 16 | "message": "" 17 | }, 18 | "headers": { 19 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 20 | "content-encoding": "gzip", 21 | "content-length": "93", 22 | "content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;", 23 | "content-type": "text\/html;charset=utf-8", 24 | "date": "Sun, 26 Apr 2020 00:31:11 GMT", 25 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 26 | "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", 27 | "ml": "A", 28 | "pragma": "no-cache", 29 | "server": "tsa_b", 30 | "set-cookie": "personalization_id=\"v1_n0ZAgT2oLIc0HI23qMIGCA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107147893563; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 31 | "status": "401 Unauthorized", 32 | "strict-transport-security": "max-age=631138519", 33 | "www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\"", 34 | "x-connection-hash": "90157d4bdfce3a9b90fd408819c767bc", 35 | "x-content-type-options": "nosniff", 36 | "x-frame-options": "SAMEORIGIN", 37 | "x-response-time": "41", 38 | "x-transaction": "0080cead006a758d", 39 | "x-twitter-response-tags": "BouncerCompliant", 40 | "x-ua-compatible": "IE=edge,chrome=1", 41 | "x-xss-protection": "0" 42 | }, 43 | "body": "Error processing your OAuth request: Invalid oauth_verifier parameter" 44 | } 45 | }] -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: Composer 3 | Upstream-Contact: Jordi Boggiano 4 | Source: https://github.com/composer/composer 5 | 6 | Files: * 7 | Copyright: 2016, Nils Adermann 8 | 2016, Jordi Boggiano 9 | License: Expat 10 | 11 | Files: src/Composer/Util/TlsHelper.php 12 | Copyright: 2016, Nils Adermann 13 | 2016, Jordi Boggiano 14 | 2013, Evan Coury 15 | License: Expat and BSD-2-Clause 16 | 17 | License: BSD-2-Clause 18 | Redistribution and use in source and binary forms, with or without modification, 19 | are permitted provided that the following conditions are met: 20 | . 21 | * Redistributions of source code must retain the above copyright notice, 22 | this list of conditions and the following disclaimer. 23 | . 24 | * Redistributions in binary form must reproduce the above copyright notice, 25 | this list of conditions and the following disclaimer in the documentation 26 | and/or other materials provided with the distribution. 27 | . 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 29 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 32 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 33 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 35 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | License: Expat 40 | Permission is hereby granted, free of charge, to any person obtaining a copy 41 | of this software and associated documentation files (the "Software"), to deal 42 | in the Software without restriction, including without limitation the rights 43 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 44 | copies of the Software, and to permit persons to whom the Software is furnished 45 | to do so, subject to the following conditions: 46 | . 47 | The above copyright notice and this permission notice shall be included in all 48 | copies or substantial portions of the Software. 49 | . 50 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 51 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 52 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 53 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 54 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 55 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 56 | THE SOFTWARE. 57 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testSetOauthToken.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "GET", 4 | "url": "https:\/\/api.twitter.com\/1.1\/friendships\/show.json?target_screen_name=twitterapi", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"TzPCDLbvxIAlxBqg5Fpf4JZpFJo%3D\"", 9 | "Expect": null 10 | } 11 | }, 12 | "response": { 13 | "status": { 14 | "http_version": "2", 15 | "code": "200", 16 | "message": "" 17 | }, 18 | "headers": { 19 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 20 | "content-disposition": "attachment; filename=json.json", 21 | "content-encoding": "gzip", 22 | "content-length": "246", 23 | "content-type": "application\/json;charset=utf-8", 24 | "date": "Sun, 26 Apr 2020 00:31:09 GMT", 25 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 26 | "last-modified": "Sun, 26 Apr 2020 00:31:09 GMT", 27 | "pragma": "no-cache", 28 | "server": "tsa_b", 29 | "set-cookie": "personalization_id=\"v1_1Yr9ogG1fxy1wdDOY63jAw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786106956820884; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 30 | "status": "200 OK", 31 | "strict-transport-security": "max-age=631138519", 32 | "x-access-level": "read-write-directmessages", 33 | "x-connection-hash": "e8b1e309982b5c1d1adedc814fa2e6c3", 34 | "x-content-type-options": "nosniff", 35 | "x-frame-options": "SAMEORIGIN", 36 | "x-rate-limit-limit": "180", 37 | "x-rate-limit-remaining": "178", 38 | "x-rate-limit-reset": "1587861610", 39 | "x-response-time": "20", 40 | "x-transaction": "0075ffd2008ff583", 41 | "x-twitter-response-tags": "BouncerCompliant", 42 | "x-xss-protection": "0" 43 | }, 44 | "body": "{\"relationship\":{\"source\":{\"id\":93915746,\"id_str\":\"93915746\",\"screen_name\":\"oauthlibtest\",\"following\":false,\"followed_by\":false,\"live_following\":false,\"following_received\":false,\"following_requested\":false,\"notifications_enabled\":false,\"can_dm\":false,\"blocking\":false,\"blocked_by\":false,\"muting\":false,\"want_retweets\":false,\"all_replies\":false,\"marked_spam\":false},\"target\":{\"id\":6253282,\"id_str\":\"6253282\",\"screen_name\":\"TwitterAPI\",\"following\":false,\"followed_by\":false,\"following_received\":false,\"following_requested\":false}}}" 45 | } 46 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/Config.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class Config 13 | { 14 | /** @var int How long to wait for a response from the API */ 15 | protected $timeout = 5; 16 | /** @var int how long to wait while connecting to the API */ 17 | protected $connectionTimeout = 5; 18 | /** @var int How many times we retry request when API is down */ 19 | protected $maxRetries = 0; 20 | /** @var int Delay in seconds before we retry the request */ 21 | protected $retriesDelay = 1; 22 | 23 | /** 24 | * Decode JSON Response as associative Array 25 | * 26 | * @see http://php.net/manual/en/function.json-decode.php 27 | * 28 | * @var bool 29 | */ 30 | protected $decodeJsonAsArray = false; 31 | /** @var string User-Agent header */ 32 | protected $userAgent = 'TwitterOAuth (+https://twitteroauth.com)'; 33 | /** @var array Store proxy connection details */ 34 | protected $proxy = []; 35 | 36 | /** @var bool Whether to encode the curl requests with gzip or not */ 37 | protected $gzipEncoding = true; 38 | 39 | /** @var integer Size for Chunked Uploads */ 40 | protected $chunkSize = 250000; // 0.25 MegaByte 41 | 42 | /** 43 | * Set the connection and response timeouts. 44 | * 45 | * @param int $connectionTimeout 46 | * @param int $timeout 47 | */ 48 | public function setTimeouts(int $connectionTimeout, int $timeout): void 49 | { 50 | $this->connectionTimeout = $connectionTimeout; 51 | $this->timeout = $timeout; 52 | } 53 | 54 | /** 55 | * Set the number of times to retry on error and how long between each. 56 | * 57 | * @param int $maxRetries 58 | * @param int $retriesDelay 59 | */ 60 | public function setRetries(int $maxRetries, int $retriesDelay): void 61 | { 62 | $this->maxRetries = $maxRetries; 63 | $this->retriesDelay = $retriesDelay; 64 | } 65 | 66 | /** 67 | * @param bool $value 68 | */ 69 | public function setDecodeJsonAsArray(bool $value): void 70 | { 71 | $this->decodeJsonAsArray = $value; 72 | } 73 | 74 | /** 75 | * @param string $userAgent 76 | */ 77 | public function setUserAgent(string $userAgent): void 78 | { 79 | $this->userAgent = $userAgent; 80 | } 81 | 82 | /** 83 | * @param array $proxy 84 | */ 85 | public function setProxy(array $proxy): void 86 | { 87 | $this->proxy = $proxy; 88 | } 89 | 90 | /** 91 | * Whether to encode the curl requests with gzip or not. 92 | * 93 | * @param boolean $gzipEncoding 94 | */ 95 | public function setGzipEncoding(bool $gzipEncoding): void 96 | { 97 | $this->gzipEncoding = $gzipEncoding; 98 | } 99 | 100 | /** 101 | * Set the size of each part of file for chunked media upload. 102 | * 103 | * @param int $value 104 | */ 105 | public function setChunkSize(int $value): void 106 | { 107 | $this->chunkSize = $value; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | - Using welcoming and inclusive language 12 | - Being respectful of differing viewpoints and experiences 13 | - Gracefully accepting constructive criticism 14 | - Focusing on what is best for the community 15 | - Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | - Trolling, insulting/derogatory comments, and personal or political attacks 21 | - Public or private harassment 22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | - Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at abraham@abrah.am. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/Util.php: -------------------------------------------------------------------------------- 1 | array('b','c'), 'd' => 'e') 47 | * 48 | * @param string $input 49 | * 50 | * @return array 51 | */ 52 | public static function parseParameters($input): array 53 | { 54 | if (!is_string($input)) { 55 | return []; 56 | } 57 | 58 | $pairs = explode('&', $input); 59 | 60 | $parameters = []; 61 | foreach ($pairs as $pair) { 62 | $split = explode('=', $pair, 2); 63 | $parameter = Util::urldecodeRfc3986($split[0]); 64 | $value = isset($split[1]) ? Util::urldecodeRfc3986($split[1]) : ''; 65 | 66 | if (isset($parameters[$parameter])) { 67 | // We have already recieved parameter(s) with this name, so add to the list 68 | // of parameters with this name 69 | 70 | if (is_scalar($parameters[$parameter])) { 71 | // This is the first duplicate, so transform scalar (string) into an array 72 | // so we can add the duplicates 73 | $parameters[$parameter] = [$parameters[$parameter]]; 74 | } 75 | 76 | $parameters[$parameter][] = $value; 77 | } else { 78 | $parameters[$parameter] = $value; 79 | } 80 | } 81 | return $parameters; 82 | } 83 | 84 | /** 85 | * @param array $params 86 | * 87 | * @return string 88 | */ 89 | public static function buildHttpQuery(array $params): string 90 | { 91 | if (empty($params)) { 92 | return ''; 93 | } 94 | 95 | // Urlencode both keys and values 96 | $keys = Util::urlencodeRfc3986(array_keys($params)); 97 | $values = Util::urlencodeRfc3986(array_values($params)); 98 | $params = array_combine($keys, $values); 99 | 100 | // Parameters are sorted by name, using lexicographical byte value ordering. 101 | // Ref: Spec: 9.1.1 (1) 102 | uksort($params, 'strcmp'); 103 | 104 | $pairs = []; 105 | foreach ($params as $parameter => $value) { 106 | if (is_array($value)) { 107 | // If two or more parameters share the same name, they are sorted by their value 108 | // Ref: Spec: 9.1.1 (1) 109 | // June 12th, 2010 - changed to sort because of issue 164 by hidetaka 110 | sort($value, SORT_STRING); 111 | foreach ($value as $duplicateValue) { 112 | $pairs[] = $parameter . '=' . $duplicateValue; 113 | } 114 | } else { 115 | $pairs[] = $parameter . '=' . $value; 116 | } 117 | } 118 | // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) 119 | // Each name-value pair is separated by an '&' character (ASCII code 38) 120 | return implode('&', $pairs); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testSetProxy.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "GET", 4 | "url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ZN1bM0df5EPRy1d7oYcoZfj3Mpw%3D\"", 9 | "Expect": null 10 | } 11 | }, 12 | "response": { 13 | "status": { 14 | "http_version": "1.1", 15 | "code": "200", 16 | "message": "OK" 17 | }, 18 | "body": "HTTP\/2 200 \r\ncache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0\r\ncontent-disposition: attachment; filename=json.json\r\ncontent-encoding: gzip\r\ncontent-length: 778\r\ncontent-type: application\/json;charset=utf-8\r\ndate: Sun, 26 Apr 2020 00:31:49 GMT\r\nexpires: Tue, 31 Mar 1981 05:00:00 GMT\r\nlast-modified: Sun, 26 Apr 2020 00:31:49 GMT\r\npragma: no-cache\r\nserver: tsa_a\r\nset-cookie: personalization_id=\"v1_hI7rl+lJjoy5n7HgyNo9LQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nset-cookie: lang=en; Path=\/\r\nset-cookie: guest_id=v1%3A158786110929931313; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nstatus: 200 OK\r\nstrict-transport-security: max-age=631138519\r\nx-access-level: read-write-directmessages\r\nx-connection-hash: 18e8b1b5df2ee964aebf8f85055ada9c\r\nx-content-type-options: nosniff\r\nx-frame-options: SAMEORIGIN\r\nx-rate-limit-limit: 75\r\nx-rate-limit-remaining: 72\r\nx-rate-limit-reset: 1587861178\r\nx-response-time: 34\r\nx-transaction: 00716cfd00f6fd8d\r\nx-twitter-response-tags: BouncerExempt\r\nx-twitter-response-tags: BouncerCompliant\r\nx-xss-protection: 0\r\n\r\n{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":1,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":74,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false}" 19 | } 20 | }] -------------------------------------------------------------------------------- /vendor/composer/installed.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "abraham/twitteroauth", 4 | "version": "2.0.0", 5 | "version_normalized": "2.0.0.0", 6 | "source": { 7 | "type": "git", 8 | "url": "https://github.com/abraham/twitteroauth.git", 9 | "reference": "96f49e67baec10f5e5cb703d87be16ba01a798a5" 10 | }, 11 | "dist": { 12 | "type": "zip", 13 | "url": "https://api.github.com/repos/abraham/twitteroauth/zipball/96f49e67baec10f5e5cb703d87be16ba01a798a5", 14 | "reference": "96f49e67baec10f5e5cb703d87be16ba01a798a5", 15 | "shasum": "" 16 | }, 17 | "require": { 18 | "composer/ca-bundle": "^1.2", 19 | "ext-curl": "*", 20 | "php": "^7.2 || ^7.3 || ^7.4 || ^8.0" 21 | }, 22 | "require-dev": { 23 | "php-vcr/php-vcr": "^1", 24 | "php-vcr/phpunit-testlistener-vcr": "dev-php-8", 25 | "phpmd/phpmd": "^2", 26 | "phpunit/phpunit": "^8", 27 | "squizlabs/php_codesniffer": "^3" 28 | }, 29 | "time": "2020-12-02T01:27:06+00:00", 30 | "type": "library", 31 | "installation-source": "dist", 32 | "autoload": { 33 | "psr-4": { 34 | "Abraham\\TwitterOAuth\\": "src" 35 | } 36 | }, 37 | "notification-url": "https://packagist.org/downloads/", 38 | "license": [ 39 | "MIT" 40 | ], 41 | "authors": [ 42 | { 43 | "name": "Abraham Williams", 44 | "email": "abraham@abrah.am", 45 | "homepage": "https://abrah.am", 46 | "role": "Developer" 47 | } 48 | ], 49 | "description": "The most popular PHP library for use with the Twitter OAuth REST API.", 50 | "homepage": "https://twitteroauth.com", 51 | "keywords": [ 52 | "Twitter API", 53 | "Twitter oAuth", 54 | "api", 55 | "oauth", 56 | "rest", 57 | "social", 58 | "twitter" 59 | ] 60 | }, 61 | { 62 | "name": "composer/ca-bundle", 63 | "version": "1.2.9", 64 | "version_normalized": "1.2.9.0", 65 | "source": { 66 | "type": "git", 67 | "url": "https://github.com/composer/ca-bundle.git", 68 | "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5" 69 | }, 70 | "dist": { 71 | "type": "zip", 72 | "url": "https://api.github.com/repos/composer/ca-bundle/zipball/78a0e288fdcebf92aa2318a8d3656168da6ac1a5", 73 | "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5", 74 | "shasum": "" 75 | }, 76 | "require": { 77 | "ext-openssl": "*", 78 | "ext-pcre": "*", 79 | "php": "^5.3.2 || ^7.0 || ^8.0" 80 | }, 81 | "require-dev": { 82 | "phpstan/phpstan": "^0.12.55", 83 | "psr/log": "^1.0", 84 | "symfony/phpunit-bridge": "^4.2 || ^5", 85 | "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" 86 | }, 87 | "time": "2021-01-12T12:10:35+00:00", 88 | "type": "library", 89 | "extra": { 90 | "branch-alias": { 91 | "dev-main": "1.x-dev" 92 | } 93 | }, 94 | "installation-source": "dist", 95 | "autoload": { 96 | "psr-4": { 97 | "Composer\\CaBundle\\": "src" 98 | } 99 | }, 100 | "notification-url": "https://packagist.org/downloads/", 101 | "license": [ 102 | "MIT" 103 | ], 104 | "authors": [ 105 | { 106 | "name": "Jordi Boggiano", 107 | "email": "j.boggiano@seld.be", 108 | "homepage": "http://seld.be" 109 | } 110 | ], 111 | "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", 112 | "keywords": [ 113 | "cabundle", 114 | "cacert", 115 | "certificate", 116 | "ssl", 117 | "tls" 118 | ] 119 | } 120 | ] 121 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesCreate.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/1.1\/favorites\/create.json", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"EA30eIQPgat0Aw%2F59GyltEiE4Xg%3D\"", 9 | "Expect": null 10 | }, 11 | "body": "id=6242973112" 12 | }, 13 | "response": { 14 | "status": { 15 | "http_version": "2", 16 | "code": "200", 17 | "message": "" 18 | }, 19 | "headers": { 20 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 21 | "content-disposition": "attachment; filename=json.json", 22 | "content-encoding": "gzip", 23 | "content-length": "755", 24 | "content-type": "application\/json;charset=utf-8", 25 | "date": "Sun, 26 Apr 2020 00:31:51 GMT", 26 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 27 | "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", 28 | "pragma": "no-cache", 29 | "server": "tsa_b", 30 | "set-cookie": "personalization_id=\"v1_Jz87HIDSEIpDevFMBlDD7g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111115490266; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 31 | "status": "200 OK", 32 | "strict-transport-security": "max-age=631138519", 33 | "x-access-level": "read-write-directmessages", 34 | "x-connection-hash": "7368af4d238e5c36df5379afb1bed3af", 35 | "x-content-type-options": "nosniff", 36 | "x-frame-options": "SAMEORIGIN", 37 | "x-response-time": "72", 38 | "x-transaction": "0012beac0086638b", 39 | "x-tsa-request-body-time": "0", 40 | "x-twitter-response-tags": "BouncerCompliant", 41 | "x-xss-protection": "0" 42 | }, 43 | "body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":1,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":76,\"favorited\":true,\"retweeted\":false,\"lang\":\"en\"}" 44 | } 45 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesDestroy.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/1.1\/favorites\/destroy.json", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"w3Nti04O5BMi8bySXjmO8%2BW5Pus%3D\"", 9 | "Expect": null 10 | }, 11 | "body": "id=6242973112" 12 | }, 13 | "response": { 14 | "status": { 15 | "http_version": "2", 16 | "code": "200", 17 | "message": "" 18 | }, 19 | "headers": { 20 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 21 | "content-disposition": "attachment; filename=json.json", 22 | "content-encoding": "gzip", 23 | "content-length": "753", 24 | "content-type": "application\/json;charset=utf-8", 25 | "date": "Sun, 26 Apr 2020 00:31:51 GMT", 26 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 27 | "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", 28 | "pragma": "no-cache", 29 | "server": "tsa_b", 30 | "set-cookie": "personalization_id=\"v1_s1J1pMUNrQO4\/v371oE9AQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111151392082; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 31 | "status": "200 OK", 32 | "strict-transport-security": "max-age=631138519", 33 | "x-access-level": "read-write-directmessages", 34 | "x-connection-hash": "a0dc865f09447e41b0d77e9eed981519", 35 | "x-content-type-options": "nosniff", 36 | "x-frame-options": "SAMEORIGIN", 37 | "x-response-time": "44", 38 | "x-transaction": "005d9083009bd4c9", 39 | "x-tsa-request-body-time": "0", 40 | "x-twitter-response-tags": "BouncerCompliant", 41 | "x-xss-protection": "0" 42 | }, 43 | "body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}" 44 | } 45 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesDestroy.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206657548226561.json", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"kyOKi3x9Ar3foSG5%2BN9XzBbnIOw%3D\"", 9 | "Expect": null 10 | } 11 | }, 12 | "response": { 13 | "status": { 14 | "http_version": "2", 15 | "code": "200", 16 | "message": "" 17 | }, 18 | "headers": { 19 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 20 | "content-disposition": "attachment; filename=json.json", 21 | "content-encoding": "gzip", 22 | "content-length": "804", 23 | "content-type": "application\/json;charset=utf-8", 24 | "date": "Sun, 26 Apr 2020 00:32:24 GMT", 25 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 26 | "last-modified": "Sun, 26 Apr 2020 00:32:24 GMT", 27 | "pragma": "no-cache", 28 | "server": "tsa_b", 29 | "set-cookie": "personalization_id=\"v1_juPKvfSeQeQoZAVeLglnhA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114418847477; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 30 | "status": "200 OK", 31 | "strict-transport-security": "max-age=631138519", 32 | "x-access-level": "read-write-directmessages", 33 | "x-connection-hash": "f4375157b19d6cd139b9917a6d76d0b0", 34 | "x-content-type-options": "nosniff", 35 | "x-frame-options": "SAMEORIGIN", 36 | "x-response-time": "198", 37 | "x-transaction": "00f3e731001ccb87", 38 | "x-twitter-response-tags": "BouncerCompliant", 39 | "x-xss-protection": "0" 40 | }, 41 | "body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}" 42 | } 43 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateUtf8.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "POST", 4 | "url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"zIzkM9jxroYElpL1fPTyYnYE%2Bys%3D\"", 9 | "Expect": null 10 | }, 11 | "body": "status=x%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C%201587861062" 12 | }, 13 | "response": { 14 | "status": { 15 | "http_version": "2", 16 | "code": "200", 17 | "message": "" 18 | }, 19 | "headers": { 20 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 21 | "content-disposition": "attachment; filename=json.json", 22 | "content-encoding": "gzip", 23 | "content-length": "804", 24 | "content-type": "application\/json;charset=utf-8", 25 | "date": "Sun, 26 Apr 2020 00:32:23 GMT", 26 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 27 | "last-modified": "Sun, 26 Apr 2020 00:32:23 GMT", 28 | "pragma": "no-cache", 29 | "server": "tsa_b", 30 | "set-cookie": "personalization_id=\"v1_8nFfK\/V8KyJDl1aminWCQw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114384224672; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 31 | "status": "200 OK", 32 | "strict-transport-security": "max-age=631138519", 33 | "x-access-level": "read-write-directmessages", 34 | "x-connection-hash": "54c0be65e0c80b57d5b7c895e58061c8", 35 | "x-content-type-options": "nosniff", 36 | "x-frame-options": "SAMEORIGIN", 37 | "x-response-time": "55", 38 | "x-transaction": "00eb7dbc0057ef33", 39 | "x-tsa-request-body-time": "0", 40 | "x-twitter-response-tags": "BouncerCompliant", 41 | "x-xss-protection": "0" 42 | }, 43 | "body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}" 44 | } 45 | }] -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/fixtures/testGetAccountVerifyCredentials.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "request": { 3 | "method": "GET", 4 | "url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json?include_email=true&include_entities=false", 5 | "headers": { 6 | "Host": "api.twitter.com", 7 | "Accept": "application\/json", 8 | "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"k8h8edFh9R2W3DCNJy5Nb07tWo0%3D\"", 9 | "Expect": null 10 | } 11 | }, 12 | "response": { 13 | "status": { 14 | "http_version": "2", 15 | "code": "200", 16 | "message": "" 17 | }, 18 | "headers": { 19 | "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", 20 | "content-disposition": "attachment; filename=json.json", 21 | "content-encoding": "gzip", 22 | "content-length": "773", 23 | "content-type": "application\/json;charset=utf-8", 24 | "date": "Sun, 26 Apr 2020 00:31:11 GMT", 25 | "expires": "Tue, 31 Mar 1981 05:00:00 GMT", 26 | "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", 27 | "pragma": "no-cache", 28 | "server": "tsa_b", 29 | "set-cookie": "personalization_id=\"v1_PPOKPD3f\/ek9QM3+ySQxjw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786107181888587; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", 30 | "status": "200 OK", 31 | "strict-transport-security": "max-age=631138519", 32 | "x-access-level": "read-write-directmessages", 33 | "x-connection-hash": "7509696bc24b6d9d09d283b844a3c232", 34 | "x-content-type-options": "nosniff", 35 | "x-frame-options": "SAMEORIGIN", 36 | "x-rate-limit-limit": "75", 37 | "x-rate-limit-remaining": "73", 38 | "x-rate-limit-reset": "1587861613", 39 | "x-response-time": "46", 40 | "x-transaction": "00cd4f6300163d67", 41 | "x-twitter-response-tags": "BouncerExempt, BouncerCompliant", 42 | "x-xss-protection": "0" 43 | }, 44 | "body": "{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false,\"email\":\"4braham+oauthlibtest@gmail.com\"}" 45 | } 46 | }] -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "b30ea01d70b5b8285746493999c79725", 8 | "packages": [ 9 | { 10 | "name": "abraham/twitteroauth", 11 | "version": "2.0.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/abraham/twitteroauth.git", 15 | "reference": "96f49e67baec10f5e5cb703d87be16ba01a798a5" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/abraham/twitteroauth/zipball/96f49e67baec10f5e5cb703d87be16ba01a798a5", 20 | "reference": "96f49e67baec10f5e5cb703d87be16ba01a798a5", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "composer/ca-bundle": "^1.2", 25 | "ext-curl": "*", 26 | "php": "^7.2 || ^7.3 || ^7.4 || ^8.0" 27 | }, 28 | "require-dev": { 29 | "php-vcr/php-vcr": "^1", 30 | "php-vcr/phpunit-testlistener-vcr": "dev-php-8", 31 | "phpmd/phpmd": "^2", 32 | "phpunit/phpunit": "^8", 33 | "squizlabs/php_codesniffer": "^3" 34 | }, 35 | "type": "library", 36 | "autoload": { 37 | "psr-4": { 38 | "Abraham\\TwitterOAuth\\": "src" 39 | } 40 | }, 41 | "notification-url": "https://packagist.org/downloads/", 42 | "license": [ 43 | "MIT" 44 | ], 45 | "authors": [ 46 | { 47 | "name": "Abraham Williams", 48 | "email": "abraham@abrah.am", 49 | "homepage": "https://abrah.am", 50 | "role": "Developer" 51 | } 52 | ], 53 | "description": "The most popular PHP library for use with the Twitter OAuth REST API.", 54 | "homepage": "https://twitteroauth.com", 55 | "keywords": [ 56 | "Twitter API", 57 | "Twitter oAuth", 58 | "api", 59 | "oauth", 60 | "rest", 61 | "social", 62 | "twitter" 63 | ], 64 | "time": "2020-12-02T01:27:06+00:00" 65 | }, 66 | { 67 | "name": "composer/ca-bundle", 68 | "version": "1.2.9", 69 | "source": { 70 | "type": "git", 71 | "url": "https://github.com/composer/ca-bundle.git", 72 | "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5" 73 | }, 74 | "dist": { 75 | "type": "zip", 76 | "url": "https://api.github.com/repos/composer/ca-bundle/zipball/78a0e288fdcebf92aa2318a8d3656168da6ac1a5", 77 | "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5", 78 | "shasum": "" 79 | }, 80 | "require": { 81 | "ext-openssl": "*", 82 | "ext-pcre": "*", 83 | "php": "^5.3.2 || ^7.0 || ^8.0" 84 | }, 85 | "require-dev": { 86 | "phpstan/phpstan": "^0.12.55", 87 | "psr/log": "^1.0", 88 | "symfony/phpunit-bridge": "^4.2 || ^5", 89 | "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" 90 | }, 91 | "type": "library", 92 | "extra": { 93 | "branch-alias": { 94 | "dev-main": "1.x-dev" 95 | } 96 | }, 97 | "autoload": { 98 | "psr-4": { 99 | "Composer\\CaBundle\\": "src" 100 | } 101 | }, 102 | "notification-url": "https://packagist.org/downloads/", 103 | "license": [ 104 | "MIT" 105 | ], 106 | "authors": [ 107 | { 108 | "name": "Jordi Boggiano", 109 | "email": "j.boggiano@seld.be", 110 | "homepage": "http://seld.be" 111 | } 112 | ], 113 | "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", 114 | "keywords": [ 115 | "cabundle", 116 | "cacert", 117 | "certificate", 118 | "ssl", 119 | "tls" 120 | ], 121 | "time": "2021-01-12T12:10:35+00:00" 122 | } 123 | ], 124 | "packages-dev": [], 125 | "aliases": [], 126 | "minimum-stability": "stable", 127 | "stability-flags": [], 128 | "prefer-stable": false, 129 | "prefer-lowest": false, 130 | "platform": [], 131 | "platform-dev": [] 132 | } 133 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/Request.php: -------------------------------------------------------------------------------- 1 | parameters = $parameters; 37 | $this->httpMethod = $httpMethod; 38 | $this->httpUrl = $httpUrl; 39 | } 40 | 41 | /** 42 | * pretty much a helper function to set up the request 43 | * 44 | * @param Consumer $consumer 45 | * @param Token $token 46 | * @param string $httpMethod 47 | * @param string $httpUrl 48 | * @param array $parameters 49 | * 50 | * @return Request 51 | */ 52 | public static function fromConsumerAndToken( 53 | Consumer $consumer, 54 | Token $token = null, 55 | string $httpMethod, 56 | string $httpUrl, 57 | array $parameters = [], 58 | $json = false 59 | ) { 60 | $defaults = [ 61 | 'oauth_version' => Request::$version, 62 | 'oauth_nonce' => Request::generateNonce(), 63 | 'oauth_timestamp' => time(), 64 | 'oauth_consumer_key' => $consumer->key, 65 | ]; 66 | if (null !== $token) { 67 | $defaults['oauth_token'] = $token->key; 68 | } 69 | 70 | // The json payload is not included in the signature on json requests, 71 | // therefore it shouldn't be included in the parameters array. 72 | if ($json) { 73 | $parameters = $defaults; 74 | } else { 75 | $parameters = array_merge($defaults, $parameters); 76 | } 77 | 78 | return new Request($httpMethod, $httpUrl, $parameters); 79 | } 80 | 81 | /** 82 | * @param string $name 83 | * @param string $value 84 | */ 85 | public function setParameter(string $name, string $value) 86 | { 87 | $this->parameters[$name] = $value; 88 | } 89 | 90 | /** 91 | * @param string $name 92 | * 93 | * @return string|null 94 | */ 95 | public function getParameter(string $name): ?string 96 | { 97 | return isset($this->parameters[$name]) 98 | ? $this->parameters[$name] 99 | : null; 100 | } 101 | 102 | /** 103 | * @return array 104 | */ 105 | public function getParameters(): array 106 | { 107 | return $this->parameters; 108 | } 109 | 110 | /** 111 | * @param string $name 112 | */ 113 | public function removeParameter(string $name): void 114 | { 115 | unset($this->parameters[$name]); 116 | } 117 | 118 | /** 119 | * The request parameters, sorted and concatenated into a normalized string. 120 | * 121 | * @return string 122 | */ 123 | public function getSignableParameters(): string 124 | { 125 | // Grab all parameters 126 | $params = $this->parameters; 127 | 128 | // Remove oauth_signature if present 129 | // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") 130 | if (isset($params['oauth_signature'])) { 131 | unset($params['oauth_signature']); 132 | } 133 | 134 | return Util::buildHttpQuery($params); 135 | } 136 | 137 | /** 138 | * Returns the base string of this request 139 | * 140 | * The base string defined as the method, the url 141 | * and the parameters (normalized), each urlencoded 142 | * and the concated with &. 143 | * 144 | * @return string 145 | */ 146 | public function getSignatureBaseString(): string 147 | { 148 | $parts = [ 149 | $this->getNormalizedHttpMethod(), 150 | $this->getNormalizedHttpUrl(), 151 | $this->getSignableParameters(), 152 | ]; 153 | 154 | $parts = Util::urlencodeRfc3986($parts); 155 | 156 | return implode('&', $parts); 157 | } 158 | 159 | /** 160 | * Returns the HTTP Method in uppercase 161 | * 162 | * @return string 163 | */ 164 | public function getNormalizedHttpMethod(): string 165 | { 166 | return strtoupper($this->httpMethod); 167 | } 168 | 169 | /** 170 | * parses the url and rebuilds it to be 171 | * scheme://host/path 172 | * 173 | * @return string 174 | */ 175 | public function getNormalizedHttpUrl(): string 176 | { 177 | $parts = parse_url($this->httpUrl); 178 | 179 | $scheme = $parts['scheme']; 180 | $host = strtolower($parts['host']); 181 | $path = $parts['path']; 182 | 183 | return "$scheme://$host$path"; 184 | } 185 | 186 | /** 187 | * Builds a url usable for a GET request 188 | * 189 | * @return string 190 | */ 191 | public function toUrl(): string 192 | { 193 | $postData = $this->toPostdata(); 194 | $out = $this->getNormalizedHttpUrl(); 195 | if ($postData) { 196 | $out .= '?' . $postData; 197 | } 198 | return $out; 199 | } 200 | 201 | /** 202 | * Builds the data one would send in a POST request 203 | * 204 | * @return string 205 | */ 206 | public function toPostdata(): string 207 | { 208 | return Util::buildHttpQuery($this->parameters); 209 | } 210 | 211 | /** 212 | * Builds the Authorization: header 213 | * 214 | * @return string 215 | * @throws TwitterOAuthException 216 | */ 217 | public function toHeader(): string 218 | { 219 | $first = true; 220 | $out = 'Authorization: OAuth'; 221 | foreach ($this->parameters as $k => $v) { 222 | if (substr($k, 0, 5) != 'oauth') { 223 | continue; 224 | } 225 | if (is_array($v)) { 226 | throw new TwitterOAuthException( 227 | 'Arrays not supported in headers' 228 | ); 229 | } 230 | $out .= $first ? ' ' : ', '; 231 | $out .= 232 | Util::urlencodeRfc3986($k) . 233 | '="' . 234 | Util::urlencodeRfc3986($v) . 235 | '"'; 236 | $first = false; 237 | } 238 | return $out; 239 | } 240 | 241 | /** 242 | * @return string 243 | */ 244 | public function __toString(): string 245 | { 246 | return $this->toUrl(); 247 | } 248 | 249 | /** 250 | * @param SignatureMethod $signatureMethod 251 | * @param Consumer $consumer 252 | * @param Token $token 253 | */ 254 | public function signRequest( 255 | SignatureMethod $signatureMethod, 256 | Consumer $consumer, 257 | Token $token = null 258 | ) { 259 | $this->setParameter( 260 | 'oauth_signature_method', 261 | $signatureMethod->getName() 262 | ); 263 | $signature = $this->buildSignature($signatureMethod, $consumer, $token); 264 | $this->setParameter('oauth_signature', $signature); 265 | } 266 | 267 | /** 268 | * @param SignatureMethod $signatureMethod 269 | * @param Consumer $consumer 270 | * @param Token $token 271 | * 272 | * @return string 273 | */ 274 | public function buildSignature( 275 | SignatureMethod $signatureMethod, 276 | Consumer $consumer, 277 | Token $token = null 278 | ): string { 279 | return $signatureMethod->buildSignature($this, $consumer, $token); 280 | } 281 | 282 | /** 283 | * @return string 284 | */ 285 | public static function generateNonce(): string 286 | { 287 | return md5(microtime() . mt_rand()); 288 | } 289 | } 290 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/tests/TwitterOAuthTest.php: -------------------------------------------------------------------------------- 1 | twitter = new TwitterOAuth( 22 | CONSUMER_KEY, 23 | CONSUMER_SECRET, 24 | ACCESS_TOKEN, 25 | ACCESS_TOKEN_SECRET 26 | ); 27 | $this->userId = explode('-', ACCESS_TOKEN)[0]; 28 | } 29 | 30 | public function testBuildClient() 31 | { 32 | $this->assertObjectHasAttribute('consumer', $this->twitter); 33 | $this->assertObjectHasAttribute('token', $this->twitter); 34 | } 35 | 36 | /** 37 | * @vcr testSetOauthToken.json 38 | */ 39 | public function testSetOauthToken() 40 | { 41 | $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); 42 | $twitter->setOauthToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET); 43 | $this->assertObjectHasAttribute('consumer', $twitter); 44 | $this->assertObjectHasAttribute('token', $twitter); 45 | $twitter->get('friendships/show', [ 46 | 'target_screen_name' => 'twitterapi', 47 | ]); 48 | $this->assertEquals(200, $twitter->getLastHttpCode()); 49 | } 50 | 51 | /** 52 | * @vcr testOauth2Token.json 53 | */ 54 | public function testOauth2Token() 55 | { 56 | $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); 57 | $result = $twitter->oauth2('oauth2/token', [ 58 | 'grant_type' => 'client_credentials', 59 | ]); 60 | $this->assertEquals(200, $twitter->getLastHttpCode()); 61 | $this->assertObjectHasAttribute('token_type', $result); 62 | $this->assertObjectHasAttribute('access_token', $result); 63 | $this->assertEquals('bearer', $result->token_type); 64 | return $result; 65 | } 66 | 67 | /** 68 | * @depends testOauth2Token 69 | * @vcr testOauth2BearerToken.json 70 | */ 71 | public function testOauth2BearerToken($accessToken) 72 | { 73 | $twitter = new TwitterOAuth( 74 | CONSUMER_KEY, 75 | CONSUMER_SECRET, 76 | null, 77 | $accessToken->access_token 78 | ); 79 | $result = $twitter->get('statuses/user_timeline', [ 80 | 'screen_name' => 'twitterapi', 81 | ]); 82 | $this->assertEquals(200, $twitter->getLastHttpCode()); 83 | return $accessToken; 84 | } 85 | 86 | /** 87 | * @depends testOauth2BearerToken 88 | * @vcr testOauth2TokenInvalidate.json 89 | */ 90 | public function testOauth2TokenInvalidate($accessToken) 91 | { 92 | $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); 93 | // HACK: access_token is already urlencoded but gets urlencoded again breaking the invalidate request. 94 | $result = $twitter->oauth2('oauth2/invalidate_token', [ 95 | 'access_token' => urldecode($accessToken->access_token), 96 | ]); 97 | $this->assertEquals(200, $twitter->getLastHttpCode()); 98 | $this->assertObjectHasAttribute('access_token', $result); 99 | } 100 | 101 | /** 102 | * @vcr testOauthRequestToken.json 103 | */ 104 | public function testOauthRequestToken() 105 | { 106 | $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); 107 | $result = $twitter->oauth('oauth/request_token', [ 108 | 'oauth_callback' => OAUTH_CALLBACK, 109 | ]); 110 | $this->assertEquals(200, $twitter->getLastHttpCode()); 111 | $this->assertArrayHasKey('oauth_token', $result); 112 | $this->assertArrayHasKey('oauth_token_secret', $result); 113 | $this->assertArrayHasKey('oauth_callback_confirmed', $result); 114 | $this->assertEquals('true', $result['oauth_callback_confirmed']); 115 | return $result; 116 | } 117 | 118 | /** 119 | * @vcr testOauthRequestTokenException.json 120 | */ 121 | public function testOauthRequestTokenException() 122 | { 123 | $this->expectException( 124 | \Abraham\TwitterOAuth\TwitterOAuthException::class 125 | ); 126 | $this->expectErrorMessage('Could not authenticate you'); 127 | $twitter = new TwitterOAuth('CONSUMER_KEY', 'CONSUMER_SECRET'); 128 | $result = $twitter->oauth('oauth/request_token', [ 129 | 'oauth_callback' => OAUTH_CALLBACK, 130 | ]); 131 | } 132 | 133 | /** 134 | * @depends testOauthRequestToken 135 | * @vcr testOauthAccessTokenTokenException.json 136 | */ 137 | public function testOauthAccessTokenTokenException(array $requestToken) 138 | { 139 | // Can't test this without a browser logging into Twitter so check for the correct error instead. 140 | $this->expectException( 141 | \Abraham\TwitterOAuth\TwitterOAuthException::class 142 | ); 143 | $this->expectErrorMessage('Invalid oauth_verifier parameter'); 144 | $twitter = new TwitterOAuth( 145 | CONSUMER_KEY, 146 | CONSUMER_SECRET, 147 | $requestToken['oauth_token'], 148 | $requestToken['oauth_token_secret'] 149 | ); 150 | $twitter->oauth('oauth/access_token', [ 151 | 'oauth_verifier' => 'fake_oauth_verifier', 152 | ]); 153 | } 154 | 155 | public function testUrl() 156 | { 157 | $url = $this->twitter->url('oauth/authorize', [ 158 | 'foo' => 'bar', 159 | 'baz' => 'qux', 160 | ]); 161 | $this->assertEquals( 162 | 'https://api.twitter.com/oauth/authorize?foo=bar&baz=qux', 163 | $url 164 | ); 165 | } 166 | 167 | /** 168 | * @vcr testGetAccountVerifyCredentials.json 169 | */ 170 | public function testGetAccountVerifyCredentials() 171 | { 172 | $user = $this->twitter->get('account/verify_credentials', [ 173 | 'include_entities' => false, 174 | 'include_email' => true, 175 | ]); 176 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 177 | $this->assertObjectHasAttribute('email', $user); 178 | } 179 | 180 | /** 181 | * @vcr testSetProxy.json 182 | */ 183 | public function testSetProxy() 184 | { 185 | $this->twitter->setProxy([ 186 | 'CURLOPT_PROXY' => PROXY, 187 | 'CURLOPT_PROXYUSERPWD' => PROXYUSERPWD, 188 | 'CURLOPT_PROXYPORT' => PROXYPORT, 189 | ]); 190 | $this->twitter->setTimeouts(60, 60); 191 | $result = $this->twitter->get('account/verify_credentials'); 192 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 193 | $this->assertObjectHasAttribute('id', $result); 194 | } 195 | 196 | /** 197 | * @vcr testGetStatusesMentionsTimeline.json 198 | */ 199 | public function testGetStatusesMentionsTimeline() 200 | { 201 | $this->twitter->get('statuses/mentions_timeline'); 202 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 203 | } 204 | 205 | /** 206 | * @vcr testGetSearchTweets.json 207 | */ 208 | public function testGetSearchTweets() 209 | { 210 | $result = $this->twitter->get('search/tweets', ['q' => 'twitter']); 211 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 212 | return $result->statuses; 213 | } 214 | 215 | /** 216 | * @depends testGetSearchTweets 217 | * @vcr testGetSearchTweetsWithMaxId.json 218 | */ 219 | public function testGetSearchTweetsWithMaxId($statuses) 220 | { 221 | $maxId = array_pop($statuses)->id_str; 222 | $this->twitter->get('search/tweets', [ 223 | 'q' => 'twitter', 224 | 'max_id' => $maxId, 225 | ]); 226 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 227 | } 228 | 229 | /** 230 | * @vcr testPostFavoritesCreate.json 231 | */ 232 | public function testPostFavoritesCreate() 233 | { 234 | $result = $this->twitter->post('favorites/create', [ 235 | 'id' => '6242973112', 236 | ]); 237 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 238 | } 239 | 240 | /** 241 | * @depends testPostFavoritesCreate 242 | * @vcr testPostFavoritesDestroy.json 243 | */ 244 | public function testPostFavoritesDestroy() 245 | { 246 | $this->twitter->post('favorites/destroy', ['id' => '6242973112']); 247 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 248 | } 249 | 250 | /** 251 | * @vcr testPostDirectMessagesEventsNew.json 252 | */ 253 | public function testPostDirectMessagesEventsNew() 254 | { 255 | $data = [ 256 | 'event' => [ 257 | 'type' => 'message_create', 258 | 'message_create' => [ 259 | 'target' => [ 260 | 'recipient_id' => $this->userId, 261 | ], 262 | 'message_data' => [ 263 | 'text' => 'Hello World!', 264 | ], 265 | ], 266 | ], 267 | ]; 268 | $result = $this->twitter->post( 269 | 'direct_messages/events/new', 270 | $data, 271 | true 272 | ); 273 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 274 | return $result; 275 | } 276 | 277 | /** 278 | * @depends testPostDirectMessagesEventsNew 279 | * @vcr testDeleteDirectMessagesEventsDestroy.json 280 | */ 281 | public function testDeleteDirectMessagesEventsDestroy($message) 282 | { 283 | $this->twitter->delete('direct_messages/events/destroy', [ 284 | 'id' => $message->event->id, 285 | ]); 286 | $this->assertEquals(204, $this->twitter->getLastHttpCode()); 287 | } 288 | 289 | /** 290 | * @vcr testPostStatusesUpdateWithMedia.json 291 | */ 292 | public function testPostStatusesUpdateWithMedia() 293 | { 294 | $this->twitter->setTimeouts(60, 60); 295 | // Image source https://www.flickr.com/photos/titrans/8548825587/ 296 | $file_path = __DIR__ . '/kitten.jpg'; 297 | $result = $this->twitter->upload('media/upload', [ 298 | 'media' => $file_path, 299 | ]); 300 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 301 | $this->assertObjectHasAttribute('media_id_string', $result); 302 | $parameters = [ 303 | 'status' => 'Hello World ' . MOCK_TIME, 304 | 'media_ids' => $result->media_id_string, 305 | ]; 306 | $result = $this->twitter->post('statuses/update', $parameters); 307 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 308 | $result = $this->twitter->post('statuses/destroy/' . $result->id_str); 309 | return $result; 310 | } 311 | 312 | /** 313 | * @vcr testPostStatusUpdateWithInvalidMediaThrowsException.json 314 | */ 315 | public function testPostStatusUpdateWithInvalidMediaThrowsException() 316 | { 317 | $this->expectException(\InvalidArgumentException::class); 318 | $file_path = __DIR__ . '/12345678900987654321.jpg'; 319 | $this->assertFalse(\is_readable($file_path)); 320 | $result = $this->twitter->upload('media/upload', [ 321 | 'media' => $file_path, 322 | ]); 323 | } 324 | 325 | /** 326 | * @vcr testPostStatusesUpdateWithMediaChunked.json 327 | */ 328 | public function testPostStatusesUpdateWithMediaChunked() 329 | { 330 | $this->twitter->setTimeouts(60, 30); 331 | // Video source http://www.sample-videos.com/ 332 | $file_path = __DIR__ . '/video.mp4'; 333 | $result = $this->twitter->upload( 334 | 'media/upload', 335 | ['media' => $file_path, 'media_type' => 'video/mp4'], 336 | true 337 | ); 338 | $this->assertEquals(201, $this->twitter->getLastHttpCode()); 339 | $this->assertObjectHasAttribute('media_id_string', $result); 340 | $parameters = [ 341 | 'status' => 'Hello World ' . MOCK_TIME, 342 | 'media_ids' => $result->media_id_string, 343 | ]; 344 | $result = $this->twitter->post('statuses/update', $parameters); 345 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 346 | $result = $this->twitter->post('statuses/destroy/' . $result->id_str); 347 | return $result; 348 | } 349 | 350 | /** 351 | * @vcr testPostStatusesUpdateUtf8.json 352 | */ 353 | public function testPostStatusesUpdateUtf8() 354 | { 355 | $result = $this->twitter->post('statuses/update', [ 356 | 'status' => 'xこんにちは世界 ' . MOCK_TIME, 357 | ]); 358 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 359 | return $result; 360 | } 361 | 362 | /** 363 | * @depends testPostStatusesUpdateUtf8 364 | * @vcr testPostStatusesDestroy.json 365 | */ 366 | public function testPostStatusesDestroy($status) 367 | { 368 | $this->twitter->post('statuses/destroy/' . $status->id_str); 369 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 370 | } 371 | 372 | /** 373 | * @vcr testLastResult.json 374 | */ 375 | public function testLastResult() 376 | { 377 | $this->twitter->get('search/tweets', ['q' => 'twitter']); 378 | $this->assertEquals('search/tweets', $this->twitter->getLastApiPath()); 379 | $this->assertEquals(200, $this->twitter->getLastHttpCode()); 380 | $this->assertObjectHasAttribute( 381 | 'statuses', 382 | $this->twitter->getLastBody() 383 | ); 384 | } 385 | 386 | /** 387 | * @depends testLastResult 388 | * @vcr testResetLastResponse.json 389 | */ 390 | public function testResetLastResponse() 391 | { 392 | $this->twitter->resetLastResponse(); 393 | $this->assertEquals('', $this->twitter->getLastApiPath()); 394 | $this->assertEquals(0, $this->twitter->getLastHttpCode()); 395 | $this->assertEquals([], $this->twitter->getLastBody()); 396 | } 397 | } 398 | -------------------------------------------------------------------------------- /vendor/composer/ClassLoader.php: -------------------------------------------------------------------------------- 1 | 7 | * Jordi Boggiano 8 | * 9 | * For the full copyright and license information, please view the LICENSE 10 | * file that was distributed with this source code. 11 | */ 12 | 13 | namespace Composer\Autoload; 14 | 15 | /** 16 | * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. 17 | * 18 | * $loader = new \Composer\Autoload\ClassLoader(); 19 | * 20 | * // register classes with namespaces 21 | * $loader->add('Symfony\Component', __DIR__.'/component'); 22 | * $loader->add('Symfony', __DIR__.'/framework'); 23 | * 24 | * // activate the autoloader 25 | * $loader->register(); 26 | * 27 | * // to enable searching the include path (eg. for PEAR packages) 28 | * $loader->setUseIncludePath(true); 29 | * 30 | * In this example, if you try to use a class in the Symfony\Component 31 | * namespace or one of its children (Symfony\Component\Console for instance), 32 | * the autoloader will first look for the class under the component/ 33 | * directory, and it will then fallback to the framework/ directory if not 34 | * found before giving up. 35 | * 36 | * This class is loosely based on the Symfony UniversalClassLoader. 37 | * 38 | * @author Fabien Potencier 39 | * @author Jordi Boggiano 40 | * @see http://www.php-fig.org/psr/psr-0/ 41 | * @see http://www.php-fig.org/psr/psr-4/ 42 | */ 43 | class ClassLoader 44 | { 45 | // PSR-4 46 | private $prefixLengthsPsr4 = array(); 47 | private $prefixDirsPsr4 = array(); 48 | private $fallbackDirsPsr4 = array(); 49 | 50 | // PSR-0 51 | private $prefixesPsr0 = array(); 52 | private $fallbackDirsPsr0 = array(); 53 | 54 | private $useIncludePath = false; 55 | private $classMap = array(); 56 | private $classMapAuthoritative = false; 57 | private $missingClasses = array(); 58 | private $apcuPrefix; 59 | 60 | public function getPrefixes() 61 | { 62 | if (!empty($this->prefixesPsr0)) { 63 | return call_user_func_array('array_merge', $this->prefixesPsr0); 64 | } 65 | 66 | return array(); 67 | } 68 | 69 | public function getPrefixesPsr4() 70 | { 71 | return $this->prefixDirsPsr4; 72 | } 73 | 74 | public function getFallbackDirs() 75 | { 76 | return $this->fallbackDirsPsr0; 77 | } 78 | 79 | public function getFallbackDirsPsr4() 80 | { 81 | return $this->fallbackDirsPsr4; 82 | } 83 | 84 | public function getClassMap() 85 | { 86 | return $this->classMap; 87 | } 88 | 89 | /** 90 | * @param array $classMap Class to filename map 91 | */ 92 | public function addClassMap(array $classMap) 93 | { 94 | if ($this->classMap) { 95 | $this->classMap = array_merge($this->classMap, $classMap); 96 | } else { 97 | $this->classMap = $classMap; 98 | } 99 | } 100 | 101 | /** 102 | * Registers a set of PSR-0 directories for a given prefix, either 103 | * appending or prepending to the ones previously set for this prefix. 104 | * 105 | * @param string $prefix The prefix 106 | * @param array|string $paths The PSR-0 root directories 107 | * @param bool $prepend Whether to prepend the directories 108 | */ 109 | public function add($prefix, $paths, $prepend = false) 110 | { 111 | if (!$prefix) { 112 | if ($prepend) { 113 | $this->fallbackDirsPsr0 = array_merge( 114 | (array) $paths, 115 | $this->fallbackDirsPsr0 116 | ); 117 | } else { 118 | $this->fallbackDirsPsr0 = array_merge( 119 | $this->fallbackDirsPsr0, 120 | (array) $paths 121 | ); 122 | } 123 | 124 | return; 125 | } 126 | 127 | $first = $prefix[0]; 128 | if (!isset($this->prefixesPsr0[$first][$prefix])) { 129 | $this->prefixesPsr0[$first][$prefix] = (array) $paths; 130 | 131 | return; 132 | } 133 | if ($prepend) { 134 | $this->prefixesPsr0[$first][$prefix] = array_merge( 135 | (array) $paths, 136 | $this->prefixesPsr0[$first][$prefix] 137 | ); 138 | } else { 139 | $this->prefixesPsr0[$first][$prefix] = array_merge( 140 | $this->prefixesPsr0[$first][$prefix], 141 | (array) $paths 142 | ); 143 | } 144 | } 145 | 146 | /** 147 | * Registers a set of PSR-4 directories for a given namespace, either 148 | * appending or prepending to the ones previously set for this namespace. 149 | * 150 | * @param string $prefix The prefix/namespace, with trailing '\\' 151 | * @param array|string $paths The PSR-4 base directories 152 | * @param bool $prepend Whether to prepend the directories 153 | * 154 | * @throws \InvalidArgumentException 155 | */ 156 | public function addPsr4($prefix, $paths, $prepend = false) 157 | { 158 | if (!$prefix) { 159 | // Register directories for the root namespace. 160 | if ($prepend) { 161 | $this->fallbackDirsPsr4 = array_merge( 162 | (array) $paths, 163 | $this->fallbackDirsPsr4 164 | ); 165 | } else { 166 | $this->fallbackDirsPsr4 = array_merge( 167 | $this->fallbackDirsPsr4, 168 | (array) $paths 169 | ); 170 | } 171 | } elseif (!isset($this->prefixDirsPsr4[$prefix])) { 172 | // Register directories for a new namespace. 173 | $length = strlen($prefix); 174 | if ('\\' !== $prefix[$length - 1]) { 175 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); 176 | } 177 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 178 | $this->prefixDirsPsr4[$prefix] = (array) $paths; 179 | } elseif ($prepend) { 180 | // Prepend directories for an already registered namespace. 181 | $this->prefixDirsPsr4[$prefix] = array_merge( 182 | (array) $paths, 183 | $this->prefixDirsPsr4[$prefix] 184 | ); 185 | } else { 186 | // Append directories for an already registered namespace. 187 | $this->prefixDirsPsr4[$prefix] = array_merge( 188 | $this->prefixDirsPsr4[$prefix], 189 | (array) $paths 190 | ); 191 | } 192 | } 193 | 194 | /** 195 | * Registers a set of PSR-0 directories for a given prefix, 196 | * replacing any others previously set for this prefix. 197 | * 198 | * @param string $prefix The prefix 199 | * @param array|string $paths The PSR-0 base directories 200 | */ 201 | public function set($prefix, $paths) 202 | { 203 | if (!$prefix) { 204 | $this->fallbackDirsPsr0 = (array) $paths; 205 | } else { 206 | $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; 207 | } 208 | } 209 | 210 | /** 211 | * Registers a set of PSR-4 directories for a given namespace, 212 | * replacing any others previously set for this namespace. 213 | * 214 | * @param string $prefix The prefix/namespace, with trailing '\\' 215 | * @param array|string $paths The PSR-4 base directories 216 | * 217 | * @throws \InvalidArgumentException 218 | */ 219 | public function setPsr4($prefix, $paths) 220 | { 221 | if (!$prefix) { 222 | $this->fallbackDirsPsr4 = (array) $paths; 223 | } else { 224 | $length = strlen($prefix); 225 | if ('\\' !== $prefix[$length - 1]) { 226 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); 227 | } 228 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 229 | $this->prefixDirsPsr4[$prefix] = (array) $paths; 230 | } 231 | } 232 | 233 | /** 234 | * Turns on searching the include path for class files. 235 | * 236 | * @param bool $useIncludePath 237 | */ 238 | public function setUseIncludePath($useIncludePath) 239 | { 240 | $this->useIncludePath = $useIncludePath; 241 | } 242 | 243 | /** 244 | * Can be used to check if the autoloader uses the include path to check 245 | * for classes. 246 | * 247 | * @return bool 248 | */ 249 | public function getUseIncludePath() 250 | { 251 | return $this->useIncludePath; 252 | } 253 | 254 | /** 255 | * Turns off searching the prefix and fallback directories for classes 256 | * that have not been registered with the class map. 257 | * 258 | * @param bool $classMapAuthoritative 259 | */ 260 | public function setClassMapAuthoritative($classMapAuthoritative) 261 | { 262 | $this->classMapAuthoritative = $classMapAuthoritative; 263 | } 264 | 265 | /** 266 | * Should class lookup fail if not found in the current class map? 267 | * 268 | * @return bool 269 | */ 270 | public function isClassMapAuthoritative() 271 | { 272 | return $this->classMapAuthoritative; 273 | } 274 | 275 | /** 276 | * APCu prefix to use to cache found/not-found classes, if the extension is enabled. 277 | * 278 | * @param string|null $apcuPrefix 279 | */ 280 | public function setApcuPrefix($apcuPrefix) 281 | { 282 | $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; 283 | } 284 | 285 | /** 286 | * The APCu prefix in use, or null if APCu caching is not enabled. 287 | * 288 | * @return string|null 289 | */ 290 | public function getApcuPrefix() 291 | { 292 | return $this->apcuPrefix; 293 | } 294 | 295 | /** 296 | * Registers this instance as an autoloader. 297 | * 298 | * @param bool $prepend Whether to prepend the autoloader or not 299 | */ 300 | public function register($prepend = false) 301 | { 302 | spl_autoload_register(array($this, 'loadClass'), true, $prepend); 303 | } 304 | 305 | /** 306 | * Unregisters this instance as an autoloader. 307 | */ 308 | public function unregister() 309 | { 310 | spl_autoload_unregister(array($this, 'loadClass')); 311 | } 312 | 313 | /** 314 | * Loads the given class or interface. 315 | * 316 | * @param string $class The name of the class 317 | * @return bool|null True if loaded, null otherwise 318 | */ 319 | public function loadClass($class) 320 | { 321 | if ($file = $this->findFile($class)) { 322 | includeFile($file); 323 | 324 | return true; 325 | } 326 | } 327 | 328 | /** 329 | * Finds the path to the file where the class is defined. 330 | * 331 | * @param string $class The name of the class 332 | * 333 | * @return string|false The path if found, false otherwise 334 | */ 335 | public function findFile($class) 336 | { 337 | // class map lookup 338 | if (isset($this->classMap[$class])) { 339 | return $this->classMap[$class]; 340 | } 341 | if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { 342 | return false; 343 | } 344 | if (null !== $this->apcuPrefix) { 345 | $file = apcu_fetch($this->apcuPrefix.$class, $hit); 346 | if ($hit) { 347 | return $file; 348 | } 349 | } 350 | 351 | $file = $this->findFileWithExtension($class, '.php'); 352 | 353 | // Search for Hack files if we are running on HHVM 354 | if (false === $file && defined('HHVM_VERSION')) { 355 | $file = $this->findFileWithExtension($class, '.hh'); 356 | } 357 | 358 | if (null !== $this->apcuPrefix) { 359 | apcu_add($this->apcuPrefix.$class, $file); 360 | } 361 | 362 | if (false === $file) { 363 | // Remember that this class does not exist. 364 | $this->missingClasses[$class] = true; 365 | } 366 | 367 | return $file; 368 | } 369 | 370 | private function findFileWithExtension($class, $ext) 371 | { 372 | // PSR-4 lookup 373 | $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; 374 | 375 | $first = $class[0]; 376 | if (isset($this->prefixLengthsPsr4[$first])) { 377 | $subPath = $class; 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { 379 | $subPath = substr($subPath, 0, $lastPos); 380 | $search = $subPath . '\\'; 381 | if (isset($this->prefixDirsPsr4[$search])) { 382 | $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); 383 | foreach ($this->prefixDirsPsr4[$search] as $dir) { 384 | if (file_exists($file = $dir . $pathEnd)) { 385 | return $file; 386 | } 387 | } 388 | } 389 | } 390 | } 391 | 392 | // PSR-4 fallback dirs 393 | foreach ($this->fallbackDirsPsr4 as $dir) { 394 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { 395 | return $file; 396 | } 397 | } 398 | 399 | // PSR-0 lookup 400 | if (false !== $pos = strrpos($class, '\\')) { 401 | // namespaced class name 402 | $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); 404 | } else { 405 | // PEAR-like class name 406 | $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; 407 | } 408 | 409 | if (isset($this->prefixesPsr0[$first])) { 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { 411 | if (0 === strpos($class, $prefix)) { 412 | foreach ($dirs as $dir) { 413 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { 414 | return $file; 415 | } 416 | } 417 | } 418 | } 419 | } 420 | 421 | // PSR-0 fallback dirs 422 | foreach ($this->fallbackDirsPsr0 as $dir) { 423 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { 424 | return $file; 425 | } 426 | } 427 | 428 | // PSR-0 include paths. 429 | if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { 430 | return $file; 431 | } 432 | 433 | return false; 434 | } 435 | } 436 | 437 | /** 438 | * Scope isolated include. 439 | * 440 | * Prevents access to $this/self from included files. 441 | */ 442 | function includeFile($file) 443 | { 444 | include $file; 445 | } 446 | -------------------------------------------------------------------------------- /vendor/composer/ca-bundle/src/CaBundle.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE file that was distributed with this source code. 10 | */ 11 | 12 | namespace Composer\CaBundle; 13 | 14 | use Psr\Log\LoggerInterface; 15 | use Symfony\Component\Process\PhpProcess; 16 | 17 | /** 18 | * @author Chris Smith 19 | * @author Jordi Boggiano 20 | */ 21 | class CaBundle 22 | { 23 | /** @var string|null */ 24 | private static $caPath; 25 | /** @var array */ 26 | private static $caFileValidity = array(); 27 | /** @var bool|null */ 28 | private static $useOpensslParse; 29 | 30 | /** 31 | * Returns the system CA bundle path, or a path to the bundled one 32 | * 33 | * This method was adapted from Sslurp. 34 | * https://github.com/EvanDotPro/Sslurp 35 | * 36 | * (c) Evan Coury 37 | * 38 | * For the full copyright and license information, please see below: 39 | * 40 | * Copyright (c) 2013, Evan Coury 41 | * All rights reserved. 42 | * 43 | * Redistribution and use in source and binary forms, with or without modification, 44 | * are permitted provided that the following conditions are met: 45 | * 46 | * * Redistributions of source code must retain the above copyright notice, 47 | * this list of conditions and the following disclaimer. 48 | * 49 | * * Redistributions in binary form must reproduce the above copyright notice, 50 | * this list of conditions and the following disclaimer in the documentation 51 | * and/or other materials provided with the distribution. 52 | * 53 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 54 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 55 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 56 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 57 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 58 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 59 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 60 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 61 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 62 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 63 | * 64 | * @param LoggerInterface $logger optional logger for information about which CA files were loaded 65 | * @return string path to a CA bundle file or directory 66 | */ 67 | public static function getSystemCaRootBundlePath(LoggerInterface $logger = null) 68 | { 69 | if (self::$caPath !== null) { 70 | return self::$caPath; 71 | } 72 | $caBundlePaths = array(); 73 | 74 | // If SSL_CERT_FILE env variable points to a valid certificate/bundle, use that. 75 | // This mimics how OpenSSL uses the SSL_CERT_FILE env variable. 76 | $caBundlePaths[] = self::getEnvVariable('SSL_CERT_FILE'); 77 | 78 | // If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that. 79 | // This mimics how OpenSSL uses the SSL_CERT_FILE env variable. 80 | $caBundlePaths[] = self::getEnvVariable('SSL_CERT_DIR'); 81 | 82 | $caBundlePaths[] = ini_get('openssl.cafile'); 83 | $caBundlePaths[] = ini_get('openssl.capath'); 84 | 85 | $otherLocations = array( 86 | '/etc/pki/tls/certs/ca-bundle.crt', // Fedora, RHEL, CentOS (ca-certificates package) 87 | '/etc/ssl/certs/ca-certificates.crt', // Debian, Ubuntu, Gentoo, Arch Linux (ca-certificates package) 88 | '/etc/ssl/ca-bundle.pem', // SUSE, openSUSE (ca-certificates package) 89 | '/usr/local/share/certs/ca-root-nss.crt', // FreeBSD (ca_root_nss_package) 90 | '/usr/ssl/certs/ca-bundle.crt', // Cygwin 91 | '/opt/local/share/curl/curl-ca-bundle.crt', // OS X macports, curl-ca-bundle package 92 | '/usr/local/share/curl/curl-ca-bundle.crt', // Default cURL CA bunde path (without --with-ca-bundle option) 93 | '/usr/share/ssl/certs/ca-bundle.crt', // Really old RedHat? 94 | '/etc/ssl/cert.pem', // OpenBSD 95 | '/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x 96 | '/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package 97 | '/usr/local/etc/openssl@1.1/cert.pem', // OS X homebrew, openssl@1.1 package 98 | ); 99 | 100 | foreach($otherLocations as $location) { 101 | $otherLocations[] = dirname($location); 102 | } 103 | 104 | $caBundlePaths = array_merge($caBundlePaths, $otherLocations); 105 | 106 | foreach ($caBundlePaths as $caBundle) { 107 | if ($caBundle && self::caFileUsable($caBundle, $logger)) { 108 | return self::$caPath = $caBundle; 109 | } 110 | 111 | if ($caBundle && self::caDirUsable($caBundle)) { 112 | return self::$caPath = $caBundle; 113 | } 114 | } 115 | 116 | return self::$caPath = static::getBundledCaBundlePath(); // Bundled CA file, last resort 117 | } 118 | 119 | /** 120 | * Returns the path to the bundled CA file 121 | * 122 | * In case you don't want to trust the user or the system, you can use this directly 123 | * 124 | * @return string path to a CA bundle file 125 | */ 126 | public static function getBundledCaBundlePath() 127 | { 128 | $caBundleFile = __DIR__.'/../res/cacert.pem'; 129 | 130 | // cURL does not understand 'phar://' paths 131 | // see https://github.com/composer/ca-bundle/issues/10 132 | if (0 === strpos($caBundleFile, 'phar://')) { 133 | $tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-'); 134 | if (false === $tempCaBundleFile) { 135 | throw new \RuntimeException('Could not create a temporary file to store the bundled CA file'); 136 | } 137 | 138 | file_put_contents( 139 | $tempCaBundleFile, 140 | file_get_contents($caBundleFile) 141 | ); 142 | 143 | register_shutdown_function(function() use ($tempCaBundleFile) { 144 | @unlink($tempCaBundleFile); 145 | }); 146 | 147 | $caBundleFile = $tempCaBundleFile; 148 | } 149 | 150 | return $caBundleFile; 151 | } 152 | 153 | /** 154 | * Validates a CA file using opensl_x509_parse only if it is safe to use 155 | * 156 | * @param string $filename 157 | * @param LoggerInterface $logger optional logger for information about which CA files were loaded 158 | * 159 | * @return bool 160 | */ 161 | public static function validateCaFile($filename, LoggerInterface $logger = null) 162 | { 163 | static $warned = false; 164 | 165 | if (isset(self::$caFileValidity[$filename])) { 166 | return self::$caFileValidity[$filename]; 167 | } 168 | 169 | $contents = file_get_contents($filename); 170 | 171 | // assume the CA is valid if php is vulnerable to 172 | // https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html 173 | if (!static::isOpensslParseSafe()) { 174 | if (!$warned && $logger) { 175 | $logger->warning(sprintf( 176 | 'Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.', 177 | PHP_VERSION 178 | )); 179 | $warned = true; 180 | } 181 | 182 | $isValid = !empty($contents); 183 | } elseif (is_string($contents) && strlen($contents) > 0) { 184 | $contents = preg_replace("/^(\\-+(?:BEGIN|END))\\s+TRUSTED\\s+(CERTIFICATE\\-+)\$/m", '$1 $2', $contents); 185 | if (null === $contents) { 186 | // regex extraction failed 187 | $isValid = false; 188 | } else { 189 | $isValid = (bool) openssl_x509_parse($contents); 190 | } 191 | } else { 192 | $isValid = false; 193 | } 194 | 195 | if ($logger) { 196 | $logger->debug('Checked CA file '.realpath($filename).': '.($isValid ? 'valid' : 'invalid')); 197 | } 198 | 199 | return self::$caFileValidity[$filename] = $isValid; 200 | } 201 | 202 | /** 203 | * Test if it is safe to use the PHP function openssl_x509_parse(). 204 | * 205 | * This checks if OpenSSL extensions is vulnerable to remote code execution 206 | * via the exploit documented as CVE-2013-6420. 207 | * 208 | * @return bool 209 | */ 210 | public static function isOpensslParseSafe() 211 | { 212 | if (null !== self::$useOpensslParse) { 213 | return self::$useOpensslParse; 214 | } 215 | 216 | if (PHP_VERSION_ID >= 50600) { 217 | return self::$useOpensslParse = true; 218 | } 219 | 220 | // Vulnerable: 221 | // PHP 5.3.0 - PHP 5.3.27 222 | // PHP 5.4.0 - PHP 5.4.22 223 | // PHP 5.5.0 - PHP 5.5.6 224 | if ( 225 | (PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50328) 226 | || (PHP_VERSION_ID < 50500 && PHP_VERSION_ID >= 50423) 227 | || PHP_VERSION_ID >= 50507 228 | ) { 229 | // This version of PHP has the fix for CVE-2013-6420 applied. 230 | return self::$useOpensslParse = true; 231 | } 232 | 233 | if (defined('PHP_WINDOWS_VERSION_BUILD')) { 234 | // Windows is probably insecure in this case. 235 | return self::$useOpensslParse = false; 236 | } 237 | 238 | $compareDistroVersionPrefix = function ($prefix, $fixedVersion) { 239 | $regex = '{^'.preg_quote($prefix).'([0-9]+)$}'; 240 | 241 | if (preg_match($regex, PHP_VERSION, $m)) { 242 | return ((int) $m[1]) >= $fixedVersion; 243 | } 244 | 245 | return false; 246 | }; 247 | 248 | // Hard coded list of PHP distributions with the fix backported. 249 | if ( 250 | $compareDistroVersionPrefix('5.3.3-7+squeeze', 18) // Debian 6 (Squeeze) 251 | || $compareDistroVersionPrefix('5.4.4-14+deb7u', 7) // Debian 7 (Wheezy) 252 | || $compareDistroVersionPrefix('5.3.10-1ubuntu3.', 9) // Ubuntu 12.04 (Precise) 253 | ) { 254 | return self::$useOpensslParse = true; 255 | } 256 | 257 | // Symfony Process component is missing so we assume it is unsafe at this point 258 | if (!class_exists('Symfony\Component\Process\PhpProcess')) { 259 | return self::$useOpensslParse = false; 260 | } 261 | 262 | // This is where things get crazy, because distros backport security 263 | // fixes the chances are on NIX systems the fix has been applied but 264 | // it's not possible to verify that from the PHP version. 265 | // 266 | // To verify exec a new PHP process and run the issue testcase with 267 | // known safe input that replicates the bug. 268 | 269 | // Based on testcase in https://github.com/php/php-src/commit/c1224573c773b6845e83505f717fbf820fc18415 270 | // changes in https://github.com/php/php-src/commit/76a7fd893b7d6101300cc656058704a73254d593 271 | $cert = 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVwRENDQTR5Z0F3SUJBZ0lKQUp6dThyNnU2ZUJjTUEwR0NTcUdTSWIzRFFFQkJRVUFNSUhETVFzd0NRWUQKVlFRR0V3SkVSVEVjTUJvR0ExVUVDQXdUVG05eVpISm9aV2x1TFZkbGMzUm1ZV3hsYmpFUU1BNEdBMVVFQnd3SApTOE9Ed3Jac2JqRVVNQklHQTFVRUNnd0xVMlZyZEdsdmJrVnBibk14SHpBZEJnTlZCQXNNRmsxaGJHbGphVzkxCmN5QkRaWEowSUZObFkzUnBiMjR4SVRBZkJnTlZCQU1NR0cxaGJHbGphVzkxY3k1elpXdDBhVzl1WldsdWN5NWsKWlRFcU1DZ0dDU3FHU0liM0RRRUpBUlliYzNSbFptRnVMbVZ6YzJWeVFITmxhM1JwYjI1bGFXNXpMbVJsTUhVWQpaREU1TnpBd01UQXhNREF3TURBd1dnQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBCkFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUEKQUFBQUFBQVhEVEUwTVRFeU9ERXhNemt6TlZvd2djTXhDekFKQmdOVkJBWVRBa1JGTVJ3d0dnWURWUVFJREJOTwpiM0prY21obGFXNHRWMlZ6ZEdaaGJHVnVNUkF3RGdZRFZRUUhEQWRMdzRQQ3RteHVNUlF3RWdZRFZRUUtEQXRUClpXdDBhVzl1UldsdWN6RWZNQjBHQTFVRUN3d1dUV0ZzYVdOcGIzVnpJRU5sY25RZ1UyVmpkR2x2YmpFaE1COEcKQTFVRUF3d1liV0ZzYVdOcGIzVnpMbk5sYTNScGIyNWxhVzV6TG1SbE1Tb3dLQVlKS29aSWh2Y05BUWtCRmh0egpkR1ZtWVc0dVpYTnpaWEpBYzJWcmRHbHZibVZwYm5NdVpHVXdnZ0VpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCCkR3QXdnZ0VLQW9JQkFRRERBZjNobDdKWTBYY0ZuaXlFSnBTU0RxbjBPcUJyNlFQNjV1c0pQUnQvOFBhRG9xQnUKd0VZVC9OYSs2ZnNnUGpDMHVLOURaZ1dnMnRIV1dvYW5TYmxBTW96NVBINlorUzRTSFJaN2UyZERJalBqZGhqaAowbUxnMlVNTzV5cDBWNzk3R2dzOWxOdDZKUmZIODFNTjJvYlhXczROdHp0TE11RDZlZ3FwcjhkRGJyMzRhT3M4CnBrZHVpNVVhd1Raa3N5NXBMUEhxNWNNaEZHbTA2djY1Q0xvMFYyUGQ5K0tBb2tQclBjTjVLTEtlYno3bUxwazYKU01lRVhPS1A0aWRFcXh5UTdPN2ZCdUhNZWRzUWh1K3ByWTNzaTNCVXlLZlF0UDVDWm5YMmJwMHdLSHhYMTJEWAoxbmZGSXQ5RGJHdkhUY3lPdU4rblpMUEJtM3ZXeG50eUlJdlZBZ01CQUFHalFqQkFNQWtHQTFVZEV3UUNNQUF3CkVRWUpZSVpJQVliNFFnRUJCQVFEQWdlQU1Bc0dBMVVkRHdRRUF3SUZvREFUQmdOVkhTVUVEREFLQmdnckJnRUYKQlFjREFqQU5CZ2txaGtpRzl3MEJBUVVGQUFPQ0FRRUFHMGZaWVlDVGJkajFYWWMrMVNub2FQUit2SThDOENhRAo4KzBVWWhkbnlVNGdnYTBCQWNEclk5ZTk0ZUVBdTZacXljRjZGakxxWFhkQWJvcHBXb2NyNlQ2R0QxeDMzQ2tsClZBcnpHL0t4UW9oR0QySmVxa2hJTWxEb214SE83a2EzOStPYThpMnZXTFZ5alU4QVp2V01BcnVIYTRFRU55RzcKbFcyQWFnYUZLRkNyOVRuWFRmcmR4R1ZFYnY3S1ZRNmJkaGc1cDVTanBXSDErTXEwM3VSM1pYUEJZZHlWODMxOQpvMGxWajFLRkkyRENML2xpV2lzSlJvb2YrMWNSMzVDdGQwd1lCY3BCNlRac2xNY09QbDc2ZHdLd0pnZUpvMlFnClpzZm1jMnZDMS9xT2xOdU5xLzBUenprVkd2OEVUVDNDZ2FVK1VYZTRYT1Z2a2NjZWJKbjJkZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K'; 272 | $script = <<<'EOT' 273 | 274 | error_reporting(-1); 275 | $info = openssl_x509_parse(base64_decode('%s')); 276 | var_dump(PHP_VERSION, $info['issuer']['emailAddress'], $info['validFrom_time_t']); 277 | 278 | EOT; 279 | $script = '<'."?php\n".sprintf($script, $cert); 280 | 281 | try { 282 | $process = new PhpProcess($script); 283 | $process->mustRun(); 284 | } catch (\Exception $e) { 285 | // In the case of any exceptions just accept it is not possible to 286 | // determine the safety of openssl_x509_parse and bail out. 287 | return self::$useOpensslParse = false; 288 | } 289 | 290 | $output = preg_split('{\r?\n}', trim($process->getOutput())); 291 | $errorOutput = trim($process->getErrorOutput()); 292 | 293 | if ( 294 | is_array($output) 295 | && count($output) === 3 296 | && $output[0] === sprintf('string(%d) "%s"', strlen(PHP_VERSION), PHP_VERSION) 297 | && $output[1] === 'string(27) "stefan.esser@sektioneins.de"' 298 | && $output[2] === 'int(-1)' 299 | && preg_match('{openssl_x509_parse\(\): illegal (?:ASN1 data type for|length in) timestamp in - on line \d+}', $errorOutput) 300 | ) { 301 | // This PHP has the fix backported probably by a distro security team. 302 | return self::$useOpensslParse = true; 303 | } 304 | 305 | return self::$useOpensslParse = false; 306 | } 307 | 308 | /** 309 | * Resets the static caches 310 | * @return void 311 | */ 312 | public static function reset() 313 | { 314 | self::$caFileValidity = array(); 315 | self::$caPath = null; 316 | self::$useOpensslParse = null; 317 | } 318 | 319 | /** 320 | * @param string $name 321 | * @return string|false 322 | */ 323 | private static function getEnvVariable($name) 324 | { 325 | if (isset($_SERVER[$name])) { 326 | return (string) $_SERVER[$name]; 327 | } 328 | 329 | if (PHP_SAPI === 'cli' && ($value = getenv($name)) !== false && $value !== null) { 330 | return (string) $value; 331 | } 332 | 333 | return false; 334 | } 335 | 336 | /** 337 | * @param string|false $certFile 338 | * @return bool 339 | */ 340 | private static function caFileUsable($certFile, LoggerInterface $logger = null) 341 | { 342 | return $certFile && @is_file($certFile) && @is_readable($certFile) && static::validateCaFile($certFile, $logger); 343 | } 344 | 345 | /** 346 | * @param string|false $certDir 347 | * @return bool 348 | */ 349 | private static function caDirUsable($certDir) 350 | { 351 | return $certDir && @is_dir($certDir) && @is_readable($certDir) && glob($certDir . '/*'); 352 | } 353 | } 354 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twitteroauth", 3 | "version": "0.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@prettier/plugin-php": { 8 | "version": "0.16.0", 9 | "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.16.0.tgz", 10 | "integrity": "sha512-HG/FamMUtq4/9hZmeuvwy0BWmOr4m9OWacvLSUmmgUrQd4+TRZW7Nqs2MAJkwSNiBIgAKTt2Vw9PK+33Gxxx8g==", 11 | "dev": true, 12 | "requires": { 13 | "linguist-languages": "^7.5.1", 14 | "mem": "^8.0.0", 15 | "php-parser": "3.0.2" 16 | } 17 | }, 18 | "ansi-regex": { 19 | "version": "4.1.0", 20 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", 21 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", 22 | "dev": true 23 | }, 24 | "ansi-styles": { 25 | "version": "3.2.1", 26 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 27 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 28 | "dev": true, 29 | "requires": { 30 | "color-convert": "^1.9.0" 31 | } 32 | }, 33 | "camelcase": { 34 | "version": "5.3.1", 35 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", 36 | "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", 37 | "dev": true 38 | }, 39 | "chalk": { 40 | "version": "2.4.2", 41 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 42 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 43 | "dev": true, 44 | "requires": { 45 | "ansi-styles": "^3.2.1", 46 | "escape-string-regexp": "^1.0.5", 47 | "supports-color": "^5.3.0" 48 | }, 49 | "dependencies": { 50 | "supports-color": { 51 | "version": "5.5.0", 52 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 53 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 54 | "dev": true, 55 | "requires": { 56 | "has-flag": "^3.0.0" 57 | } 58 | } 59 | } 60 | }, 61 | "cliui": { 62 | "version": "5.0.0", 63 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", 64 | "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", 65 | "dev": true, 66 | "requires": { 67 | "string-width": "^3.1.0", 68 | "strip-ansi": "^5.2.0", 69 | "wrap-ansi": "^5.1.0" 70 | } 71 | }, 72 | "color-convert": { 73 | "version": "1.9.3", 74 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 75 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 76 | "dev": true, 77 | "requires": { 78 | "color-name": "1.1.3" 79 | } 80 | }, 81 | "color-name": { 82 | "version": "1.1.3", 83 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 84 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 85 | "dev": true 86 | }, 87 | "concurrently": { 88 | "version": "5.3.0", 89 | "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-5.3.0.tgz", 90 | "integrity": "sha512-8MhqOB6PWlBfA2vJ8a0bSFKATOdWlHiQlk11IfmQBPaHVP8oP2gsh2MObE6UR3hqDHqvaIvLTyceNW6obVuFHQ==", 91 | "dev": true, 92 | "requires": { 93 | "chalk": "^2.4.2", 94 | "date-fns": "^2.0.1", 95 | "lodash": "^4.17.15", 96 | "read-pkg": "^4.0.1", 97 | "rxjs": "^6.5.2", 98 | "spawn-command": "^0.0.2-1", 99 | "supports-color": "^6.1.0", 100 | "tree-kill": "^1.2.2", 101 | "yargs": "^13.3.0" 102 | } 103 | }, 104 | "date-fns": { 105 | "version": "2.15.0", 106 | "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.15.0.tgz", 107 | "integrity": "sha512-ZCPzAMJZn3rNUvvQIMlXhDr4A+Ar07eLeGsGREoWU19a3Pqf5oYa+ccd+B3F6XVtQY6HANMFdOQ8A+ipFnvJdQ==", 108 | "dev": true 109 | }, 110 | "decamelize": { 111 | "version": "1.2.0", 112 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 113 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", 114 | "dev": true 115 | }, 116 | "emoji-regex": { 117 | "version": "7.0.3", 118 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", 119 | "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", 120 | "dev": true 121 | }, 122 | "error-ex": { 123 | "version": "1.3.2", 124 | "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", 125 | "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", 126 | "dev": true, 127 | "requires": { 128 | "is-arrayish": "^0.2.1" 129 | } 130 | }, 131 | "escape-string-regexp": { 132 | "version": "1.0.5", 133 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 134 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 135 | "dev": true 136 | }, 137 | "find-up": { 138 | "version": "3.0.0", 139 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", 140 | "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", 141 | "dev": true, 142 | "requires": { 143 | "locate-path": "^3.0.0" 144 | } 145 | }, 146 | "get-caller-file": { 147 | "version": "2.0.5", 148 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 149 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 150 | "dev": true 151 | }, 152 | "has-flag": { 153 | "version": "3.0.0", 154 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 155 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 156 | "dev": true 157 | }, 158 | "hosted-git-info": { 159 | "version": "2.8.8", 160 | "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", 161 | "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", 162 | "dev": true 163 | }, 164 | "is-arrayish": { 165 | "version": "0.2.1", 166 | "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", 167 | "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", 168 | "dev": true 169 | }, 170 | "is-fullwidth-code-point": { 171 | "version": "2.0.0", 172 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 173 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", 174 | "dev": true 175 | }, 176 | "json-parse-better-errors": { 177 | "version": "1.0.2", 178 | "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", 179 | "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", 180 | "dev": true 181 | }, 182 | "linguist-languages": { 183 | "version": "7.11.1", 184 | "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.11.1.tgz", 185 | "integrity": "sha512-+cRUk+1WTbydcdzipXQER2iilX+wMrb1LPkbkGuDP/IcGPJRDmOZH6Olf1iH6sHlHwPnJYiNJH39YsFCVZxvUQ==", 186 | "dev": true 187 | }, 188 | "locate-path": { 189 | "version": "3.0.0", 190 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", 191 | "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", 192 | "dev": true, 193 | "requires": { 194 | "p-locate": "^3.0.0", 195 | "path-exists": "^3.0.0" 196 | } 197 | }, 198 | "lodash": { 199 | "version": "4.17.19", 200 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", 201 | "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", 202 | "dev": true 203 | }, 204 | "map-age-cleaner": { 205 | "version": "0.1.3", 206 | "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", 207 | "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", 208 | "dev": true, 209 | "requires": { 210 | "p-defer": "^1.0.0" 211 | } 212 | }, 213 | "mem": { 214 | "version": "8.0.0", 215 | "resolved": "https://registry.npmjs.org/mem/-/mem-8.0.0.tgz", 216 | "integrity": "sha512-qrcJOe6uD+EW8Wrci1Vdiua/15Xw3n/QnaNXE7varnB6InxSk7nu3/i5jfy3S6kWxr8WYJ6R1o0afMUtvorTsA==", 217 | "dev": true, 218 | "requires": { 219 | "map-age-cleaner": "^0.1.3", 220 | "mimic-fn": "^3.1.0" 221 | } 222 | }, 223 | "mimic-fn": { 224 | "version": "3.1.0", 225 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", 226 | "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", 227 | "dev": true 228 | }, 229 | "normalize-package-data": { 230 | "version": "2.5.0", 231 | "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", 232 | "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", 233 | "dev": true, 234 | "requires": { 235 | "hosted-git-info": "^2.1.4", 236 | "resolve": "^1.10.0", 237 | "semver": "2 || 3 || 4 || 5", 238 | "validate-npm-package-license": "^3.0.1" 239 | } 240 | }, 241 | "p-defer": { 242 | "version": "1.0.0", 243 | "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", 244 | "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", 245 | "dev": true 246 | }, 247 | "p-limit": { 248 | "version": "2.3.0", 249 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", 250 | "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", 251 | "dev": true, 252 | "requires": { 253 | "p-try": "^2.0.0" 254 | } 255 | }, 256 | "p-locate": { 257 | "version": "3.0.0", 258 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", 259 | "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", 260 | "dev": true, 261 | "requires": { 262 | "p-limit": "^2.0.0" 263 | } 264 | }, 265 | "p-try": { 266 | "version": "2.2.0", 267 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", 268 | "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", 269 | "dev": true 270 | }, 271 | "parse-json": { 272 | "version": "4.0.0", 273 | "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", 274 | "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", 275 | "dev": true, 276 | "requires": { 277 | "error-ex": "^1.3.1", 278 | "json-parse-better-errors": "^1.0.1" 279 | } 280 | }, 281 | "path-exists": { 282 | "version": "3.0.0", 283 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", 284 | "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", 285 | "dev": true 286 | }, 287 | "path-parse": { 288 | "version": "1.0.6", 289 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 290 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", 291 | "dev": true 292 | }, 293 | "php-parser": { 294 | "version": "3.0.2", 295 | "resolved": "https://registry.npmjs.org/php-parser/-/php-parser-3.0.2.tgz", 296 | "integrity": "sha512-a7y1+odEGsceLDLpu7oNyspZ0pK8FMWJOoim4/yd82AtnEZNLdCLZ67arnOQZ9K0lHJiSp4/7lVUpGELVxE14w==", 297 | "dev": true 298 | }, 299 | "pify": { 300 | "version": "3.0.0", 301 | "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", 302 | "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", 303 | "dev": true 304 | }, 305 | "prettier": { 306 | "version": "2.2.1", 307 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", 308 | "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", 309 | "dev": true 310 | }, 311 | "prettier-plugin-package": { 312 | "version": "1.3.0", 313 | "resolved": "https://registry.npmjs.org/prettier-plugin-package/-/prettier-plugin-package-1.3.0.tgz", 314 | "integrity": "sha512-KPNHR/Jm2zTevBp1SnjzMnooO1BOQW2bixVbOp8flOJoW+dxdDwEncObfsKZdkjwrv6AIH4oWqm5EO/etDmK9Q==", 315 | "dev": true 316 | }, 317 | "read-pkg": { 318 | "version": "4.0.1", 319 | "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", 320 | "integrity": "sha1-ljYlN48+HE1IyFhytabsfV0JMjc=", 321 | "dev": true, 322 | "requires": { 323 | "normalize-package-data": "^2.3.2", 324 | "parse-json": "^4.0.0", 325 | "pify": "^3.0.0" 326 | } 327 | }, 328 | "require-directory": { 329 | "version": "2.1.1", 330 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 331 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", 332 | "dev": true 333 | }, 334 | "require-main-filename": { 335 | "version": "2.0.0", 336 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", 337 | "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", 338 | "dev": true 339 | }, 340 | "resolve": { 341 | "version": "1.17.0", 342 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", 343 | "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", 344 | "dev": true, 345 | "requires": { 346 | "path-parse": "^1.0.6" 347 | } 348 | }, 349 | "rxjs": { 350 | "version": "6.6.2", 351 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz", 352 | "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==", 353 | "dev": true, 354 | "requires": { 355 | "tslib": "^1.9.0" 356 | } 357 | }, 358 | "semver": { 359 | "version": "5.7.1", 360 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 361 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 362 | "dev": true 363 | }, 364 | "set-blocking": { 365 | "version": "2.0.0", 366 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 367 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", 368 | "dev": true 369 | }, 370 | "spawn-command": { 371 | "version": "0.0.2-1", 372 | "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", 373 | "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=", 374 | "dev": true 375 | }, 376 | "spdx-correct": { 377 | "version": "3.1.1", 378 | "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", 379 | "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", 380 | "dev": true, 381 | "requires": { 382 | "spdx-expression-parse": "^3.0.0", 383 | "spdx-license-ids": "^3.0.0" 384 | } 385 | }, 386 | "spdx-exceptions": { 387 | "version": "2.3.0", 388 | "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", 389 | "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", 390 | "dev": true 391 | }, 392 | "spdx-expression-parse": { 393 | "version": "3.0.1", 394 | "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", 395 | "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", 396 | "dev": true, 397 | "requires": { 398 | "spdx-exceptions": "^2.1.0", 399 | "spdx-license-ids": "^3.0.0" 400 | } 401 | }, 402 | "spdx-license-ids": { 403 | "version": "3.0.5", 404 | "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", 405 | "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", 406 | "dev": true 407 | }, 408 | "string-width": { 409 | "version": "3.1.0", 410 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", 411 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", 412 | "dev": true, 413 | "requires": { 414 | "emoji-regex": "^7.0.1", 415 | "is-fullwidth-code-point": "^2.0.0", 416 | "strip-ansi": "^5.1.0" 417 | } 418 | }, 419 | "strip-ansi": { 420 | "version": "5.2.0", 421 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", 422 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", 423 | "dev": true, 424 | "requires": { 425 | "ansi-regex": "^4.1.0" 426 | } 427 | }, 428 | "supports-color": { 429 | "version": "6.1.0", 430 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", 431 | "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", 432 | "dev": true, 433 | "requires": { 434 | "has-flag": "^3.0.0" 435 | } 436 | }, 437 | "tree-kill": { 438 | "version": "1.2.2", 439 | "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", 440 | "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", 441 | "dev": true 442 | }, 443 | "tslib": { 444 | "version": "1.13.0", 445 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", 446 | "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", 447 | "dev": true 448 | }, 449 | "validate-npm-package-license": { 450 | "version": "3.0.4", 451 | "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", 452 | "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", 453 | "dev": true, 454 | "requires": { 455 | "spdx-correct": "^3.0.0", 456 | "spdx-expression-parse": "^3.0.0" 457 | } 458 | }, 459 | "which-module": { 460 | "version": "2.0.0", 461 | "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", 462 | "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", 463 | "dev": true 464 | }, 465 | "wrap-ansi": { 466 | "version": "5.1.0", 467 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", 468 | "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", 469 | "dev": true, 470 | "requires": { 471 | "ansi-styles": "^3.2.0", 472 | "string-width": "^3.0.0", 473 | "strip-ansi": "^5.0.0" 474 | } 475 | }, 476 | "y18n": { 477 | "version": "4.0.0", 478 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", 479 | "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", 480 | "dev": true 481 | }, 482 | "yargs": { 483 | "version": "13.3.2", 484 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", 485 | "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", 486 | "dev": true, 487 | "requires": { 488 | "cliui": "^5.0.0", 489 | "find-up": "^3.0.0", 490 | "get-caller-file": "^2.0.1", 491 | "require-directory": "^2.1.1", 492 | "require-main-filename": "^2.0.0", 493 | "set-blocking": "^2.0.0", 494 | "string-width": "^3.0.0", 495 | "which-module": "^2.0.0", 496 | "y18n": "^4.0.0", 497 | "yargs-parser": "^13.1.2" 498 | } 499 | }, 500 | "yargs-parser": { 501 | "version": "13.1.2", 502 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", 503 | "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", 504 | "dev": true, 505 | "requires": { 506 | "camelcase": "^5.0.0", 507 | "decamelize": "^1.2.0" 508 | } 509 | } 510 | } 511 | } 512 | -------------------------------------------------------------------------------- /vendor/abraham/twitteroauth/src/TwitterOAuth.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | class TwitterOAuth extends Config 22 | { 23 | private const API_VERSION = '1.1'; 24 | private const API_HOST = 'https://api.twitter.com'; 25 | private const UPLOAD_HOST = 'https://upload.twitter.com'; 26 | 27 | /** @var Response details about the result of the last request */ 28 | private $response; 29 | /** @var string|null Application bearer token */ 30 | private $bearer; 31 | /** @var Consumer Twitter application details */ 32 | private $consumer; 33 | /** @var Token|null User access token details */ 34 | private $token; 35 | /** @var HmacSha1 OAuth 1 signature type used by Twitter */ 36 | private $signatureMethod; 37 | /** @var int Number of attempts we made for the request */ 38 | private $attempts = 0; 39 | 40 | /** 41 | * Constructor 42 | * 43 | * @param string $consumerKey The Application Consumer Key 44 | * @param string $consumerSecret The Application Consumer Secret 45 | * @param string|null $oauthToken The Client Token (optional) 46 | * @param string|null $oauthTokenSecret The Client Token Secret (optional) 47 | */ 48 | public function __construct( 49 | string $consumerKey, 50 | string $consumerSecret, 51 | ?string $oauthToken = null, 52 | ?string $oauthTokenSecret = null 53 | ) { 54 | $this->resetLastResponse(); 55 | $this->signatureMethod = new HmacSha1(); 56 | $this->consumer = new Consumer($consumerKey, $consumerSecret); 57 | if (!empty($oauthToken) && !empty($oauthTokenSecret)) { 58 | $this->setOauthToken($oauthToken, $oauthTokenSecret); 59 | } 60 | if (empty($oauthToken) && !empty($oauthTokenSecret)) { 61 | $this->setBearer($oauthTokenSecret); 62 | } 63 | } 64 | 65 | /** 66 | * @param string $oauthToken 67 | * @param string $oauthTokenSecret 68 | */ 69 | public function setOauthToken( 70 | string $oauthToken, 71 | string $oauthTokenSecret 72 | ): void { 73 | $this->token = new Token($oauthToken, $oauthTokenSecret); 74 | $this->bearer = null; 75 | } 76 | 77 | /** 78 | * @param string $oauthTokenSecret 79 | */ 80 | public function setBearer(string $oauthTokenSecret): void 81 | { 82 | $this->bearer = $oauthTokenSecret; 83 | $this->token = null; 84 | } 85 | 86 | /** 87 | * @return string|null 88 | */ 89 | public function getLastApiPath(): ?string 90 | { 91 | return $this->response->getApiPath(); 92 | } 93 | 94 | /** 95 | * @return int 96 | */ 97 | public function getLastHttpCode(): int 98 | { 99 | return $this->response->getHttpCode(); 100 | } 101 | 102 | /** 103 | * @return array 104 | */ 105 | public function getLastXHeaders(): array 106 | { 107 | return $this->response->getXHeaders(); 108 | } 109 | 110 | /** 111 | * @return array|object|null 112 | */ 113 | public function getLastBody() 114 | { 115 | return $this->response->getBody(); 116 | } 117 | 118 | /** 119 | * Resets the last response cache. 120 | */ 121 | public function resetLastResponse(): void 122 | { 123 | $this->response = new Response(); 124 | } 125 | 126 | /** 127 | * Resets the attempts number. 128 | */ 129 | private function resetAttemptsNumber(): void 130 | { 131 | $this->attempts = 0; 132 | } 133 | 134 | /** 135 | * Delays the retries when they're activated. 136 | */ 137 | private function sleepIfNeeded(): void 138 | { 139 | if ($this->maxRetries && $this->attempts) { 140 | sleep($this->retriesDelay); 141 | } 142 | } 143 | 144 | /** 145 | * Make URLs for user browser navigation. 146 | * 147 | * @param string $path 148 | * @param array $parameters 149 | * 150 | * @return string 151 | */ 152 | public function url(string $path, array $parameters): string 153 | { 154 | $this->resetLastResponse(); 155 | $this->response->setApiPath($path); 156 | $query = http_build_query($parameters); 157 | return sprintf('%s/%s?%s', self::API_HOST, $path, $query); 158 | } 159 | 160 | /** 161 | * Make /oauth/* requests to the API. 162 | * 163 | * @param string $path 164 | * @param array $parameters 165 | * 166 | * @return array 167 | * @throws TwitterOAuthException 168 | */ 169 | public function oauth(string $path, array $parameters = []): array 170 | { 171 | $response = []; 172 | $this->resetLastResponse(); 173 | $this->response->setApiPath($path); 174 | $url = sprintf('%s/%s', self::API_HOST, $path); 175 | $result = $this->oAuthRequest($url, 'POST', $parameters); 176 | 177 | if ($this->getLastHttpCode() != 200) { 178 | throw new TwitterOAuthException($result); 179 | } 180 | 181 | parse_str($result, $response); 182 | $this->response->setBody($response); 183 | 184 | return $response; 185 | } 186 | 187 | /** 188 | * Make /oauth2/* requests to the API. 189 | * 190 | * @param string $path 191 | * @param array $parameters 192 | * 193 | * @return array|object 194 | */ 195 | public function oauth2(string $path, array $parameters = []) 196 | { 197 | $method = 'POST'; 198 | $this->resetLastResponse(); 199 | $this->response->setApiPath($path); 200 | $url = sprintf('%s/%s', self::API_HOST, $path); 201 | $request = Request::fromConsumerAndToken( 202 | $this->consumer, 203 | $this->token, 204 | $method, 205 | $url, 206 | $parameters 207 | ); 208 | $authorization = 209 | 'Authorization: Basic ' . 210 | $this->encodeAppAuthorization($this->consumer); 211 | $result = $this->request( 212 | $request->getNormalizedHttpUrl(), 213 | $method, 214 | $authorization, 215 | $parameters 216 | ); 217 | $response = JsonDecoder::decode($result, $this->decodeJsonAsArray); 218 | $this->response->setBody($response); 219 | return $response; 220 | } 221 | 222 | /** 223 | * Make GET requests to the API. 224 | * 225 | * @param string $path 226 | * @param array $parameters 227 | * 228 | * @return array|object 229 | */ 230 | public function get(string $path, array $parameters = []) 231 | { 232 | return $this->http('GET', self::API_HOST, $path, $parameters, false); 233 | } 234 | 235 | /** 236 | * Make POST requests to the API. 237 | * 238 | * @param string $path 239 | * @param array $parameters 240 | * @param bool $json 241 | * 242 | * @return array|object 243 | */ 244 | public function post( 245 | string $path, 246 | array $parameters = [], 247 | bool $json = false 248 | ) { 249 | return $this->http('POST', self::API_HOST, $path, $parameters, $json); 250 | } 251 | 252 | /** 253 | * Make DELETE requests to the API. 254 | * 255 | * @param string $path 256 | * @param array $parameters 257 | * 258 | * @return array|object 259 | */ 260 | public function delete(string $path, array $parameters = []) 261 | { 262 | return $this->http('DELETE', self::API_HOST, $path, $parameters, false); 263 | } 264 | 265 | /** 266 | * Make PUT requests to the API. 267 | * 268 | * @param string $path 269 | * @param array $parameters 270 | * 271 | * @return array|object 272 | */ 273 | public function put(string $path, array $parameters = []) 274 | { 275 | return $this->http('PUT', self::API_HOST, $path, $parameters, false); 276 | } 277 | 278 | /** 279 | * Upload media to upload.twitter.com. 280 | * 281 | * @param string $path 282 | * @param array $parameters 283 | * @param boolean $chunked 284 | * 285 | * @return array|object 286 | */ 287 | public function upload( 288 | string $path, 289 | array $parameters = [], 290 | bool $chunked = false 291 | ) { 292 | if ($chunked) { 293 | return $this->uploadMediaChunked($path, $parameters); 294 | } else { 295 | return $this->uploadMediaNotChunked($path, $parameters); 296 | } 297 | } 298 | 299 | /** 300 | * Progression of media upload 301 | * 302 | * @param string $media_id 303 | * 304 | * @return array|object 305 | */ 306 | public function mediaStatus(string $media_id) 307 | { 308 | return $this->http( 309 | 'GET', 310 | self::UPLOAD_HOST, 311 | 'media/upload', 312 | [ 313 | 'command' => 'STATUS', 314 | 'media_id' => $media_id, 315 | ], 316 | false 317 | ); 318 | } 319 | 320 | /** 321 | * Private method to upload media (not chunked) to upload.twitter.com. 322 | * 323 | * @param string $path 324 | * @param array $parameters 325 | * 326 | * @return array|object 327 | */ 328 | private function uploadMediaNotChunked(string $path, array $parameters) 329 | { 330 | if ( 331 | !is_readable($parameters['media']) || 332 | ($file = file_get_contents($parameters['media'])) === false 333 | ) { 334 | throw new \InvalidArgumentException( 335 | 'You must supply a readable file' 336 | ); 337 | } 338 | $parameters['media'] = base64_encode($file); 339 | return $this->http( 340 | 'POST', 341 | self::UPLOAD_HOST, 342 | $path, 343 | $parameters, 344 | false 345 | ); 346 | } 347 | 348 | /** 349 | * Private method to upload media (chunked) to upload.twitter.com. 350 | * 351 | * @param string $path 352 | * @param array $parameters 353 | * 354 | * @return array|object 355 | */ 356 | private function uploadMediaChunked(string $path, array $parameters) 357 | { 358 | $init = $this->http( 359 | 'POST', 360 | self::UPLOAD_HOST, 361 | $path, 362 | $this->mediaInitParameters($parameters), 363 | false 364 | ); 365 | // Append 366 | $segmentIndex = 0; 367 | $media = fopen($parameters['media'], 'rb'); 368 | while (!feof($media)) { 369 | $this->http( 370 | 'POST', 371 | self::UPLOAD_HOST, 372 | 'media/upload', 373 | [ 374 | 'command' => 'APPEND', 375 | 'media_id' => $init->media_id_string, 376 | 'segment_index' => $segmentIndex++, 377 | 'media_data' => base64_encode( 378 | fread($media, $this->chunkSize) 379 | ), 380 | ], 381 | false 382 | ); 383 | } 384 | fclose($media); 385 | // Finalize 386 | $finalize = $this->http( 387 | 'POST', 388 | self::UPLOAD_HOST, 389 | 'media/upload', 390 | [ 391 | 'command' => 'FINALIZE', 392 | 'media_id' => $init->media_id_string, 393 | ], 394 | false 395 | ); 396 | return $finalize; 397 | } 398 | 399 | /** 400 | * Private method to get params for upload media chunked init. 401 | * Twitter docs: https://dev.twitter.com/rest/reference/post/media/upload-init.html 402 | * 403 | * @param array $parameters 404 | * 405 | * @return array 406 | */ 407 | private function mediaInitParameters(array $parameters): array 408 | { 409 | $allowed_keys = [ 410 | 'media_type', 411 | 'additional_owners', 412 | 'media_category', 413 | 'shared', 414 | ]; 415 | $base = [ 416 | 'command' => 'INIT', 417 | 'total_bytes' => filesize($parameters['media']), 418 | ]; 419 | $allowed_parameters = array_intersect_key( 420 | $parameters, 421 | array_flip($allowed_keys) 422 | ); 423 | return array_merge($base, $allowed_parameters); 424 | } 425 | 426 | /** 427 | * Cleanup any parameters that are known not to work. 428 | * 429 | * @param array $parameters 430 | * 431 | * @return array 432 | */ 433 | private function cleanUpParameters(array $parameters) 434 | { 435 | foreach ($parameters as $key => $value) { 436 | // PHP coerces `true` to `"1"` which some Twitter APIs don't like. 437 | if (is_bool($value)) { 438 | $parameters[$key] = var_export($value, true); 439 | } 440 | } 441 | return $parameters; 442 | } 443 | 444 | /** 445 | * @param string $method 446 | * @param string $host 447 | * @param string $path 448 | * @param array $parameters 449 | * @param bool $json 450 | * 451 | * @return array|object 452 | */ 453 | private function http( 454 | string $method, 455 | string $host, 456 | string $path, 457 | array $parameters, 458 | bool $json 459 | ) { 460 | $this->resetLastResponse(); 461 | $this->resetAttemptsNumber(); 462 | $url = sprintf('%s/%s/%s.json', $host, self::API_VERSION, $path); 463 | $this->response->setApiPath($path); 464 | if (!$json) { 465 | $parameters = $this->cleanUpParameters($parameters); 466 | } 467 | return $this->makeRequests($url, $method, $parameters, $json); 468 | } 469 | 470 | /** 471 | * 472 | * Make requests and retry them (if enabled) in case of Twitter's problems. 473 | * 474 | * @param string $method 475 | * @param string $url 476 | * @param string $method 477 | * @param array $parameters 478 | * @param bool $json 479 | * 480 | * @return array|object 481 | */ 482 | private function makeRequests( 483 | string $url, 484 | string $method, 485 | array $parameters, 486 | bool $json 487 | ) { 488 | do { 489 | $this->sleepIfNeeded(); 490 | $result = $this->oAuthRequest($url, $method, $parameters, $json); 491 | $response = JsonDecoder::decode($result, $this->decodeJsonAsArray); 492 | $this->response->setBody($response); 493 | $this->attempts++; 494 | // Retry up to our $maxRetries number if we get errors greater than 500 (over capacity etc) 495 | } while ($this->requestsAvailable()); 496 | 497 | return $response; 498 | } 499 | 500 | /** 501 | * Checks if we have to retry request if API is down. 502 | * 503 | * @return bool 504 | */ 505 | private function requestsAvailable(): bool 506 | { 507 | return $this->maxRetries && 508 | $this->attempts <= $this->maxRetries && 509 | $this->getLastHttpCode() >= 500; 510 | } 511 | 512 | /** 513 | * Format and sign an OAuth / API request 514 | * 515 | * @param string $url 516 | * @param string $method 517 | * @param array $parameters 518 | * @param bool $json 519 | * 520 | * @return string 521 | * @throws TwitterOAuthException 522 | */ 523 | private function oAuthRequest( 524 | string $url, 525 | string $method, 526 | array $parameters, 527 | bool $json = false 528 | ) { 529 | $request = Request::fromConsumerAndToken( 530 | $this->consumer, 531 | $this->token, 532 | $method, 533 | $url, 534 | $parameters, 535 | $json 536 | ); 537 | if (array_key_exists('oauth_callback', $parameters)) { 538 | // Twitter doesn't like oauth_callback as a parameter. 539 | unset($parameters['oauth_callback']); 540 | } 541 | if ($this->bearer === null) { 542 | $request->signRequest( 543 | $this->signatureMethod, 544 | $this->consumer, 545 | $this->token 546 | ); 547 | $authorization = $request->toHeader(); 548 | if (array_key_exists('oauth_verifier', $parameters)) { 549 | // Twitter doesn't always work with oauth in the body and in the header 550 | // and it's already included in the $authorization header 551 | unset($parameters['oauth_verifier']); 552 | } 553 | } else { 554 | $authorization = 'Authorization: Bearer ' . $this->bearer; 555 | } 556 | return $this->request( 557 | $request->getNormalizedHttpUrl(), 558 | $method, 559 | $authorization, 560 | $parameters, 561 | $json 562 | ); 563 | } 564 | 565 | /** 566 | * Set Curl options. 567 | * 568 | * @return array 569 | */ 570 | private function curlOptions(): array 571 | { 572 | $bundlePath = CaBundle::getSystemCaRootBundlePath(); 573 | $options = [ 574 | // CURLOPT_VERBOSE => true, 575 | CURLOPT_CONNECTTIMEOUT => $this->connectionTimeout, 576 | CURLOPT_HEADER => true, 577 | CURLOPT_RETURNTRANSFER => true, 578 | CURLOPT_SSL_VERIFYHOST => 2, 579 | CURLOPT_SSL_VERIFYPEER => true, 580 | CURLOPT_TIMEOUT => $this->timeout, 581 | CURLOPT_USERAGENT => $this->userAgent, 582 | $this->curlCaOpt($bundlePath) => $bundlePath, 583 | ]; 584 | 585 | if ($this->gzipEncoding) { 586 | $options[CURLOPT_ENCODING] = 'gzip'; 587 | } 588 | 589 | if (!empty($this->proxy)) { 590 | $options[CURLOPT_PROXY] = $this->proxy['CURLOPT_PROXY']; 591 | $options[CURLOPT_PROXYUSERPWD] = 592 | $this->proxy['CURLOPT_PROXYUSERPWD']; 593 | $options[CURLOPT_PROXYPORT] = $this->proxy['CURLOPT_PROXYPORT']; 594 | $options[CURLOPT_PROXYAUTH] = CURLAUTH_BASIC; 595 | $options[CURLOPT_PROXYTYPE] = CURLPROXY_HTTP; 596 | } 597 | 598 | return $options; 599 | } 600 | 601 | /** 602 | * Make an HTTP request 603 | * 604 | * @param string $url 605 | * @param string $method 606 | * @param string $authorization 607 | * @param array $postfields 608 | * @param bool $json 609 | * 610 | * @return string 611 | * @throws TwitterOAuthException 612 | */ 613 | private function request( 614 | string $url, 615 | string $method, 616 | string $authorization, 617 | array $postfields, 618 | bool $json = false 619 | ): string { 620 | $options = $this->curlOptions(); 621 | $options[CURLOPT_URL] = $url; 622 | $options[CURLOPT_HTTPHEADER] = [ 623 | 'Accept: application/json', 624 | $authorization, 625 | 'Expect:', 626 | ]; 627 | 628 | switch ($method) { 629 | case 'GET': 630 | break; 631 | case 'POST': 632 | $options[CURLOPT_POST] = true; 633 | if ($json) { 634 | $options[CURLOPT_HTTPHEADER][] = 635 | 'Content-type: application/json'; 636 | $options[CURLOPT_POSTFIELDS] = json_encode($postfields); 637 | } else { 638 | $options[CURLOPT_POSTFIELDS] = Util::buildHttpQuery( 639 | $postfields 640 | ); 641 | } 642 | break; 643 | case 'DELETE': 644 | $options[CURLOPT_CUSTOMREQUEST] = 'DELETE'; 645 | break; 646 | case 'PUT': 647 | $options[CURLOPT_CUSTOMREQUEST] = 'PUT'; 648 | break; 649 | } 650 | 651 | if ( 652 | in_array($method, ['GET', 'PUT', 'DELETE']) && 653 | !empty($postfields) 654 | ) { 655 | $options[CURLOPT_URL] .= '?' . Util::buildHttpQuery($postfields); 656 | } 657 | 658 | $curlHandle = curl_init(); 659 | curl_setopt_array($curlHandle, $options); 660 | $response = curl_exec($curlHandle); 661 | 662 | // Throw exceptions on cURL errors. 663 | if (curl_errno($curlHandle) > 0) { 664 | $error = curl_error($curlHandle); 665 | $errorNo = curl_errno($curlHandle); 666 | curl_close($curlHandle); 667 | throw new TwitterOAuthException($error, $errorNo); 668 | } 669 | 670 | $this->response->setHttpCode( 671 | curl_getinfo($curlHandle, CURLINFO_HTTP_CODE) 672 | ); 673 | $parts = explode("\r\n\r\n", $response); 674 | $responseBody = array_pop($parts); 675 | $responseHeader = array_pop($parts); 676 | $this->response->setHeaders($this->parseHeaders($responseHeader)); 677 | 678 | curl_close($curlHandle); 679 | 680 | return $responseBody; 681 | } 682 | 683 | /** 684 | * Get the header info to store. 685 | * 686 | * @param string $header 687 | * 688 | * @return array 689 | */ 690 | private function parseHeaders(string $header): array 691 | { 692 | $headers = []; 693 | foreach (explode("\r\n", $header) as $line) { 694 | if (strpos($line, ':') !== false) { 695 | [$key, $value] = explode(': ', $line); 696 | $key = str_replace('-', '_', strtolower($key)); 697 | $headers[$key] = trim($value); 698 | } 699 | } 700 | return $headers; 701 | } 702 | 703 | /** 704 | * Encode application authorization header with base64. 705 | * 706 | * @param Consumer $consumer 707 | * 708 | * @return string 709 | */ 710 | private function encodeAppAuthorization(Consumer $consumer): string 711 | { 712 | $key = rawurlencode($consumer->key); 713 | $secret = rawurlencode($consumer->secret); 714 | return base64_encode($key . ':' . $secret); 715 | } 716 | 717 | /** 718 | * Get Curl CA option based on whether the given path is a directory or file. 719 | * 720 | * @param string $path 721 | * @return int 722 | */ 723 | private function curlCaOpt(string $path): int 724 | { 725 | return is_dir($path) ? CURLOPT_CAPATH : CURLOPT_CAINFO; 726 | } 727 | } 728 | --------------------------------------------------------------------------------