Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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'];
 }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #6
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function raw()
 {
     Version::warn(__METHOD__ . ' is deprecated. Use toArray()');
     return $this->toArray();
 }
Beispiel #7
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function enableMagicMethods($isEnabled)
 {
     Version::warn(__METHOD__ . ' is deprecated');
 }
Beispiel #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');
 }
Beispiel #9
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function getCurlString()
 {
     Version::warn(__METHOD__ . ' is deprecated. Use getCurlValue()');
     return $this->getCurlValue();
 }
Beispiel #10
0
 public function __construct(\Zend_Log $logObject)
 {
     $this->log = $logObject;
     Version::warn(__CLASS__ . ' is deprecated');
 }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #13
0
 /**
  * @deprecated
  * @codeCoverageIgnore
  */
 public function getRequest()
 {
     Version::warn(__METHOD__ . ' is deprecated');
     return null;
 }