���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/trader/vendor/zaloplatform/zalo-php-sdk/src/HttpClients/ |
<?php /** * Zalo © 2019 * */ namespace Zalo\HttpClients; use Zalo\HttpClients\ZaloCurlHttpClient; /** * Class HttpClientsFactory * * @package Zalo */ class HttpClientsFactory { private function __construct() { // a factory constructor should never be invoked } /** * HTTP client generation. * * @param ZaloHttpClientInterface|Client|string|null $handler * * @throws Exception * @throws InvalidArgumentException If the http client handler isn't "curl", "stream", or an instance of Zalo\HttpClients\ZaloHttpClientInterface. * * @return ZaloHttpClientInterface */ public static function createHttpClient($handler) { if (!$handler) { return self::detectDefaultClient(); } if ($handler instanceof ZaloHttpClientInterface) { return $handler; } if ('curl' === $handler) { if (!extension_loaded('curl')) { throw new Exception('The cURL extension must be loaded in order to use the "curl" handler.'); } return new ZaloCurlHttpClient(); } throw new InvalidArgumentException('The http client handler must be set to "curl" be an instance of Zalo\HttpClients\ZaloHttpClientInterface'); } /** * Detect default HTTP client. * * @return ZaloHttpClientInterface */ private static function detectDefaultClient() { return new ZaloCurlHttpClient(); } }