Exemplo n.º 1
0
 /**
  * @param string $username HTTP basic auth username
  * @param string $password Password
  * @param int    $scheme   Curl auth scheme
  */
 public function __construct($username, $password, $scheme = CURLAUTH_BASIC)
 {
     Version::warn(__CLASS__ . " is deprecated. Use \$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');");
     $this->username = $username;
     $this->password = $password;
     $this->scheme = $scheme;
 }
Exemplo n.º 2
0
 public function parseUrl($url)
 {
     Version::warn(__CLASS__ . ' is deprecated. Just use parse_url()');
     static $defaults = array('scheme' => null, 'host' => null, 'path' => null, 'port' => null, 'query' => null, 'user' => null, 'pass' => null, 'fragment' => null);
     $parts = parse_url($url);
     // Need to handle query parsing specially for UTF-8 requirements
     if ($this->utf8 && isset($parts['query'])) {
         $queryPos = strpos($url, '?');
         if (isset($parts['fragment'])) {
             $parts['query'] = substr($url, $queryPos + 1, strpos($url, '#') - $queryPos - 1);
         } else {
             $parts['query'] = substr($url, $queryPos + 1);
         }
     }
     return $parts + $defaults;
 }
Exemplo n.º 3
0
 /**
  * Create a Guzzle cache adapter based on an array of options
  *
  * @param array $config Array of configuration options
  *
  * @return CacheAdapterInterface
  * @throws InvalidArgumentException
  * @deprecated This will be removed in a future version
  * @codeCoverageIgnore
  */
 public static function factory($config = array())
 {
     Version::warn(__METHOD__ . ' is deprecated');
     if (!is_array($config)) {
         throw new InvalidArgumentException('$config must be an array');
     }
     if (!isset($config['cache.adapter']) && !isset($config['cache.provider'])) {
         $config['cache.adapter'] = 'Akeeba\\ARS\\Amazon\\Guzzle\\Cache\\NullCacheAdapter';
         $config['cache.provider'] = null;
     } else {
         // Validate that the options are valid
         foreach (array('cache.adapter', 'cache.provider') as $required) {
             if (!isset($config[$required])) {
                 throw new InvalidArgumentException("{$required} is a required CacheAdapterFactory option");
             }
             if (is_string($config[$required])) {
                 // Convert dot notation to namespaces
                 $config[$required] = str_replace('.', '\\', $config[$required]);
                 if (!class_exists($config[$required])) {
                     throw new InvalidArgumentException("{$config[$required]} is not a valid class for {$required}");
                 }
             }
         }
         // Instantiate the cache provider
         if (is_string($config['cache.provider'])) {
             $args = isset($config['cache.provider.args']) ? $config['cache.provider.args'] : null;
             $config['cache.provider'] = self::createObject($config['cache.provider'], $args);
         }
     }
     // Instantiate the cache adapter using the provider and options
     if (is_string($config['cache.adapter'])) {
         $args = isset($config['cache.adapter.args']) ? $config['cache.adapter.args'] : array();
         array_unshift($args, $config['cache.provider']);
         $config['cache.adapter'] = self::createObject($config['cache.adapter'], $args);
     }
     return $config['cache.adapter'];
 }
Exemplo n.º 4
0
 /**
  * @deprecated Use the history plugin
  * @codeCoverageIgnore
  */
 public function isRedirect()
 {
     Version::warn(__METHOD__ . ' is deprecated. Use the HistoryPlugin to track this.');
     return $this->isRedirect;
 }
Exemplo n.º 5
0
 /**
  * @deprecated
  */
 public function setDefaultHeaders($headers)
 {
     Version::warn(__METHOD__ . ' is deprecated. Use the request.options array to specify default request options');
     if ($headers instanceof Collection) {
         $this->defaultHeaders = $headers;
     } elseif (is_array($headers)) {
         $this->defaultHeaders = new Collection($headers);
     } else {
         throw new InvalidArgumentException('Headers must be an array or Collection');
     }
     return $this;
 }
Exemplo n.º 6
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function raw()
 {
     Version::warn(__METHOD__ . ' is deprecated. Use toArray()');
     return $this->toArray();
 }
Exemplo n.º 7
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function enableMagicMethods($isEnabled)
 {
     Version::warn(__METHOD__ . ' is deprecated');
 }
Exemplo n.º 8
0
 /**
  * @param ResourceIteratorInterface $iterator Resource iterator to apply a callback to
  * @param array|callable            $callback Callback method accepting the resource iterator
  *                                            and an array of the iterator's current resources
  */
 public function __construct(ResourceIteratorInterface $iterator, $callback)
 {
     $this->iterator = $iterator;
     $this->callback = $callback;
     Version::warn(__CLASS__ . ' is deprecated');
 }
Exemplo n.º 9
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function getCurlString()
 {
     Version::warn(__METHOD__ . ' is deprecated. Use getCurlValue()');
     return $this->getCurlValue();
 }
Exemplo n.º 10
0
 public function __construct(\Zend_Log $logObject)
 {
     $this->log = $logObject;
     Version::warn(__CLASS__ . ' is deprecated');
 }
Exemplo n.º 11
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function removeCacheControlDirective($directive)
 {
     Version::warn(__METHOD__ . ' is deprecated. Use $message->getHeader(\'Cache-Control\')->removeDirective()');
     if ($header = $this->getHeader('Cache-Control')) {
         $header->removeDirective($directive);
     }
     return $this;
 }
Exemplo n.º 12
0
 /**
  * @param \Zend_Cache_Backend $cache Cache object to wrap
  */
 public function __construct(\Zend_Cache_Backend $cache)
 {
     Version::warn(__CLASS__ . ' is deprecated. Upgrade to ZF2 or use PsrCacheAdapter');
     $this->cache = $cache;
 }
Exemplo n.º 13
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function getRequest()
 {
     Version::warn(__METHOD__ . ' is deprecated');
     return null;
 }