Changeset 2039426
- Timestamp:
- 02/26/2019 06:48:47 AM (7 years ago)
- Location:
- mplus-intercom-subscription/trunk
- Files:
-
- 70 edited
-
mplus-intercom-subscription.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/ClassLoader.php (modified) (8 diffs)
-
vendor/composer/LICENSE (modified) (1 diff)
-
vendor/composer/autoload_files.php (modified) (1 diff)
-
vendor/composer/autoload_psr4.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/composer/installed.json (modified) (7 diffs)
-
vendor/guzzlehttp/guzzle/CHANGELOG.md (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/LICENSE (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/README.md (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/composer.json (modified) (2 diffs)
-
vendor/guzzlehttp/guzzle/src/Client.php (modified) (6 diffs)
-
vendor/guzzlehttp/guzzle/src/ClientInterface.php (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php (modified) (5 diffs)
-
vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php (modified) (3 diffs)
-
vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php (modified) (5 diffs)
-
vendor/guzzlehttp/guzzle/src/HandlerStack.php (modified) (1 diff)
-
vendor/guzzlehttp/guzzle/src/MessageFormatter.php (modified) (2 diffs)
-
vendor/guzzlehttp/guzzle/src/Middleware.php (modified) (2 diffs)
-
vendor/guzzlehttp/guzzle/src/UriTemplate.php (modified) (3 diffs)
-
vendor/guzzlehttp/guzzle/src/functions.php (modified) (2 diffs)
-
vendor/guzzlehttp/psr7/CHANGELOG.md (modified) (3 diffs)
-
vendor/guzzlehttp/psr7/README.md (modified) (2 diffs)
-
vendor/guzzlehttp/psr7/composer.json (modified) (3 diffs)
-
vendor/guzzlehttp/psr7/src/AppendStream.php (modified) (4 diffs)
-
vendor/guzzlehttp/psr7/src/FnStream.php (modified) (1 diff)
-
vendor/guzzlehttp/psr7/src/InflateStream.php (modified) (1 diff)
-
vendor/guzzlehttp/psr7/src/Request.php (modified) (2 diffs)
-
vendor/guzzlehttp/psr7/src/Response.php (modified) (1 diff)
-
vendor/guzzlehttp/psr7/src/ServerRequest.php (modified) (5 diffs)
-
vendor/guzzlehttp/psr7/src/Stream.php (modified) (7 diffs)
-
vendor/guzzlehttp/psr7/src/StreamWrapper.php (modified) (3 diffs)
-
vendor/guzzlehttp/psr7/src/Uri.php (modified) (3 diffs)
-
vendor/guzzlehttp/psr7/src/functions.php (modified) (11 diffs)
-
vendor/intercom/intercom-php/README.md (modified) (20 diffs)
-
vendor/intercom/intercom-php/composer.json (modified) (2 diffs)
-
vendor/intercom/intercom-php/src/IntercomAdmins.php (modified) (4 diffs)
-
vendor/intercom/intercom-php/src/IntercomBulk.php (modified) (3 diffs)
-
vendor/intercom/intercom-php/src/IntercomClient.php (modified) (7 diffs)
-
vendor/intercom/intercom-php/src/IntercomCompanies.php (modified) (5 diffs)
-
vendor/intercom/intercom-php/src/IntercomConversations.php (modified) (6 diffs)
-
vendor/intercom/intercom-php/src/IntercomCounts.php (modified) (2 diffs)
-
vendor/intercom/intercom-php/src/IntercomEvents.php (modified) (3 diffs)
-
vendor/intercom/intercom-php/src/IntercomLeads.php (modified) (8 diffs)
-
vendor/intercom/intercom-php/src/IntercomMessages.php (modified) (2 diffs)
-
vendor/intercom/intercom-php/src/IntercomNotes.php (modified) (4 diffs)
-
vendor/intercom/intercom-php/src/IntercomSegments.php (modified) (3 diffs)
-
vendor/intercom/intercom-php/src/IntercomTags.php (modified) (3 diffs)
-
vendor/intercom/intercom-php/src/IntercomUsers.php (modified) (7 diffs)
-
vendor/intercom/intercom-php/src/IntercomVisitors.php (modified) (5 diffs)
-
vendor/intercom/intercom-php/test/IntercomAdminsTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomBulkTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomClientTest.php (modified) (7 diffs)
-
vendor/intercom/intercom-php/test/IntercomCompaniesTest.php (modified) (2 diffs)
-
vendor/intercom/intercom-php/test/IntercomConversationsTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomCountsTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomEventsTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomLeadsTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomMessagesTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomNotesTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomSegmentsTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomTagsTest.php (modified) (1 diff)
-
vendor/intercom/intercom-php/test/IntercomUsersTest.php (modified) (2 diffs)
-
vendor/intercom/intercom-php/test/IntercomVisitorsTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mplus-intercom-subscription/trunk/mplus-intercom-subscription.php
r1951178 r2039426 4 4 * Plugin URI: https://www.79mplus.com/intercom-subscription/ 5 5 * Description: The easiest and most extendable WordPress plugin for Intercom. This lets you offer a subscription form for Intercom and offers a wide range of extensions to grow your user base with the power of Intercom. 6 * Version: 1.0.2 46 * Version: 1.0.25 7 7 * Author: 79mplus 8 8 * Author URI: https://www.79mplus.com/ … … 28 28 * Plugin version. 29 29 */ 30 define( 'MPLUSISVERSION', '1.0.2 4' );30 define( 'MPLUSISVERSION', '1.0.25' ); 31 31 /** 32 32 * Plugin directory. -
mplus-intercom-subscription/trunk/readme.txt
r1960555 r2039426 4 4 Tags: intercom, email, newsletter, marketing, user base, grow, communication 5 5 Requires at least: 4.6 6 Tested up to: 5. 06 Tested up to: 5.1 7 7 Stable tag: trunk 8 Requires PHP: 5.2.48 Requires PHP: 7.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 134 134 == Changelog == 135 135 136 = 1.0.25 = 137 * Updated intercom php SDK file 138 * Fix user not created issue. 139 136 140 = 1.0.24 = 137 141 * Updated the new logo and banner. -
mplus-intercom-subscription/trunk/vendor/autoload.php
r1877046 r2039426 1 1 <?php 2 3 // File Security Check4 if ( ! defined( 'ABSPATH' ) ) :5 exit;6 endif;7 2 8 3 // autoload.php @generated by Composer 9 4 10 require_once __DIR__ . '/composer ' . '/autoload_real.php';5 require_once __DIR__ . '/composer/autoload_real.php'; 11 6 12 return ComposerAutoloaderInit d17eceb359be558bbf8db8ddf58b8404::getLoader();7 return ComposerAutoloaderInitc8232c00733f860956eb2ccd68c4460b::getLoader(); -
mplus-intercom-subscription/trunk/vendor/composer/ClassLoader.php
r1864548 r2039426 14 14 15 15 /** 16 * ClassLoader implements a PSR-0 class loader 17 * 18 * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md 16 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. 19 17 * 20 18 * $loader = new \Composer\Autoload\ClassLoader(); … … 40 38 * @author Fabien Potencier <fabien@symfony.com> 41 39 * @author Jordi Boggiano <j.boggiano@seld.be> 40 * @see http://www.php-fig.org/psr/psr-0/ 41 * @see http://www.php-fig.org/psr/psr-4/ 42 42 */ 43 43 class ClassLoader … … 54 54 private $useIncludePath = false; 55 55 private $classMap = array(); 56 57 56 private $classMapAuthoritative = false; 57 private $missingClasses = array(); 58 private $apcuPrefix; 58 59 59 60 public function getPrefixes() … … 148 149 * 149 150 * @param string $prefix The prefix/namespace, with trailing '\\' 150 * @param array|string $paths The PSR- 0base directories151 * @param array|string $paths The PSR-4 base directories 151 152 * @param bool $prepend Whether to prepend the directories 152 153 * … … 273 274 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 /** 275 296 * Registers this instance as an autoloader. 276 297 * … … 314 335 public function findFile($class) 315 336 { 316 // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731317 if ('\\' == $class[0]) {318 $class = substr($class, 1);319 }320 321 337 // class map lookup 322 338 if (isset($this->classMap[$class])) { 323 339 return $this->classMap[$class]; 324 340 } 325 if ($this->classMapAuthoritative ) {341 if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { 326 342 return false; 327 343 } 344 if (null !== $this->apcuPrefix) { 345 $file = apcu_fetch($this->apcuPrefix.$class, $hit); 346 if ($hit) { 347 return $file; 348 } 349 } 328 350 329 351 $file = $this->findFileWithExtension($class, '.php'); 330 352 331 353 // Search for Hack files if we are running on HHVM 332 if ( $file === null&& defined('HHVM_VERSION')) {354 if (false === $file && defined('HHVM_VERSION')) { 333 355 $file = $this->findFileWithExtension($class, '.hh'); 334 356 } 335 357 336 if ($file === null) { 358 if (null !== $this->apcuPrefix) { 359 apcu_add($this->apcuPrefix.$class, $file); 360 } 361 362 if (false === $file) { 337 363 // Remember that this class does not exist. 338 return $this->classMap[$class] = false;364 $this->missingClasses[$class] = true; 339 365 } 340 366 … … 349 375 $first = $class[0]; 350 376 if (isset($this->prefixLengthsPsr4[$first])) { 351 foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { 352 if (0 === strpos($class, $prefix)) { 353 foreach ($this->prefixDirsPsr4[$prefix] as $dir) { 354 if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { 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)) { 355 385 return $file; 356 386 } … … 400 430 return $file; 401 431 } 432 433 return false; 402 434 } 403 435 } -
mplus-intercom-subscription/trunk/vendor/composer/LICENSE
r1864548 r2039426 1 1 2 Copyright (c) 2015Nils Adermann, Jordi Boggiano2 Copyright (c) Nils Adermann, Jordi Boggiano 3 3 4 4 Permission is hereby granted, free of charge, to any person obtaining a copy -
mplus-intercom-subscription/trunk/vendor/composer/autoload_files.php
r1864548 r2039426 7 7 8 8 return array( 9 $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 10 $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 11 $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 9 '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 10 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 11 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 12 'ddc0a4d7e61c0286f0f8593b1903e894' => $vendorDir . '/clue/stream-filter/src/functions.php', 13 '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 14 '8cff32064859f4559445b89279f3199c' => $vendorDir . '/php-http/message/src/filters.php', 12 15 ); -
mplus-intercom-subscription/trunk/vendor/composer/autoload_psr4.php
r1864548 r2039426 8 8 return array( 9 9 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 10 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 10 11 'Intercom\\' => array($vendorDir . '/intercom/intercom-php/src'), 12 'Http\\Promise\\' => array($vendorDir . '/php-http/promise/src'), 13 'Http\\Message\\' => array($vendorDir . '/php-http/message/src', $vendorDir . '/php-http/message-factory/src'), 14 'Http\\Discovery\\' => array($vendorDir . '/php-http/discovery/src'), 15 'Http\\Client\\' => array($vendorDir . '/php-http/httplug/src'), 16 'Http\\Adapter\\Guzzle6\\' => array($vendorDir . '/php-http/guzzle6-adapter/src'), 11 17 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 12 18 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 13 19 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 20 'Clue\\StreamFilter\\' => array($vendorDir . '/clue/stream-filter/src'), 14 21 ); -
mplus-intercom-subscription/trunk/vendor/composer/autoload_real.php
r1864548 r2039426 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit d17eceb359be558bbf8db8ddf58b84045 class ComposerAutoloaderInitc8232c00733f860956eb2ccd68c4460b 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit d17eceb359be558bbf8db8ddf58b8404', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInitc8232c00733f860956eb2ccd68c4460b', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit d17eceb359be558bbf8db8ddf58b8404', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInitc8232c00733f860956eb2ccd68c4460b', 'loadClassLoader')); 25 25 26 $map = require __DIR__ . '/autoload_namespaces.php'; 27 foreach ($map as $namespace => $path) { 28 $loader->set($namespace, $path); 29 } 26 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 if ($useStaticLoader) { 28 require_once __DIR__ . '/autoload_static.php'; 30 29 31 $map = require __DIR__ . '/autoload_psr4.php'; 32 foreach ($map as $namespace => $path) { 33 $loader->setPsr4($namespace, $path); 34 } 30 call_user_func(\Composer\Autoload\ComposerStaticInitc8232c00733f860956eb2ccd68c4460b::getInitializer($loader)); 31 } else { 32 $map = require __DIR__ . '/autoload_namespaces.php'; 33 foreach ($map as $namespace => $path) { 34 $loader->set($namespace, $path); 35 } 35 36 36 $classMap = require __DIR__ . '/autoload_classmap.php'; 37 if ($classMap) { 38 $loader->addClassMap($classMap); 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 } 39 46 } 40 47 41 48 $loader->register(true); 42 49 43 $includeFiles = require __DIR__ . '/autoload_files.php'; 44 foreach ($includeFiles as $file) { 45 composerRequired17eceb359be558bbf8db8ddf58b8404($file); 50 if ($useStaticLoader) { 51 $includeFiles = Composer\Autoload\ComposerStaticInitc8232c00733f860956eb2ccd68c4460b::$files; 52 } else { 53 $includeFiles = require __DIR__ . '/autoload_files.php'; 54 } 55 foreach ($includeFiles as $fileIdentifier => $file) { 56 composerRequirec8232c00733f860956eb2ccd68c4460b($fileIdentifier, $file); 46 57 } 47 58 … … 50 61 } 51 62 52 function composerRequire d17eceb359be558bbf8db8ddf58b8404($file)63 function composerRequirec8232c00733f860956eb2ccd68c4460b($fileIdentifier, $file) 53 64 { 54 require $file; 65 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 66 require $file; 67 68 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 69 } 55 70 } -
mplus-intercom-subscription/trunk/vendor/composer/installed.json
r1864548 r2039426 1 1 [ 2 2 { 3 "name": "guzzlehttp/promises", 4 "version": "v1.3.1", 5 "version_normalized": "1.3.1.0", 6 "source": { 7 "type": "git", 8 "url": "https://github.com/guzzle/promises.git", 9 "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" 10 }, 11 "dist": { 12 "type": "zip", 13 "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", 14 "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", 15 "shasum": "" 16 }, 17 "require": { 18 "php": ">=5.5.0" 19 }, 20 "require-dev": { 21 "phpunit/phpunit": "^4.0" 22 }, 23 "time": "2016-12-20 10:07:11", 24 "type": "library", 25 "extra": { 26 "branch-alias": { 27 "dev-master": "1.4-dev" 28 } 29 }, 30 "installation-source": "dist", 31 "autoload": { 32 "psr-4": { 33 "GuzzleHttp\\Promise\\": "src/" 3 "name": "clue/stream-filter", 4 "version": "v1.4.0", 5 "version_normalized": "1.4.0.0", 6 "source": { 7 "type": "git", 8 "url": "https://github.com/clue/php-stream-filter.git", 9 "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" 10 }, 11 "dist": { 12 "type": "zip", 13 "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", 14 "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", 15 "shasum": "" 16 }, 17 "require": { 18 "php": ">=5.3" 19 }, 20 "require-dev": { 21 "phpunit/phpunit": "^5.0 || ^4.8" 22 }, 23 "time": "2017-08-18T09:54:01+00:00", 24 "type": "library", 25 "installation-source": "dist", 26 "autoload": { 27 "psr-4": { 28 "Clue\\StreamFilter\\": "src/" 34 29 }, 35 30 "files": [ 36 "src/functions _include.php"31 "src/functions.php" 37 32 ] 38 33 }, … … 43 38 "authors": [ 44 39 { 45 "name": "Michael Dowling", 46 "email": "mtdowling@gmail.com", 47 "homepage": "https://github.com/mtdowling" 48 } 49 ], 50 "description": "Guzzle promises library", 51 "keywords": [ 52 "promise" 53 ] 54 }, 55 { 56 "name": "psr/http-message", 57 "version": "1.0.1", 58 "version_normalized": "1.0.1.0", 59 "source": { 60 "type": "git", 61 "url": "https://github.com/php-fig/http-message.git", 62 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 63 }, 64 "dist": { 65 "type": "zip", 66 "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 67 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 68 "shasum": "" 69 }, 70 "require": { 71 "php": ">=5.3.0" 72 }, 73 "time": "2016-08-06 14:39:51", 74 "type": "library", 75 "extra": { 76 "branch-alias": { 77 "dev-master": "1.0.x-dev" 78 } 79 }, 80 "installation-source": "dist", 81 "autoload": { 82 "psr-4": { 83 "Psr\\Http\\Message\\": "src/" 84 } 85 }, 86 "notification-url": "https://packagist.org/downloads/", 87 "license": [ 88 "MIT" 89 ], 90 "authors": [ 91 { 92 "name": "PHP-FIG", 93 "homepage": "http://www.php-fig.org/" 94 } 95 ], 96 "description": "Common interface for HTTP messages", 97 "homepage": "https://github.com/php-fig/http-message", 98 "keywords": [ 99 "http", 100 "http-message", 101 "psr", 102 "psr-7", 103 "request", 104 "response" 105 ] 106 }, 107 { 108 "name": "guzzlehttp/psr7", 109 "version": "1.4.2", 110 "version_normalized": "1.4.2.0", 111 "source": { 112 "type": "git", 113 "url": "https://github.com/guzzle/psr7.git", 114 "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" 115 }, 116 "dist": { 117 "type": "zip", 118 "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", 119 "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", 120 "shasum": "" 121 }, 122 "require": { 123 "php": ">=5.4.0", 124 "psr/http-message": "~1.0" 125 }, 126 "provide": { 127 "psr/http-message-implementation": "1.0" 128 }, 129 "require-dev": { 130 "phpunit/phpunit": "~4.0" 131 }, 132 "time": "2017-03-20 17:10:46", 133 "type": "library", 134 "extra": { 135 "branch-alias": { 136 "dev-master": "1.4-dev" 137 } 138 }, 139 "installation-source": "dist", 140 "autoload": { 141 "psr-4": { 142 "GuzzleHttp\\Psr7\\": "src/" 143 }, 144 "files": [ 145 "src/functions_include.php" 146 ] 147 }, 148 "notification-url": "https://packagist.org/downloads/", 149 "license": [ 150 "MIT" 151 ], 152 "authors": [ 153 { 154 "name": "Michael Dowling", 155 "email": "mtdowling@gmail.com", 156 "homepage": "https://github.com/mtdowling" 157 }, 158 { 159 "name": "Tobias Schultze", 160 "homepage": "https://github.com/Tobion" 161 } 162 ], 163 "description": "PSR-7 message implementation that also provides common utility methods", 164 "keywords": [ 165 "http", 166 "message", 167 "request", 168 "response", 40 "name": "Christian Lück", 41 "email": "christian@lueck.tv" 42 } 43 ], 44 "description": "A simple and modern approach to stream filtering in PHP", 45 "homepage": "https://github.com/clue/php-stream-filter", 46 "keywords": [ 47 "bucket brigade", 48 "callback", 49 "filter", 50 "php_user_filter", 169 51 "stream", 170 " uri",171 " url"52 "stream_filter_append", 53 "stream_filter_register" 172 54 ] 173 55 }, 174 56 { 175 57 "name": "guzzlehttp/guzzle", 176 "version": "6.3. 0",177 "version_normalized": "6.3. 0.0",58 "version": "6.3.3", 59 "version_normalized": "6.3.3.0", 178 60 "source": { 179 61 "type": "git", 180 62 "url": "https://github.com/guzzle/guzzle.git", 181 "reference": " f4db5a78a5ea468d4831de7f0bf9d9415e348699"182 }, 183 "dist": { 184 "type": "zip", 185 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ f4db5a78a5ea468d4831de7f0bf9d9415e348699",186 "reference": " f4db5a78a5ea468d4831de7f0bf9d9415e348699",63 "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" 64 }, 65 "dist": { 66 "type": "zip", 67 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", 68 "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", 187 69 "shasum": "" 188 70 }, … … 194 76 "require-dev": { 195 77 "ext-curl": "*", 196 "phpunit/phpunit": "^4. 0 || ^5.0",78 "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 197 79 "psr/log": "^1.0" 198 80 }, … … 200 82 "psr/log": "Required for using the Log middleware" 201 83 }, 202 "time": "201 7-06-22 18:50:49",203 "type": "library", 204 "extra": { 205 "branch-alias": { 206 "dev-master": "6. 2-dev"84 "time": "2018-04-22T15:46:56+00:00", 85 "type": "library", 86 "extra": { 87 "branch-alias": { 88 "dev-master": "6.3-dev" 207 89 } 208 90 }, … … 240 122 }, 241 123 { 124 "name": "guzzlehttp/promises", 125 "version": "v1.3.1", 126 "version_normalized": "1.3.1.0", 127 "source": { 128 "type": "git", 129 "url": "https://github.com/guzzle/promises.git", 130 "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" 131 }, 132 "dist": { 133 "type": "zip", 134 "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", 135 "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", 136 "shasum": "" 137 }, 138 "require": { 139 "php": ">=5.5.0" 140 }, 141 "require-dev": { 142 "phpunit/phpunit": "^4.0" 143 }, 144 "time": "2016-12-20T10:07:11+00:00", 145 "type": "library", 146 "extra": { 147 "branch-alias": { 148 "dev-master": "1.4-dev" 149 } 150 }, 151 "installation-source": "dist", 152 "autoload": { 153 "psr-4": { 154 "GuzzleHttp\\Promise\\": "src/" 155 }, 156 "files": [ 157 "src/functions_include.php" 158 ] 159 }, 160 "notification-url": "https://packagist.org/downloads/", 161 "license": [ 162 "MIT" 163 ], 164 "authors": [ 165 { 166 "name": "Michael Dowling", 167 "email": "mtdowling@gmail.com", 168 "homepage": "https://github.com/mtdowling" 169 } 170 ], 171 "description": "Guzzle promises library", 172 "keywords": [ 173 "promise" 174 ] 175 }, 176 { 177 "name": "guzzlehttp/psr7", 178 "version": "1.5.2", 179 "version_normalized": "1.5.2.0", 180 "source": { 181 "type": "git", 182 "url": "https://github.com/guzzle/psr7.git", 183 "reference": "9f83dded91781a01c63574e387eaa769be769115" 184 }, 185 "dist": { 186 "type": "zip", 187 "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", 188 "reference": "9f83dded91781a01c63574e387eaa769be769115", 189 "shasum": "" 190 }, 191 "require": { 192 "php": ">=5.4.0", 193 "psr/http-message": "~1.0", 194 "ralouphie/getallheaders": "^2.0.5" 195 }, 196 "provide": { 197 "psr/http-message-implementation": "1.0" 198 }, 199 "require-dev": { 200 "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" 201 }, 202 "time": "2018-12-04T20:46:45+00:00", 203 "type": "library", 204 "extra": { 205 "branch-alias": { 206 "dev-master": "1.5-dev" 207 } 208 }, 209 "installation-source": "dist", 210 "autoload": { 211 "psr-4": { 212 "GuzzleHttp\\Psr7\\": "src/" 213 }, 214 "files": [ 215 "src/functions_include.php" 216 ] 217 }, 218 "notification-url": "https://packagist.org/downloads/", 219 "license": [ 220 "MIT" 221 ], 222 "authors": [ 223 { 224 "name": "Michael Dowling", 225 "email": "mtdowling@gmail.com", 226 "homepage": "https://github.com/mtdowling" 227 }, 228 { 229 "name": "Tobias Schultze", 230 "homepage": "https://github.com/Tobion" 231 } 232 ], 233 "description": "PSR-7 message implementation that also provides common utility methods", 234 "keywords": [ 235 "http", 236 "message", 237 "psr-7", 238 "request", 239 "response", 240 "stream", 241 "uri", 242 "url" 243 ] 244 }, 245 { 242 246 "name": "intercom/intercom-php", 243 "version": "v 3.1.8",244 "version_normalized": " 3.1.8.0",247 "version": "v4.0.0", 248 "version_normalized": "4.0.0.0", 245 249 "source": { 246 250 "type": "git", 247 251 "url": "https://github.com/intercom/intercom-php.git", 248 "reference": "b700866052cdb39777720b6ed886c61175b240f8" 249 }, 250 "dist": { 251 "type": "zip", 252 "url": "https://api.github.com/repos/intercom/intercom-php/zipball/b700866052cdb39777720b6ed886c61175b240f8", 253 "reference": "b700866052cdb39777720b6ed886c61175b240f8", 254 "shasum": "" 255 }, 256 "require": { 257 "guzzlehttp/guzzle": "~6.0", 258 "php": ">= 5.6" 259 }, 260 "require-dev": { 261 "phpunit/phpunit": "4.0.*", 252 "reference": "362e3053d741d96fe56de6ad156885ea564dd884" 253 }, 254 "dist": { 255 "type": "zip", 256 "url": "https://api.github.com/repos/intercom/intercom-php/zipball/362e3053d741d96fe56de6ad156885ea564dd884", 257 "reference": "362e3053d741d96fe56de6ad156885ea564dd884", 258 "shasum": "" 259 }, 260 "require": { 261 "ext-json": "*", 262 "php": ">= 7.1", 263 "php-http/client-implementation": "*", 264 "php-http/discovery": "^1.4", 265 "php-http/httplug": "^1.0 || ^2.0", 266 "php-http/message": "^1.7", 267 "psr/http-message": "^1.0" 268 }, 269 "require-dev": { 270 "php-http/guzzle6-adapter": "^2.0", 271 "phpunit/phpunit": "^7.0", 262 272 "squizlabs/php_codesniffer": "^3.1" 263 273 }, 264 "time": "201 7-10-24 09:58:05",274 "time": "2019-01-15T11:17:08+00:00", 265 275 "type": "library", 266 276 "installation-source": "dist", … … 274 284 "notification-url": "https://packagist.org/downloads/", 275 285 "license": [ 276 "Apache Version 2"286 "Apache-2.0" 277 287 ], 278 288 "authors": [ … … 289 299 "intercom.io" 290 300 ] 301 }, 302 { 303 "name": "php-http/discovery", 304 "version": "1.6.0", 305 "version_normalized": "1.6.0.0", 306 "source": { 307 "type": "git", 308 "url": "https://github.com/php-http/discovery.git", 309 "reference": "02b7ea21eafa0757af04140890a67d8ed45f83b2" 310 }, 311 "dist": { 312 "type": "zip", 313 "url": "https://api.github.com/repos/php-http/discovery/zipball/02b7ea21eafa0757af04140890a67d8ed45f83b2", 314 "reference": "02b7ea21eafa0757af04140890a67d8ed45f83b2", 315 "shasum": "" 316 }, 317 "require": { 318 "php": "^5.5 || ^7.0" 319 }, 320 "conflict": { 321 "nyholm/psr7": "<1.0" 322 }, 323 "require-dev": { 324 "php-http/httplug": "^1.0 || ^2.0", 325 "php-http/message-factory": "^1.0", 326 "phpspec/phpspec": "^2.4", 327 "puli/composer-plugin": "1.0.0-beta10" 328 }, 329 "suggest": { 330 "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", 331 "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." 332 }, 333 "time": "2019-01-23T12:41:22+00:00", 334 "type": "library", 335 "extra": { 336 "branch-alias": { 337 "dev-master": "1.5-dev" 338 } 339 }, 340 "installation-source": "dist", 341 "autoload": { 342 "psr-4": { 343 "Http\\Discovery\\": "src/" 344 } 345 }, 346 "notification-url": "https://packagist.org/downloads/", 347 "license": [ 348 "MIT" 349 ], 350 "authors": [ 351 { 352 "name": "Márk Sági-Kazár", 353 "email": "mark.sagikazar@gmail.com" 354 } 355 ], 356 "description": "Finds installed HTTPlug implementations and PSR-7 message factories", 357 "homepage": "http://php-http.org", 358 "keywords": [ 359 "adapter", 360 "client", 361 "discovery", 362 "factory", 363 "http", 364 "message", 365 "psr7" 366 ] 367 }, 368 { 369 "name": "php-http/guzzle6-adapter", 370 "version": "v2.0.1", 371 "version_normalized": "2.0.1.0", 372 "source": { 373 "type": "git", 374 "url": "https://github.com/php-http/guzzle6-adapter.git", 375 "reference": "6074a4b1f4d5c21061b70bab3b8ad484282fe31f" 376 }, 377 "dist": { 378 "type": "zip", 379 "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/6074a4b1f4d5c21061b70bab3b8ad484282fe31f", 380 "reference": "6074a4b1f4d5c21061b70bab3b8ad484282fe31f", 381 "shasum": "" 382 }, 383 "require": { 384 "guzzlehttp/guzzle": "^6.0", 385 "php": "^7.1", 386 "php-http/httplug": "^2.0", 387 "psr/http-client": "^1.0" 388 }, 389 "provide": { 390 "php-http/async-client-implementation": "1.0", 391 "php-http/client-implementation": "1.0", 392 "psr/http-client-implementation": "1.0" 393 }, 394 "require-dev": { 395 "ext-curl": "*", 396 "php-http/client-integration-tests": "^2.0", 397 "phpunit/phpunit": "^7.4" 398 }, 399 "time": "2018-12-16T14:44:03+00:00", 400 "type": "library", 401 "extra": { 402 "branch-alias": { 403 "dev-master": "2.x-dev" 404 } 405 }, 406 "installation-source": "dist", 407 "autoload": { 408 "psr-4": { 409 "Http\\Adapter\\Guzzle6\\": "src/" 410 } 411 }, 412 "notification-url": "https://packagist.org/downloads/", 413 "license": [ 414 "MIT" 415 ], 416 "authors": [ 417 { 418 "name": "Márk Sági-Kazár", 419 "email": "mark.sagikazar@gmail.com" 420 }, 421 { 422 "name": "David de Boer", 423 "email": "david@ddeboer.nl" 424 } 425 ], 426 "description": "Guzzle 6 HTTP Adapter", 427 "homepage": "http://httplug.io", 428 "keywords": [ 429 "Guzzle", 430 "http" 431 ] 432 }, 433 { 434 "name": "php-http/httplug", 435 "version": "v2.0.0", 436 "version_normalized": "2.0.0.0", 437 "source": { 438 "type": "git", 439 "url": "https://github.com/php-http/httplug.git", 440 "reference": "b3842537338c949f2469557ef4ad4bdc47b58603" 441 }, 442 "dist": { 443 "type": "zip", 444 "url": "https://api.github.com/repos/php-http/httplug/zipball/b3842537338c949f2469557ef4ad4bdc47b58603", 445 "reference": "b3842537338c949f2469557ef4ad4bdc47b58603", 446 "shasum": "" 447 }, 448 "require": { 449 "php": "^7.0", 450 "php-http/promise": "^1.0", 451 "psr/http-client": "^1.0", 452 "psr/http-message": "^1.0" 453 }, 454 "require-dev": { 455 "henrikbjorn/phpspec-code-coverage": "^1.0", 456 "phpspec/phpspec": "^2.4" 457 }, 458 "time": "2018-10-31T09:14:44+00:00", 459 "type": "library", 460 "extra": { 461 "branch-alias": { 462 "dev-master": "2.0.x-dev" 463 } 464 }, 465 "installation-source": "dist", 466 "autoload": { 467 "psr-4": { 468 "Http\\Client\\": "src/" 469 } 470 }, 471 "notification-url": "https://packagist.org/downloads/", 472 "license": [ 473 "MIT" 474 ], 475 "authors": [ 476 { 477 "name": "Eric GELOEN", 478 "email": "geloen.eric@gmail.com" 479 }, 480 { 481 "name": "Márk Sági-Kazár", 482 "email": "mark.sagikazar@gmail.com" 483 } 484 ], 485 "description": "HTTPlug, the HTTP client abstraction for PHP", 486 "homepage": "http://httplug.io", 487 "keywords": [ 488 "client", 489 "http" 490 ] 491 }, 492 { 493 "name": "php-http/message", 494 "version": "1.7.2", 495 "version_normalized": "1.7.2.0", 496 "source": { 497 "type": "git", 498 "url": "https://github.com/php-http/message.git", 499 "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1" 500 }, 501 "dist": { 502 "type": "zip", 503 "url": "https://api.github.com/repos/php-http/message/zipball/b159ffe570dffd335e22ef0b91a946eacb182fa1", 504 "reference": "b159ffe570dffd335e22ef0b91a946eacb182fa1", 505 "shasum": "" 506 }, 507 "require": { 508 "clue/stream-filter": "^1.4", 509 "php": "^5.4 || ^7.0", 510 "php-http/message-factory": "^1.0.2", 511 "psr/http-message": "^1.0" 512 }, 513 "provide": { 514 "php-http/message-factory-implementation": "1.0" 515 }, 516 "require-dev": { 517 "akeneo/phpspec-skip-example-extension": "^1.0", 518 "coduo/phpspec-data-provider-extension": "^1.0", 519 "ext-zlib": "*", 520 "guzzlehttp/psr7": "^1.0", 521 "henrikbjorn/phpspec-code-coverage": "^1.0", 522 "phpspec/phpspec": "^2.4", 523 "slim/slim": "^3.0", 524 "zendframework/zend-diactoros": "^1.0" 525 }, 526 "suggest": { 527 "ext-zlib": "Used with compressor/decompressor streams", 528 "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", 529 "slim/slim": "Used with Slim Framework PSR-7 implementation", 530 "zendframework/zend-diactoros": "Used with Diactoros Factories" 531 }, 532 "time": "2018-11-01T09:32:41+00:00", 533 "type": "library", 534 "extra": { 535 "branch-alias": { 536 "dev-master": "1.6-dev" 537 } 538 }, 539 "installation-source": "dist", 540 "autoload": { 541 "psr-4": { 542 "Http\\Message\\": "src/" 543 }, 544 "files": [ 545 "src/filters.php" 546 ] 547 }, 548 "notification-url": "https://packagist.org/downloads/", 549 "license": [ 550 "MIT" 551 ], 552 "authors": [ 553 { 554 "name": "Márk Sági-Kazár", 555 "email": "mark.sagikazar@gmail.com" 556 } 557 ], 558 "description": "HTTP Message related tools", 559 "homepage": "http://php-http.org", 560 "keywords": [ 561 "http", 562 "message", 563 "psr-7" 564 ] 565 }, 566 { 567 "name": "php-http/message-factory", 568 "version": "v1.0.2", 569 "version_normalized": "1.0.2.0", 570 "source": { 571 "type": "git", 572 "url": "https://github.com/php-http/message-factory.git", 573 "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" 574 }, 575 "dist": { 576 "type": "zip", 577 "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", 578 "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", 579 "shasum": "" 580 }, 581 "require": { 582 "php": ">=5.4", 583 "psr/http-message": "^1.0" 584 }, 585 "time": "2015-12-19T14:08:53+00:00", 586 "type": "library", 587 "extra": { 588 "branch-alias": { 589 "dev-master": "1.0-dev" 590 } 591 }, 592 "installation-source": "dist", 593 "autoload": { 594 "psr-4": { 595 "Http\\Message\\": "src/" 596 } 597 }, 598 "notification-url": "https://packagist.org/downloads/", 599 "license": [ 600 "MIT" 601 ], 602 "authors": [ 603 { 604 "name": "Márk Sági-Kazár", 605 "email": "mark.sagikazar@gmail.com" 606 } 607 ], 608 "description": "Factory interfaces for PSR-7 HTTP Message", 609 "homepage": "http://php-http.org", 610 "keywords": [ 611 "factory", 612 "http", 613 "message", 614 "stream", 615 "uri" 616 ] 617 }, 618 { 619 "name": "php-http/promise", 620 "version": "v1.0.0", 621 "version_normalized": "1.0.0.0", 622 "source": { 623 "type": "git", 624 "url": "https://github.com/php-http/promise.git", 625 "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" 626 }, 627 "dist": { 628 "type": "zip", 629 "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", 630 "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", 631 "shasum": "" 632 }, 633 "require-dev": { 634 "henrikbjorn/phpspec-code-coverage": "^1.0", 635 "phpspec/phpspec": "^2.4" 636 }, 637 "time": "2016-01-26T13:27:02+00:00", 638 "type": "library", 639 "extra": { 640 "branch-alias": { 641 "dev-master": "1.1-dev" 642 } 643 }, 644 "installation-source": "dist", 645 "autoload": { 646 "psr-4": { 647 "Http\\Promise\\": "src/" 648 } 649 }, 650 "notification-url": "https://packagist.org/downloads/", 651 "license": [ 652 "MIT" 653 ], 654 "authors": [ 655 { 656 "name": "Márk Sági-Kazár", 657 "email": "mark.sagikazar@gmail.com" 658 }, 659 { 660 "name": "Joel Wurtz", 661 "email": "joel.wurtz@gmail.com" 662 } 663 ], 664 "description": "Promise used for asynchronous HTTP requests", 665 "homepage": "http://httplug.io", 666 "keywords": [ 667 "promise" 668 ] 669 }, 670 { 671 "name": "psr/http-client", 672 "version": "1.0.0", 673 "version_normalized": "1.0.0.0", 674 "source": { 675 "type": "git", 676 "url": "https://github.com/php-fig/http-client.git", 677 "reference": "496a823ef742b632934724bf769560c2a5c7c44e" 678 }, 679 "dist": { 680 "type": "zip", 681 "url": "https://api.github.com/repos/php-fig/http-client/zipball/496a823ef742b632934724bf769560c2a5c7c44e", 682 "reference": "496a823ef742b632934724bf769560c2a5c7c44e", 683 "shasum": "" 684 }, 685 "require": { 686 "php": "^7.0", 687 "psr/http-message": "^1.0" 688 }, 689 "time": "2018-10-30T23:29:13+00:00", 690 "type": "library", 691 "extra": { 692 "branch-alias": { 693 "dev-master": "1.0.x-dev" 694 } 695 }, 696 "installation-source": "dist", 697 "autoload": { 698 "psr-4": { 699 "Psr\\Http\\Client\\": "src/" 700 } 701 }, 702 "notification-url": "https://packagist.org/downloads/", 703 "license": [ 704 "MIT" 705 ], 706 "authors": [ 707 { 708 "name": "PHP-FIG", 709 "homepage": "http://www.php-fig.org/" 710 } 711 ], 712 "description": "Common interface for HTTP clients", 713 "homepage": "https://github.com/php-fig/http-client", 714 "keywords": [ 715 "http", 716 "http-client", 717 "psr", 718 "psr-18" 719 ] 720 }, 721 { 722 "name": "psr/http-message", 723 "version": "1.0.1", 724 "version_normalized": "1.0.1.0", 725 "source": { 726 "type": "git", 727 "url": "https://github.com/php-fig/http-message.git", 728 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 729 }, 730 "dist": { 731 "type": "zip", 732 "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 733 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 734 "shasum": "" 735 }, 736 "require": { 737 "php": ">=5.3.0" 738 }, 739 "time": "2016-08-06T14:39:51+00:00", 740 "type": "library", 741 "extra": { 742 "branch-alias": { 743 "dev-master": "1.0.x-dev" 744 } 745 }, 746 "installation-source": "dist", 747 "autoload": { 748 "psr-4": { 749 "Psr\\Http\\Message\\": "src/" 750 } 751 }, 752 "notification-url": "https://packagist.org/downloads/", 753 "license": [ 754 "MIT" 755 ], 756 "authors": [ 757 { 758 "name": "PHP-FIG", 759 "homepage": "http://www.php-fig.org/" 760 } 761 ], 762 "description": "Common interface for HTTP messages", 763 "homepage": "https://github.com/php-fig/http-message", 764 "keywords": [ 765 "http", 766 "http-message", 767 "psr", 768 "psr-7", 769 "request", 770 "response" 771 ] 772 }, 773 { 774 "name": "ralouphie/getallheaders", 775 "version": "2.0.5", 776 "version_normalized": "2.0.5.0", 777 "source": { 778 "type": "git", 779 "url": "https://github.com/ralouphie/getallheaders.git", 780 "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" 781 }, 782 "dist": { 783 "type": "zip", 784 "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", 785 "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", 786 "shasum": "" 787 }, 788 "require": { 789 "php": ">=5.3" 790 }, 791 "require-dev": { 792 "phpunit/phpunit": "~3.7.0", 793 "satooshi/php-coveralls": ">=1.0" 794 }, 795 "time": "2016-02-11T07:05:27+00:00", 796 "type": "library", 797 "installation-source": "dist", 798 "autoload": { 799 "files": [ 800 "src/getallheaders.php" 801 ] 802 }, 803 "notification-url": "https://packagist.org/downloads/", 804 "license": [ 805 "MIT" 806 ], 807 "authors": [ 808 { 809 "name": "Ralph Khattar", 810 "email": "ralph.khattar@gmail.com" 811 } 812 ], 813 "description": "A polyfill for getallheaders." 291 814 } 292 815 ] -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/CHANGELOG.md
r1864548 r2039426 1 # CHANGELOG 1 # Change Log 2 3 ## 6.3.3 - 2018-04-22 4 5 * Fix: Default headers when decode_content is specified 6 7 8 ## 6.3.2 - 2018-03-26 9 10 * Fix: Release process 11 12 13 ## 6.3.1 - 2018-03-26 14 15 * Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) 16 * Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) 17 * Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) 18 * Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) 19 * Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) 20 * Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) 21 * Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) 22 23 + Minor code cleanups, documentation fixes and clarifications. 24 2 25 3 26 ## 6.3.0 - 2017-06-22 -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/LICENSE
r1864548 r2039426 1 Copyright (c) 2011-201 6Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>1 Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com> 2 2 3 3 Permission is hereby granted, free of charge, to any person obtaining a copy -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/README.md
r1864548 r2039426 2 2 ======================= 3 3 4 [](https://travis-ci.org/guzzle/guzzle) 4 [](https://github.com/guzzle/guzzle/releases) 5 [](https://travis-ci.org/guzzle/guzzle) 6 [](https://packagist.org/packages/guzzlehttp/guzzle) 5 7 6 8 Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/composer.json
r1864548 r2039426 20 20 "require-dev": { 21 21 "ext-curl": "*", 22 "phpunit/phpunit": "^4. 0 || ^5.0",22 "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 23 23 "psr/log": "^1.0" 24 24 }, … … 39 39 "extra": { 40 40 "branch-alias": { 41 "dev-master": "6. 2-dev"41 "dev-master": "6.3-dev" 42 42 } 43 43 } -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Client.php
r1864548 r2039426 291 291 private function applyOptions(RequestInterface $request, array &$options) 292 292 { 293 $modify = []; 293 $modify = [ 294 'set_headers' => [], 295 ]; 296 297 if (isset($options['headers'])) { 298 $modify['set_headers'] = $options['headers']; 299 unset($options['headers']); 300 } 294 301 295 302 if (isset($options['form_params'])) { … … 303 310 $options['body'] = http_build_query($options['form_params'], '', '&'); 304 311 unset($options['form_params']); 312 // Ensure that we don't have the header in different case and set the new value. 313 $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); 305 314 $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; 306 315 } … … 314 323 $options['body'] = \GuzzleHttp\json_encode($options['json']); 315 324 unset($options['json']); 325 // Ensure that we don't have the header in different case and set the new value. 326 $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); 316 327 $options['_conditional']['Content-Type'] = 'application/json'; 317 328 } … … 320 331 && $options['decode_content'] !== true 321 332 ) { 333 // Ensure that we don't have the header in different case and set the new value. 334 $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']); 322 335 $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; 323 }324 325 if (isset($options['headers'])) {326 if (isset($modify['set_headers'])) {327 $modify['set_headers'] = $options['headers'] + $modify['set_headers'];328 } else {329 $modify['set_headers'] = $options['headers'];330 }331 unset($options['headers']);332 336 } 333 337 … … 345 349 switch ($type) { 346 350 case 'basic': 351 // Ensure that we don't have the header in different case and set the new value. 352 $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']); 347 353 $modify['set_headers']['Authorization'] = 'Basic ' 348 354 . base64_encode("$value[0]:$value[1]"); … … 383 389 if ($request->getBody() instanceof Psr7\MultipartStream) { 384 390 // Use a multipart/form-data POST if a Content-Type is not set. 391 // Ensure that we don't have the header in different case and set the new value. 392 $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); 385 393 $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' 386 394 . $request->getBody()->getBoundary(); -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/ClientInterface.php
r1864548 r2039426 13 13 interface ClientInterface 14 14 { 15 const VERSION = '6. 2.1';15 const VERSION = '6.3.3'; 16 16 17 17 /** -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
r1864548 r2039426 96 96 { 97 97 // don't allow a null name 98 if ($name === null) {98 if ($name === null) { 99 99 return null; 100 100 } 101 foreach ($this->cookies as $cookie) {102 if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) {101 foreach ($this->cookies as $cookie) { 102 if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) { 103 103 return $cookie; 104 104 } -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
r1864548 r2039426 16 16 * Create a new SessionCookieJar object 17 17 * 18 * @param string $sessionKey Session key name to store the cookie 18 * @param string $sessionKey Session key name to store the cookie 19 19 * data in session 20 20 * @param bool $storeSessionCookies Set to true to store session cookies -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
r1864548 r2039426 36 36 // Explode the cookie string using a series of semicolons 37 37 $pieces = array_filter(array_map('trim', explode(';', $cookie))); 38 // The name of the cookie (first kvp) must include an equal sign.39 if (empty($pieces ) || !strpos($pieces[0], '=')) {38 // The name of the cookie (first kvp) must exist and include an equal sign. 39 if (empty($pieces[0]) || !strpos($pieces[0], '=')) { 40 40 return new self($data); 41 41 } … … 43 43 // Add the cookie pieces into the parsed data array 44 44 foreach ($pieces as $part) { 45 46 45 $cookieParts = explode('=', $part, 2); 47 46 $key = trim($cookieParts[0]); … … 350 349 } 351 350 352 return (bool) preg_match('/\.' . preg_quote($cookieDomain ) . '$/', $domain);351 return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain); 353 352 } 354 353 … … 360 359 public function isExpired() 361 360 { 362 return $this->getExpires() && time() > $this->getExpires();361 return $this->getExpires() !== null && time() > $this->getExpires(); 363 362 } 364 363 … … 379 378 if (preg_match( 380 379 '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', 381 $name )382 ) {380 $name 381 )) { 383 382 return 'Cookie name must not contain invalid characters: ASCII ' 384 383 . 'Control characters (0-31;127), space, tab and the ' -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php
r1864548 r2039426 2 2 namespace GuzzleHttp\Exception; 3 3 4 /** 5 * @method string getMessage() 6 * @method \Throwable|null getPrevious() 7 * @method mixed getCode() 8 * @method string getFile() 9 * @method int getLine() 10 * @method array getTrace() 11 * @method string getTraceAsString() 12 */ 4 13 interface GuzzleException {} -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
r1864548 r2039426 5 5 use GuzzleHttp\Exception\ConnectException; 6 6 use GuzzleHttp\Promise\FulfilledPromise; 7 use GuzzleHttp\Promise\RejectedPromise;8 7 use GuzzleHttp\Psr7; 9 8 use GuzzleHttp\Psr7\LazyOpenStream; … … 289 288 foreach ($conf['_headers'] as $name => $values) { 290 289 foreach ($values as $value) { 291 $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; 290 $value = (string) $value; 291 if ($value === '') { 292 // cURL requires a special format for empty headers. 293 // See https://github.com/guzzle/guzzle/issues/1882 for more details. 294 $conf[CURLOPT_HTTPHEADER][] = "$name;"; 295 } else { 296 $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; 297 } 292 298 } 293 299 } … … 389 395 if ('v4' === $options['force_ip_resolve']) { 390 396 $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; 391 } else if ('v6' === $options['force_ip_resolve']) {397 } elseif ('v6' === $options['force_ip_resolve']) { 392 398 $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6; 393 399 } -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
r1864548 r2039426 66 66 $promise = new Promise( 67 67 [$this, 'execute'], 68 function () use ($id) { return $this->cancel($id); } 68 function () use ($id) { 69 return $this->cancel($id); 70 } 69 71 ); 70 72 -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
r1864548 r2039426 5 5 use GuzzleHttp\Exception\ConnectException; 6 6 use GuzzleHttp\Promise\FulfilledPromise; 7 use GuzzleHttp\Promise\RejectedPromise;8 7 use GuzzleHttp\Promise\PromiseInterface; 9 8 use GuzzleHttp\Psr7; … … 62 61 || strpos($message, 'Connection refused') 63 62 || strpos($message, "couldn't connect to host") // error on HHVM 63 || strpos($message, "connection attempt failed") 64 64 ) { 65 65 $e = new ConnectException($e->getMessage(), $request, $e); … … 104 104 $reason = isset($parts[2]) ? $parts[2] : null; 105 105 $headers = \GuzzleHttp\headers_from_lines($hdrs); 106 list ($stream, $headers) = $this->checkDecode($options, $headers, $stream);106 list($stream, $headers) = $this->checkDecode($options, $headers, $stream); 107 107 $stream = Psr7\stream_for($stream); 108 108 $sink = $stream; … … 277 277 278 278 $params = []; 279 $context = $this->getDefaultContext($request , $options);279 $context = $this->getDefaultContext($request); 280 280 281 281 if (isset($options['on_headers']) && !is_callable($options['on_headers'])) { … … 308 308 && 'ntlm' == $options['auth'][2] 309 309 ) { 310 311 310 throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); 312 311 } -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/HandlerStack.php
r1864548 r2039426 23 23 * 24 24 * The returned handler will wrap the provided handler or use the most 25 * appropriate default handler for you system. The returned HandlerStack has25 * appropriate default handler for your system. The returned HandlerStack has 26 26 * support for cookies, redirects, HTTP error exceptions, and preparing a body 27 27 * before sending. -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
r1864548 r2039426 20 20 * - {method}: Method of the request 21 21 * - {uri}: URI of the request 22 * - {host}: Host of the request23 22 * - {version}: Protocol version 24 23 * - {target}: Request target of the request (path + query + fragment) … … 75 74 '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', 76 75 function (array $matches) use ($request, $response, $error, &$cache) { 77 78 76 if (isset($cache[$matches[1]])) { 79 77 return $cache[$matches[1]]; -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/Middleware.php
r1864548 r2039426 35 35 $request = $cookieJar->withCookieHeader($request); 36 36 return $handler($request, $options) 37 ->then(function ($response) use ($cookieJar, $request) { 38 $cookieJar->extractCookies($request, $response); 39 return $response; 40 } 37 ->then( 38 function ($response) use ($cookieJar, $request) { 39 $cookieJar->extractCookies($request, $response); 40 return $response; 41 } 41 42 ); 42 43 }; … … 73 74 * Middleware that pushes history data to an ArrayAccess container. 74 75 * 75 * @param array $container Container to hold the history (by reference).76 * @param array|\ArrayAccess $container Container to hold the history (by reference). 76 77 * 77 78 * @return callable Returns a function that accepts the next handler. -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/UriTemplate.php
r1864548 r2039426 108 108 109 109 foreach ($parsed['values'] as $value) { 110 111 110 if (!isset($this->variables[$value['value']])) { 112 111 continue; … … 118 117 119 118 if (is_array($variable)) { 120 121 119 $isAssoc = $this->isAssoc($variable); 122 120 $kvp = []; 123 121 foreach ($variable as $key => $var) { 124 125 122 if ($isAssoc) { 126 123 $key = rawurlencode($key); … … 180 177 $expanded = implode(',', $kvp); 181 178 } 182 183 179 } else { 184 180 if ($value['modifier'] === ':') { -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/guzzle/src/functions.php
r1864548 r2039426 303 303 if (JSON_ERROR_NONE !== json_last_error()) { 304 304 throw new \InvalidArgumentException( 305 'json_decode error: ' . json_last_error_msg()); 305 'json_decode error: ' . json_last_error_msg() 306 ); 306 307 } 307 308 … … 325 326 if (JSON_ERROR_NONE !== json_last_error()) { 326 327 throw new \InvalidArgumentException( 327 'json_encode error: ' . json_last_error_msg()); 328 'json_encode error: ' . json_last_error_msg() 329 ); 328 330 } 329 331 -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/CHANGELOG.md
r1864548 r2039426 1 # CHANGELOG 2 3 ## 1.4.2 - 2017-03-20 4 5 * Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing 1 # Change Log 2 3 4 All notable changes to this project will be documented in this file. 5 6 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 7 and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 8 9 10 ## [Unreleased] 11 12 13 ## [1.5.2] - 2018-12-04 14 15 ### Fixed 16 17 - Check body size when getting the message summary 18 19 20 ## [1.5.1] - 2018-12-04 21 22 ### Fixed 23 24 - Get the summary of a body only if it is readable 25 26 27 ## [1.5.0] - 2018-12-03 28 29 ### Added 30 31 - Response first-line to response string exception (fixes #145) 32 - A test for #129 behavior 33 - `get_message_body_summary` function in order to get the message summary 34 - `3gp` and `mkv` mime types 35 36 ### Changed 37 38 - Clarify exception message when stream is detached 39 40 ### Deprecated 41 42 - Deprecated parsing folded header lines as per RFC 7230 43 44 ### Fixed 45 46 - Fix `AppendStream::detach` to not close streams 47 - `InflateStream` preserves `isSeekable` attribute of the underlying stream 48 - `ServerRequest::getUriFromGlobals` to support URLs in query parameters 49 50 51 Several other fixes and improvements. 52 53 54 ## [1.4.2] - 2017-03-20 55 56 ### Fixed 57 58 - Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing 6 59 calls to `trigger_error` when deprecated methods are invoked. 7 60 8 ## 1.4.1 - 2017-02-27 9 10 * Reverted BC break by reintroducing behavior to automagically fix a URI with a 61 62 ## [1.4.1] - 2017-02-27 63 64 ### Added 65 66 - Rriggering of silenced deprecation warnings. 67 68 ### Fixed 69 70 - Reverted BC break by reintroducing behavior to automagically fix a URI with a 11 71 relative path and an authority by adding a leading slash to the path. It's only 12 72 deprecated now. 13 * Added triggering of silenced deprecation warnings. 14 15 ## 1.4.0 - 2017-02-21 16 17 * Fix `Stream::read` when length parameter <= 0. 18 * `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. 19 * Fix `ServerRequest::getUriFromGlobals` when `Host` header contains port. 20 * Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. 21 * Allow `parse_response` to parse a response without delimiting space and reason. 22 * Ensure each URI modification results in a valid URI according to PSR-7 discussions. 23 Invalid modifications will throw an exception instead of returning a wrong URI or 24 doing some magic. 25 - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception 26 because the path of a URI with an authority must start with a slash "/" or be empty 27 - `(new Uri())->withScheme('http')` will return `'http://localhost'` 28 * Fix compatibility of URIs with `file` scheme and empty host. 29 * Added common URI utility methods based on RFC 3986 (see documentation in the readme): 73 74 75 ## [1.4.0] - 2017-02-21 76 77 ### Added 78 79 - Added common URI utility methods based on RFC 3986 (see documentation in the readme): 30 80 - `Uri::isDefaultPort` 31 81 - `Uri::isAbsolute` … … 38 88 - `UriNormalizer::isEquivalent` 39 89 - `UriResolver::relativize` 40 * Deprecated `Uri::resolve` in favor of `UriResolver::resolve` 41 * Deprecated `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` 42 43 ## 1.3.1 - 2016-06-25 44 45 * Fix `Uri::__toString` for network path references, e.g. `//example.org`. 46 * Fix missing lowercase normalization for host. 47 * Fix handling of URI components in case they are `'0'` in a lot of places, 90 91 ### Changed 92 93 - Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. 94 - Allow `parse_response` to parse a response without delimiting space and reason. 95 - Ensure each URI modification results in a valid URI according to PSR-7 discussions. 96 Invalid modifications will throw an exception instead of returning a wrong URI or 97 doing some magic. 98 - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception 99 because the path of a URI with an authority must start with a slash "/" or be empty 100 - `(new Uri())->withScheme('http')` will return `'http://localhost'` 101 102 ### Deprecated 103 104 - `Uri::resolve` in favor of `UriResolver::resolve` 105 - `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` 106 107 ### Fixed 108 109 - `Stream::read` when length parameter <= 0. 110 - `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. 111 - `ServerRequest::getUriFromGlobals` when `Host` header contains port. 112 - Compatibility of URIs with `file` scheme and empty host. 113 114 115 ## [1.3.1] - 2016-06-25 116 117 ### Fixed 118 119 - `Uri::__toString` for network path references, e.g. `//example.org`. 120 - Missing lowercase normalization for host. 121 - Handling of URI components in case they are `'0'` in a lot of places, 48 122 e.g. as a user info password. 49 * Fix`Uri::withAddedHeader` to correctly merge headers with different case.50 * Fix trimming of header values in `Uri::withAddedHeader`. Header values may123 - `Uri::withAddedHeader` to correctly merge headers with different case. 124 - Trimming of header values in `Uri::withAddedHeader`. Header values may 51 125 be surrounded by whitespace which should be ignored according to RFC 7230 52 126 Section 3.2.4. This does not apply to header names. 53 * Fix`Uri::withAddedHeader` with an array of header values.54 * Fix`Uri::resolve` when base path has no slash and handling of fragment.55 * Fix handling of encoding in `Uri::with(out)QueryValue` so one can pass the127 - `Uri::withAddedHeader` with an array of header values. 128 - `Uri::resolve` when base path has no slash and handling of fragment. 129 - Handling of encoding in `Uri::with(out)QueryValue` so one can pass the 56 130 key/value both in encoded as well as decoded form to those methods. This is 57 131 consistent with withPath, withQuery etc. 58 * Fix `ServerRequest::withoutAttribute` when attribute value is null. 59 60 ## 1.3.0 - 2016-04-13 61 62 * Added remaining interfaces needed for full PSR7 compatibility 132 - `ServerRequest::withoutAttribute` when attribute value is null. 133 134 135 ## [1.3.0] - 2016-04-13 136 137 ### Added 138 139 - Remaining interfaces needed for full PSR7 compatibility 63 140 (ServerRequestInterface, UploadedFileInterface, etc.). 64 * Added support for stream_for from scalars. 65 * Can now extend Uri. 66 * Fixed a bug in validating request methods by making it more permissive. 67 68 ## 1.2.3 - 2016-02-18 69 70 * Fixed support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote 141 - Support for stream_for from scalars. 142 143 ### Changed 144 145 - Can now extend Uri. 146 147 ### Fixed 148 - A bug in validating request methods by making it more permissive. 149 150 151 ## [1.2.3] - 2016-02-18 152 153 ### Fixed 154 155 - Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote 71 156 streams, which can sometimes return fewer bytes than requested with `fread`. 72 * Fixed handling of gzipped responses with FNAME headers. 73 74 ## 1.2.2 - 2016-01-22 75 76 * Added support for URIs without any authority. 77 * Added support for HTTP 451 'Unavailable For Legal Reasons.' 78 * Added support for using '0' as a filename. 79 * Added support for including non-standard ports in Host headers. 80 81 ## 1.2.1 - 2015-11-02 82 83 * Now supporting negative offsets when seeking to SEEK_END. 84 85 ## 1.2.0 - 2015-08-15 86 87 * Body as `"0"` is now properly added to a response. 88 * Now allowing forward seeking in CachingStream. 89 * Now properly parsing HTTP requests that contain proxy targets in 157 - Handling of gzipped responses with FNAME headers. 158 159 160 ## [1.2.2] - 2016-01-22 161 162 ### Added 163 164 - Support for URIs without any authority. 165 - Support for HTTP 451 'Unavailable For Legal Reasons.' 166 - Support for using '0' as a filename. 167 - Support for including non-standard ports in Host headers. 168 169 170 ## [1.2.1] - 2015-11-02 171 172 ### Changes 173 174 - Now supporting negative offsets when seeking to SEEK_END. 175 176 177 ## [1.2.0] - 2015-08-15 178 179 ### Changed 180 181 - Body as `"0"` is now properly added to a response. 182 - Now allowing forward seeking in CachingStream. 183 - Now properly parsing HTTP requests that contain proxy targets in 90 184 `parse_request`. 91 * functions.php is now conditionally required. 92 * user-info is no longer dropped when resolving URIs. 93 94 ## 1.1.0 - 2015-06-24 95 96 * URIs can now be relative. 97 * `multipart/form-data` headers are now overridden case-insensitively. 98 * URI paths no longer encode the following characters because they are allowed 185 - functions.php is now conditionally required. 186 - user-info is no longer dropped when resolving URIs. 187 188 189 ## [1.1.0] - 2015-06-24 190 191 ### Changed 192 193 - URIs can now be relative. 194 - `multipart/form-data` headers are now overridden case-insensitively. 195 - URI paths no longer encode the following characters because they are allowed 99 196 in URIs: "(", ")", "*", "!", "'" 100 *A port is no longer added to a URI when the scheme is missing and no port is197 - A port is no longer added to a URI when the scheme is missing and no port is 101 198 present. 199 102 200 103 201 ## 1.0.0 - 2015-05-19 … … 109 207 - `Psr\Http\Message\ServerRequestInterface` 110 208 - `Psr\Http\Message\UploadedFileInterface` 209 210 211 212 [Unreleased]: https://github.com/guzzle/psr7/compare/1.5.2...HEAD 213 [1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 214 [1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 215 [1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 216 [1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 217 [1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 218 [1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 219 [1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 220 [1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 221 [1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 222 [1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 223 [1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 224 [1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 225 [1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/README.md
r1864548 r2039426 373 373 $stream = GuzzleHttp\Psr7\stream_for(fopen('/path/to/file', 'r')); 374 374 375 $generator function ($bytes) {375 $generator = function ($bytes) { 376 376 for ($i = 0; $i < $bytes; $i++) { 377 377 yield ' '; … … 607 607 key without a value, e.g. "key" instead of "key=value". 608 608 609 ### `GuzzleHttp\Psr7\Uri::withQueryValues` 610 611 `public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` 612 613 Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an 614 associative array of key => value. 609 615 610 616 ### `GuzzleHttp\Psr7\Uri::withoutQueryValue` -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/composer.json
r1864548 r2039426 3 3 "type": "library", 4 4 "description": "PSR-7 message implementation that also provides common utility methods", 5 "keywords": ["request", "response", "message", "stream", "http", "uri", "url" ],5 "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], 6 6 "license": "MIT", 7 7 "authors": [ … … 18 18 "require": { 19 19 "php": ">=5.4.0", 20 "psr/http-message": "~1.0" 20 "psr/http-message": "~1.0", 21 "ralouphie/getallheaders": "^2.0.5" 21 22 }, 22 23 "require-dev": { 23 "phpunit/phpunit": "~4. 0"24 "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" 24 25 }, 25 26 "provide": { … … 32 33 "files": ["src/functions_include.php"] 33 34 }, 35 "autoload-dev": { 36 "psr-4": { 37 "GuzzleHttp\\Tests\\Psr7\\": "tests/" 38 } 39 }, 34 40 "extra": { 35 41 "branch-alias": { 36 "dev-master": "1. 4-dev"42 "dev-master": "1.5-dev" 37 43 } 38 44 } -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/AppendStream.php
r1864548 r2039426 17 17 private $current = 0; 18 18 private $pos = 0; 19 private $detached = false;20 19 21 20 /** … … 74 73 { 75 74 $this->pos = $this->current = 0; 75 $this->seekable = true; 76 76 77 77 foreach ($this->streams as $stream) { … … 83 83 84 84 /** 85 * Detaches each attached stream 85 * Detaches each attached stream. 86 * 87 * Returns null as it's not clear which underlying stream resource to return. 86 88 * 87 89 * {@inheritdoc} … … 89 91 public function detach() 90 92 { 91 $this->close(); 92 $this->detached = true; 93 $this->pos = $this->current = 0; 94 $this->seekable = true; 95 96 foreach ($this->streams as $stream) { 97 $stream->detach(); 98 } 99 100 $this->streams = []; 93 101 } 94 102 -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/FnStream.php
r1864548 r2039426 51 51 call_user_func($this->_fn_close); 52 52 } 53 } 54 55 /** 56 * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. 57 * @throws \LogicException 58 */ 59 public function __wakeup() 60 { 61 throw new \LogicException('FnStream should never be unserialized'); 53 62 } 54 63 -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/InflateStream.php
r1864548 r2039426 28 28 $resource = StreamWrapper::getResource($stream); 29 29 stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); 30 $this->stream = new Stream($resource);30 $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); 31 31 } 32 32 -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/Request.php
r1864548 r2039426 46 46 $this->protocol = $version; 47 47 48 if (! $this->hasHeader('Host')) {48 if (!isset($this->headerNames['host'])) { 49 49 $this->updateHostFromUri(); 50 50 } … … 111 111 $new->uri = $uri; 112 112 113 if (!$preserveHost ) {113 if (!$preserveHost || !isset($this->headerNames['host'])) { 114 114 $new->updateHostFromUri(); 115 115 } -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/Response.php
r1864548 r2039426 94 94 $reason = null 95 95 ) { 96 if (filter_var($status, FILTER_VALIDATE_INT) === false) { 97 throw new \InvalidArgumentException('Status code must be an integer value.'); 98 } 99 96 100 $this->statusCode = (int) $status; 97 101 -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/ServerRequest.php
r1864548 r2039426 167 167 { 168 168 $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; 169 $headers = function_exists('getallheaders') ? getallheaders() : [];169 $headers = getallheaders(); 170 170 $uri = self::getUriFromGlobals(); 171 171 $body = new LazyOpenStream('php://input', 'r+'); … … 181 181 } 182 182 183 private static function extractHostAndPortFromAuthority($authority) 184 { 185 $uri = 'http://'.$authority; 186 $parts = parse_url($uri); 187 if (false === $parts) { 188 return [null, null]; 189 } 190 191 $host = isset($parts['host']) ? $parts['host'] : null; 192 $port = isset($parts['port']) ? $parts['port'] : null; 193 194 return [$host, $port]; 195 } 196 183 197 /** 184 198 * Get a Uri populated with values from $_SERVER. … … 186 200 * @return UriInterface 187 201 */ 188 public static function getUriFromGlobals() { 202 public static function getUriFromGlobals() 203 { 189 204 $uri = new Uri(''); 190 205 … … 193 208 $hasPort = false; 194 209 if (isset($_SERVER['HTTP_HOST'])) { 195 $hostHeaderParts = explode(':', $_SERVER['HTTP_HOST']); 196 $uri = $uri->withHost($hostHeaderParts[0]); 197 if (isset($hostHeaderParts[1])) { 210 list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); 211 if ($host !== null) { 212 $uri = $uri->withHost($host); 213 } 214 215 if ($port !== null) { 198 216 $hasPort = true; 199 $uri = $uri->withPort($ hostHeaderParts[1]);217 $uri = $uri->withPort($port); 200 218 } 201 219 } elseif (isset($_SERVER['SERVER_NAME'])) { … … 211 229 $hasQuery = false; 212 230 if (isset($_SERVER['REQUEST_URI'])) { 213 $requestUriParts = explode('?', $_SERVER['REQUEST_URI'] );231 $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); 214 232 $uri = $uri->withPath($requestUriParts[0]); 215 233 if (isset($requestUriParts[1])) { -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/Stream.php
r1864548 r2039426 25 25 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, 26 26 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, 27 'x+t' => true, 'c+t' => true, 'a+' => true 27 'x+t' => true, 'c+t' => true, 'a+' => true, 'rb+' => true, 28 28 ], 29 29 'write' => [ 30 30 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, 31 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, 31 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, 'rb+' => true, 32 32 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, 33 33 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true … … 71 71 } 72 72 73 public function __get($name)74 {75 if ($name == 'stream') {76 throw new \RuntimeException('The stream is detached');77 }78 79 throw new \BadMethodCallException('No value for ' . $name);80 }81 82 73 /** 83 74 * Closes the stream when the destructed … … 100 91 public function getContents() 101 92 { 93 if (!isset($this->stream)) { 94 throw new \RuntimeException('Stream is detached'); 95 } 96 102 97 $contents = stream_get_contents($this->stream); 103 98 … … 174 169 public function eof() 175 170 { 176 return !$this->stream || feof($this->stream); 171 if (!isset($this->stream)) { 172 throw new \RuntimeException('Stream is detached'); 173 } 174 175 return feof($this->stream); 177 176 } 178 177 179 178 public function tell() 180 179 { 180 if (!isset($this->stream)) { 181 throw new \RuntimeException('Stream is detached'); 182 } 183 181 184 $result = ftell($this->stream); 182 185 … … 195 198 public function seek($offset, $whence = SEEK_SET) 196 199 { 200 if (!isset($this->stream)) { 201 throw new \RuntimeException('Stream is detached'); 202 } 197 203 if (!$this->seekable) { 198 204 throw new \RuntimeException('Stream is not seekable'); 199 } elseif (fseek($this->stream, $offset, $whence) === -1) { 205 } 206 if (fseek($this->stream, $offset, $whence) === -1) { 200 207 throw new \RuntimeException('Unable to seek to stream position ' 201 208 . $offset . ' with whence ' . var_export($whence, true)); … … 205 212 public function read($length) 206 213 { 214 if (!isset($this->stream)) { 215 throw new \RuntimeException('Stream is detached'); 216 } 207 217 if (!$this->readable) { 208 218 throw new \RuntimeException('Cannot read from non-readable stream'); … … 226 236 public function write($string) 227 237 { 238 if (!isset($this->stream)) { 239 throw new \RuntimeException('Stream is detached'); 240 } 228 241 if (!$this->writable) { 229 242 throw new \RuntimeException('Cannot write to a non-writable stream'); -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/StreamWrapper.php
r1864548 r2039426 39 39 } 40 40 41 return fopen('guzzle://stream', $mode, null, stream_context_create([ 41 return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); 42 } 43 44 /** 45 * Creates a stream context that can be used to open a stream as a php stream resource. 46 * 47 * @param StreamInterface $stream 48 * 49 * @return resource 50 */ 51 public static function createStreamContext(StreamInterface $stream) 52 { 53 return stream_context_create([ 42 54 'guzzle' => ['stream' => $stream] 43 ]) );55 ]); 44 56 } 45 57 … … 95 107 } 96 108 109 public function stream_cast($cast_as) 110 { 111 $stream = clone($this->stream); 112 113 return $stream->detach(); 114 } 115 97 116 public function stream_stat() 98 117 { 99 118 static $modeMap = [ 100 119 'r' => 33060, 120 'rb' => 33060, 101 121 'r+' => 33206, 102 'w' => 33188 122 'w' => 33188, 123 'wb' => 33188 103 124 ]; 104 125 … … 119 140 ]; 120 141 } 142 143 public function url_stat($path, $flags) 144 { 145 return [ 146 'dev' => 0, 147 'ino' => 0, 148 'mode' => 0, 149 'nlink' => 0, 150 'uid' => 0, 151 'gid' => 0, 152 'rdev' => 0, 153 'size' => 0, 154 'atime' => 0, 155 'mtime' => 0, 156 'ctime' => 0, 157 'blksize' => 0, 158 'blocks' => 0 159 ]; 160 } 121 161 } -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/Uri.php
r1864548 r2039426 302 302 public static function withoutQueryValue(UriInterface $uri, $key) 303 303 { 304 $current = $uri->getQuery(); 305 if ($current === '') { 306 return $uri; 307 } 308 309 $decodedKey = rawurldecode($key); 310 $result = array_filter(explode('&', $current), function ($part) use ($decodedKey) { 311 return rawurldecode(explode('=', $part)[0]) !== $decodedKey; 312 }); 304 $result = self::getFilteredQueryString($uri, [$key]); 313 305 314 306 return $uri->withQuery(implode('&', $result)); … … 332 324 public static function withQueryValue(UriInterface $uri, $key, $value) 333 325 { 334 $current = $uri->getQuery(); 335 336 if ($current === '') { 337 $result = []; 338 } else { 339 $decodedKey = rawurldecode($key); 340 $result = array_filter(explode('&', $current), function ($part) use ($decodedKey) { 341 return rawurldecode(explode('=', $part)[0]) !== $decodedKey; 342 }); 343 } 344 345 // Query string separators ("=", "&") within the key or value need to be encoded 346 // (while preventing double-encoding) before setting the query string. All other 347 // chars that need percent-encoding will be encoded by withQuery(). 348 $key = strtr($key, self::$replaceQuery); 349 350 if ($value !== null) { 351 $result[] = $key . '=' . strtr($value, self::$replaceQuery); 352 } else { 353 $result[] = $key; 326 $result = self::getFilteredQueryString($uri, [$key]); 327 328 $result[] = self::generateQueryString($key, $value); 329 330 return $uri->withQuery(implode('&', $result)); 331 } 332 333 /** 334 * Creates a new URI with multiple specific query string values. 335 * 336 * It has the same behavior as withQueryValue() but for an associative array of key => value. 337 * 338 * @param UriInterface $uri URI to use as a base. 339 * @param array $keyValueArray Associative array of key and values 340 * 341 * @return UriInterface 342 */ 343 public static function withQueryValues(UriInterface $uri, array $keyValueArray) 344 { 345 $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); 346 347 foreach ($keyValueArray as $key => $value) { 348 $result[] = self::generateQueryString($key, $value); 354 349 } 355 350 … … 621 616 } 622 617 618 /** 619 * @param UriInterface $uri 620 * @param array $keys 621 * 622 * @return array 623 */ 624 private static function getFilteredQueryString(UriInterface $uri, array $keys) 625 { 626 $current = $uri->getQuery(); 627 628 if ($current === '') { 629 return []; 630 } 631 632 $decodedKeys = array_map('rawurldecode', $keys); 633 634 return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { 635 return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); 636 }); 637 } 638 639 /** 640 * @param string $key 641 * @param string|null $value 642 * 643 * @return string 644 */ 645 private static function generateQueryString($key, $value) 646 { 647 // Query string separators ("=", "&") within the key or value need to be encoded 648 // (while preventing double-encoding) before setting the query string. All other 649 // chars that need percent-encoding will be encoded by withQuery(). 650 $queryString = strtr($key, self::$replaceQuery); 651 652 if ($value !== null) { 653 $queryString .= '=' . strtr($value, self::$replaceQuery); 654 } 655 656 return $queryString; 657 } 658 623 659 private function removeDefaultPort() 624 660 { -
mplus-intercom-subscription/trunk/vendor/guzzlehttp/psr7/src/functions.php
r1864548 r2039426 70 70 * - size: Size of the stream. 71 71 * 72 * @param resource|string|null|int|float|bool|StreamInterface|callable $resource Entity body data73 * @param array $options Additional options74 * 75 * @return Stream 72 * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data 73 * @param array $options Additional options 74 * 75 * @return StreamInterface 76 76 * @throws \InvalidArgumentException if the $resource arg is not valid. 77 77 */ … … 239 239 240 240 if ($request instanceof ServerRequestInterface) { 241 return new ServerRequest(241 return (new ServerRequest( 242 242 isset($changes['method']) ? $changes['method'] : $request->getMethod(), 243 243 $uri, … … 248 248 : $request->getProtocolVersion(), 249 249 $request->getServerParams() 250 ); 250 )) 251 ->withParsedBody($request->getParsedBody()) 252 ->withQueryParams($request->getQueryParams()) 253 ->withCookieParams($request->getCookieParams()) 254 ->withUploadedFiles($request->getUploadedFiles()); 251 255 } 252 256 … … 432 436 * @param int $maxLength Maximum buffer length 433 437 * 434 * @return string |bool438 * @return string 435 439 */ 436 440 function readline(StreamInterface $stream, $maxLength = null) … … 496 500 // responses without space and reason as well. 497 501 if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { 498 throw new \InvalidArgumentException('Invalid response string ');502 throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); 499 503 } 500 504 $parts = explode(' ', $data['start-line'], 3); … … 517 521 * be parsed into ['foo[a]' => '1', 'foo[b]' => '2']). 518 522 * 519 * @param string $str Query string to parse520 * @param bool|string$urlEncoding How the query string is encoded523 * @param string $str Query string to parse 524 * @param int|bool $urlEncoding How the query string is encoded 521 525 * 522 526 * @return array … … 534 538 return rawurldecode(str_replace('+', ' ', $value)); 535 539 }; 536 } elseif ($urlEncoding == PHP_QUERY_RFC3986) {540 } elseif ($urlEncoding === PHP_QUERY_RFC3986) { 537 541 $decoder = 'rawurldecode'; 538 } elseif ($urlEncoding == PHP_QUERY_RFC1738) {542 } elseif ($urlEncoding === PHP_QUERY_RFC1738) { 539 543 $decoder = 'urldecode'; 540 544 } else { … … 634 638 { 635 639 static $mimetypes = [ 640 '3gp' => 'video/3gpp', 636 641 '7z' => 'application/x-7z-compressed', 637 642 'aac' => 'audio/x-aac', … … 681 686 'midi' => 'audio/midi', 682 687 'mov' => 'video/quicktime', 688 'mkv' => 'video/x-matroska', 683 689 'mp3' => 'audio/mpeg', 684 690 'mp4' => 'video/mp4', … … 759 765 } 760 766 761 // Iterate over each line in the message, accounting for line endings 762 $lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE); 763 $result = ['start-line' => array_shift($lines), 'headers' => [], 'body' => '']; 764 array_shift($lines); 765 766 for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) { 767 $line = $lines[$i]; 768 // If two line breaks were encountered, then this is the end of body 769 if (empty($line)) { 770 if ($i < $totalLines - 1) { 771 $result['body'] = implode('', array_slice($lines, $i + 2)); 772 } 773 break; 774 } 775 if (strpos($line, ':')) { 776 $parts = explode(':', $line, 2); 777 $key = trim($parts[0]); 778 $value = isset($parts[1]) ? trim($parts[1]) : ''; 779 $result['headers'][$key][] = $value; 780 } 781 } 782 783 return $result; 767 $message = ltrim($message, "\r\n"); 768 769 $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); 770 771 if ($messageParts === false || count($messageParts) !== 2) { 772 throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); 773 } 774 775 list($rawHeaders, $body) = $messageParts; 776 $rawHeaders .= "\r\n"; // Put back the delimiter we split previously 777 $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); 778 779 if ($headerParts === false || count($headerParts) !== 2) { 780 throw new \InvalidArgumentException('Invalid message: Missing status line'); 781 } 782 783 list($startLine, $rawHeaders) = $headerParts; 784 785 if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { 786 // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 787 $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); 788 } 789 790 /** @var array[] $headerLines */ 791 $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); 792 793 // If these aren't the same, then one line didn't match and there's an invalid header. 794 if ($count !== substr_count($rawHeaders, "\n")) { 795 // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 796 if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { 797 throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); 798 } 799 800 throw new \InvalidArgumentException('Invalid header syntax'); 801 } 802 803 $headers = []; 804 805 foreach ($headerLines as $headerLine) { 806 $headers[$headerLine[1]][] = $headerLine[2]; 807 } 808 809 return [ 810 'start-line' => $startLine, 811 'headers' => $headers, 812 'body' => $body, 813 ]; 784 814 } 785 815 … … 810 840 } 811 841 842 /** 843 * Get a short summary of the message body 844 * 845 * Will return `null` if the response is not printable. 846 * 847 * @param MessageInterface $message The message to get the body summary 848 * @param int $truncateAt The maximum allowed size of the summary 849 * 850 * @return null|string 851 */ 852 function get_message_body_summary(MessageInterface $message, $truncateAt = 120) 853 { 854 $body = $message->getBody(); 855 856 if (!$body->isSeekable() || !$body->isReadable()) { 857 return null; 858 } 859 860 $size = $body->getSize(); 861 862 if ($size === 0) { 863 return null; 864 } 865 866 $summary = $body->read($truncateAt); 867 $body->rewind(); 868 869 if ($size > $truncateAt) { 870 $summary .= ' (truncated...)'; 871 } 872 873 // Matches any printable character, including unicode characters: 874 // letters, marks, numbers, punctuation, spacing, and separators. 875 if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) { 876 return null; 877 } 878 879 return $summary; 880 } 881 812 882 /** @internal */ 813 883 function _caseless_remove($keys, array $data) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/README.md
r1864548 r2039426 1 2 [](https://codeclimate.com/repos/537da4a7e30ba062b101be9c/feed) [](https://travis-ci.org/intercom/intercom-php) 5 6 ## intercom-php 7 8 > Official PHP bindings to the Intercom API 1 # intercom-php 2 3 [](https://codeclimate.com/repos/537da4a7e30ba062b101be9c/feed) [](https://circleci.com/gh/intercom/intercom-php) 4 5 Official PHP bindings to the Intercom API 9 6 10 7 ## Installation 11 8 12 Requires PHP 5.6. 9 This library supports PHP 7.1 and later 10 11 This library uses [HTTPPlug](https://github.com/php-http/httplug) as HTTP client. HTTPPlug is an abstraction that allows this library to support many different HTTP Clients. Therefore, you need to provide it with an adapter for the HTTP library you prefer. You can find all the available adapters [in Packagist](https://packagist.org/providers/php-http/client-implementation). This documentation assumes you use the Guzzle6 Client, but you can replace it with any adapter that you prefer. 13 12 14 13 The recommended way to install intercom-php is through [Composer](https://getcomposer.org): 15 14 16 First, install Composer: 17 18 ``` 19 $ curl -sS https://getcomposer.org/installer | php 20 ``` 21 22 Next, install the latest intercom-php: 23 24 ``` 25 $ php composer.phar require intercom/intercom-php 26 ``` 27 28 Finally, you need to require the library in your PHP application: 29 30 ```php 31 require "vendor/autoload.php"; 15 ```sh 16 composer require intercom/intercom-php php-http/guzzle6-adapter 32 17 ``` 33 18 34 19 ## Clients 35 For OAuth or Access Tokens use: 20 21 Initialize your client using your access token: 36 22 37 23 ```php 38 24 use Intercom\IntercomClient; 39 25 40 $client = new IntercomClient(<insert_token_here>, null); 41 ``` 42 43 > If you already have an access token you can find it [here](https://app.intercom.com/developers/_). If you want to create or learn more about access tokens then you can find more info [here](https://developers.intercom.io/docs/personal-access-tokens). 44 45 > If you are building a third party application you can get your OAuth token by [setting-up-oauth](https://developers.intercom.io/page/setting-up-oauth) for Intercom. 26 $client = new IntercomClient('<insert_token_here>'); 27 ``` 28 29 > If you already have an access token you can find it [here](https://app.intercom.com/a/apps/_/developer-hub). If you want to create or learn more about access tokens then you can find more info [here](https://developers.intercom.com/building-apps/docs/authorization#section-access-tokens). 30 > 31 > If you are building a third party application you can get your OAuth token by [setting-up-oauth](https://developers.intercom.com/building-apps/docs/authorization#section-oauth) for Intercom. 32 33 For most use cases the code snippet above should suffice. However, if needed, you can customize the Intercom client as follows: 34 35 ```php 36 use Intercom\IntercomClient; 37 38 $client = new IntercomClient('<insert_token_here>', null, ['Custom-Header' => 'value']); 39 40 $client->setHttpClient($myCustomHttpClient); // $myCustomHttpClient implements Psr\Http\Client\ClientInterface 41 $client->setRequestFactory($myCustomRequestFactory); // $myCustomRequestFactory implements Http\Message\RequestFactory 42 $client->setUriFactory($myCustomUriFactory); // $myCustomUriFactory implements Http\Message\UriFactory 43 ``` 46 44 47 45 ## Users … … 50 48 /** Create a user */ 51 49 $client->users->create([ 52 "email" => "test@example.com",53 "custom_attributes" => ['foo' => 'bar']54 ]); 55 56 /** 57 * Update a user (Note: This method is an alias to the create method. In practice you 50 "email" => "test@example.com", 51 "custom_attributes" => ['foo' => 'bar'] 52 ]); 53 54 /** 55 * Update a user (Note: This method is an alias to the create method. In practice you 58 56 * can use create to update users if you wish) 59 57 */ 60 58 $client->users->update([ 61 "email" => "test@example.com", 62 "custom_attributes" => ['foo' => 'bar'] 63 ]); 64 65 /** Delete a user by ID */ 66 $client->users->deleteUser("570680a8a1bcbca8a90001b9"); 59 "email" => "test@example.com", 60 "custom_attributes" => ['foo' => 'bar'] 61 ]); 62 63 /** Archive a user by ID (i.e. soft delete) */ 64 $client->users->archiveUser("570680a8a1bcbca8a90001b9"); 65 66 /** Permanently delete a user */ 67 $client->users->permanentlyDeleteUser("570680a8a1bcbca8a90001b9"); 68 69 /** For more on the difference between archive and permanently deleting a user please see https://developers.intercom.com/reference#archive-a-user. */ 67 70 68 71 /** Get a user by ID */ … … 71 74 /** Add companies to a user */ 72 75 $client->users->create([ 73 "email" => "test@example.com",74 "companies" => [75 [76 "company_id" => "3"77 ]78 ]76 "email" => "test@example.com", 77 "companies" => [ 78 [ 79 "company_id" => "3" 80 ] 81 ] 79 82 ]); 80 83 81 84 /** Remove companies from a user */ 82 85 $client->users->create([ 83 "email" => "test@example.com",84 "companies" => [85 [86 "company_id" => "3",87 "remove" => true88 ]89 ]86 "email" => "test@example.com", 87 "companies" => [ 88 [ 89 "company_id" => "3", 90 "remove" => true 91 ] 92 ] 90 93 ]); 91 94 … … 96 99 $client->users->getUsers([]); 97 100 98 /** 101 /** 99 102 * List all users (even above 10k records) 100 * The result object contains an array of your user objects and a scroll_param which you can then 101 * use to request the next 100 users. Note that the scroll parameter will time out after one minute 103 * The result object contains an array of your user objects and a scroll_param which you can then 104 * use to request the next 100 users. Note that the scroll parameter will time out after one minute 102 105 * and you will need to make a new request 103 106 */ … … 105 108 ``` 106 109 110 See [here](https://github.com/intercom/intercom-php#scroll) for more info on using the scroll parameter 111 107 112 ## Leads 108 113 109 114 ```php 110 /** 115 /** 111 116 * Create a lead 112 117 * See more options here: https://developers.intercom.io/reference#create-lead 113 118 */ 114 119 $client->leads->create([ 115 "email" => "test@example.com",116 "custom_attributes" => ['foo' => 'bar']117 ]); 118 119 /** 120 * Update a lead (Note: This method is an alias to the create method. 120 "email" => "test@example.com", 121 "custom_attributes" => ['foo' => 'bar'] 122 ]); 123 124 /** 125 * Update a lead (Note: This method is an alias to the create method. 121 126 * In practice you can use create to update leads if you wish) 122 127 */ 123 128 $client->leads->update([ 124 "email" => "test@example.com",125 "custom_attributes" => ['foo' => 'bar']126 ]); 127 128 /** 129 "email" => "test@example.com", 130 "custom_attributes" => ['foo' => 'bar'] 131 ]); 132 133 /** 129 134 * List leads 130 135 * See more options here: https://developers.intercom.io/reference#list-leads … … 140 145 /** Convert a Lead to a User */ 141 146 $client->leads->convertLead([ 142 "contact" => [143 "user_id" => "8a88a590-e1c3-41e2-a502-e0649dbf721c"144 ],145 "user" => [146 "email" => "winstonsmith@truth.org"147 ]148 ]); 149 150 /** 147 "contact" => [ 148 "user_id" => "8a88a590-e1c3-41e2-a502-e0649dbf721c" 149 ], 150 "user" => [ 151 "email" => "winstonsmith@truth.org" 152 ] 153 ]); 154 155 /** 151 156 * List all leads (even above 10k records) 152 * The result object contains an array of your contacts objects and a scroll_param which you can then 153 * use to request the next 100 leads. Note that the scroll parameter will time out after one minute 157 * The result object contains an array of your contacts objects and a scroll_param which you can then 158 * use to request the next 100 leads. Note that the scroll parameter will time out after one minute 154 159 * and you will need to make a new request 155 160 */ … … 157 162 ``` 158 163 164 See [here](https://github.com/intercom/intercom-php#scroll) for more info on using the scroll parameter 165 159 166 ## Visitors 167 160 168 Retrieve `user_id` of a visitor via [the JavaScript API](https://developers.intercom.com/docs/intercom-javascript#section-intercomgetvisitorid) 161 169 … … 163 171 /** Update a visitor */ 164 172 $client->visitors->update([ 165 "user_id" => "8a88a590-e1c3-41e2-a502-e0649dbf721c",166 "custom_attributes" => ['foo' => 'bar']173 "user_id" => "8a88a590-e1c3-41e2-a502-e0649dbf721c", 174 "custom_attributes" => ['foo' => 'bar'] 167 175 ]); 168 176 … … 178 186 /** Convert a Visitor to a Lead */ 179 187 $client->visitors->convertVisitor([ 180 "visitor" => [181 "user_id" => "8a88a590-e1c3-41e2-a502-e0649dbf721c"182 ],183 "type" => "lead"188 "visitor" => [ 189 "user_id" => "8a88a590-e1c3-41e2-a502-e0649dbf721c" 190 ], 191 "type" => "lead" 184 192 ]); 185 193 186 194 /** Convert a Visitor to a User */ 187 195 $client->visitors->convertVisitor([ 188 "visitor" => [189 "user_id" => "8a88a590-e1c3-41e2-a502-e0649dbf721c"190 ],191 "user" => [192 "email" => "winstonsmith@truth.org"193 ],194 "type" => "user"196 "visitor" => [ 197 "user_id" => "8a88a590-e1c3-41e2-a502-e0649dbf721c" 198 ], 199 "user" => [ 200 "email" => "winstonsmith@truth.org" 201 ], 202 "type" => "user" 195 203 ]); 196 204 ``` … … 202 210 $client->tags->getTags(); 203 211 204 /** 212 /** 205 213 * Tag users 206 214 * See more options here: https://developers.intercom.io/reference#tag-or-untag-users-companies-leads-contacts 207 215 */ 208 216 $client->tags->tag([ 209 "name" => "Test",210 "users" => [211 ["id" => "1234"]212 ]217 "name" => "Test", 218 "users" => [ 219 ["id" => "1234"] 220 ] 213 221 ]); 214 222 ``` … … 222 230 /** View a segment */ 223 231 $client->segments->getSegment("58a707924f6651b07b94376c"); 232 233 /** View a segment with count */ 234 $client->segments->getSegment("59c124f770e00fd819b9ce81", ["include_count"=>"true"]); 224 235 ``` 225 236 … … 229 240 /** Create an event */ 230 241 $client->events->create([ 231 "event_name" => "testing", 232 "created_at" => 1391691571, 233 "email" => "test@example.com" 242 "event_name" => "testing", 243 "created_at" => 1391691571, 244 "email" => "test@example.com", 245 "metadata" => [ 246 "order_date" => 1392036272, 247 "stripe_invoice" => "inv_3434343434" 248 ] 234 249 ]); 235 250 … … 243 258 /** Create a company */ 244 259 $client->companies->create([ 245 "name" => "foocorp", "company_id" => "3" 246 ]); 247 248 /** 249 * Update a company (Note: This method is an alias to the create method. 260 "name" => "foocorp", 261 "company_id" => "3" 262 ]); 263 264 /** 265 * Update a company (Note: This method is an alias to the create method. 250 266 * In practice you can use create to update companies if you wish) 251 267 */ 252 268 $client->companies->update([ 253 "name" => "foocorp", "id" => "3" 269 "name" => "foocorp", 270 "id" => "3" 254 271 ]); 255 272 256 273 /** Creating or Update a company with custom attributes. */ 257 274 $client->companies->update([ 258 "name" => "foocorp",259 "id" => "3",260 "custom_attributes" => [261 "foo" => "bar",262 "baz" => "qux"263 ]275 "name" => "foocorp", 276 "id" => "3", 277 "custom_attributes" => [ 278 "foo" => "bar", 279 "baz" => "qux" 280 ] 264 281 ]); 265 282 266 283 /** List Companies */ 267 284 $client->companies->getCompanies([]); 285 286 /** Get a company by ID */ 287 $client->companies->getCompany("531ee472cce572a6ec000006"); 268 288 ``` 269 289 … … 278 298 279 299 ```php 280 /** 300 /** 281 301 * Send a message from an admin to a user 282 302 * See more options here: https://developers.intercom.io/reference#conversations 283 303 */ 284 304 $client->messages->create([ 285 "message_type" => "inapp",286 "subject" => "Hey",287 "body" => "Ponies, cute small horses or something more sinister?",288 "from" => [289 "type" => "admin",290 "id" => "1234"291 ],292 "to" => [293 "type" => "user",294 "email" => "bob@example.com"295 ]305 "message_type" => "inapp", 306 "subject" => "Hey", 307 "body" => "Ponies, cute small horses or something more sinister?", 308 "from" => [ 309 "type" => "admin", 310 "id" => "1234" 311 ], 312 "to" => [ 313 "type" => "user", 314 "email" => "bob@example.com" 315 ] 296 316 ]); 297 317 ``` … … 300 320 301 321 ```php 302 /** 322 /** 303 323 * List conversations for an admin 304 324 * See more options here: https://developers.intercom.io/reference#list-conversations 305 325 */ 306 326 $client->conversations->getConversations([ 307 "type" => "admin",308 "admin_id" => "25610"327 "type" => "admin", 328 "admin_id" => "25610" 309 329 ]); 310 330 … … 314 334 /** Get a single conversation with plaintext comments */ 315 335 $client->conversations->getConversation("1234", [ 316 "display_as" => "plaintext"336 "display_as" => "plaintext" 317 337 ]) 318 338 319 /** 339 /** 320 340 * Reply to a conversation 321 341 * See more options here: https://developers.intercom.io/reference#replying-to-a-conversation 322 342 */ 323 343 $client->conversations->replyToConversation("5678", [ 324 "email" => "test@example.com",325 "body" => "Thanks :)",326 "type" => "user",327 "message_type" => "comment"328 ]); 329 330 /** 344 "email" => "test@example.com", 345 "body" => "Thanks :)", 346 "type" => "user", 347 "message_type" => "comment" 348 ]); 349 350 /** 331 351 * Reply to a user's last conversation 332 352 * See more options here: https://developers.intercom.com/reference#replying-to-users-last-conversation 333 353 */ 334 354 $client->conversations->replyToLastConversation([ 335 "email" => "test@example.com",336 "body" => "Thanks :)",337 "type" => "user",338 "message_type" => "comment"339 ]); 340 341 /** 355 "email" => "test@example.com", 356 "body" => "Thanks :)", 357 "type" => "user", 358 "message_type" => "comment" 359 ]); 360 361 /** 342 362 * Mark a conversation as read 343 363 * See API documentation here: https://developers.intercom.io/reference#marking-a-conversation-as-read … … 349 369 350 370 ```php 351 /** 371 /** 352 372 * List counts 353 373 * See more options here: https://developers.intercom.io/reference#getting-counts … … 361 381 /** Create a note */ 362 382 $client->notes->create([ 363 "admin_id" => "21",364 "body" => "Text for my note",365 "user" => [366 "id" => "5310d8e8598c9a0b24000005"367 ]383 "admin_id" => "21", 384 "body" => "Text for my note", 385 "user" => [ 386 "id" => "5310d8e8598c9a0b24000005" 387 ] 368 388 ]); 369 389 … … 382 402 You can access this information as follows: 383 403 384 ``` 404 ```php 385 405 $rate_limit = $intercom->getRateLimitDetails(); 386 406 print("{$rate_limit['remaining']} {$rate_limit['limit']} \n"); 387 407 print_r($rate_limit['reset_at']->format(DateTime::ISO8601)); 388 408 ``` 409 389 410 For more info on rate limits and these headers please see the [API reference docs](https://developers.intercom.com/reference#rate-limiting) 390 411 … … 407 428 ``` 408 429 430 ## Scroll 431 432 The first time you use the scroll API you can just send a simple GET request. 433 This will return up to 100 records. If you have more than 100 you will need to make another call. 434 To do this you need to use to scroll_parameter returned in the original response. 435 Use this for subsequent responses until you get an empty array of records. 436 This means there are no records and the scroll timer will be reset. 437 For more information on scroll please see the [API reference](https://developers.intercom.com/reference#iterating-over-all-users) 438 Here is an example of a simple way to use the scroll for multiple calls: 439 440 ```php 441 require "vendor/autoload.php"; 442 443 use Intercom\IntercomClient; 444 445 $intercom = new IntercomClient(getenv('AT'), null); 446 $resp = $intercom->users->scrollUsers([]); 447 $count = 1; 448 echo "PAGE $count: " . sizeof($resp->users); 449 echo "\n"; 450 while (!empty($resp->scroll_param) && sizeof($resp->users) > 0) { 451 $count = ++$count; 452 $resp = $intercom->users->scrollUsers(["scroll_param" => $resp->scroll_param]); 453 echo "PAGE $count: " . sizeof($resp->users); 454 echo "\n"; 455 } 456 ``` 409 457 410 458 ## Exceptions 411 459 412 Exceptions are handled by [Guzzle](https://github.com/guzzle/guzzle).460 Exceptions are handled by HTTPPlug. Every exception thrown implements `Http\Client\Exception`. See the different exceptions that can be thrown [in the HTTPPlug documentation](http://docs.php-http.org/en/latest/httplug/exceptions.html). 413 461 The Intercom API may return an unsuccessful HTTP response, for example when a resource is not found (404). 414 If you want to catch errors you can wrap your API call into a try/catch: 415 416 ```php 417 use GuzzleHttp\Exception\ClientException; 418 462 If you want to catch errors you can wrap your API call into a try/catch block: 463 464 ```php 419 465 try { 420 $user = $client->users->getUser("570680a8a1bcbca8a90001b9"); 421 } catch(ClientException $e) { 422 $response = $e->getResponse(); 423 $statusCode = $response->getStatusCode(); 424 if ($statusCode == '404') { 425 // Handle 404 error 426 return; 427 } else { 428 throw $e; 429 } 466 $user = $client->users->getUser("570680a8a1bcbca8a90001b9"); 467 } catch(Http\Client\Exception $e) { 468 if ($e->getCode() == '404') { 469 // Handle 404 error 470 return; 471 } else { 472 throw $e; 473 } 430 474 } 431 475 ``` -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/composer.json
r1864548 r2039426 3 3 "description": "Intercom API client built on top of Guzzle 6", 4 4 "keywords": ["intercom", "intercom.io", "api", "guzzle"], 5 "license": "Apache Version 2",5 "license": "Apache-2.0", 6 6 "authors": [ 7 7 { … … 15 15 } 16 16 }, 17 "autoload-dev": { 18 "psr-4": { 19 "Intercom\\Test\\": ["test"] 20 } 21 }, 17 22 "require": { 18 "guzzlehttp/guzzle": "~6.0", 19 "php": ">= 5.6" 23 "php": ">= 7.1", 24 "ext-json": "*", 25 "php-http/httplug": "^1.0 || ^2.0", 26 "php-http/client-implementation": "*", 27 "php-http/discovery": "^1.4", 28 "php-http/message": "^1.7", 29 "psr/http-message": "^1.0" 20 30 }, 21 31 "require-dev": { 22 "phpunit/phpunit": "4.0.*", 23 "squizlabs/php_codesniffer": "^3.1" 32 "phpunit/phpunit": "^7.0", 33 "squizlabs/php_codesniffer": "^3.1", 34 "php-http/guzzle6-adapter": "^2.0" 24 35 } 25 36 } -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomAdmins.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomAdmins … … 26 28 * @see https://developers.intercom.io/reference#list-admins 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function getAdmins($options = []) … … 40 42 * @param integer $id 41 43 * @param array $options 42 * @return mixed43 * @throws \GuzzleHttp\Exception\GuzzleException44 * @return stdClass 45 * @throws Exception 44 46 */ 45 47 public function getAdmin($id, $options = []) … … 49 51 } 50 52 53 /** 54 * Returns endpoint path to Admin with given ID. 55 * 56 * @param string $id 57 * @return string 58 */ 51 59 public function adminPath($id) 52 60 { -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomBulk.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomBulk … … 24 26 * Creates Users in bulk. 25 27 * 26 * @see https://developers.intercom.io/reference#bulk-user-operations27 28 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException29 * @return stdClass 30 * @throws Exception 30 31 */ 31 32 public function users($options) … … 37 38 * Creates Events in bulk. 38 39 * 39 * @see https://developers.intercom.io/reference#bulk-event-operations40 40 * @param array $options 41 * @return mixed42 * @throws \GuzzleHttp\Exception\GuzzleException41 * @return stdClass 42 * @throws Exception 43 43 */ 44 44 public function events($options) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomClient.php
r1864548 r2039426 3 3 namespace Intercom; 4 4 5 use GuzzleHttp\Client; 6 use GuzzleHttp\Psr7\Response; 5 use Http\Discovery\HttpClientDiscovery; 6 use Http\Discovery\MessageFactoryDiscovery; 7 use Http\Discovery\UriFactoryDiscovery; 8 use Http\Message\Authentication; 9 use Http\Message\Authentication\BasicAuth; 10 use Http\Message\Authentication\Bearer; 11 use Http\Message\RequestFactory; 12 use Http\Message\UriFactory; 13 use Psr\Http\Client\ClientExceptionInterface; 14 use Psr\Http\Client\ClientInterface; 15 use Psr\Http\Message\RequestInterface; 7 16 use Psr\Http\Message\ResponseInterface; 17 use Psr\Http\Message\UriInterface; 8 18 9 19 class IntercomClient 10 20 { 11 12 /** 13 * @var Client $http_client 14 */ 15 private $http_client; 21 /** 22 * @var ClientInterface $httpClient 23 */ 24 private $httpClient; 25 26 /** 27 * @var RequestFactory $requestFactory 28 */ 29 private $requestFactory; 30 31 /** 32 * @var UriFactory $uriFactory 33 */ 34 private $uriFactory; 16 35 17 36 /** 18 37 * @var string API user authentication 19 38 */ 20 pr otected $usernamePart;39 private $usernameOrToken; 21 40 22 41 /** 23 42 * @var string API password authentication 24 43 */ 25 pr otected $passwordPart;26 27 /** 28 * @var string Extra Guzzle Requests Options29 */ 30 pr otected $extraGuzzleRequestsOptions;44 private $password; 45 46 /** 47 * @var array $extraRequestHeaders 48 */ 49 private $extraRequestHeaders; 31 50 32 51 /** … … 61 80 62 81 /** 82 * @var IntercomVisitors $visitors 83 */ 84 public $visitors; 85 86 /** 63 87 * @var IntercomAdmins $admins 64 88 */ … … 91 115 92 116 /** 93 * @var int[]$rateLimitDetails117 * @var array $rateLimitDetails 94 118 */ 95 119 protected $rateLimitDetails = []; … … 98 122 * IntercomClient constructor. 99 123 * 100 * @param string $ usernamePartApp ID.101 * @param string $passwordPartApi Key.102 * /103 public function __construct($usernamePart, $passwordPart, $extraGuzzleRequestsOptions = [])104 {105 $this->setDefaultClient();124 * @param string $appIdOrToken App ID. 125 * @param string|null $password Api Key. 126 * @param array $extraRequestHeaders Extra request headers to be sent in every api request 127 */ 128 public function __construct($appIdOrToken, $password = null, $extraRequestHeaders = []) 129 { 106 130 $this->users = new IntercomUsers($this); 107 131 $this->events = new IntercomEvents($this); … … 118 142 $this->notes = new IntercomNotes($this); 119 143 120 $this->usernamePart = $usernamePart; 121 $this->passwordPart = $passwordPart; 122 $this->extraGuzzleRequestsOptions = $extraGuzzleRequestsOptions; 123 } 124 125 private function setDefaultClient() 126 { 127 $this->http_client = new Client(); 128 } 129 130 /** 131 * Sets GuzzleHttp client. 132 * 133 * @param Client $client 134 */ 135 public function setClient($client) 136 { 137 $this->http_client = $client; 144 $this->appIdOrToken = $appIdOrToken; 145 $this->passwordPart = $password; 146 $this->extraRequestHeaders = $extraRequestHeaders; 147 148 $this->httpClient = HttpClientDiscovery::find(); 149 $this->requestFactory = MessageFactoryDiscovery::find(); 150 $this->uriFactory = UriFactoryDiscovery::find(); 151 } 152 153 /** 154 * Sets the HTTP client. 155 * 156 * @param ClientInterface $httpClient 157 */ 158 public function setHttpClient(ClientInterface $httpClient) 159 { 160 $this->httpClient = $httpClient; 161 } 162 163 /** 164 * Sets the request factory. 165 * 166 * @param RequestFactory $requestFactory 167 */ 168 public function setRequestFactory(RequestFactory $requestFactory) 169 { 170 $this->requestFactory = $requestFactory; 171 } 172 173 /** 174 * Sets the URI factory. 175 * 176 * @param UriFactory $uriFactory 177 */ 178 public function setUriFactory(UriFactory $uriFactory) 179 { 180 $this->uriFactory = $uriFactory; 138 181 } 139 182 … … 142 185 * 143 186 * @param string $endpoint 144 * @param string $json 145 * @return mixed 146 * @throws \GuzzleHttp\Exception\GuzzleException 187 * @param array $json 188 * @return stdClass 147 189 */ 148 190 public function post($endpoint, $json) 149 191 { 150 $guzzleRequestOptions = $this->getGuzzleRequestOptions( 192 $response = $this->sendRequest('POST', "https://api.intercom.io/$endpoint", $json); 193 return $this->handleResponse($response); 194 } 195 196 /** 197 * Sends PUT request to Intercom API. 198 * 199 * @param string $endpoint 200 * @param array $json 201 * @return stdClass 202 */ 203 public function put($endpoint, $json) 204 { 205 $response = $this->sendRequest('PUT', "https://api.intercom.io/$endpoint", $json); 206 return $this->handleResponse($response); 207 } 208 209 /** 210 * Sends DELETE request to Intercom API. 211 * 212 * @param string $endpoint 213 * @param array $json 214 * @return stdClass 215 */ 216 public function delete($endpoint, $json) 217 { 218 $response = $this->sendRequest('DELETE', "https://api.intercom.io/$endpoint", $json); 219 return $this->handleResponse($response); 220 } 221 222 /** 223 * Sends GET request to Intercom API. 224 * 225 * @param string $endpoint 226 * @param array $queryParams 227 * @return stdClass 228 */ 229 public function get($endpoint, $queryParams = []) 230 { 231 $uri = $this->uriFactory->createUri("https://api.intercom.io/$endpoint"); 232 if (!empty($queryParams)) { 233 $uri = $uri->withQuery(http_build_query($queryParams)); 234 } 235 236 $response = $this->sendRequest('GET', $uri); 237 238 return $this->handleResponse($response); 239 } 240 241 /** 242 * Returns the next page of the result. 243 * 244 * @param stdClass $pages 245 * @return stdClass 246 */ 247 public function nextPage($pages) 248 { 249 $response = $this->sendRequest('GET', $pages->next); 250 return $this->handleResponse($response); 251 } 252 253 /** 254 * Gets the rate limit details. 255 * 256 * @return array 257 */ 258 public function getRateLimitDetails() 259 { 260 return $this->rateLimitDetails; 261 } 262 263 /** 264 * @return array 265 */ 266 private function getRequestHeaders() 267 { 268 return array_merge( 151 269 [ 152 'json' => $json, 153 'auth' => $this->getAuth(), 154 'headers' => [ 155 'Accept' => 'application/json' 270 'Accept' => 'application/json', 271 'Content-Type' => 'application/json' 156 272 ], 157 ]273 $this->extraRequestHeaders 158 274 ); 159 $response = $this->http_client->request('POST', "https://api.intercom.io/$endpoint", $guzzleRequestOptions); 160 return $this->handleResponse($response); 161 } 162 163 /** 164 * Sends PUT request to Intercom API. 165 * 166 * @param string $endpoint 167 * @param string $json 168 * @return mixed 169 * @throws \GuzzleHttp\Exception\GuzzleException 170 */ 171 public function put($endpoint, $json) 172 { 173 $guzzleRequestOptions = $this->getGuzzleRequestOptions( 174 [ 175 'json' => $json, 176 'auth' => $this->getAuth(), 177 'headers' => [ 178 'Accept' => 'application/json' 179 ], 180 ] 275 } 276 277 /** 278 * Returns authentication parameters 279 * 280 * @return Authentication 281 */ 282 private function getAuth() 283 { 284 if (!empty($this->appIdOrToken) && !empty($this->passwordPart)) { 285 return new BasicAuth($this->appIdOrToken, $this->passwordPart); 286 } elseif (!empty($this->appIdOrToken)) { 287 return new Bearer($this->appIdOrToken); 288 } 289 return null; 290 } 291 292 /** 293 * Authenticates a request object 294 * @param RequestInterface $request 295 * 296 * @return RequestInterface 297 */ 298 private function authenticateRequest(RequestInterface $request) 299 { 300 $auth = $this->getAuth(); 301 return $auth ? $auth->authenticate($request) : $request; 302 } 303 304 /** 305 * @param string $method 306 * @param string|UriInterface $uri 307 * @param array|string|null $body 308 * 309 * @return ResponseInterface 310 * @throws ClientExceptionInterface 311 */ 312 private function sendRequest($method, $uri, $body = null) 313 { 314 $headers = $this->getRequestHeaders(); 315 $body = is_array($body) ? json_encode($body) : $body; 316 $request = $this->authenticateRequest( 317 $this->requestFactory->createRequest($method, $uri, $headers, $body) 181 318 ); 182 319 183 $response = $this->http_client->request('PUT', "https://api.intercom.io/$endpoint", $guzzleRequestOptions); 184 return $this->handleResponse($response); 185 } 186 187 /** 188 * Sends DELETE request to Intercom API. 189 * 190 * @param string $endpoint 191 * @param string $json 192 * @return mixed 193 * @throws \GuzzleHttp\Exception\GuzzleException 194 */ 195 public function delete($endpoint, $json) 196 { 197 $guzzleRequestOptions = $this->getGuzzleRequestOptions( 198 [ 199 'json' => $json, 200 'auth' => $this->getAuth(), 201 'headers' => [ 202 'Accept' => 'application/json' 203 ], 204 ] 205 ); 206 207 $response = $this->http_client->request('DELETE', "https://api.intercom.io/$endpoint", $guzzleRequestOptions); 208 return $this->handleResponse($response); 209 } 210 211 /** 212 * @param string $endpoint 213 * @param array $query 214 * @return mixed 215 * @throws \GuzzleHttp\Exception\GuzzleException 216 */ 217 public function get($endpoint, $query) 218 { 219 $guzzleRequestOptions = $this->getGuzzleRequestOptions( 220 [ 221 'query' => $query, 222 'auth' => $this->getAuth(), 223 'headers' => [ 224 'Accept' => 'application/json' 225 ], 226 ] 227 ); 228 229 $response = $this->http_client->request('GET', "https://api.intercom.io/$endpoint", $guzzleRequestOptions); 230 return $this->handleResponse($response); 231 } 232 233 /** 234 * Returns next page of the result. 235 * 236 * @param \stdClass $pages 237 * @return mixed 238 * @throws \GuzzleHttp\Exception\GuzzleException 239 */ 240 public function nextPage($pages) 241 { 242 $guzzleRequestOptions = $this->getGuzzleRequestOptions( 243 [ 244 'auth' => $this->getAuth(), 245 'headers' => [ 246 'Accept' => 'application/json' 247 ], 248 ] 249 ); 250 251 $response = $this->http_client->request('GET', $pages->next, $guzzleRequestOptions); 252 return $this->handleResponse($response); 253 } 254 255 /** 256 * Returns Guzzle Requests Options Array 257 * 258 * @param array $defaultGuzzleRequestsOptions 259 * @return array 260 */ 261 public function getGuzzleRequestOptions($defaultGuzzleRequestOptions = []) 262 { 263 return array_replace_recursive($this->extraGuzzleRequestsOptions, $defaultGuzzleRequestOptions); 264 } 265 266 /** 267 * Returns authentication parameters. 268 * 269 * @return array 270 */ 271 public function getAuth() 272 { 273 return [$this->usernamePart, $this->passwordPart]; 274 } 275 276 /** 277 * @param Response $response 278 * @return mixed 279 */ 280 private function handleResponse(Response $response) 320 return $this->httpClient->sendRequest($request); 321 } 322 323 /** 324 * @param ResponseInterface $response 325 * 326 * @return stdClass 327 */ 328 private function handleResponse(ResponseInterface $response) 281 329 { 282 330 $this->setRateLimitDetails($response); 283 331 284 $stream = \GuzzleHttp\Psr7\stream_for($response->getBody()); 285 $data = json_decode($stream); 286 return $data; 287 } 288 289 /** 290 * @param Response $response 291 * @return void 292 */ 293 private function setRateLimitDetails(Response $response) 332 $stream = $response->getBody()->getContents(); 333 334 return json_decode($stream); 335 } 336 337 /** 338 * @param ResponseInterface $response 339 */ 340 private function setRateLimitDetails(ResponseInterface $response) 294 341 { 295 342 $this->rateLimitDetails = [ … … 305 352 ]; 306 353 } 307 308 /**309 * @return int[]310 */311 public function getRateLimitDetails()312 {313 return $this->rateLimitDetails;314 }315 354 } -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomCompanies.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomCompanies … … 26 28 * @see https://developers.intercom.io/reference#create-or-update-company 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function create($options) … … 39 41 * @see https://developers.intercom.io/reference#create-or-update-company 40 42 * @param array $options 41 * @return mixed42 * @throws \GuzzleHttp\Exception\GuzzleException43 * @return stdClass 44 * @throws Exception 43 45 */ 44 46 public function update($options) … … 52 54 * @see https://developers.intercom.io/reference#list-companies 53 55 * @param array $options 54 * @return mixed55 * @throws \GuzzleHttp\Exception\GuzzleException56 * @return stdClass 57 * @throws Exception 56 58 */ 57 59 public function getCompanies($options) … … 59 61 return $this->client->get("companies", $options); 60 62 } 63 64 /** 65 * Gets a single Company based on the Intercom ID. 66 * 67 * @see https://developers.intercom.com/reference#view-a-company 68 * @param string $id 69 * @param array $options 70 * @return stdClass 71 * @throws Exception 72 */ 73 public function getCompany($id, $options = []) 74 { 75 $path = $this->companyPath($id); 76 return $this->client->get($path, $options); 77 } 78 79 /** 80 * @param string $id 81 * @return string 82 */ 83 public function companyPath($id) 84 { 85 return 'companies/' . $id; 86 } 61 87 } -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomConversations.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomConversations … … 26 28 * @see https://developers.intercom.io/reference#list-conversations 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function getConversations($options) … … 39 41 * @see https://developers.intercom.io/reference#get-a-single-conversation 40 42 * @param string $id 41 * @return mixed 42 * @throws \GuzzleHttp\Exception\GuzzleException 43 * @param array $options 44 * @return stdClass 45 * @throws Exception 43 46 */ 44 47 public function getConversation($id, $options = []) … … 54 57 * @param string $id 55 58 * @param array $options 56 * @return mixed57 * @throws \GuzzleHttp\Exception\GuzzleException59 * @return stdClass 60 * @throws Exception 58 61 */ 59 62 public function replyToConversation($id, $options) … … 68 71 * @see https://developers.intercom.io/reference#replying-to-users-last-conversation 69 72 * @param array $options 70 * @return mixed71 * @throws \GuzzleHttp\Exception\GuzzleException73 * @return stdClass 74 * @throws Exception 72 75 */ 73 76 public function replyToLastConversation($options) … … 82 85 * @see https://developers.intercom.io/reference#marking-a-conversation-as-read 83 86 * @param string $id 84 * @return mixed85 * @throws \GuzzleHttp\Exception\GuzzleException87 * @return stdClass 88 * @throws Exception 86 89 */ 87 90 public function markConversationAsRead($id) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomCounts.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomCounts … … 26 28 * @see https://developers.intercom.io/reference#getting-counts 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function getCounts($options = []) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomEvents.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomEvents … … 26 28 * @see https://developers.intercom.io/reference#submitting-events 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function create($options) … … 39 41 * @see https://developers.intercom.io/reference#list-user-events 40 42 * @param array $options 41 * @return mixed42 * @throws \GuzzleHttp\Exception\GuzzleException43 * @return stdClass 44 * @throws Exception 43 45 */ 44 46 public function getEvents($options) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomLeads.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomLeads … … 26 28 * @see https://developers.intercom.io/reference#create-lead 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function create($options) … … 39 41 * @see https://developers.intercom.io/reference#create-lead 40 42 * @param array $options 41 * @return mixed42 * @throws \GuzzleHttp\Exception\GuzzleException43 * @return stdClass 44 * @throws Exception 43 45 */ 44 46 public function update($options) … … 52 54 * @see https://developers.intercom.io/reference#list-leads 53 55 * @param array $options 54 * @return mixed55 * @throws \GuzzleHttp\Exception\GuzzleException56 * @return stdClass 57 * @throws Exception 56 58 */ 57 59 public function getLeads($options) … … 66 68 * @param string $id 67 69 * @param array $options 68 * @return mixed69 * @throws \GuzzleHttp\Exception\GuzzleException70 * @return stdClass 71 * @throws Exception 70 72 */ 71 73 public function getLead($id, $options = []) … … 81 83 * @param string $id 82 84 * @param array $options 83 * @return mixed84 * @throws \GuzzleHttp\Exception\GuzzleException85 * @return stdClass 86 * @throws Exception 85 87 */ 86 88 public function deleteLead($id, $options = []) … … 95 97 * @see https://developers.intercom.io/reference#convert-a-lead 96 98 * @param $options 97 * @return mixed98 * @throws \GuzzleHttp\Exception\GuzzleException99 * @return stdClass 100 * @throws Exception 99 101 */ 100 102 public function convertLead($options) … … 119 121 * @see https://developers.intercom.com/v2.0/reference#iterating-over-all-leads 120 122 * @param array $options 121 * @return mixed122 * @throws \GuzzleHttp\Exception\GuzzleException123 * @return stdClass 124 * @throws Exception 123 125 */ 124 126 public function scrollLeads($options = []) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomMessages.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomMessages … … 26 28 * @see https://developers.intercom.io/reference#conversations 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function create($options) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomNotes.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomNotes … … 26 28 * @see https://developers.intercom.io/reference#create-a-note 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function create($options) … … 39 41 * @see https://developers.intercom.io/reference#list-notes-for-a-user 40 42 * @param array $options 41 * @return mixed42 * @throws \GuzzleHttp\Exception\GuzzleException43 * @return stdClass 44 * @throws Exception 43 45 */ 44 46 public function getNotes($options) … … 52 54 * @see https://developers.intercom.io/reference#view-a-note 53 55 * @param string $id 54 * @return mixed55 * @throws \GuzzleHttp\Exception\GuzzleException56 * @return stdClass 57 * @throws Exception 56 58 */ 57 59 public function getNote($id) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomSegments.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomSegments … … 27 29 * @param string $id 28 30 * @param array $options 29 * @return mixed30 * @throws \GuzzleHttp\Exception\GuzzleException31 * @return stdClass 32 * @throws Exception 31 33 */ 32 34 public function getSegment($id, array $options = []) … … 40 42 * @see https://developers.intercom.com/reference#list-segments 41 43 * @param array $options 42 * @return mixed43 * @throws \GuzzleHttp\Exception\GuzzleException44 * @return stdClass 45 * @throws Exception 44 46 */ 45 47 public function getSegments($options = []) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomTags.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomTags … … 26 28 * @see https://developers.intercom.io/reference#create-and-update-tags 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function tag($options) … … 39 41 * @see https://developers.intercom.io/reference#list-tags-for-an-app 40 42 * @param array $options 41 * @return mixed42 * @throws \GuzzleHttp\Exception\GuzzleException43 * @return stdClass 44 * @throws Exception 43 45 */ 44 46 public function getTags($options = []) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomUsers.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomUsers … … 26 28 * @see https://developers.intercom.io/reference#create-or-update-user 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function create($options) … … 39 41 * @see https://developers.intercom.io/reference#create-or-update-user 40 42 * @param array $options 41 * @return mixed42 * @throws \GuzzleHttp\Exception\GuzzleException43 * @return stdClass 44 * @throws Exception 43 45 */ 44 46 public function update($options) … … 52 54 * @see https://developers.intercom.io/reference#list-users 53 55 * @param array $options 54 * @return mixed55 * @throws \GuzzleHttp\Exception\GuzzleException56 * @return stdClass 57 * @throws Exception 56 58 */ 57 59 public function getUsers($options) … … 66 68 * @param string $id 67 69 * @param array $options 68 * @return mixed69 * @throws \GuzzleHttp\Exception\GuzzleException70 * @return stdClass 71 * @throws Exception 70 72 */ 71 73 public function getUser($id, $options = []) … … 80 82 * @see https://developers.intercom.com/reference#iterating-over-all-users 81 83 * @param array $options 82 * @return mixed83 * @throws \GuzzleHttp\Exception\GuzzleException84 * @return stdClass 85 * @throws Exception 84 86 */ 85 87 public function scrollUsers($options = []) … … 91 93 * Deletes a single User based on the Intercom ID. 92 94 * 93 * @see https://developers.intercom.com/reference# delete-a-user95 * @see https://developers.intercom.com/reference#archive-a-user 94 96 * @param string $id 95 97 * @param array $options 96 * @return mixed 97 * @throws \GuzzleHttp\Exception\GuzzleException 98 * @return stdClass 99 * @throws Exception 100 */ 101 public function archiveUser($id, $options = []) 102 { 103 $path = $this->userPath($id); 104 return $this->client->delete($path, $options); 105 } 106 107 /** 108 * Deletes a single User based on the Intercom ID. 109 * 110 * @see https://developers.intercom.com/reference#archive-a-user 111 * @param string $id 112 * @param array $options 113 * @return stdClass 114 * @throws Exception 98 115 */ 99 116 public function deleteUser($id, $options = []) 100 117 { 101 $path = $this->userPath($id); 102 return $this->client->delete($path, $options); 118 return $this->archiveUser($id, $options); 119 } 120 121 /** 122 * Permanently deletes a single User based on the Intercom ID. 123 * 124 * @see https://developers.intercom.com/reference#delete-users 125 * @param string $id 126 * @return stdClass 127 * @throws Exception 128 */ 129 public function permanentlyDeleteUser($id) 130 { 131 return $this->client->post('user_delete_requests', [ 132 'intercom_user_id' => $id 133 ]); 103 134 } 104 135 -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/src/IntercomVisitors.php
r1864548 r2039426 2 2 3 3 namespace Intercom; 4 5 use Http\Client\Exception; 4 6 5 7 class IntercomVisitors … … 26 28 * @see https://developers.intercom.com/reference#update-a-visitor 27 29 * @param array $options 28 * @return mixed29 * @throws \GuzzleHttp\Exception\GuzzleException30 * @return stdClass 31 * @throws Exception 30 32 */ 31 33 public function update($options) … … 41 43 * @param string $id 42 44 * @param array $options 43 * @return mixed44 * @throws \GuzzleHttp\Exception\GuzzleException45 * @return stdClass 46 * @throws Exception 45 47 */ 46 48 public function getVisitor($id, $options = []) … … 56 58 * @param string $id 57 59 * @param array $options 58 * @return mixed59 * @throws \GuzzleHttp\Exception\GuzzleException60 * @return stdClass 61 * @throws Exception 60 62 */ 61 63 public function deleteVisitor($id, $options = []) … … 70 72 * @see https://developers.intercom.io/reference#convert-a-lead 71 73 * @param $options 72 * @return mixed73 * @throws \GuzzleHttp\Exception\GuzzleException74 * @return stdClass 75 * @throws Exception 74 76 */ 75 77 public function convertVisitor($options) -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomAdminsTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomAdmins; 6 use PHPUnit\Framework\TestCase; 4 7 5 class IntercomAdminsTest extends PHPUnit_Framework_TestCase8 class IntercomAdminsTest extends TestCase 6 9 { 7 10 public function testAdminsList() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomBulkTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomBulk; 6 use PHPUnit\Framework\TestCase; 4 7 5 class IntercomBulkTest extends PHPUnit_Framework_TestCase8 class IntercomBulkTest extends TestCase 6 9 { 7 10 public function testBulkUsers() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomClientTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 5 use DateTimeImmutable; 6 use Http\Adapter\Guzzle6\Client; 3 7 use Intercom\IntercomClient; 4 use GuzzleHttp\Client ;8 use GuzzleHttp\Client as GuzzleClient; 5 9 use GuzzleHttp\Handler\MockHandler; 6 10 use GuzzleHttp\Psr7\Response; 7 11 use GuzzleHttp\HandlerStack; 8 12 use GuzzleHttp\Middleware; 13 use PHPUnit\Framework\TestCase; 14 use stdClass; 9 15 10 class IntercomClientTest extends PHPUnit_Framework_TestCase16 class IntercomClientTest extends TestCase 11 17 { 12 18 public function testBasicClient() 13 19 { 14 $mock = new MockHandler( 15 [ 20 $mock = new MockHandler([ 16 21 new Response(200, ['X-Foo' => 'Bar'], "{\"foo\":\"bar\"}") 17 ] 18 ); 22 ]); 19 23 20 24 $container = []; … … 23 27 $stack->push($history); 24 28 25 $http _client = new Client(['handler' => $stack]);29 $httpClient = new Client(new GuzzleClient(['handler' => $stack])); 26 30 27 31 $client = new IntercomClient('u', 'p'); 28 $client->set Client($http_client);32 $client->setHttpClient($httpClient); 29 33 30 $client->users->create( 31 [ 34 $client->users->create([ 32 35 'email' => 'test@intercom.io' 33 ] 34 ); 36 ]); 35 37 36 38 foreach ($container as $transaction) { … … 42 44 public function testExtendedClient() 43 45 { 44 $mock = new MockHandler( 45 [ 46 $mock = new MockHandler([ 46 47 new Response(200, ['X-Foo' => 'Bar'], "{\"foo\":\"bar\"}") 47 ] 48 ); 48 ]); 49 49 50 50 $container = []; … … 53 53 $stack->push($history); 54 54 55 $http _client = new Client(['handler' => $stack]);55 $httpClient = new Client(new GuzzleClient(['handler' => $stack, 'connect_timeout' => 10])); 56 56 57 $client = new IntercomClient('u', 'p' , ['connect_timeout' => 10]);58 $client->set Client($http_client);57 $client = new IntercomClient('u', 'p'); 58 $client->setHttpClient($httpClient); 59 59 60 $client->users->create( 61 [ 60 $client->users->create([ 62 61 'email' => 'test@intercom.io' 63 ] 64 ); 62 ]); 65 63 66 64 foreach ($container as $transaction) { 67 $ basic = $client->getGuzzleRequestOptions()['connect_timeout'];68 $this->assert True($basic ==10);65 $options = $transaction['options']; 66 $this->assertEquals($options['connect_timeout'], 10); 69 67 } 70 68 } 71 69 72 73 public function testPaginationHelper() 70 public function testClientWithExtraHeaders() 74 71 { 75 $mock = new MockHandler( 76 [ 72 $mock = new MockHandler([ 77 73 new Response(200, ['X-Foo' => 'Bar'], "{\"foo\":\"bar\"}") 78 ] 79 ); 74 ]); 80 75 81 76 $container = []; … … 84 79 $stack->push($history); 85 80 86 $http_client = new Client(['handler' => $stack]); 81 $httpClient = new Client(new GuzzleClient(['handler' => $stack])); 82 83 $client = new IntercomClient('u', 'p', ['Custom-Header' => 'value']); 84 $client->setHttpClient($httpClient); 85 86 $client->users->create([ 87 'email' => 'test@intercom.io' 88 ]); 89 90 foreach ($container as $transaction) { 91 $headers = $transaction['request']->getHeaders(); 92 $this->assertEquals($headers['Accept'][0], 'application/json'); 93 $this->assertEquals($headers['Content-Type'][0], 'application/json'); 94 $this->assertEquals($headers['Custom-Header'][0], 'value'); 95 } 96 } 97 98 public function testPaginationHelper() 99 { 100 $mock = new MockHandler([ 101 new Response(200, ['X-Foo' => 'Bar'], "{\"foo\":\"bar\"}") 102 ]); 103 104 $container = []; 105 $history = Middleware::history($container); 106 $stack = HandlerStack::create($mock); 107 $stack->push($history); 108 109 $httpClient = new Client(new GuzzleClient(['handler' => $stack])); 87 110 88 111 $client = new IntercomClient('u', 'p'); 89 $client->set Client($http_client);112 $client->setHttpClient($httpClient); 90 113 91 114 $pages = new stdClass; … … 104 127 date_default_timezone_set('UTC'); 105 128 $time = time() + 7; 106 $mock = new MockHandler( 107 [ 108 new Response(200, ['X-RateLimit-Limit' => '83', 'X-RateLimit-Remaining' => '2', 'X-RateLimit-Reset' => $time], "{\"foo\":\"bar\"}") 109 ] 110 ); 129 $mock = new MockHandler([ 130 new Response( 131 200, 132 [ 133 'X-RateLimit-Limit' => '83', 134 'X-RateLimit-Remaining' => '2', 135 'X-RateLimit-Reset' => $time 136 ], 137 "{\"foo\":\"bar\"}" 138 ) 139 ]); 111 140 112 141 $container = []; … … 115 144 $stack->push($history); 116 145 117 $http _client = new Client(['handler' => $stack]);146 $httpClient = new Client(new GuzzleClient(['handler' => $stack])); 118 147 119 148 $client = new IntercomClient('u', 'p'); 120 $client->set Client($http_client);149 $client->setHttpClient($httpClient); 121 150 122 $client->users->create( 123 [ 151 $client->users->create([ 124 152 'email' => 'test@intercom.io' 125 ] 126 ); 153 ]); 127 154 128 155 $rateLimitDetails = $client->getRateLimitDetails(); -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomCompaniesTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomCompanies; 4 use Intercom\IntercomClient; 5 use GuzzleHttp\Client; 6 use GuzzleHttp\Handler\MockHandler; 7 use GuzzleHttp\Psr7\Response; 8 use GuzzleHttp\HandlerStack; 9 use GuzzleHttp\Middleware; 6 use PHPUnit\Framework\TestCase; 10 7 11 class IntercomCompaniesTest extends PHPUnit_Framework_TestCase8 class IntercomCompaniesTest extends TestCase 12 9 { 13 10 public function testCompanyCreate() … … 37 34 $this->assertEquals('foo', $companies->getCompanies([])); 38 35 } 36 37 public function testCompanyPath() 38 { 39 $stub = $this->getMockBuilder('Intercom\IntercomClient')->disableOriginalConstructor()->getMock(); 40 $users = new IntercomCompanies($stub); 41 $this->assertEquals('companies/foo', $users->companyPath("foo")); 42 } 43 44 public function testCompanyGetById() 45 { 46 $stub = $this->getMockBuilder('Intercom\IntercomClient')->disableOriginalConstructor()->getMock(); 47 $stub->method('get')->willReturn('foo'); 48 49 $users = new IntercomCompanies($stub); 50 $this->assertEquals('foo', $users->getCompany("foo")); 51 } 39 52 } -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomConversationsTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomConversations; 4 use Intercom\IntercomClient; 5 use GuzzleHttp\Client; 6 use GuzzleHttp\Handler\MockHandler; 7 use GuzzleHttp\Psr7\Response; 8 use GuzzleHttp\HandlerStack; 9 use GuzzleHttp\Middleware; 6 use PHPUnit\Framework\TestCase; 10 7 11 class IntercomConversationsTest extends PHPUnit_Framework_TestCase8 class IntercomConversationsTest extends TestCase 12 9 { 13 10 public function testConversationsList() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomCountsTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomCounts; 6 use PHPUnit\Framework\TestCase; 4 7 5 class IntercomCountsTest extends PHPUnit_Framework_TestCase8 class IntercomCountsTest extends TestCase 6 9 { 7 10 public function testCountsList() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomEventsTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomEvents; 4 use Intercom\IntercomClient; 5 use GuzzleHttp\Client; 6 use GuzzleHttp\Handler\MockHandler; 7 use GuzzleHttp\Psr7\Response; 8 use GuzzleHttp\HandlerStack; 9 use GuzzleHttp\Middleware; 6 use PHPUnit\Framework\TestCase; 10 7 11 class IntercomEventsTest extends PHPUnit_Framework_TestCase8 class IntercomEventsTest extends TestCase 12 9 { 13 10 public function testEventCreate() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomLeadsTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomLeads; 6 use PHPUnit\Framework\TestCase; 4 7 5 class IntercomLeadsTest extends PHPUnit_Framework_TestCase8 class IntercomLeadsTest extends TestCase 6 9 { 7 10 public function testLeadCreate() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomMessagesTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomMessages; 4 use Intercom\IntercomClient; 5 use GuzzleHttp\Client; 6 use GuzzleHttp\Handler\MockHandler; 7 use GuzzleHttp\Psr7\Response; 8 use GuzzleHttp\HandlerStack; 9 use GuzzleHttp\Middleware; 6 use PHPUnit\Framework\TestCase; 10 7 11 class IntercomMessagesTest extends PHPUnit_Framework_TestCase8 class IntercomMessagesTest extends TestCase 12 9 { 13 10 public function testMessageCreate() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomNotesTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomNotes; 6 use PHPUnit\Framework\TestCase; 4 7 5 class IntercomNotesTest extends PHPUnit_Framework_TestCase8 class IntercomNotesTest extends TestCase 6 9 { 7 10 public function testNoteCreate() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomSegmentsTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomSegments; 6 use PHPUnit\Framework\TestCase; 4 7 5 class IntercomSegmentTest extends PHPUnit_Framework_TestCase8 class IntercomSegmentTest extends TestCase 6 9 { 7 10 -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomTagsTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomTags; 6 use PHPUnit\Framework\TestCase; 4 7 5 class IntercomTagsTest extends PHPUnit_Framework_TestCase8 class IntercomTagsTest extends TestCase 6 9 { 7 10 public function testTagUsers() -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomUsersTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomUsers; 4 use Intercom\IntercomClient; 5 use GuzzleHttp\Client; 6 use GuzzleHttp\Handler\MockHandler; 7 use GuzzleHttp\Psr7\Response; 8 use GuzzleHttp\HandlerStack; 9 use GuzzleHttp\Middleware; 6 use PHPUnit\Framework\TestCase; 10 7 11 class IntercomUsersTest extends PHPUnit_Framework_TestCase8 class IntercomUsersTest extends TestCase 12 9 { 13 10 public function testUserCreate() … … 37 34 $this->assertEquals('foo', $users->getUsers([])); 38 35 } 36 37 public function testArchiveUser() 38 { 39 $stub = $this->getMockBuilder('Intercom\IntercomClient')->disableOriginalConstructor()->getMock(); 40 $stub->method('delete')->willReturn('foo'); 41 42 $users = new IntercomUsers($stub); 43 $this->assertEquals('foo', $users->archiveUser('')); 44 } 45 46 public function testDeleteUser() 47 { 48 $stub = $this->getMockBuilder('Intercom\IntercomClient')->disableOriginalConstructor()->getMock(); 49 $stub->method('delete')->willReturn('foo'); 50 51 $users = new IntercomUsers($stub); 52 $this->assertEquals('foo', $users->deleteUser('')); 53 } 54 55 public function testPermanentlyDeleteUser() 56 { 57 $stub = $this->getMockBuilder('Intercom\IntercomClient')->disableOriginalConstructor()->getMock(); 58 $stub->method('post')->willReturn('foo'); 59 60 $users = new IntercomUsers($stub); 61 $this->assertEquals('foo', $users->permanentlyDeleteUser('')); 62 } 39 63 } -
mplus-intercom-subscription/trunk/vendor/intercom/intercom-php/test/IntercomVisitorsTest.php
r1864548 r2039426 1 1 <?php 2 2 3 namespace Intercom\Test; 4 3 5 use Intercom\IntercomVisitors; 6 use PHPUnit\Framework\TestCase; 4 7 5 class IntercomVisitorsTest extends PHPUnit_Framework_TestCase8 class IntercomVisitorsTest extends TestCase 6 9 { 7 10
Note: See TracChangeset
for help on using the changeset viewer.