' + . $label + . $output + . ''; + } + + if ($echo) { + echo($output); + } + return $output; + } + +} diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Exception.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Exception.php new file mode 100644 index 0000000..92b2e46 --- /dev/null +++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Exception.php @@ -0,0 +1,96 @@ +_previous = $previous; + } else { + parent::__construct($msg, (int) $code, $previous); + } + } + + /** + * Overloading + * + * For PHP < 5.3.0, provides access to the getPrevious() method. + * + * @param string $method + * @param array $args + * @return mixed + */ + public function __call($method, array $args) + { + if ('getprevious' == strtolower($method)) { + return $this->_getPrevious(); + } + return null; + } + + /** + * String representation of the exception + * + * @return string + */ + public function __toString() + { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + if (null !== ($e = $this->getPrevious())) { + return $e->__toString() + . "\n\nNext " + . parent::__toString(); + } + } + return parent::__toString(); + } + + /** + * Returns previous Exception + * + * @return Exception|null + */ + protected function _getPrevious() + { + return $this->_previous; + } +} diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client.php new file mode 100644 index 0000000..8f3c13f --- /dev/null +++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client.php @@ -0,0 +1,1564 @@ + 5, + 'strictredirects' => false, + 'useragent' => 'Zend_Http_Client', + 'timeout' => 10, + 'adapter' => 'Zend_Http_Client_Adapter_Socket', + 'httpversion' => self::HTTP_1, + 'keepalive' => false, + 'storeresponse' => true, + 'strict' => true, + 'output_stream' => false, + 'encodecookies' => true, + 'rfc3986_strict' => false + ); + + /** + * The adapter used to perform the actual connection to the server + * + * @var Zend_Http_Client_Adapter_Interface + */ + protected $adapter = null; + + /** + * Request URI + * + * @var Zend_Uri_Http + */ + protected $uri = null; + + /** + * Associative array of request headers + * + * @var array + */ + protected $headers = array(); + + /** + * HTTP request method + * + * @var string + */ + protected $method = self::GET; + + /** + * Associative array of GET parameters + * + * @var array + */ + protected $paramsGet = array(); + + /** + * Associative array of POST parameters + * + * @var array + */ + protected $paramsPost = array(); + + /** + * Request body content type (for POST requests) + * + * @var string + */ + protected $enctype = null; + + /** + * The raw post data to send. Could be set by setRawData($data, $enctype). + * + * @var string + */ + protected $raw_post_data = null; + + /** + * HTTP Authentication settings + * + * Expected to be an associative array with this structure: + * $this->auth = array('user' => 'username', 'password' => 'password', 'type' => 'basic') + * Where 'type' should be one of the supported authentication types (see the AUTH_* + * constants), for example 'basic' or 'digest'. + * + * If null, no authentication will be used. + * + * @var array|null + */ + protected $auth; + + /** + * File upload arrays (used in POST requests) + * + * An associative array, where each element is of the format: + * 'name' => array('filename.txt', 'text/plain', 'This is the actual file contents') + * + * @var array + */ + protected $files = array(); + + /** + * Ordered list of keys from key/value pair data to include in body + * + * An associative array, where each element is of the format: + * '
+ * $this->setAuth('shahar', 'secret', Zend_Http_Client::AUTH_BASIC);
+ *
+ *
+ * To disable authentication:
+ *
+ * $this->setAuth(false);
+ *
+ *
+ * @see http://www.faqs.org/rfcs/rfc2617.html
+ * @param string|false $user User name or false disable authentication
+ * @param string $password Password
+ * @param string $type Authentication type
+ * @return Zend_Http_Client
+ * @throws Zend_Http_Client_Exception
+ */
+ public function setAuth($user, $password = '', $type = self::AUTH_BASIC)
+ {
+ // If we got false or null, disable authentication
+ if ($user === false || $user === null) {
+ $this->auth = null;
+
+ // Clear the auth information in the uri instance as well
+ if ($this->uri instanceof Zend_Uri_Http) {
+ $this->getUri()->setUsername('');
+ $this->getUri()->setPassword('');
+ }
+ // Else, set up authentication
+ } else {
+ // Check we got a proper authentication type
+ if (! defined('self::AUTH_' . strtoupper($type))) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("Invalid or not supported authentication type: '$type'");
+ }
+
+ $this->auth = array(
+ 'user' => (string) $user,
+ 'password' => (string) $password,
+ 'type' => $type
+ );
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set the HTTP client's cookie jar.
+ *
+ * A cookie jar is an object that holds and maintains cookies across HTTP requests
+ * and responses.
+ *
+ * @param Zend_Http_CookieJar|boolean $cookiejar Existing cookiejar object, true to create a new one, false to disable
+ * @return Zend_Http_Client
+ * @throws Zend_Http_Client_Exception
+ */
+ public function setCookieJar($cookiejar = true)
+ {
+ Zend_Loader::loadClass('Zend_Http_CookieJar');
+
+ if ($cookiejar instanceof Zend_Http_CookieJar) {
+ $this->cookiejar = $cookiejar;
+ } elseif ($cookiejar === true) {
+ $this->cookiejar = new Zend_Http_CookieJar();
+ } elseif (! $cookiejar) {
+ $this->cookiejar = null;
+ } else {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception('Invalid parameter type passed as CookieJar');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return the current cookie jar or null if none.
+ *
+ * @return Zend_Http_CookieJar|null
+ */
+ public function getCookieJar()
+ {
+ return $this->cookiejar;
+ }
+
+ /**
+ * Add a cookie to the request. If the client has no Cookie Jar, the cookies
+ * will be added directly to the headers array as "Cookie" headers.
+ *
+ * @param Zend_Http_Cookie|string $cookie
+ * @param string|null $value If "cookie" is a string, this is the cookie value.
+ * @return Zend_Http_Client
+ * @throws Zend_Http_Client_Exception
+ */
+ public function setCookie($cookie, $value = null)
+ {
+ Zend_Loader::loadClass('Zend_Http_Cookie');
+
+ if (is_array($cookie)) {
+ foreach ($cookie as $c => $v) {
+ if (is_string($c)) {
+ $this->setCookie($c, $v);
+ } else {
+ $this->setCookie($v);
+ }
+ }
+
+ return $this;
+ }
+
+ if ($value !== null && $this->config['encodecookies']) {
+ $value = urlencode($value);
+ }
+
+ if (isset($this->cookiejar)) {
+ if ($cookie instanceof Zend_Http_Cookie) {
+ $this->cookiejar->addCookie($cookie);
+ } elseif (is_string($cookie) && $value !== null) {
+ $cookie = Zend_Http_Cookie::fromString("{$cookie}={$value}",
+ $this->uri,
+ $this->config['encodecookies']);
+ $this->cookiejar->addCookie($cookie);
+ }
+ } else {
+ if ($cookie instanceof Zend_Http_Cookie) {
+ $name = $cookie->getName();
+ $value = $cookie->getValue();
+ $cookie = $name;
+ }
+
+ if (preg_match("/[=,; \t\r\n\013\014]/", $cookie)) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("Cookie name cannot contain these characters: =,; \t\r\n\013\014 ({$cookie})");
+ }
+
+ $value = addslashes($value);
+
+ if (! isset($this->headers['cookie'])) {
+ $this->headers['cookie'] = array('Cookie', '');
+ }
+ $this->headers['cookie'][1] .= $cookie . '=' . $value . '; ';
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set a file to upload (using a POST request)
+ *
+ * Can be used in two ways:
+ *
+ * 1. $data is null (default): $filename is treated as the name if a local file which
+ * will be read and sent. Will try to guess the content type using mime_content_type().
+ * 2. $data is set - $filename is sent as the file name, but $data is sent as the file
+ * contents and no file is read from the file system. In this case, you need to
+ * manually set the Content-Type ($ctype) or it will default to
+ * application/octet-stream.
+ *
+ * @param string $filename Name of file to upload, or name to save as
+ * @param string $formname Name of form element to send as
+ * @param string $data Data to send (if null, $filename is read and sent)
+ * @param string $ctype Content type to use (if $data is set and $ctype is
+ * null, will be application/octet-stream)
+ * @return Zend_Http_Client
+ * @throws Zend_Http_Client_Exception
+ */
+ public function setFileUpload($filename, $formname, $data = null, $ctype = null)
+ {
+ if ($data === null) {
+ if (($data = @file_get_contents($filename)) === false) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("Unable to read file '{$filename}' for upload");
+ }
+
+ if (! $ctype) {
+ $ctype = $this->_detectFileMimeType($filename);
+ }
+ }
+
+ // Force enctype to multipart/form-data
+ $this->setEncType(self::ENC_FORMDATA);
+
+ $this->files[] = array(
+ 'formname' => $formname,
+ 'filename' => basename($filename),
+ 'ctype' => $ctype,
+ 'data' => $data
+ );
+
+ $this->body_field_order[$formname] = self::VTYPE_FILE;
+
+ return $this;
+ }
+
+ /**
+ * Set the encoding type for POST data
+ *
+ * @param string $enctype
+ * @return Zend_Http_Client
+ */
+ public function setEncType($enctype = self::ENC_URLENCODED)
+ {
+ $this->enctype = $enctype;
+
+ return $this;
+ }
+
+ /**
+ * Set the raw (already encoded) POST data.
+ *
+ * This function is here for two reasons:
+ * 1. For advanced user who would like to set their own data, already encoded
+ * 2. For backwards compatibilty: If someone uses the old post($data) method.
+ * this method will be used to set the encoded data.
+ *
+ * $data can also be stream (such as file) from which the data will be read.
+ *
+ * @param string|resource $data
+ * @param string $enctype
+ * @return Zend_Http_Client
+ */
+ public function setRawData($data, $enctype = null)
+ {
+ $this->raw_post_data = $data;
+ $this->setEncType($enctype);
+ if (is_resource($data)) {
+ // We've got stream data
+ $stat = @fstat($data);
+ if($stat) {
+ $this->setHeaders(self::CONTENT_LENGTH, $stat['size']);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set the unmask feature for GET parameters as array
+ *
+ * Example:
+ * foo%5B0%5D=a&foo%5B1%5D=b
+ * becomes
+ * foo=a&foo=b
+ *
+ * This is usefull for some services
+ *
+ * @param boolean $status
+ * @return Zend_Http_Client
+ */
+ public function setUnmaskStatus($status = true)
+ {
+ $this->_unmaskStatus = (BOOL)$status;
+ return $this;
+ }
+
+ /**
+ * Returns the currently configured unmask status
+ *
+ * @return boolean
+ */
+ public function getUnmaskStatus()
+ {
+ return $this->_unmaskStatus;
+ }
+
+ /**
+ * Clear all GET and POST parameters
+ *
+ * Should be used to reset the request parameters if the client is
+ * used for several concurrent requests.
+ *
+ * clearAll parameter controls if we clean just parameters or also
+ * headers and last_*
+ *
+ * @param bool $clearAll Should all data be cleared?
+ * @return Zend_Http_Client
+ */
+ public function resetParameters($clearAll = false)
+ {
+ // Reset parameter data
+ $this->paramsGet = array();
+ $this->paramsPost = array();
+ $this->files = array();
+ $this->raw_post_data = null;
+ $this->enctype = null;
+
+ if($clearAll) {
+ $this->headers = array();
+ $this->last_request = null;
+ $this->last_response = null;
+ } else {
+ // Clear outdated headers
+ if (isset($this->headers[strtolower(self::CONTENT_TYPE)])) {
+ unset($this->headers[strtolower(self::CONTENT_TYPE)]);
+ }
+ if (isset($this->headers[strtolower(self::CONTENT_LENGTH)])) {
+ unset($this->headers[strtolower(self::CONTENT_LENGTH)]);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get the last HTTP request as string
+ *
+ * @return string
+ */
+ public function getLastRequest()
+ {
+ return $this->last_request;
+ }
+
+ /**
+ * Get the last HTTP response received by this client
+ *
+ * If $config['storeresponse'] is set to false, or no response was
+ * stored yet, will return null
+ *
+ * @return Zend_Http_Response or null if none
+ */
+ public function getLastResponse()
+ {
+ return $this->last_response;
+ }
+
+ /**
+ * Load the connection adapter
+ *
+ * While this method is not called more than one for a client, it is
+ * seperated from ->request() to preserve logic and readability
+ *
+ * @param Zend_Http_Client_Adapter_Interface|string $adapter
+ * @return null
+ * @throws Zend_Http_Client_Exception
+ */
+ public function setAdapter($adapter)
+ {
+ if (is_string($adapter)) {
+ try {
+ Zend_Loader::loadClass($adapter);
+ } catch (Zend_Exception $e) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("Unable to load adapter '$adapter': {$e->getMessage()}", 0, $e);
+ }
+
+ $adapter = new $adapter;
+ }
+
+ if (! $adapter instanceof Zend_Http_Client_Adapter_Interface) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception('Passed adapter is not a HTTP connection adapter');
+ }
+
+ $this->adapter = $adapter;
+ $config = $this->config;
+ unset($config['adapter']);
+ $this->adapter->setConfig($config);
+ }
+
+ /**
+ * Load the connection adapter
+ *
+ * @return Zend_Http_Client_Adapter_Interface $adapter
+ */
+ public function getAdapter()
+ {
+ if (null === $this->adapter) {
+ $this->setAdapter($this->config['adapter']);
+ }
+
+ return $this->adapter;
+ }
+
+ /**
+ * Set streaming for received data
+ *
+ * @param string|boolean $streamfile Stream file, true for temp file, false/null for no streaming
+ * @return Zend_Http_Client
+ */
+ public function setStream($streamfile = true)
+ {
+ $this->setConfig(array("output_stream" => $streamfile));
+ return $this;
+ }
+
+ /**
+ * Get status of streaming for received data
+ * @return boolean|string
+ */
+ public function getStream()
+ {
+ return $this->config["output_stream"];
+ }
+
+ /**
+ * Create temporary stream
+ *
+ * @return resource
+ */
+ protected function _openTempStream()
+ {
+ $this->_stream_name = $this->config['output_stream'];
+ if(!is_string($this->_stream_name)) {
+ // If name is not given, create temp name
+ $this->_stream_name = tempnam(isset($this->config['stream_tmp_dir'])?$this->config['stream_tmp_dir']:sys_get_temp_dir(),
+ 'Zend_Http_Client');
+ }
+
+ if (false === ($fp = @fopen($this->_stream_name, "w+b"))) {
+ if ($this->adapter instanceof Zend_Http_Client_Adapter_Interface) {
+ $this->adapter->close();
+ }
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("Could not open temp file {$this->_stream_name}");
+ }
+
+ return $fp;
+ }
+
+ /**
+ * Send the HTTP request and return an HTTP response object
+ *
+ * @param string $method
+ * @return Zend_Http_Response
+ * @throws Zend_Http_Client_Exception
+ */
+ public function request($method = null)
+ {
+ if (! $this->uri instanceof Zend_Uri_Http) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception('No valid URI has been passed to the client');
+ }
+
+ if ($method) {
+ $this->setMethod($method);
+ }
+ $this->redirectCounter = 0;
+ $response = null;
+
+ // Make sure the adapter is loaded
+ if ($this->adapter == null) {
+ $this->setAdapter($this->config['adapter']);
+ }
+
+ // Send the first request. If redirected, continue.
+ do {
+ // Clone the URI and add the additional GET parameters to it
+ $uri = clone $this->uri;
+ if (! empty($this->paramsGet)) {
+ $query = $uri->getQuery();
+ if (! empty($query)) {
+ $query .= '&';
+ }
+ $query .= http_build_query($this->paramsGet, null, '&');
+ if ($this->config['rfc3986_strict']) {
+ $query = str_replace('+', '%20', $query);
+ }
+
+ // @see ZF-11671 to unmask for some services to foo=val1&foo=val2
+ if ($this->getUnmaskStatus()) {
+ if ($this->_queryBracketsEscaped) {
+ $query = preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $query);
+ } else {
+ $query = preg_replace('/\\[(?:[0-9]|[1-9][0-9]+)\\]=/', '=', $query);
+ }
+ }
+
+ $uri->setQuery($query);
+ }
+
+ $body = $this->_prepareBody();
+ $headers = $this->_prepareHeaders();
+
+ // check that adapter supports streaming before using it
+ if(is_resource($body) && !($this->adapter instanceof Zend_Http_Client_Adapter_Stream)) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception('Adapter does not support streaming');
+ }
+
+ // Open the connection, send the request and read the response
+ $this->adapter->connect($uri->getHost(), $uri->getPort(),
+ ($uri->getScheme() == 'https' ? true : false));
+
+ if($this->config['output_stream']) {
+ if($this->adapter instanceof Zend_Http_Client_Adapter_Stream) {
+ $stream = $this->_openTempStream();
+ $this->adapter->setOutputStream($stream);
+ } else {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception('Adapter does not support streaming');
+ }
+ }
+
+ $this->last_request = $this->adapter->write($this->method,
+ $uri, $this->config['httpversion'], $headers, $body);
+
+ $response = $this->adapter->read();
+ if (! $response) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception('Unable to read response, or response is empty');
+ }
+
+ if($this->config['output_stream']) {
+ $streamMetaData = stream_get_meta_data($stream);
+ if ($streamMetaData['seekable']) {
+ rewind($stream);
+ }
+ // cleanup the adapter
+ $this->adapter->setOutputStream(null);
+ $response = Zend_Http_Response_Stream::fromStream($response, $stream);
+ $response->setStreamName($this->_stream_name);
+ if(!is_string($this->config['output_stream'])) {
+ // we used temp name, will need to clean up
+ $response->setCleanup(true);
+ }
+ } else {
+ $response = Zend_Http_Response::fromString($response);
+ }
+
+ if ($this->config['storeresponse']) {
+ $this->last_response = $response;
+ }
+
+ // Load cookies into cookie jar
+ if (isset($this->cookiejar)) {
+ $this->cookiejar->addCookiesFromResponse($response, $uri, $this->config['encodecookies']);
+ }
+
+ // If we got redirected, look for the Location header
+ if ($response->isRedirect() && ($location = $response->getHeader('location'))) {
+
+ // Avoid problems with buggy servers that add whitespace at the
+ // end of some headers (See ZF-11283)
+ $location = trim($location);
+
+ // Check whether we send the exact same request again, or drop the parameters
+ // and send a GET request
+ if ($response->getStatus() == 303 ||
+ ((! $this->config['strictredirects']) && ($response->getStatus() == 302 ||
+ $response->getStatus() == 301))) {
+
+ $this->resetParameters();
+ $this->setMethod(self::GET);
+ }
+
+ // If we got a well formed absolute URI
+ if (($scheme = substr($location, 0, 6)) && ($scheme == 'http:/' || $scheme == 'https:')) {
+ $this->setHeaders('host', null);
+ $this->setUri($location);
+
+ } else {
+
+ // Split into path and query and set the query
+ if (strpos($location, '?') !== false) {
+ list($location, $query) = explode('?', $location, 2);
+ } else {
+ $query = '';
+ }
+ $this->uri->setQuery($query);
+
+ // Else, if we got just an absolute path, set it
+ if(strpos($location, '/') === 0) {
+ $this->uri->setPath($location);
+
+ // Else, assume we have a relative path
+ } else {
+ // Get the current path directory, removing any trailing slashes
+ $path = $this->uri->getPath();
+ $path = rtrim(substr($path, 0, strrpos($path, '/')), "/");
+ $this->uri->setPath($path . '/' . $location);
+ }
+ }
+ ++$this->redirectCounter;
+
+ } else {
+ // If we didn't get any location, stop redirecting
+ break;
+ }
+
+ } while ($this->redirectCounter < $this->config['maxredirects']);
+
+ return $response;
+ }
+
+ /**
+ * Prepare the request headers
+ *
+ * @return array
+ */
+ protected function _prepareHeaders()
+ {
+ $headers = array();
+
+ // Set the host header
+ if (! isset($this->headers['host'])) {
+ $host = $this->uri->getHost();
+
+ // If the port is not default, add it
+ if (! (($this->uri->getScheme() == 'http' && $this->uri->getPort() == 80) ||
+ ($this->uri->getScheme() == 'https' && $this->uri->getPort() == 443))) {
+ $host .= ':' . $this->uri->getPort();
+ }
+
+ $headers[] = "Host: {$host}";
+ }
+
+ // Set the connection header
+ if (! isset($this->headers['connection'])) {
+ if (! $this->config['keepalive']) {
+ $headers[] = "Connection: close";
+ }
+ }
+
+ // Set the Accept-encoding header if not set - depending on whether
+ // zlib is available or not.
+ if (! isset($this->headers['accept-encoding'])) {
+ if (function_exists('gzinflate')) {
+ $headers[] = 'Accept-encoding: gzip, deflate';
+ } else {
+ $headers[] = 'Accept-encoding: identity';
+ }
+ }
+
+ // Set the Content-Type header
+ if (($this->method == self::POST || $this->method == self::PUT) &&
+ (! isset($this->headers[strtolower(self::CONTENT_TYPE)]) && isset($this->enctype))) {
+
+ $headers[] = self::CONTENT_TYPE . ': ' . $this->enctype;
+ }
+
+ // Set the user agent header
+ if (! isset($this->headers['user-agent']) && isset($this->config['useragent'])) {
+ $headers[] = "User-Agent: {$this->config['useragent']}";
+ }
+
+ // Set HTTP authentication if needed
+ if (is_array($this->auth)) {
+ $auth = self::encodeAuthHeader($this->auth['user'], $this->auth['password'], $this->auth['type']);
+ $headers[] = "Authorization: {$auth}";
+ }
+
+ // Load cookies from cookie jar
+ if (isset($this->cookiejar)) {
+ $cookstr = $this->cookiejar->getMatchingCookies($this->uri,
+ true, Zend_Http_CookieJar::COOKIE_STRING_CONCAT);
+
+ if ($cookstr) {
+ $headers[] = "Cookie: {$cookstr}";
+ }
+ }
+
+ // Add all other user defined headers
+ foreach ($this->headers as $header) {
+ list($name, $value) = $header;
+ if (is_array($value)) {
+ $value = implode(', ', $value);
+ }
+
+ $headers[] = "$name: $value";
+ }
+
+ return $headers;
+ }
+
+ /**
+ * Prepare the request body (for POST and PUT requests)
+ *
+ * @return string
+ * @throws Zend_Http_Client_Exception
+ */
+ protected function _prepareBody()
+ {
+ // According to RFC2616, a TRACE request should not have a body.
+ if ($this->method == self::TRACE) {
+ return '';
+ }
+
+ if (isset($this->raw_post_data) && is_resource($this->raw_post_data)) {
+ return $this->raw_post_data;
+ }
+ // If mbstring overloads substr and strlen functions, we have to
+ // override it's internal encoding
+ if (function_exists('mb_internal_encoding') &&
+ ((int) ini_get('mbstring.func_overload')) & 2) {
+
+ $mbIntEnc = mb_internal_encoding();
+ mb_internal_encoding('ASCII');
+ }
+
+ // If we have raw_post_data set, just use it as the body.
+ if (isset($this->raw_post_data)) {
+ $this->setHeaders(self::CONTENT_LENGTH, strlen($this->raw_post_data));
+ if (isset($mbIntEnc)) {
+ mb_internal_encoding($mbIntEnc);
+ }
+
+ return $this->raw_post_data;
+ }
+
+ $body = '';
+
+ // If we have files to upload, force enctype to multipart/form-data
+ if (count ($this->files) > 0) {
+ $this->setEncType(self::ENC_FORMDATA);
+ }
+
+ // If we have POST parameters or files, encode and add them to the body
+ if (count($this->paramsPost) > 0 || count($this->files) > 0) {
+ switch($this->enctype) {
+ case self::ENC_FORMDATA:
+ // Encode body as multipart/form-data
+ $boundary = '---ZENDHTTPCLIENT-' . md5(microtime());
+ $this->setHeaders(self::CONTENT_TYPE, self::ENC_FORMDATA . "; boundary={$boundary}");
+
+ // Encode all files and POST vars in the order they were given
+ foreach ($this->body_field_order as $fieldName=>$fieldType) {
+ switch ($fieldType) {
+ case self::VTYPE_FILE:
+ foreach ($this->files as $file) {
+ if ($file['formname']===$fieldName) {
+ $fhead = array(self::CONTENT_TYPE => $file['ctype']);
+ $body .= self::encodeFormData($boundary, $file['formname'], $file['data'], $file['filename'], $fhead);
+ }
+ }
+ break;
+ case self::VTYPE_SCALAR:
+ if (isset($this->paramsPost[$fieldName])) {
+ if (is_array($this->paramsPost[$fieldName])) {
+ $flattened = self::_flattenParametersArray($this->paramsPost[$fieldName], $fieldName);
+ foreach ($flattened as $pp) {
+ $body .= self::encodeFormData($boundary, $pp[0], $pp[1]);
+ }
+ } else {
+ $body .= self::encodeFormData($boundary, $fieldName, $this->paramsPost[$fieldName]);
+ }
+ }
+ break;
+ }
+ }
+
+ $body .= "--{$boundary}--\r\n";
+ break;
+
+ case self::ENC_URLENCODED:
+ // Encode body as application/x-www-form-urlencoded
+ $this->setHeaders(self::CONTENT_TYPE, self::ENC_URLENCODED);
+ $body = http_build_query($this->paramsPost, '', '&');
+ break;
+
+ default:
+ if (isset($mbIntEnc)) {
+ mb_internal_encoding($mbIntEnc);
+ }
+
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("Cannot handle content type '{$this->enctype}' automatically." .
+ " Please use Zend_Http_Client::setRawData to send this kind of content.");
+ break;
+ }
+ }
+
+ // Set the Content-Length if we have a body or if request is POST/PUT
+ if ($body || $this->method == self::POST || $this->method == self::PUT) {
+ $this->setHeaders(self::CONTENT_LENGTH, strlen($body));
+ }
+
+ if (isset($mbIntEnc)) {
+ mb_internal_encoding($mbIntEnc);
+ }
+
+ return $body;
+ }
+
+ /**
+ * Helper method that gets a possibly multi-level parameters array (get or
+ * post) and flattens it.
+ *
+ * The method returns an array of (key, value) pairs (because keys are not
+ * necessarily unique. If one of the parameters in as array, it will also
+ * add a [] suffix to the key.
+ *
+ * This method is deprecated since Zend Framework 1.9 in favour of
+ * self::_flattenParametersArray() and will be dropped in 2.0
+ *
+ * @deprecated since 1.9
+ *
+ * @param array $parray The parameters array
+ * @param bool $urlencode Whether to urlencode the name and value
+ * @return array
+ */
+ protected function _getParametersRecursive($parray, $urlencode = false)
+ {
+ // Issue a deprecated notice
+ trigger_error("The " . __METHOD__ . " method is deprecated and will be dropped in 2.0.",
+ E_USER_NOTICE);
+
+ if (! is_array($parray)) {
+ return $parray;
+ }
+ $parameters = array();
+
+ foreach ($parray as $name => $value) {
+ if ($urlencode) {
+ $name = urlencode($name);
+ }
+
+ // If $value is an array, iterate over it
+ if (is_array($value)) {
+ $name .= ($urlencode ? '%5B%5D' : '[]');
+ foreach ($value as $subval) {
+ if ($urlencode) {
+ $subval = urlencode($subval);
+ }
+ $parameters[] = array($name, $subval);
+ }
+ } else {
+ if ($urlencode) {
+ $value = urlencode($value);
+ }
+ $parameters[] = array($name, $value);
+ }
+ }
+
+ return $parameters;
+ }
+
+ /**
+ * Attempt to detect the MIME type of a file using available extensions
+ *
+ * This method will try to detect the MIME type of a file. If the fileinfo
+ * extension is available, it will be used. If not, the mime_magic
+ * extension which is deprected but is still available in many PHP setups
+ * will be tried.
+ *
+ * If neither extension is available, the default application/octet-stream
+ * MIME type will be returned
+ *
+ * @param string $file File path
+ * @return string MIME type
+ */
+ protected function _detectFileMimeType($file)
+ {
+ $type = null;
+
+ // First try with fileinfo functions
+ if (function_exists('finfo_open')) {
+ if (self::$_fileInfoDb === null) {
+ self::$_fileInfoDb = @finfo_open(FILEINFO_MIME);
+ }
+
+ if (self::$_fileInfoDb) {
+ $type = finfo_file(self::$_fileInfoDb, $file);
+ }
+
+ } elseif (function_exists('mime_content_type')) {
+ $type = mime_content_type($file);
+ }
+
+ // Fallback to the default application/octet-stream
+ if (! $type) {
+ $type = 'application/octet-stream';
+ }
+
+ return $type;
+ }
+
+ /**
+ * Encode data to a multipart/form-data part suitable for a POST request.
+ *
+ * @param string $boundary
+ * @param string $name
+ * @param mixed $value
+ * @param string $filename
+ * @param array $headers Associative array of optional headers @example ("Content-Transfer-Encoding" => "binary")
+ * @return string
+ */
+ public static function encodeFormData($boundary, $name, $value, $filename = null, $headers = array()) {
+ $ret = "--{$boundary}\r\n" .
+ 'Content-Disposition: form-data; name="' . $name .'"';
+
+ if ($filename) {
+ $ret .= '; filename="' . $filename . '"';
+ }
+ $ret .= "\r\n";
+
+ foreach ($headers as $hname => $hvalue) {
+ $ret .= "{$hname}: {$hvalue}\r\n";
+ }
+ $ret .= "\r\n";
+
+ $ret .= "{$value}\r\n";
+
+ return $ret;
+ }
+
+ /**
+ * Create a HTTP authentication "Authorization:" header according to the
+ * specified user, password and authentication method.
+ *
+ * @see http://www.faqs.org/rfcs/rfc2617.html
+ * @param string $user
+ * @param string $password
+ * @param string $type
+ * @return string
+ * @throws Zend_Http_Client_Exception
+ */
+ public static function encodeAuthHeader($user, $password, $type = self::AUTH_BASIC)
+ {
+ $authHeader = null;
+
+ switch ($type) {
+ case self::AUTH_BASIC:
+ // In basic authentication, the user name cannot contain ":"
+ if (strpos($user, ':') !== false) {
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("The user name cannot contain ':' in 'Basic' HTTP authentication");
+ }
+
+ $authHeader = 'Basic ' . base64_encode($user . ':' . $password);
+ break;
+
+ //case self::AUTH_DIGEST:
+ /**
+ * @todo Implement digest authentication
+ */
+ // break;
+
+ default:
+ /** @see Zend_Http_Client_Exception */
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("Not a supported HTTP authentication type: '$type'");
+ }
+
+ return $authHeader;
+ }
+
+ /**
+ * Convert an array of parameters into a flat array of (key, value) pairs
+ *
+ * Will flatten a potentially multi-dimentional array of parameters (such
+ * as POST parameters) into a flat array of (key, value) paris. In case
+ * of multi-dimentional arrays, square brackets ([]) will be added to the
+ * key to indicate an array.
+ *
+ * @since 1.9
+ *
+ * @param array $parray
+ * @param string $prefix
+ * @return array
+ */
+ static protected function _flattenParametersArray($parray, $prefix = null)
+ {
+ if (! is_array($parray)) {
+ return $parray;
+ }
+
+ $parameters = array();
+
+ foreach($parray as $name => $value) {
+
+ // Calculate array key
+ if ($prefix) {
+ if (is_int($name)) {
+ $key = $prefix . '[]';
+ } else {
+ $key = $prefix . "[$name]";
+ }
+ } else {
+ $key = $name;
+ }
+
+ if (is_array($value)) {
+ $parameters = array_merge($parameters, self::_flattenParametersArray($value, $key));
+
+ } else {
+ $parameters[] = array($key, $value);
+ }
+ }
+
+ return $parameters;
+ }
+
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Curl.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Curl.php
new file mode 100644
index 0000000..a66b386
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Curl.php
@@ -0,0 +1,510 @@
+_invalidOverwritableCurlOptions = array(
+ CURLOPT_HTTPGET,
+ CURLOPT_POST,
+ CURLOPT_PUT,
+ CURLOPT_CUSTOMREQUEST,
+ CURLOPT_HEADER,
+ CURLOPT_RETURNTRANSFER,
+ CURLOPT_HTTPHEADER,
+ CURLOPT_POSTFIELDS,
+ CURLOPT_INFILE,
+ CURLOPT_INFILESIZE,
+ CURLOPT_PORT,
+ CURLOPT_MAXREDIRS,
+ CURLOPT_CONNECTTIMEOUT,
+ CURL_HTTP_VERSION_1_1,
+ CURL_HTTP_VERSION_1_0,
+ );
+ }
+
+ /**
+ * Set the configuration array for the adapter
+ *
+ * @throws Zend_Http_Client_Adapter_Exception
+ * @param Zend_Config | array $config
+ * @return Zend_Http_Client_Adapter_Curl
+ */
+ public function setConfig($config = array())
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+
+ } elseif (! is_array($config)) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Array or Zend_Config object expected, got ' . gettype($config)
+ );
+ }
+
+ if(isset($config['proxy_user']) && isset($config['proxy_pass'])) {
+ $this->setCurlOption(CURLOPT_PROXYUSERPWD, $config['proxy_user'].":".$config['proxy_pass']);
+ unset($config['proxy_user'], $config['proxy_pass']);
+ }
+
+ foreach ($config as $k => $v) {
+ $option = strtolower($k);
+ switch($option) {
+ case 'proxy_host':
+ $this->setCurlOption(CURLOPT_PROXY, $v);
+ break;
+ case 'proxy_port':
+ $this->setCurlOption(CURLOPT_PROXYPORT, $v);
+ break;
+ default:
+ $this->_config[$option] = $v;
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve the array of all configuration options
+ *
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->_config;
+ }
+
+ /**
+ * Direct setter for cURL adapter related options.
+ *
+ * @param string|int $option
+ * @param mixed $value
+ * @return Zend_Http_Adapter_Curl
+ */
+ public function setCurlOption($option, $value)
+ {
+ if (!isset($this->_config['curloptions'])) {
+ $this->_config['curloptions'] = array();
+ }
+ $this->_config['curloptions'][$option] = $value;
+ return $this;
+ }
+
+ /**
+ * Initialize curl
+ *
+ * @param string $host
+ * @param int $port
+ * @param boolean $secure
+ * @return void
+ * @throws Zend_Http_Client_Adapter_Exception if unable to connect
+ */
+ public function connect($host, $port = 80, $secure = false)
+ {
+ // If we're already connected, disconnect first
+ if ($this->_curl) {
+ $this->close();
+ }
+
+ // If we are connected to a different server or port, disconnect first
+ if ($this->_curl
+ && is_array($this->_connected_to)
+ && ($this->_connected_to[0] != $host
+ || $this->_connected_to[1] != $port)
+ ) {
+ $this->close();
+ }
+
+ // Do the actual connection
+ $this->_curl = curl_init();
+ if ($port != 80) {
+ curl_setopt($this->_curl, CURLOPT_PORT, intval($port));
+ }
+
+ // Set timeout
+ curl_setopt($this->_curl, CURLOPT_CONNECTTIMEOUT, $this->_config['timeout']);
+
+ // Set Max redirects
+ curl_setopt($this->_curl, CURLOPT_MAXREDIRS, $this->_config['maxredirects']);
+
+ if (!$this->_curl) {
+ $this->close();
+
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Unable to Connect to ' . $host . ':' . $port);
+ }
+
+ if ($secure !== false) {
+ // Behave the same like Zend_Http_Adapter_Socket on SSL options.
+ if (isset($this->_config['sslcert'])) {
+ curl_setopt($this->_curl, CURLOPT_SSLCERT, $this->_config['sslcert']);
+ }
+ if (isset($this->_config['sslpassphrase'])) {
+ curl_setopt($this->_curl, CURLOPT_SSLCERTPASSWD, $this->_config['sslpassphrase']);
+ }
+ }
+
+ // Update connected_to
+ $this->_connected_to = array($host, $port);
+ }
+
+ /**
+ * Send request to the remote server
+ *
+ * @param string $method
+ * @param Zend_Uri_Http $uri
+ * @param float $http_ver
+ * @param array $headers
+ * @param string $body
+ * @return string $request
+ * @throws Zend_Http_Client_Adapter_Exception If connection fails, connected to wrong host, no PUT file defined, unsupported method, or unsupported cURL option
+ */
+ public function write($method, $uri, $httpVersion = 1.1, $headers = array(), $body = '')
+ {
+ // Make sure we're properly connected
+ if (!$this->_curl) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception("Trying to write but we are not connected");
+ }
+
+ if ($this->_connected_to[0] != $uri->getHost() || $this->_connected_to[1] != $uri->getPort()) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception("Trying to write but we are connected to the wrong host");
+ }
+
+ // set URL
+ curl_setopt($this->_curl, CURLOPT_URL, $uri->__toString());
+
+ // ensure correct curl call
+ $curlValue = true;
+ switch ($method) {
+ case Zend_Http_Client::GET:
+ $curlMethod = CURLOPT_HTTPGET;
+ break;
+
+ case Zend_Http_Client::POST:
+ $curlMethod = CURLOPT_POST;
+ break;
+
+ case Zend_Http_Client::PUT:
+ // There are two different types of PUT request, either a Raw Data string has been set
+ // or CURLOPT_INFILE and CURLOPT_INFILESIZE are used.
+ if(is_resource($body)) {
+ $this->_config['curloptions'][CURLOPT_INFILE] = $body;
+ }
+ if (isset($this->_config['curloptions'][CURLOPT_INFILE])) {
+ // Now we will probably already have Content-Length set, so that we have to delete it
+ // from $headers at this point:
+ foreach ($headers AS $k => $header) {
+ if (preg_match('/Content-Length:\s*(\d+)/i', $header, $m)) {
+ if(is_resource($body)) {
+ $this->_config['curloptions'][CURLOPT_INFILESIZE] = (int)$m[1];
+ }
+ unset($headers[$k]);
+ }
+ }
+
+ if (!isset($this->_config['curloptions'][CURLOPT_INFILESIZE])) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception("Cannot set a file-handle for cURL option CURLOPT_INFILE without also setting its size in CURLOPT_INFILESIZE.");
+ }
+
+ if(is_resource($body)) {
+ $body = '';
+ }
+
+ $curlMethod = CURLOPT_PUT;
+ } else {
+ $curlMethod = CURLOPT_CUSTOMREQUEST;
+ $curlValue = "PUT";
+ }
+ break;
+
+ case Zend_Http_Client::DELETE:
+ $curlMethod = CURLOPT_CUSTOMREQUEST;
+ $curlValue = "DELETE";
+ break;
+
+ case Zend_Http_Client::OPTIONS:
+ $curlMethod = CURLOPT_CUSTOMREQUEST;
+ $curlValue = "OPTIONS";
+ break;
+
+ case Zend_Http_Client::TRACE:
+ $curlMethod = CURLOPT_CUSTOMREQUEST;
+ $curlValue = "TRACE";
+ break;
+
+ case Zend_Http_Client::HEAD:
+ $curlMethod = CURLOPT_CUSTOMREQUEST;
+ $curlValue = "HEAD";
+ break;
+
+ default:
+ // For now, through an exception for unsupported request methods
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception("Method currently not supported");
+ }
+
+ if(is_resource($body) && $curlMethod != CURLOPT_PUT) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception("Streaming requests are allowed only with PUT");
+ }
+
+ // get http version to use
+ $curlHttp = ($httpVersion == 1.1) ? CURL_HTTP_VERSION_1_1 : CURL_HTTP_VERSION_1_0;
+
+ // mark as HTTP request and set HTTP method
+ curl_setopt($this->_curl, $curlHttp, true);
+ curl_setopt($this->_curl, $curlMethod, $curlValue);
+
+ if($this->out_stream) {
+ // headers will be read into the response
+ curl_setopt($this->_curl, CURLOPT_HEADER, false);
+ curl_setopt($this->_curl, CURLOPT_HEADERFUNCTION, array($this, "readHeader"));
+ // and data will be written into the file
+ curl_setopt($this->_curl, CURLOPT_FILE, $this->out_stream);
+ } else {
+ // ensure headers are also returned
+ curl_setopt($this->_curl, CURLOPT_HEADER, true);
+
+ // ensure actual response is returned
+ curl_setopt($this->_curl, CURLOPT_RETURNTRANSFER, true);
+ }
+
+ // set additional headers
+ $headers['Accept'] = '';
+ curl_setopt($this->_curl, CURLOPT_HTTPHEADER, $headers);
+
+ /**
+ * Make sure POSTFIELDS is set after $curlMethod is set:
+ * @link http://de2.php.net/manual/en/function.curl-setopt.php#81161
+ */
+ if ($method == Zend_Http_Client::POST) {
+ curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
+ } elseif ($curlMethod == CURLOPT_PUT) {
+ // this covers a PUT by file-handle:
+ // Make the setting of this options explicit (rather than setting it through the loop following a bit lower)
+ // to group common functionality together.
+ curl_setopt($this->_curl, CURLOPT_INFILE, $this->_config['curloptions'][CURLOPT_INFILE]);
+ curl_setopt($this->_curl, CURLOPT_INFILESIZE, $this->_config['curloptions'][CURLOPT_INFILESIZE]);
+ unset($this->_config['curloptions'][CURLOPT_INFILE]);
+ unset($this->_config['curloptions'][CURLOPT_INFILESIZE]);
+ } elseif ($method == Zend_Http_Client::PUT) {
+ // This is a PUT by a setRawData string, not by file-handle
+ curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
+ } elseif ($method == Zend_Http_Client::DELETE) {
+ // This is a DELETE by a setRawData string
+ curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
+ }
+
+ // set additional curl options
+ if (isset($this->_config['curloptions'])) {
+ foreach ((array)$this->_config['curloptions'] as $k => $v) {
+ if (!in_array($k, $this->_invalidOverwritableCurlOptions)) {
+ if (curl_setopt($this->_curl, $k, $v) == false) {
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception(sprintf("Unknown or erroreous cURL option '%s' set", $k));
+ }
+ }
+ }
+ }
+
+ // send the request
+ $response = curl_exec($this->_curl);
+
+ // if we used streaming, headers are already there
+ if(!is_resource($this->out_stream)) {
+ $this->_response = $response;
+ }
+
+ $request = curl_getinfo($this->_curl, CURLINFO_HEADER_OUT);
+ $request .= $body;
+
+ if (empty($this->_response)) {
+ require_once 'Zend/Http/Client/Exception.php';
+ throw new Zend_Http_Client_Exception("Error in cURL request: " . curl_error($this->_curl));
+ }
+
+ // cURL automatically decodes chunked-messages, this means we have to disallow the Zend_Http_Response to do it again
+ if (stripos($this->_response, "Transfer-Encoding: chunked\r\n")) {
+ $this->_response = str_ireplace("Transfer-Encoding: chunked\r\n", '', $this->_response);
+ }
+
+ // Eliminate multiple HTTP responses.
+ do {
+ $parts = preg_split('|(?:\r?\n){2}|m', $this->_response, 2);
+ $again = false;
+
+ if (isset($parts[1]) && preg_match("|^HTTP/1\.[01](.*?)\r\n|mi", $parts[1])) {
+ $this->_response = $parts[1];
+ $again = true;
+ }
+ } while ($again);
+
+ // cURL automatically handles Proxy rewrites, remove the "HTTP/1.0 200 Connection established" string:
+ if (stripos($this->_response, "HTTP/1.0 200 Connection established\r\n\r\n") !== false) {
+ $this->_response = str_ireplace("HTTP/1.0 200 Connection established\r\n\r\n", '', $this->_response);
+ }
+
+ return $request;
+ }
+
+ /**
+ * Return read response from server
+ *
+ * @return string
+ */
+ public function read()
+ {
+ return $this->_response;
+ }
+
+ /**
+ * Close the connection to the server
+ *
+ */
+ public function close()
+ {
+ if(is_resource($this->_curl)) {
+ curl_close($this->_curl);
+ }
+ $this->_curl = null;
+ $this->_connected_to = array(null, null);
+ }
+
+ /**
+ * Get cUrl Handle
+ *
+ * @return resource
+ */
+ public function getHandle()
+ {
+ return $this->_curl;
+ }
+
+ /**
+ * Set output stream for the response
+ *
+ * @param resource $stream
+ * @return Zend_Http_Client_Adapter_Socket
+ */
+ public function setOutputStream($stream)
+ {
+ $this->out_stream = $stream;
+ return $this;
+ }
+
+ /**
+ * Header reader function for CURL
+ *
+ * @param resource $curl
+ * @param string $header
+ * @return int
+ */
+ public function readHeader($curl, $header)
+ {
+ $this->_response .= $header;
+ return strlen($header);
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Exception.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Exception.php
new file mode 100644
index 0000000..6416175
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Exception.php
@@ -0,0 +1,38 @@
+ 'ssl',
+ 'sslcert' => null,
+ 'sslpassphrase' => null,
+ 'sslusecontext' => false,
+ 'proxy_host' => '',
+ 'proxy_port' => 8080,
+ 'proxy_user' => '',
+ 'proxy_pass' => '',
+ 'proxy_auth' => Zend_Http_Client::AUTH_BASIC,
+ 'persistent' => false
+ );
+
+ /**
+ * Whether HTTPS CONNECT was already negotiated with the proxy or not
+ *
+ * @var boolean
+ */
+ protected $negotiated = false;
+
+ /**
+ * Stores the last CONNECT handshake request
+ *
+ * @var string
+ */
+ protected $connectHandshakeRequest;
+
+ /**
+ * Connect to the remote server
+ *
+ * Will try to connect to the proxy server. If no proxy was set, will
+ * fall back to the target server (behave like regular Socket adapter)
+ *
+ * @param string $host
+ * @param int $port
+ * @param boolean $secure
+ */
+ public function connect($host, $port = 80, $secure = false)
+ {
+ // If no proxy is set, fall back to Socket adapter
+ if (! $this->config['proxy_host']) {
+ return parent::connect($host, $port, $secure);
+ }
+
+ /* Url might require stream context even if proxy connection doesn't */
+ if ($secure) {
+ $this->config['sslusecontext'] = true;
+ }
+
+ // Connect (a non-secure connection) to the proxy server
+ return parent::connect(
+ $this->config['proxy_host'],
+ $this->config['proxy_port'],
+ false
+ );
+ }
+
+ /**
+ * Send request to the proxy server
+ *
+ * @param string $method
+ * @param Zend_Uri_Http $uri
+ * @param string $http_ver
+ * @param array $headers
+ * @param string $body
+ * @return string Request as string
+ * @throws Zend_Http_Client_Adapter_Exception
+ */
+ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')
+ {
+ // If no proxy is set, fall back to default Socket adapter
+ if (!$this->config['proxy_host']) {
+ return parent::write($method, $uri, $http_ver, $headers, $body);
+ }
+
+ // Make sure we're properly connected
+ if (!$this->socket) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Trying to write but we are not connected'
+ );
+ }
+
+ $host = $this->config['proxy_host'];
+ $port = $this->config['proxy_port'];
+
+ if ($this->connected_to[0] != "tcp://$host" || $this->connected_to[1] != $port) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Trying to write but we are connected to the wrong proxy server'
+ );
+ }
+
+ // Add Proxy-Authorization header
+ if ($this->config['proxy_user']) {
+ // Check to see if one already exists
+ $hasProxyAuthHeader = false;
+ foreach ($headers as $k => $v) {
+ if ((string) $k == 'proxy-authorization'
+ || preg_match("/^proxy-authorization:/i", $v)
+ ) {
+ $hasProxyAuthHeader = true;
+ break;
+ }
+ }
+ if (!$hasProxyAuthHeader) {
+ $headers[] = 'Proxy-authorization: '
+ . Zend_Http_Client::encodeAuthHeader(
+ $this->config['proxy_user'],
+ $this->config['proxy_pass'], $this->config['proxy_auth']
+ );
+ }
+ }
+
+ // if we are proxying HTTPS, preform CONNECT handshake with the proxy
+ if ($uri->getScheme() == 'https' && (!$this->negotiated)) {
+ $this->connectHandshake(
+ $uri->getHost(), $uri->getPort(), $http_ver, $headers
+ );
+ $this->negotiated = true;
+ }
+
+ // Save request method for later
+ $this->method = $method;
+
+ // Build request headers
+ if ($this->negotiated) {
+ $path = $uri->getPath();
+ if ($uri->getQuery()) {
+ $path .= '?' . $uri->getQuery();
+ }
+ $request = "$method $path HTTP/$http_ver\r\n";
+ } else {
+ $request = "$method $uri HTTP/$http_ver\r\n";
+ }
+
+ // Add all headers to the request string
+ foreach ($headers as $k => $v) {
+ if (is_string($k)) $v = "$k: $v";
+ $request .= "$v\r\n";
+ }
+
+ if(is_resource($body)) {
+ $request .= "\r\n";
+ } else {
+ // Add the request body
+ $request .= "\r\n" . $body;
+ }
+
+ // Send the request
+ if (!@fwrite($this->socket, $request)) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Error writing request to proxy server'
+ );
+ }
+
+ if(is_resource($body)) {
+ if(stream_copy_to_stream($body, $this->socket) == 0) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Error writing request to server'
+ );
+ }
+ }
+
+ return $request;
+ }
+
+ /**
+ * Preform handshaking with HTTPS proxy using CONNECT method
+ *
+ * @param string $host
+ * @param integer $port
+ * @param string $http_ver
+ * @param array $headers
+ * @return void
+ * @throws Zend_Http_Client_Adapter_Exception
+ */
+ protected function connectHandshake(
+ $host, $port = 443, $http_ver = '1.1', array &$headers = array()
+ )
+ {
+ $request = "CONNECT $host:$port HTTP/$http_ver\r\n" .
+ "Host: " . $this->config['proxy_host'] . "\r\n";
+
+ // Process provided headers, including important ones to CONNECT request
+ foreach ($headers as $k => $v) {
+ switch (strtolower(substr($v,0,strpos($v,':')))) {
+ case 'proxy-authorization':
+ // break intentionally omitted
+
+ case 'user-agent':
+ $request .= $v . "\r\n";
+ break;
+
+ default:
+ break;
+ }
+ }
+ $request .= "\r\n";
+
+ // @see ZF-3189
+ $this->connectHandshakeRequest = $request;
+
+ // Send the request
+ if (!@fwrite($this->socket, $request)) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Error writing request to proxy server'
+ );
+ }
+
+ // Read response headers only
+ $response = '';
+ $gotStatus = false;
+ while ($line = @fgets($this->socket)) {
+ $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);
+ if ($gotStatus) {
+ $response .= $line;
+ if (!chop($line)) {
+ break;
+ }
+ }
+ }
+
+ // Check that the response from the proxy is 200
+ if (Zend_Http_Response::extractCode($response) != 200) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Unable to connect to HTTPS proxy. Server response: ' . $response
+ );
+ }
+
+ // If all is good, switch socket to secure mode. We have to fall back
+ // through the different modes
+ $modes = array(
+ STREAM_CRYPTO_METHOD_TLS_CLIENT,
+ STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
+ STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
+ STREAM_CRYPTO_METHOD_SSLv2_CLIENT
+ );
+
+ $success = false;
+ foreach($modes as $mode) {
+ $success = stream_socket_enable_crypto($this->socket, true, $mode);
+ if ($success) {
+ break;
+ }
+ }
+
+ if (false !== $success) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Unable to connect to HTTPS server through proxy: could not '
+ . 'negotiate secure connection.'
+ );
+ }
+ }
+
+ /**
+ * Close the connection to the server
+ *
+ */
+ public function close()
+ {
+ parent::close();
+ $this->negotiated = false;
+ }
+
+ /**
+ * Destructor: make sure the socket is disconnected
+ *
+ */
+ public function __destruct()
+ {
+ if ($this->socket) {
+ $this->close();
+ }
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Socket.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Socket.php
new file mode 100644
index 0000000..b2a0e9b
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Socket.php
@@ -0,0 +1,543 @@
+ false,
+ 'ssltransport' => 'ssl',
+ 'sslcert' => null,
+ 'sslpassphrase' => null,
+ 'sslusecontext' => false
+ );
+
+ /**
+ * Request method - will be set by write() and might be used by read()
+ *
+ * @var string
+ */
+ protected $method = null;
+
+ /**
+ * Stream context
+ *
+ * @var resource
+ */
+ protected $_context = null;
+
+ /**
+ * Adapter constructor, currently empty. Config is set using setConfig()
+ *
+ */
+ public function __construct()
+ {
+ }
+
+ /**
+ * Set the configuration array for the adapter
+ *
+ * @param Zend_Config | array $config
+ */
+ public function setConfig($config = array())
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+
+ } elseif (! is_array($config)) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Array or Zend_Config object expected, got ' . gettype($config)
+ );
+ }
+
+ foreach ($config as $k => $v) {
+ $this->config[strtolower($k)] = $v;
+ }
+ }
+
+ /**
+ * Retrieve the array of all configuration options
+ *
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Set the stream context for the TCP connection to the server
+ *
+ * Can accept either a pre-existing stream context resource, or an array
+ * of stream options, similar to the options array passed to the
+ * stream_context_create() PHP function. In such case a new stream context
+ * will be created using the passed options.
+ *
+ * @since Zend Framework 1.9
+ *
+ * @param mixed $context Stream context or array of context options
+ * @return Zend_Http_Client_Adapter_Socket
+ */
+ public function setStreamContext($context)
+ {
+ if (is_resource($context) && get_resource_type($context) == 'stream-context') {
+ $this->_context = $context;
+
+ } elseif (is_array($context)) {
+ $this->_context = stream_context_create($context);
+
+ } else {
+ // Invalid parameter
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ "Expecting either a stream context resource or array, got " . gettype($context)
+ );
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get the stream context for the TCP connection to the server.
+ *
+ * If no stream context is set, will create a default one.
+ *
+ * @return resource
+ */
+ public function getStreamContext()
+ {
+ if (! $this->_context) {
+ $this->_context = stream_context_create();
+ }
+
+ return $this->_context;
+ }
+
+ /**
+ * Connect to the remote server
+ *
+ * @param string $host
+ * @param int $port
+ * @param boolean $secure
+ */
+ public function connect($host, $port = 80, $secure = false)
+ {
+ // If the URI should be accessed via SSL, prepend the Hostname with ssl://
+ $host = ($secure ? $this->config['ssltransport'] : 'tcp') . '://' . $host;
+
+ // If we are connected to the wrong host, disconnect first
+ if (($this->connected_to[0] != $host || $this->connected_to[1] != $port)) {
+ if (is_resource($this->socket)) $this->close();
+ }
+
+ // Now, if we are not connected, connect
+ if (! is_resource($this->socket) || ! $this->config['keepalive']) {
+ $context = $this->getStreamContext();
+ if ($secure || $this->config['sslusecontext']) {
+ if ($this->config['sslcert'] !== null) {
+ if (! stream_context_set_option($context, 'ssl', 'local_cert',
+ $this->config['sslcert'])) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Unable to set sslcert option');
+ }
+ }
+ if ($this->config['sslpassphrase'] !== null) {
+ if (! stream_context_set_option($context, 'ssl', 'passphrase',
+ $this->config['sslpassphrase'])) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Unable to set sslpassphrase option');
+ }
+ }
+ }
+
+ $flags = STREAM_CLIENT_CONNECT;
+ if ($this->config['persistent']) $flags |= STREAM_CLIENT_PERSISTENT;
+
+ $this->socket = @stream_socket_client($host . ':' . $port,
+ $errno,
+ $errstr,
+ (int) $this->config['timeout'],
+ $flags,
+ $context);
+
+ if (! $this->socket) {
+ $this->close();
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Unable to Connect to ' . $host . ':' . $port . '. Error #' . $errno . ': ' . $errstr);
+ }
+
+ // Set the stream timeout
+ if (! stream_set_timeout($this->socket, (int) $this->config['timeout'])) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Unable to set the connection timeout');
+ }
+
+ // Update connected_to
+ $this->connected_to = array($host, $port);
+ }
+ }
+
+ /**
+ * Send request to the remote server
+ *
+ * @param string $method
+ * @param Zend_Uri_Http $uri
+ * @param string $http_ver
+ * @param array $headers
+ * @param string $body
+ * @return string Request as string
+ */
+ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')
+ {
+ // Make sure we're properly connected
+ if (! $this->socket) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Trying to write but we are not connected');
+ }
+
+ $host = $uri->getHost();
+ $host = (strtolower($uri->getScheme()) == 'https' ? $this->config['ssltransport'] : 'tcp') . '://' . $host;
+ if ($this->connected_to[0] != $host || $this->connected_to[1] != $uri->getPort()) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Trying to write but we are connected to the wrong host');
+ }
+
+ // Save request method for later
+ $this->method = $method;
+
+ // Build request headers
+ $path = $uri->getPath();
+ if ($uri->getQuery()) $path .= '?' . $uri->getQuery();
+ $request = "{$method} {$path} HTTP/{$http_ver}\r\n";
+ foreach ($headers as $k => $v) {
+ if (is_string($k)) $v = ucfirst($k) . ": $v";
+ $request .= "$v\r\n";
+ }
+
+ if(is_resource($body)) {
+ $request .= "\r\n";
+ } else {
+ // Add the request body
+ $request .= "\r\n" . $body;
+ }
+
+ // Send the request
+ if (! @fwrite($this->socket, $request)) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Error writing request to server');
+ }
+
+ if(is_resource($body)) {
+ if(stream_copy_to_stream($body, $this->socket) == 0) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Error writing request to server');
+ }
+ }
+
+ return $request;
+ }
+
+ /**
+ * Read response from server
+ *
+ * @return string
+ */
+ public function read()
+ {
+ // First, read headers only
+ $response = '';
+ $gotStatus = false;
+
+ while (($line = @fgets($this->socket)) !== false) {
+ $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);
+ if ($gotStatus) {
+ $response .= $line;
+ if (rtrim($line) === '') break;
+ }
+ }
+
+ $this->_checkSocketReadTimeout();
+
+ $statusCode = Zend_Http_Response::extractCode($response);
+
+ // Handle 100 and 101 responses internally by restarting the read again
+ if ($statusCode == 100 || $statusCode == 101) return $this->read();
+
+ // Check headers to see what kind of connection / transfer encoding we have
+ $headers = Zend_Http_Response::extractHeaders($response);
+
+ /**
+ * Responses to HEAD requests and 204 or 304 responses are not expected
+ * to have a body - stop reading here
+ */
+ if ($statusCode == 304 || $statusCode == 204 ||
+ $this->method == Zend_Http_Client::HEAD) {
+
+ // Close the connection if requested to do so by the server
+ if (isset($headers['connection']) && $headers['connection'] == 'close') {
+ $this->close();
+ }
+ return $response;
+ }
+
+ // If we got a 'transfer-encoding: chunked' header
+ if (isset($headers['transfer-encoding'])) {
+
+ if (strtolower($headers['transfer-encoding']) == 'chunked') {
+
+ do {
+ $line = @fgets($this->socket);
+ $this->_checkSocketReadTimeout();
+
+ $chunk = $line;
+
+ // Figure out the next chunk size
+ $chunksize = trim($line);
+ if (! ctype_xdigit($chunksize)) {
+ $this->close();
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Invalid chunk size "' .
+ $chunksize . '" unable to read chunked body');
+ }
+
+ // Convert the hexadecimal value to plain integer
+ $chunksize = hexdec($chunksize);
+
+ // Read next chunk
+ $read_to = ftell($this->socket) + $chunksize;
+
+ do {
+ $current_pos = ftell($this->socket);
+ if ($current_pos >= $read_to) break;
+
+ if($this->out_stream) {
+ if(stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
+ $this->_checkSocketReadTimeout();
+ break;
+ }
+ } else {
+ $line = @fread($this->socket, $read_to - $current_pos);
+ if ($line === false || strlen($line) === 0) {
+ $this->_checkSocketReadTimeout();
+ break;
+ }
+ $chunk .= $line;
+ }
+ } while (! feof($this->socket));
+
+ $chunk .= @fgets($this->socket);
+ $this->_checkSocketReadTimeout();
+
+ if(!$this->out_stream) {
+ $response .= $chunk;
+ }
+ } while ($chunksize > 0);
+ } else {
+ $this->close();
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Cannot handle "' .
+ $headers['transfer-encoding'] . '" transfer encoding');
+ }
+
+ // We automatically decode chunked-messages when writing to a stream
+ // this means we have to disallow the Zend_Http_Response to do it again
+ if ($this->out_stream) {
+ $response = str_ireplace("Transfer-Encoding: chunked\r\n", '', $response);
+ }
+ // Else, if we got the content-length header, read this number of bytes
+ } elseif (isset($headers['content-length'])) {
+
+ // If we got more than one Content-Length header (see ZF-9404) use
+ // the last value sent
+ if (is_array($headers['content-length'])) {
+ $contentLength = $headers['content-length'][count($headers['content-length']) - 1];
+ } else {
+ $contentLength = $headers['content-length'];
+ }
+
+ $current_pos = ftell($this->socket);
+ $chunk = '';
+
+ for ($read_to = $current_pos + $contentLength;
+ $read_to > $current_pos;
+ $current_pos = ftell($this->socket)) {
+
+ if($this->out_stream) {
+ if(@stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
+ $this->_checkSocketReadTimeout();
+ break;
+ }
+ } else {
+ $chunk = @fread($this->socket, $read_to - $current_pos);
+ if ($chunk === false || strlen($chunk) === 0) {
+ $this->_checkSocketReadTimeout();
+ break;
+ }
+
+ $response .= $chunk;
+ }
+
+ // Break if the connection ended prematurely
+ if (feof($this->socket)) break;
+ }
+
+ // Fallback: just read the response until EOF
+ } else {
+
+ do {
+ if($this->out_stream) {
+ if(@stream_copy_to_stream($this->socket, $this->out_stream) == 0) {
+ $this->_checkSocketReadTimeout();
+ break;
+ }
+ } else {
+ $buff = @fread($this->socket, 8192);
+ if ($buff === false || strlen($buff) === 0) {
+ $this->_checkSocketReadTimeout();
+ break;
+ } else {
+ $response .= $buff;
+ }
+ }
+
+ } while (feof($this->socket) === false);
+
+ $this->close();
+ }
+
+ // Close the connection if requested to do so by the server
+ if (isset($headers['connection']) && $headers['connection'] == 'close') {
+ $this->close();
+ }
+
+ return $response;
+ }
+
+ /**
+ * Close the connection to the server
+ *
+ */
+ public function close()
+ {
+ if (is_resource($this->socket)) @fclose($this->socket);
+ $this->socket = null;
+ $this->connected_to = array(null, null);
+ }
+
+ /**
+ * Check if the socket has timed out - if so close connection and throw
+ * an exception
+ *
+ * @throws Zend_Http_Client_Adapter_Exception with READ_TIMEOUT code
+ */
+ protected function _checkSocketReadTimeout()
+ {
+ if ($this->socket) {
+ $info = stream_get_meta_data($this->socket);
+ $timedout = $info['timed_out'];
+ if ($timedout) {
+ $this->close();
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ "Read timed out after {$this->config['timeout']} seconds",
+ Zend_Http_Client_Adapter_Exception::READ_TIMEOUT
+ );
+ }
+ }
+ }
+
+ /**
+ * Set output stream for the response
+ *
+ * @param resource $stream
+ * @return Zend_Http_Client_Adapter_Socket
+ */
+ public function setOutputStream($stream)
+ {
+ $this->out_stream = $stream;
+ return $this;
+ }
+
+ /**
+ * Destructor: make sure the socket is disconnected
+ *
+ * If we are in persistent TCP mode, will not close the connection
+ *
+ */
+ public function __destruct()
+ {
+ if (! $this->config['persistent']) {
+ if ($this->socket) $this->close();
+ }
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Stream.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Stream.php
new file mode 100644
index 0000000..98f4410
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Adapter/Stream.php
@@ -0,0 +1,46 @@
+_nextRequestWillFail = (bool) $flag;
+
+ return $this;
+ }
+
+ /**
+ * Set the configuration array for the adapter
+ *
+ * @param Zend_Config | array $config
+ */
+ public function setConfig($config = array())
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+
+ } elseif (! is_array($config)) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Array or Zend_Config object expected, got ' . gettype($config)
+ );
+ }
+
+ foreach ($config as $k => $v) {
+ $this->config[strtolower($k)] = $v;
+ }
+ }
+
+
+ /**
+ * Connect to the remote server
+ *
+ * @param string $host
+ * @param int $port
+ * @param boolean $secure
+ * @param int $timeout
+ * @throws Zend_Http_Client_Adapter_Exception
+ */
+ public function connect($host, $port = 80, $secure = false)
+ {
+ if ($this->_nextRequestWillFail) {
+ $this->_nextRequestWillFail = false;
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception('Request failed');
+ }
+ }
+
+ /**
+ * Send request to the remote server
+ *
+ * @param string $method
+ * @param Zend_Uri_Http $uri
+ * @param string $http_ver
+ * @param array $headers
+ * @param string $body
+ * @return string Request as string
+ */
+ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')
+ {
+ $host = $uri->getHost();
+ $host = (strtolower($uri->getScheme()) == 'https' ? 'sslv2://' . $host : $host);
+
+ // Build request headers
+ $path = $uri->getPath();
+ if ($uri->getQuery()) $path .= '?' . $uri->getQuery();
+ $request = "{$method} {$path} HTTP/{$http_ver}\r\n";
+ foreach ($headers as $k => $v) {
+ if (is_string($k)) $v = ucfirst($k) . ": $v";
+ $request .= "$v\r\n";
+ }
+
+ // Add the request body
+ $request .= "\r\n" . $body;
+
+ // Do nothing - just return the request as string
+
+ return $request;
+ }
+
+ /**
+ * Return the response set in $this->setResponse()
+ *
+ * @return string
+ */
+ public function read()
+ {
+ if ($this->responseIndex >= count($this->responses)) {
+ $this->responseIndex = 0;
+ }
+ return $this->responses[$this->responseIndex++];
+ }
+
+ /**
+ * Close the connection (dummy)
+ *
+ */
+ public function close()
+ { }
+
+ /**
+ * Set the HTTP response(s) to be returned by this adapter
+ *
+ * @param Zend_Http_Response|array|string $response
+ */
+ public function setResponse($response)
+ {
+ if ($response instanceof Zend_Http_Response) {
+ $response = $response->asString("\r\n");
+ }
+
+ $this->responses = (array)$response;
+ $this->responseIndex = 0;
+ }
+
+ /**
+ * Add another response to the response buffer.
+ *
+ * @param string Zend_Http_Response|$response
+ */
+ public function addResponse($response)
+ {
+ if ($response instanceof Zend_Http_Response) {
+ $response = $response->asString("\r\n");
+ }
+
+ $this->responses[] = $response;
+ }
+
+ /**
+ * Sets the position of the response buffer. Selects which
+ * response will be returned on the next call to read().
+ *
+ * @param integer $index
+ */
+ public function setResponseIndex($index)
+ {
+ if ($index < 0 || $index >= count($this->responses)) {
+ require_once 'Zend/Http/Client/Adapter/Exception.php';
+ throw new Zend_Http_Client_Adapter_Exception(
+ 'Index out of range of response buffer size');
+ }
+ $this->responseIndex = $index;
+ }
+
+ /**
+ * Retrieve the array of all configuration options
+ *
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Exception.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Exception.php
new file mode 100644
index 0000000..278b90b
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Client/Exception.php
@@ -0,0 +1,36 @@
+name = (string) $name) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception('Cookies must have a name');
+ }
+
+ if (! $this->domain = (string) $domain) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception('Cookies must have a domain');
+ }
+
+ $this->value = (string) $value;
+ $this->expires = ($expires === null ? null : (int) $expires);
+ $this->path = ($path ? $path : '/');
+ $this->secure = $secure;
+ }
+
+ /**
+ * Get Cookie name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Get cookie value
+ *
+ * @return string
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Get cookie domain
+ *
+ * @return string
+ */
+ public function getDomain()
+ {
+ return $this->domain;
+ }
+
+ /**
+ * Get the cookie path
+ *
+ * @return string
+ */
+ public function getPath()
+ {
+ return $this->path;
+ }
+
+ /**
+ * Get the expiry time of the cookie, or null if no expiry time is set
+ *
+ * @return int|null
+ */
+ public function getExpiryTime()
+ {
+ return $this->expires;
+ }
+
+ /**
+ * Check whether the cookie should only be sent over secure connections
+ *
+ * @return boolean
+ */
+ public function isSecure()
+ {
+ return $this->secure;
+ }
+
+ /**
+ * Check whether the cookie has expired
+ *
+ * Always returns false if the cookie is a session cookie (has no expiry time)
+ *
+ * @param int $now Timestamp to consider as "now"
+ * @return boolean
+ */
+ public function isExpired($now = null)
+ {
+ if ($now === null) $now = time();
+ if (is_int($this->expires) && $this->expires < $now) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Check whether the cookie is a session cookie (has no expiry time set)
+ *
+ * @return boolean
+ */
+ public function isSessionCookie()
+ {
+ return ($this->expires === null);
+ }
+
+ /**
+ * Checks whether the cookie should be sent or not in a specific scenario
+ *
+ * @param string|Zend_Uri_Http $uri URI to check against (secure, domain, path)
+ * @param boolean $matchSessionCookies Whether to send session cookies
+ * @param int $now Override the current time when checking for expiry time
+ * @return boolean
+ */
+ public function match($uri, $matchSessionCookies = true, $now = null)
+ {
+ if (is_string ($uri)) {
+ $uri = Zend_Uri_Http::factory($uri);
+ }
+
+ // Make sure we have a valid Zend_Uri_Http object
+ if (! ($uri->valid() && ($uri->getScheme() == 'http' || $uri->getScheme() =='https'))) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception('Passed URI is not a valid HTTP or HTTPS URI');
+ }
+
+ // Check that the cookie is secure (if required) and not expired
+ if ($this->secure && $uri->getScheme() != 'https') return false;
+ if ($this->isExpired($now)) return false;
+ if ($this->isSessionCookie() && ! $matchSessionCookies) return false;
+
+ // Check if the domain matches
+ if (! self::matchCookieDomain($this->getDomain(), $uri->getHost())) {
+ return false;
+ }
+
+ // Check that path matches using prefix match
+ if (! self::matchCookiePath($this->getPath(), $uri->getPath())) {
+ return false;
+ }
+
+ // If we didn't die until now, return true.
+ return true;
+ }
+
+ /**
+ * Get the cookie as a string, suitable for sending as a "Cookie" header in an
+ * HTTP request
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if ($this->encodeValue) {
+ return $this->name . '=' . urlencode($this->value) . ';';
+ }
+ return $this->name . '=' . $this->value . ';';
+ }
+
+ /**
+ * Generate a new Cookie object from a cookie string
+ * (for example the value of the Set-Cookie HTTP header)
+ *
+ * @param string $cookieStr
+ * @param Zend_Uri_Http|string $refUri Reference URI for default values (domain, path)
+ * @param boolean $encodeValue Whether or not the cookie's value should be
+ * passed through urlencode/urldecode
+ * @return Zend_Http_Cookie A new Zend_Http_Cookie object or false on failure.
+ */
+ public static function fromString($cookieStr, $refUri = null, $encodeValue = true)
+ {
+ // Set default values
+ if (is_string($refUri)) {
+ $refUri = Zend_Uri_Http::factory($refUri);
+ }
+
+ $name = '';
+ $value = '';
+ $domain = '';
+ $path = '';
+ $expires = null;
+ $secure = false;
+ $parts = explode(';', $cookieStr);
+
+ // If first part does not include '=', fail
+ if (strpos($parts[0], '=') === false) return false;
+
+ // Get the name and value of the cookie
+ list($name, $value) = explode('=', trim(array_shift($parts)), 2);
+ $name = trim($name);
+ if ($encodeValue) {
+ $value = urldecode(trim($value));
+ }
+
+ // Set default domain and path
+ if ($refUri instanceof Zend_Uri_Http) {
+ $domain = $refUri->getHost();
+ $path = $refUri->getPath();
+ $path = substr($path, 0, strrpos($path, '/'));
+ }
+
+ // Set other cookie parameters
+ foreach ($parts as $part) {
+ $part = trim($part);
+ if (strtolower($part) == 'secure') {
+ $secure = true;
+ continue;
+ }
+
+ $keyValue = explode('=', $part, 2);
+ if (count($keyValue) == 2) {
+ list($k, $v) = $keyValue;
+ switch (strtolower($k)) {
+ case 'expires':
+ if(($expires = strtotime($v)) === false) {
+ /**
+ * The expiration is past Tue, 19 Jan 2038 03:14:07 UTC
+ * the maximum for 32-bit signed integer. Zend_Date
+ * can get around that limit.
+ *
+ * @see Zend_Date
+ */
+ require_once 'Zend/Date.php';
+
+ $expireDate = new Zend_Date($v);
+ $expires = $expireDate->getTimestamp();
+ }
+ break;
+
+ case 'path':
+ $path = $v;
+ break;
+
+ case 'domain':
+ $domain = $v;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ if ($name !== '') {
+ $ret = new self($name, $value, $domain, $expires, $path, $secure);
+ $ret->encodeValue = ($encodeValue) ? true : false;
+ return $ret;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Check if a cookie's domain matches a host name.
+ *
+ * Used by Zend_Http_Cookie and Zend_Http_CookieJar for cookie matching
+ *
+ * @param string $cookieDomain
+ * @param string $host
+ *
+ * @return boolean
+ */
+ public static function matchCookieDomain($cookieDomain, $host)
+ {
+ if (! $cookieDomain) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("\$cookieDomain is expected to be a cookie domain");
+ }
+
+ if (! $host) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("\$host is expected to be a host name");
+ }
+
+ $cookieDomain = strtolower($cookieDomain);
+ $host = strtolower($host);
+
+ if ($cookieDomain[0] == '.') {
+ $cookieDomain = substr($cookieDomain, 1);
+ }
+
+ // Check for either exact match or suffix match
+ return ($cookieDomain == $host ||
+ preg_match('/\.' . preg_quote($cookieDomain) . '$/', $host));
+ }
+
+ /**
+ * Check if a cookie's path matches a URL path
+ *
+ * Used by Zend_Http_Cookie and Zend_Http_CookieJar for cookie matching
+ *
+ * @param string $cookiePath
+ * @param string $path
+ * @return boolean
+ */
+ public static function matchCookiePath($cookiePath, $path)
+ {
+ if (! $cookiePath) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("\$cookiePath is expected to be a cookie path");
+ }
+
+ if (! $path) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("\$path is expected to be a host name");
+ }
+
+ return (strpos($path, $cookiePath) === 0);
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/CookieJar.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/CookieJar.php
new file mode 100644
index 0000000..bdc4110
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/CookieJar.php
@@ -0,0 +1,428 @@
+getDomain();
+ $path = $cookie->getPath();
+ if (! isset($this->cookies[$domain])) $this->cookies[$domain] = array();
+ if (! isset($this->cookies[$domain][$path])) $this->cookies[$domain][$path] = array();
+ $this->cookies[$domain][$path][$cookie->getName()] = $cookie;
+ $this->_rawCookies[] = $cookie;
+ } else {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception('Supplient argument is not a valid cookie string or object');
+ }
+ }
+
+ /**
+ * Parse an HTTP response, adding all the cookies set in that response
+ * to the cookie jar.
+ *
+ * @param Zend_Http_Response $response
+ * @param Zend_Uri_Http|string $ref_uri Requested URI
+ * @param boolean $encodeValue
+ */
+ public function addCookiesFromResponse($response, $ref_uri, $encodeValue = true)
+ {
+ if (! $response instanceof Zend_Http_Response) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception('$response is expected to be a Response object, ' .
+ gettype($response) . ' was passed');
+ }
+
+ $cookie_hdrs = $response->getHeader('Set-Cookie');
+
+ if (is_array($cookie_hdrs)) {
+ foreach ($cookie_hdrs as $cookie) {
+ $this->addCookie($cookie, $ref_uri, $encodeValue);
+ }
+ } elseif (is_string($cookie_hdrs)) {
+ $this->addCookie($cookie_hdrs, $ref_uri, $encodeValue);
+ }
+ }
+
+ /**
+ * Get all cookies in the cookie jar as an array
+ *
+ * @param int $ret_as Whether to return cookies as objects of Zend_Http_Cookie or as strings
+ * @return array|string
+ */
+ public function getAllCookies($ret_as = self::COOKIE_OBJECT)
+ {
+ $cookies = $this->_flattenCookiesArray($this->cookies, $ret_as);
+ if($ret_as == self::COOKIE_STRING_CONCAT_STRICT) {
+ $cookies = rtrim(trim($cookies), ';');
+ }
+ return $cookies;
+ }
+
+ /**
+ * Return an array of all cookies matching a specific request according to the request URI,
+ * whether session cookies should be sent or not, and the time to consider as "now" when
+ * checking cookie expiry time.
+ *
+ * @param string|Zend_Uri_Http $uri URI to check against (secure, domain, path)
+ * @param boolean $matchSessionCookies Whether to send session cookies
+ * @param int $ret_as Whether to return cookies as objects of Zend_Http_Cookie or as strings
+ * @param int $now Override the current time when checking for expiry time
+ * @return array|string
+ */
+ public function getMatchingCookies($uri, $matchSessionCookies = true,
+ $ret_as = self::COOKIE_OBJECT, $now = null)
+ {
+ if (is_string($uri)) $uri = Zend_Uri::factory($uri);
+ if (! $uri instanceof Zend_Uri_Http) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("Invalid URI string or object passed");
+ }
+
+ // First, reduce the array of cookies to only those matching domain and path
+ $cookies = $this->_matchDomain($uri->getHost());
+ $cookies = $this->_matchPath($cookies, $uri->getPath());
+ $cookies = $this->_flattenCookiesArray($cookies, self::COOKIE_OBJECT);
+
+ // Next, run Cookie->match on all cookies to check secure, time and session mathcing
+ $ret = array();
+ foreach ($cookies as $cookie)
+ if ($cookie->match($uri, $matchSessionCookies, $now))
+ $ret[] = $cookie;
+
+ // Now, use self::_flattenCookiesArray again - only to convert to the return format ;)
+ $ret = $this->_flattenCookiesArray($ret, $ret_as);
+ if($ret_as == self::COOKIE_STRING_CONCAT_STRICT) {
+ $ret = rtrim(trim($ret), ';');
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Get a specific cookie according to a URI and name
+ *
+ * @param Zend_Uri_Http|string $uri The uri (domain and path) to match
+ * @param string $cookie_name The cookie's name
+ * @param int $ret_as Whether to return cookies as objects of Zend_Http_Cookie or as strings
+ * @return Zend_Http_Cookie|string
+ */
+ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
+ {
+ if (is_string($uri)) {
+ $uri = Zend_Uri::factory($uri);
+ }
+
+ if (! $uri instanceof Zend_Uri_Http) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception('Invalid URI specified');
+ }
+
+ // Get correct cookie path
+ $path = $uri->getPath();
+ $path = substr($path, 0, strrpos($path, '/'));
+ if (! $path) $path = '/';
+
+ if (isset($this->cookies[$uri->getHost()][$path][$cookie_name])) {
+ $cookie = $this->cookies[$uri->getHost()][$path][$cookie_name];
+
+ switch ($ret_as) {
+ case self::COOKIE_OBJECT:
+ return $cookie;
+ break;
+
+ case self::COOKIE_STRING_CONCAT_STRICT:
+ return rtrim(trim($cookie->__toString()), ';');
+ break;
+
+ case self::COOKIE_STRING_ARRAY:
+ case self::COOKIE_STRING_CONCAT:
+ return $cookie->__toString();
+ break;
+
+ default:
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("Invalid value passed for \$ret_as: {$ret_as}");
+ break;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Helper function to recursivly flatten an array. Shoud be used when exporting the
+ * cookies array (or parts of it)
+ *
+ * @param Zend_Http_Cookie|array $ptr
+ * @param int $ret_as What value to return
+ * @return array|string
+ */
+ protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT) {
+ if (is_array($ptr)) {
+ $ret = ($ret_as == self::COOKIE_STRING_CONCAT || $ret_as == self::COOKIE_STRING_CONCAT_STRICT) ? '' : array();
+ foreach ($ptr as $item) {
+ if ($ret_as == self::COOKIE_STRING_CONCAT_STRICT) {
+ $postfix_combine = (!is_array($item) ? ' ' : '');
+ $ret .= $this->_flattenCookiesArray($item, $ret_as) . $postfix_combine;
+ } elseif ($ret_as == self::COOKIE_STRING_CONCAT) {
+ $ret .= $this->_flattenCookiesArray($item, $ret_as);
+ } else {
+ $ret = array_merge($ret, $this->_flattenCookiesArray($item, $ret_as));
+ }
+ }
+ return $ret;
+ } elseif ($ptr instanceof Zend_Http_Cookie) {
+ switch ($ret_as) {
+ case self::COOKIE_STRING_ARRAY:
+ return array($ptr->__toString());
+ break;
+
+ case self::COOKIE_STRING_CONCAT_STRICT:
+ // break intentionally omitted
+
+ case self::COOKIE_STRING_CONCAT:
+ return $ptr->__toString();
+ break;
+
+ case self::COOKIE_OBJECT:
+ default:
+ return array($ptr);
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Return a subset of the cookies array matching a specific domain
+ *
+ * @param string $domain
+ * @return array
+ */
+ protected function _matchDomain($domain)
+ {
+ $ret = array();
+
+ foreach (array_keys($this->cookies) as $cdom) {
+ if (Zend_Http_Cookie::matchCookieDomain($cdom, $domain)) {
+ $ret[$cdom] = $this->cookies[$cdom];
+ }
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Return a subset of a domain-matching cookies that also match a specified path
+ *
+ * @param array $dom_array
+ * @param string $path
+ * @return array
+ */
+ protected function _matchPath($domains, $path)
+ {
+ $ret = array();
+
+ foreach ($domains as $dom => $paths_array) {
+ foreach (array_keys($paths_array) as $cpath) {
+ if (Zend_Http_Cookie::matchCookiePath($cpath, $path)) {
+ if (! isset($ret[$dom])) {
+ $ret[$dom] = array();
+ }
+
+ $ret[$dom][$cpath] = $paths_array[$cpath];
+ }
+ }
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Create a new CookieJar object and automatically load into it all the
+ * cookies set in an Http_Response object. If $uri is set, it will be
+ * considered as the requested URI for setting default domain and path
+ * of the cookie.
+ *
+ * @param Zend_Http_Response $response HTTP Response object
+ * @param Zend_Uri_Http|string $uri The requested URI
+ * @return Zend_Http_CookieJar
+ * @todo Add the $uri functionality.
+ */
+ public static function fromResponse(Zend_Http_Response $response, $ref_uri)
+ {
+ $jar = new self();
+ $jar->addCookiesFromResponse($response, $ref_uri);
+ return $jar;
+ }
+
+ /**
+ * Required by Countable interface
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return count($this->_rawCookies);
+ }
+
+ /**
+ * Required by IteratorAggregate interface
+ *
+ * @return ArrayIterator
+ */
+ public function getIterator()
+ {
+ return new ArrayIterator($this->_rawCookies);
+ }
+
+ /**
+ * Tells if the jar is empty of any cookie
+ *
+ * @return bool
+ */
+ public function isEmpty()
+ {
+ return count($this) == 0;
+ }
+
+ /**
+ * Empties the cookieJar of any cookie
+ *
+ * @return Zend_Http_CookieJar
+ */
+ public function reset()
+ {
+ $this->cookies = $this->_rawCookies = array();
+ return $this;
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Exception.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Exception.php
new file mode 100644
index 0000000..b780074
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Exception.php
@@ -0,0 +1,36 @@
+getName() === NULL) {
+ $header->setName($headerKey);
+ $header->setValue($headerValue);
+ continue;
+ }
+
+ // Process the remanining elements
+ switch (str_replace(array('-', '_'), '', strtolower($headerKey))) {
+ case 'expires' : $header->setExpires($headerValue); break;
+ case 'domain' : $header->setDomain($headerValue); break;
+ case 'path' : $header->setPath($headerValue); break;
+ case 'secure' : $header->setSecure(true); break;
+ case 'httponly': $header->setHttponly(true); break;
+ case 'version' : $header->setVersion((int) $headerValue); break;
+ case 'maxage' : $header->setMaxAge((int) $headerValue); break;
+ default:
+ // Intentionally omitted
+ }
+ }
+ $headers[] = $header;
+ }
+ return count($headers) == 1 ? array_pop($headers) : $headers;
+ }
+
+ /**
+ * Cookie object constructor
+ *
+ * @todo Add validation of each one of the parameters (legal domain, etc.)
+ *
+ * @param string $name
+ * @param string $value
+ * @param int $expires
+ * @param string $path
+ * @param string $domain
+ * @param bool $secure
+ * @param bool $httponly
+ * @param string $maxAge
+ * @param int $version
+ * @return SetCookie
+ */
+ public function __construct($name = null, $value = null, $expires = null, $path = null, $domain = null, $secure = false, $httponly = false, $maxAge = null, $version = null)
+ {
+ $this->type = 'Cookie';
+
+ if ($name) {
+ $this->setName($name);
+ }
+
+ if ($value) {
+ $this->setValue($value); // in parent
+ }
+
+ if ($version) {
+ $this->setVersion($version);
+ }
+
+ if ($maxAge) {
+ $this->setMaxAge($maxAge);
+ }
+
+ if ($domain) {
+ $this->setDomain($domain);
+ }
+
+ if ($expires) {
+ $this->setExpires($expires);
+ }
+
+ if ($path) {
+ $this->setPath($path);
+ }
+
+ if ($secure) {
+ $this->setSecure($secure);
+ }
+
+ if ($httponly) {
+ $this->setHttponly($httponly);
+ }
+ }
+
+ /**
+ * @return string 'Set-Cookie'
+ */
+ public function getFieldName()
+ {
+ return 'Set-Cookie';
+ }
+
+ /**
+ * @throws Zend_Http_Header_Exception_RuntimeException
+ * @return string
+ */
+ public function getFieldValue()
+ {
+ if ($this->getName() == '') {
+ throw new Zend_Http_Header_Exception_RuntimeException('A cookie name is required to generate a field value for this cookie');
+ }
+
+ $value = $this->getValue();
+ if (strpos($value,'"')!==false) {
+ $value = '"'.urlencode(str_replace('"', '', $value)).'"';
+ } else {
+ $value = urlencode($value);
+ }
+ $fieldValue = $this->getName() . '=' . $value;
+
+ $version = $this->getVersion();
+ if ($version!==null) {
+ $fieldValue .= '; Version=' . $version;
+ }
+
+ $maxAge = $this->getMaxAge();
+ if ($maxAge!==null) {
+ $fieldValue .= '; Max-Age=' . $maxAge;
+ }
+
+ $expires = $this->getExpires();
+ if ($expires) {
+ $fieldValue .= '; Expires=' . $expires;
+ }
+
+ $domain = $this->getDomain();
+ if ($domain) {
+ $fieldValue .= '; Domain=' . $domain;
+ }
+
+ $path = $this->getPath();
+ if ($path) {
+ $fieldValue .= '; Path=' . $path;
+ }
+
+ if ($this->isSecure()) {
+ $fieldValue .= '; Secure';
+ }
+
+ if ($this->isHttponly()) {
+ $fieldValue .= '; HttpOnly';
+ }
+
+ return $fieldValue;
+ }
+
+ /**
+ * @param string $name
+ * @return SetCookie
+ */
+ public function setName($name)
+ {
+ if (preg_match("/[=,; \t\r\n\013\014]/", $name)) {
+ throw new Zend_Http_Header_Exception_InvalidArgumentException("Cookie name cannot contain these characters: =,; \\t\\r\\n\\013\\014 ({$name})");
+ }
+
+ $this->name = $name;
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * @param string $value
+ */
+ public function setValue($value)
+ {
+ $this->value = $value;
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Set version
+ *
+ * @param integer $version
+ */
+ public function setVersion($version)
+ {
+ if (!is_int($version)) {
+ throw new Zend_Http_Header_Exception_InvalidArgumentException('Invalid Version number specified');
+ }
+ $this->version = $version;
+ }
+
+ /**
+ * Get version
+ *
+ * @return integer
+ */
+ public function getVersion()
+ {
+ return $this->version;
+ }
+
+ /**
+ * Set Max-Age
+ *
+ * @param integer $maxAge
+ */
+ public function setMaxAge($maxAge)
+ {
+ if (!is_int($maxAge) || ($maxAge<0)) {
+ throw new Zend_Http_Header_Exception_InvalidArgumentException('Invalid Max-Age number specified');
+ }
+ $this->maxAge = $maxAge;
+ }
+
+ /**
+ * Get Max-Age
+ *
+ * @return integer
+ */
+ public function getMaxAge()
+ {
+ return $this->maxAge;
+ }
+
+ /**
+ * @param int $expires
+ * @return SetCookie
+ */
+ public function setExpires($expires)
+ {
+ if (!empty($expires)) {
+ if (is_string($expires)) {
+ $expires = strtotime($expires);
+ } elseif (!is_int($expires)) {
+ throw new Zend_Http_Header_Exception_InvalidArgumentException('Invalid expires time specified');
+ }
+ $this->expires = (int) $expires;
+ }
+ return $this;
+ }
+
+ /**
+ * @return int
+ */
+ public function getExpires($inSeconds = false)
+ {
+ if ($this->expires == null) {
+ return;
+ }
+ if ($inSeconds) {
+ return $this->expires;
+ }
+ return gmdate('D, d-M-Y H:i:s', $this->expires) . ' GMT';
+ }
+
+ /**
+ * @param string $domain
+ */
+ public function setDomain($domain)
+ {
+ $this->domain = $domain;
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDomain()
+ {
+ return $this->domain;
+ }
+
+ /**
+ * @param string $path
+ */
+ public function setPath($path)
+ {
+ $this->path = $path;
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPath()
+ {
+ return $this->path;
+ }
+
+ /**
+ * @param boolean $secure
+ */
+ public function setSecure($secure)
+ {
+ $this->secure = $secure;
+ return $this;
+ }
+
+ /**
+ * @return boolean
+ */
+ public function isSecure()
+ {
+ return $this->secure;
+ }
+
+ /**
+ * @param bool $httponly
+ */
+ public function setHttponly($httponly)
+ {
+ $this->httponly = $httponly;
+ return $this;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isHttponly()
+ {
+ return $this->httponly;
+ }
+
+ /**
+ * Check whether the cookie has expired
+ *
+ * Always returns false if the cookie is a session cookie (has no expiry time)
+ *
+ * @param int $now Timestamp to consider as "now"
+ * @return boolean
+ */
+ public function isExpired($now = null)
+ {
+ if ($now === null) {
+ $now = time();
+ }
+
+ if (is_int($this->expires) && $this->expires < $now) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Check whether the cookie is a session cookie (has no expiry time set)
+ *
+ * @return boolean
+ */
+ public function isSessionCookie()
+ {
+ return ($this->expires === null);
+ }
+
+ public function isValidForRequest($requestDomain, $path, $isSecure = false)
+ {
+ if ($this->getDomain() && (strrpos($requestDomain, $this->getDomain()) !== false)) {
+ return false;
+ }
+
+ if ($this->getPath() && (strpos($path, $this->getPath()) !== 0)) {
+ return false;
+ }
+
+ if ($this->secure && $this->isSecure()!==$isSecure) {
+ return false;
+ }
+
+ return true;
+
+ }
+
+ public function toString()
+ {
+ return $this->getFieldName() . ': ' . $this->getFieldValue();
+ }
+
+ public function __toString()
+ {
+ return $this->toString();
+ }
+
+ public function toStringMultipleHeaders(array $headers)
+ {
+ $headerLine = $this->toString();
+ /* @var $header SetCookie */
+ foreach ($headers as $header) {
+ if (!$header instanceof Zend_Http_Header_SetCookie) {
+ throw new Zend_Http_Header_Exception_RuntimeException(
+ 'The SetCookie multiple header implementation can only accept an array of SetCookie headers'
+ );
+ }
+ $headerLine .= ', ' . $header->getFieldValue();
+ }
+ return $headerLine;
+ }
+
+
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Response.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Response.php
new file mode 100644
index 0000000..acc6955
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Http/Response.php
@@ -0,0 +1,667 @@
+ 'Continue',
+ 101 => 'Switching Protocols',
+
+ // Success 2xx
+ 200 => 'OK',
+ 201 => 'Created',
+ 202 => 'Accepted',
+ 203 => 'Non-Authoritative Information',
+ 204 => 'No Content',
+ 205 => 'Reset Content',
+ 206 => 'Partial Content',
+
+ // Redirection 3xx
+ 300 => 'Multiple Choices',
+ 301 => 'Moved Permanently',
+ 302 => 'Found', // 1.1
+ 303 => 'See Other',
+ 304 => 'Not Modified',
+ 305 => 'Use Proxy',
+ // 306 is deprecated but reserved
+ 307 => 'Temporary Redirect',
+
+ // Client Error 4xx
+ 400 => 'Bad Request',
+ 401 => 'Unauthorized',
+ 402 => 'Payment Required',
+ 403 => 'Forbidden',
+ 404 => 'Not Found',
+ 405 => 'Method Not Allowed',
+ 406 => 'Not Acceptable',
+ 407 => 'Proxy Authentication Required',
+ 408 => 'Request Timeout',
+ 409 => 'Conflict',
+ 410 => 'Gone',
+ 411 => 'Length Required',
+ 412 => 'Precondition Failed',
+ 413 => 'Request Entity Too Large',
+ 414 => 'Request-URI Too Long',
+ 415 => 'Unsupported Media Type',
+ 416 => 'Requested Range Not Satisfiable',
+ 417 => 'Expectation Failed',
+
+ // Server Error 5xx
+ 500 => 'Internal Server Error',
+ 501 => 'Not Implemented',
+ 502 => 'Bad Gateway',
+ 503 => 'Service Unavailable',
+ 504 => 'Gateway Timeout',
+ 505 => 'HTTP Version Not Supported',
+ 509 => 'Bandwidth Limit Exceeded'
+ );
+
+ /**
+ * The HTTP version (1.0, 1.1)
+ *
+ * @var string
+ */
+ protected $version;
+
+ /**
+ * The HTTP response code
+ *
+ * @var int
+ */
+ protected $code;
+
+ /**
+ * The HTTP response code as string
+ * (e.g. 'Not Found' for 404 or 'Internal Server Error' for 500)
+ *
+ * @var string
+ */
+ protected $message;
+
+ /**
+ * The HTTP response headers array
+ *
+ * @var array
+ */
+ protected $headers = array();
+
+ /**
+ * The HTTP response body
+ *
+ * @var string
+ */
+ protected $body;
+
+ /**
+ * HTTP response constructor
+ *
+ * In most cases, you would use Zend_Http_Response::fromString to parse an HTTP
+ * response string and create a new Zend_Http_Response object.
+ *
+ * NOTE: The constructor no longer accepts nulls or empty values for the code and
+ * headers and will throw an exception if the passed values do not form a valid HTTP
+ * responses.
+ *
+ * If no message is passed, the message will be guessed according to the response code.
+ *
+ * @param int $code Response code (200, 404, ...)
+ * @param array $headers Headers array
+ * @param string $body Response body
+ * @param string $version HTTP version
+ * @param string $message Response code as text
+ * @throws Zend_Http_Exception
+ */
+ public function __construct($code, array $headers, $body = null, $version = '1.1', $message = null)
+ {
+ // Make sure the response code is valid and set it
+ if (self::responseCodeAsText($code) === null) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("{$code} is not a valid HTTP response code");
+ }
+
+ $this->code = $code;
+
+ foreach ($headers as $name => $value) {
+ if (is_int($name)) {
+ $header = explode(":", $value, 2);
+ if (count($header) != 2) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("'{$value}' is not a valid HTTP header");
+ }
+
+ $name = trim($header[0]);
+ $value = trim($header[1]);
+ }
+
+ $this->headers[ucwords(strtolower($name))] = $value;
+ }
+
+ // Set the body
+ $this->body = $body;
+
+ // Set the HTTP version
+ if (! preg_match('|^\d\.\d$|', $version)) {
+ require_once 'Zend/Http/Exception.php';
+ throw new Zend_Http_Exception("Invalid HTTP response version: $version");
+ }
+
+ $this->version = $version;
+
+ // If we got the response message, set it. Else, set it according to
+ // the response code
+ if (is_string($message)) {
+ $this->message = $message;
+ } else {
+ $this->message = self::responseCodeAsText($code);
+ }
+ }
+
+ /**
+ * Check whether the response is an error
+ *
+ * @return boolean
+ */
+ public function isError()
+ {
+ $restype = floor($this->code / 100);
+ if ($restype == 4 || $restype == 5) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Check whether the response in successful
+ *
+ * @return boolean
+ */
+ public function isSuccessful()
+ {
+ $restype = floor($this->code / 100);
+ if ($restype == 2 || $restype == 1) { // Shouldn't 3xx count as success as well ???
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Check whether the response is a redirection
+ *
+ * @return boolean
+ */
+ public function isRedirect()
+ {
+ $restype = floor($this->code / 100);
+ if ($restype == 3) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the response body as string
+ *
+ * This method returns the body of the HTTP response (the content), as it
+ * should be in it's readable version - that is, after decoding it (if it
+ * was decoded), deflating it (if it was gzip compressed), etc.
+ *
+ * If you want to get the raw body (as transfered on wire) use
+ * $this->getRawBody() instead.
+ *
+ * @return string
+ */
+ public function getBody()
+ {
+ $body = '';
+
+ // Decode the body if it was transfer-encoded
+ switch (strtolower($this->getHeader('transfer-encoding'))) {
+
+ // Handle chunked body
+ case 'chunked':
+ $body = self::decodeChunkedBody($this->body);
+ break;
+
+ // No transfer encoding, or unknown encoding extension:
+ // return body as is
+ default:
+ $body = $this->body;
+ break;
+ }
+
+ // Decode any content-encoding (gzip or deflate) if needed
+ switch (strtolower($this->getHeader('content-encoding'))) {
+
+ // Handle gzip encoding
+ case 'gzip':
+ $body = self::decodeGzip($body);
+ break;
+
+ // Handle deflate encoding
+ case 'deflate':
+ $body = self::decodeDeflate($body);
+ break;
+
+ default:
+ break;
+ }
+
+ return $body;
+ }
+
+ /**
+ * Get the raw response body (as transfered "on wire") as string
+ *
+ * If the body is encoded (with Transfer-Encoding, not content-encoding -
+ * IE "chunked" body), gzip compressed, etc. it will not be decoded.
+ *
+ * @return string
+ */
+ public function getRawBody()
+ {
+ return $this->body;
+ }
+
+ /**
+ * Get the HTTP version of the response
+ *
+ * @return string
+ */
+ public function getVersion()
+ {
+ return $this->version;
+ }
+
+ /**
+ * Get the HTTP response status code
+ *
+ * @return int
+ */
+ public function getStatus()
+ {
+ return $this->code;
+ }
+
+ /**
+ * Return a message describing the HTTP response code
+ * (Eg. "OK", "Not Found", "Moved Permanently")
+ *
+ * @return string
+ */
+ public function getMessage()
+ {
+ return $this->message;
+ }
+
+ /**
+ * Get the response headers
+ *
+ * @return array
+ */
+ public function getHeaders()
+ {
+ return $this->headers;
+ }
+
+ /**
+ * Get a specific header as string, or null if it is not set
+ *
+ * @param string$header
+ * @return string|array|null
+ */
+ public function getHeader($header)
+ {
+ $header = ucwords(strtolower($header));
+ if (! is_string($header) || ! isset($this->headers[$header])) return null;
+
+ return $this->headers[$header];
+ }
+
+ /**
+ * Get all headers as string
+ *
+ * @param boolean $status_line Whether to return the first status line (IE "HTTP 200 OK")
+ * @param string $br Line breaks (eg. "\n", "\r\n", "
+ * spl_autoload_register(array('Zend_Loader', 'autoload'));
+ *
+ *
+ * @deprecated Since 1.8.0
+ * @param string $class
+ * @return string|false Class name on success; false on failure
+ */
+ public static function autoload($class)
+ {
+ trigger_error(__CLASS__ . '::' . __METHOD__ . ' is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead', E_USER_NOTICE);
+ try {
+ @self::loadClass($class);
+ return $class;
+ } catch (Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Register {@link autoload()} with spl_autoload()
+ *
+ * @deprecated Since 1.8.0
+ * @param string $class (optional)
+ * @param boolean $enabled (optional)
+ * @return void
+ * @throws Zend_Exception if spl_autoload() is not found
+ * or if the specified class does not have an autoload() method.
+ */
+ public static function registerAutoload($class = 'Zend_Loader', $enabled = true)
+ {
+ trigger_error(__CLASS__ . '::' . __METHOD__ . ' is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead', E_USER_NOTICE);
+ require_once 'Zend/Loader/Autoloader.php';
+ $autoloader = Zend_Loader_Autoloader::getInstance();
+ $autoloader->setFallbackAutoloader(true);
+
+ if ('Zend_Loader' != $class) {
+ self::loadClass($class);
+ $methods = get_class_methods($class);
+ if (!in_array('autoload', (array) $methods)) {
+ require_once 'Zend/Exception.php';
+ throw new Zend_Exception("The class \"$class\" does not have an autoload() method");
+ }
+
+ $callback = array($class, 'autoload');
+
+ if ($enabled) {
+ $autoloader->pushAutoloader($callback);
+ } else {
+ $autoloader->removeAutoloader($callback);
+ }
+ }
+ }
+
+ /**
+ * Ensure that filename does not contain exploits
+ *
+ * @param string $filename
+ * @return void
+ * @throws Zend_Exception
+ */
+ protected static function _securityCheck($filename)
+ {
+ /**
+ * Security check
+ */
+ if (preg_match('/[^a-z0-9\\/\\\\_.:-]/i', $filename)) {
+ require_once 'Zend/Exception.php';
+ throw new Zend_Exception('Security check: Illegal character in filename');
+ }
+ }
+
+ /**
+ * Attempt to include() the file.
+ *
+ * include() is not prefixed with the @ operator because if
+ * the file is loaded and contains a parse error, execution
+ * will halt silently and this is difficult to debug.
+ *
+ * Always set display_errors = Off on production servers!
+ *
+ * @param string $filespec
+ * @param boolean $once
+ * @return boolean
+ * @deprecated Since 1.5.0; use loadFile() instead
+ */
+ protected static function _includeFile($filespec, $once = false)
+ {
+ if ($once) {
+ return include_once $filespec;
+ } else {
+ return include $filespec ;
+ }
+ }
+
+ /**
+ * Standardise the filename.
+ *
+ * Convert the supplied filename into the namespace-aware standard,
+ * based on the Framework Interop Group reference implementation:
+ * http://groups.google.com/group/php-standards/web/psr-0-final-proposal
+ *
+ * The filename must be formatted as "$file.php".
+ *
+ * @param string $file - The file name to be loaded.
+ * @return string
+ */
+ public static function standardiseFile($file)
+ {
+ $fileName = ltrim($file, '\\');
+ $file = '';
+ $namespace = '';
+ if ($lastNsPos = strripos($fileName, '\\')) {
+ $namespace = substr($fileName, 0, $lastNsPos);
+ $fileName = substr($fileName, $lastNsPos + 1);
+ $file = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
+ }
+ $file .= str_replace('_', DIRECTORY_SEPARATOR, $fileName) . '.php';
+ return $file;
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Autoloader.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Autoloader.php
new file mode 100644
index 0000000..cf7f357
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Autoloader.php
@@ -0,0 +1,589 @@
+ true,
+ 'ZendX_' => true,
+ );
+
+ /**
+ * @var array Namespace-specific autoloaders
+ */
+ protected $_namespaceAutoloaders = array();
+
+ /**
+ * @var bool Whether or not to suppress file not found warnings
+ */
+ protected $_suppressNotFoundWarnings = false;
+
+ /**
+ * @var null|string
+ */
+ protected $_zfPath;
+
+ /**
+ * Retrieve singleton instance
+ *
+ * @return Zend_Loader_Autoloader
+ */
+ public static function getInstance()
+ {
+ if (null === self::$_instance) {
+ self::$_instance = new self();
+ }
+ return self::$_instance;
+ }
+
+ /**
+ * Reset the singleton instance
+ *
+ * @return void
+ */
+ public static function resetInstance()
+ {
+ self::$_instance = null;
+ }
+
+ /**
+ * Autoload a class
+ *
+ * @param string $class
+ * @return bool
+ */
+ public static function autoload($class)
+ {
+ $self = self::getInstance();
+
+ foreach ($self->getClassAutoloaders($class) as $autoloader) {
+ if ($autoloader instanceof Zend_Loader_Autoloader_Interface) {
+ if ($autoloader->autoload($class)) {
+ return true;
+ }
+ } elseif (is_array($autoloader)) {
+ if (call_user_func($autoloader, $class)) {
+ return true;
+ }
+ } elseif (is_string($autoloader) || is_callable($autoloader)) {
+ if ($autoloader($class)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Set the default autoloader implementation
+ *
+ * @param string|array $callback PHP callback
+ * @return void
+ */
+ public function setDefaultAutoloader($callback)
+ {
+ if (!is_callable($callback)) {
+ throw new Zend_Loader_Exception('Invalid callback specified for default autoloader');
+ }
+
+ $this->_defaultAutoloader = $callback;
+ return $this;
+ }
+
+ /**
+ * Retrieve the default autoloader callback
+ *
+ * @return string|array PHP Callback
+ */
+ public function getDefaultAutoloader()
+ {
+ return $this->_defaultAutoloader;
+ }
+
+ /**
+ * Set several autoloader callbacks at once
+ *
+ * @param array $autoloaders Array of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders
+ * @return Zend_Loader_Autoloader
+ */
+ public function setAutoloaders(array $autoloaders)
+ {
+ $this->_autoloaders = $autoloaders;
+ return $this;
+ }
+
+ /**
+ * Get attached autoloader implementations
+ *
+ * @return array
+ */
+ public function getAutoloaders()
+ {
+ return $this->_autoloaders;
+ }
+
+ /**
+ * Return all autoloaders for a given namespace
+ *
+ * @param string $namespace
+ * @return array
+ */
+ public function getNamespaceAutoloaders($namespace)
+ {
+ $namespace = (string) $namespace;
+ if (!array_key_exists($namespace, $this->_namespaceAutoloaders)) {
+ return array();
+ }
+ return $this->_namespaceAutoloaders[$namespace];
+ }
+
+ /**
+ * Register a namespace to autoload
+ *
+ * @param string|array $namespace
+ * @return Zend_Loader_Autoloader
+ */
+ public function registerNamespace($namespace)
+ {
+ if (is_string($namespace)) {
+ $namespace = (array) $namespace;
+ } elseif (!is_array($namespace)) {
+ throw new Zend_Loader_Exception('Invalid namespace provided');
+ }
+
+ foreach ($namespace as $ns) {
+ if (!isset($this->_namespaces[$ns])) {
+ $this->_namespaces[$ns] = true;
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Unload a registered autoload namespace
+ *
+ * @param string|array $namespace
+ * @return Zend_Loader_Autoloader
+ */
+ public function unregisterNamespace($namespace)
+ {
+ if (is_string($namespace)) {
+ $namespace = (array) $namespace;
+ } elseif (!is_array($namespace)) {
+ throw new Zend_Loader_Exception('Invalid namespace provided');
+ }
+
+ foreach ($namespace as $ns) {
+ if (isset($this->_namespaces[$ns])) {
+ unset($this->_namespaces[$ns]);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Get a list of registered autoload namespaces
+ *
+ * @return array
+ */
+ public function getRegisteredNamespaces()
+ {
+ return array_keys($this->_namespaces);
+ }
+
+ public function setZfPath($spec, $version = 'latest')
+ {
+ $path = $spec;
+ if (is_array($spec)) {
+ if (!isset($spec['path'])) {
+ throw new Zend_Loader_Exception('No path specified for ZF');
+ }
+ $path = $spec['path'];
+ if (isset($spec['version'])) {
+ $version = $spec['version'];
+ }
+ }
+
+ $this->_zfPath = $this->_getVersionPath($path, $version);
+ set_include_path(implode(PATH_SEPARATOR, array(
+ $this->_zfPath,
+ get_include_path(),
+ )));
+ return $this;
+ }
+
+ public function getZfPath()
+ {
+ return $this->_zfPath;
+ }
+
+ /**
+ * Get or set the value of the "suppress not found warnings" flag
+ *
+ * @param null|bool $flag
+ * @return bool|Zend_Loader_Autoloader Returns boolean if no argument is passed, object instance otherwise
+ */
+ public function suppressNotFoundWarnings($flag = null)
+ {
+ if (null === $flag) {
+ return $this->_suppressNotFoundWarnings;
+ }
+ $this->_suppressNotFoundWarnings = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Indicate whether or not this autoloader should be a fallback autoloader
+ *
+ * @param bool $flag
+ * @return Zend_Loader_Autoloader
+ */
+ public function setFallbackAutoloader($flag)
+ {
+ $this->_fallbackAutoloader = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is this instance acting as a fallback autoloader?
+ *
+ * @return bool
+ */
+ public function isFallbackAutoloader()
+ {
+ return $this->_fallbackAutoloader;
+ }
+
+ /**
+ * Get autoloaders to use when matching class
+ *
+ * Determines if the class matches a registered namespace, and, if so,
+ * returns only the autoloaders for that namespace. Otherwise, it returns
+ * all non-namespaced autoloaders.
+ *
+ * @param string $class
+ * @return array Array of autoloaders to use
+ */
+ public function getClassAutoloaders($class)
+ {
+ $namespace = false;
+ $autoloaders = array();
+
+ // Add concrete namespaced autoloaders
+ foreach (array_keys($this->_namespaceAutoloaders) as $ns) {
+ if ('' == $ns) {
+ continue;
+ }
+ if (0 === strpos($class, $ns)) {
+ if ((false === $namespace) || (strlen($ns) > strlen($namespace))) {
+ $namespace = $ns;
+ $autoloaders = $this->getNamespaceAutoloaders($ns);
+ }
+ }
+ }
+
+ // Add internal namespaced autoloader
+ foreach ($this->getRegisteredNamespaces() as $ns) {
+ if (0 === strpos($class, $ns)) {
+ $namespace = $ns;
+ $autoloaders[] = $this->_internalAutoloader;
+ break;
+ }
+ }
+
+ // Add non-namespaced autoloaders
+ $autoloadersNonNamespace = $this->getNamespaceAutoloaders('');
+ if (count($autoloadersNonNamespace)) {
+ foreach ($autoloadersNonNamespace as $ns) {
+ $autoloaders[] = $ns;
+ }
+ unset($autoloadersNonNamespace);
+ }
+
+ // Add fallback autoloader
+ if (!$namespace && $this->isFallbackAutoloader()) {
+ $autoloaders[] = $this->_internalAutoloader;
+ }
+
+ return $autoloaders;
+ }
+
+ /**
+ * Add an autoloader to the beginning of the stack
+ *
+ * @param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
+ * @param string|array $namespace Specific namespace(s) under which to register callback
+ * @return Zend_Loader_Autoloader
+ */
+ public function unshiftAutoloader($callback, $namespace = '')
+ {
+ $autoloaders = $this->getAutoloaders();
+ array_unshift($autoloaders, $callback);
+ $this->setAutoloaders($autoloaders);
+
+ $namespace = (array) $namespace;
+ foreach ($namespace as $ns) {
+ $autoloaders = $this->getNamespaceAutoloaders($ns);
+ array_unshift($autoloaders, $callback);
+ $this->_setNamespaceAutoloaders($autoloaders, $ns);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Append an autoloader to the autoloader stack
+ *
+ * @param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
+ * @param string|array $namespace Specific namespace(s) under which to register callback
+ * @return Zend_Loader_Autoloader
+ */
+ public function pushAutoloader($callback, $namespace = '')
+ {
+ $autoloaders = $this->getAutoloaders();
+ array_push($autoloaders, $callback);
+ $this->setAutoloaders($autoloaders);
+
+ $namespace = (array) $namespace;
+ foreach ($namespace as $ns) {
+ $autoloaders = $this->getNamespaceAutoloaders($ns);
+ array_push($autoloaders, $callback);
+ $this->_setNamespaceAutoloaders($autoloaders, $ns);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Remove an autoloader from the autoloader stack
+ *
+ * @param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
+ * @param null|string|array $namespace Specific namespace(s) from which to remove autoloader
+ * @return Zend_Loader_Autoloader
+ */
+ public function removeAutoloader($callback, $namespace = null)
+ {
+ if (null === $namespace) {
+ $autoloaders = $this->getAutoloaders();
+ if (false !== ($index = array_search($callback, $autoloaders, true))) {
+ unset($autoloaders[$index]);
+ $this->setAutoloaders($autoloaders);
+ }
+
+ foreach ($this->_namespaceAutoloaders as $ns => $autoloaders) {
+ if (false !== ($index = array_search($callback, $autoloaders, true))) {
+ unset($autoloaders[$index]);
+ $this->_setNamespaceAutoloaders($autoloaders, $ns);
+ }
+ }
+ } else {
+ $namespace = (array) $namespace;
+ foreach ($namespace as $ns) {
+ $autoloaders = $this->getNamespaceAutoloaders($ns);
+ if (false !== ($index = array_search($callback, $autoloaders, true))) {
+ unset($autoloaders[$index]);
+ $this->_setNamespaceAutoloaders($autoloaders, $ns);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Constructor
+ *
+ * Registers instance with spl_autoload stack
+ *
+ * @return void
+ */
+ protected function __construct()
+ {
+ spl_autoload_register(array(__CLASS__, 'autoload'));
+ $this->_internalAutoloader = array($this, '_autoload');
+ }
+
+ /**
+ * Internal autoloader implementation
+ *
+ * @param string $class
+ * @return bool
+ */
+ protected function _autoload($class)
+ {
+ $callback = $this->getDefaultAutoloader();
+ try {
+ if ($this->suppressNotFoundWarnings()) {
+ @call_user_func($callback, $class);
+ } else {
+ call_user_func($callback, $class);
+ }
+ return $class;
+ } catch (Zend_Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Set autoloaders for a specific namespace
+ *
+ * @param array $autoloaders
+ * @param string $namespace
+ * @return Zend_Loader_Autoloader
+ */
+ protected function _setNamespaceAutoloaders(array $autoloaders, $namespace = '')
+ {
+ $namespace = (string) $namespace;
+ $this->_namespaceAutoloaders[$namespace] = $autoloaders;
+ return $this;
+ }
+
+ /**
+ * Retrieve the filesystem path for the requested ZF version
+ *
+ * @param string $path
+ * @param string $version
+ * @return void
+ */
+ protected function _getVersionPath($path, $version)
+ {
+ $type = $this->_getVersionType($version);
+
+ if ($type == 'latest') {
+ $version = 'latest';
+ }
+
+ $availableVersions = $this->_getAvailableVersions($path, $version);
+ if (empty($availableVersions)) {
+ throw new Zend_Loader_Exception('No valid ZF installations discovered');
+ }
+
+ $matchedVersion = array_pop($availableVersions);
+ return $matchedVersion;
+ }
+
+ /**
+ * Retrieve the ZF version type
+ *
+ * @param string $version
+ * @return string "latest", "major", "minor", or "specific"
+ * @throws Zend_Loader_Exception if version string contains too many dots
+ */
+ protected function _getVersionType($version)
+ {
+ if (strtolower($version) == 'latest') {
+ return 'latest';
+ }
+
+ $parts = explode('.', $version);
+ $count = count($parts);
+ if (1 == $count) {
+ return 'major';
+ }
+ if (2 == $count) {
+ return 'minor';
+ }
+ if (3 < $count) {
+ throw new Zend_Loader_Exception('Invalid version string provided');
+ }
+ return 'specific';
+ }
+
+ /**
+ * Get available versions for the version type requested
+ *
+ * @param string $path
+ * @param string $version
+ * @return array
+ */
+ protected function _getAvailableVersions($path, $version)
+ {
+ if (!is_dir($path)) {
+ throw new Zend_Loader_Exception('Invalid ZF path provided');
+ }
+
+ $path = rtrim($path, '/');
+ $path = rtrim($path, '\\');
+ $versionLen = strlen($version);
+ $versions = array();
+ $dirs = glob("$path/*", GLOB_ONLYDIR);
+ foreach ((array) $dirs as $dir) {
+ $dirName = substr($dir, strlen($path) + 1);
+ if (!preg_match('/^(?:ZendFramework-)?(\d+\.\d+\.\d+((a|b|pl|pr|p|rc)\d+)?)(?:-minimal)?$/i', $dirName, $matches)) {
+ continue;
+ }
+
+ $matchedVersion = $matches[1];
+
+ if (('latest' == $version)
+ || ((strlen($matchedVersion) >= $versionLen)
+ && (0 === strpos($matchedVersion, $version)))
+ ) {
+ $versions[$matchedVersion] = $dir . '/library';
+ }
+ }
+
+ uksort($versions, 'version_compare');
+ return $versions;
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Autoloader/Interface.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Autoloader/Interface.php
new file mode 100644
index 0000000..44d3a06
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Autoloader/Interface.php
@@ -0,0 +1,43 @@
+toArray();
+ }
+ if (!is_array($options)) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception('Options must be passed to resource loader constructor');
+ }
+
+ $this->setOptions($options);
+
+ $namespace = $this->getNamespace();
+ if ((null === $namespace)
+ || (null === $this->getBasePath())
+ ) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception('Resource loader requires both a namespace and a base path for initialization');
+ }
+
+ if (!empty($namespace)) {
+ $namespace .= '_';
+ }
+ require_once 'Zend/Loader/Autoloader.php';
+ Zend_Loader_Autoloader::getInstance()->unshiftAutoloader($this, $namespace);
+ }
+
+ /**
+ * Overloading: methods
+ *
+ * Allow retrieving concrete resource object instances using 'get
+ * $loader = new Zend_Loader_Autoloader_Resource(array(
+ * 'namespace' => 'Stuff_',
+ * 'basePath' => '/path/to/some/stuff',
+ * ))
+ * $loader->addResourceType('Model', 'models', 'Model');
+ *
+ * $foo = $loader->getModel('Foo'); // get instance of Stuff_Model_Foo class
+ *
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ * @throws Zend_Loader_Exception if method not beginning with 'get' or not matching a valid resource type is called
+ */
+ public function __call($method, $args)
+ {
+ if ('get' == substr($method, 0, 3)) {
+ $type = strtolower(substr($method, 3));
+ if (!$this->hasResourceType($type)) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception("Invalid resource type $type; cannot load resource");
+ }
+ if (empty($args)) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception("Cannot load resources; no resource specified");
+ }
+ $resource = array_shift($args);
+ return $this->load($resource, $type);
+ }
+
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception("Method '$method' is not supported");
+ }
+
+ /**
+ * Helper method to calculate the correct class path
+ *
+ * @param string $class
+ * @return False if not matched other wise the correct path
+ */
+ public function getClassPath($class)
+ {
+ $segments = explode('_', $class);
+ $namespaceTopLevel = $this->getNamespace();
+ $namespace = '';
+
+ if (!empty($namespaceTopLevel)) {
+ $namespace = array();
+ $topLevelSegments = count(explode('_', $namespaceTopLevel));
+ for ($i = 0; $i < $topLevelSegments; $i++) {
+ $namespace[] = array_shift($segments);
+ }
+ $namespace = implode('_', $namespace);
+ if ($namespace != $namespaceTopLevel) {
+ // wrong prefix? we're done
+ return false;
+ }
+ }
+
+ if (count($segments) < 2) {
+ // assumes all resources have a component and class name, minimum
+ return false;
+ }
+
+ $final = array_pop($segments);
+ $component = $namespace;
+ $lastMatch = false;
+ do {
+ $segment = array_shift($segments);
+ $component .= empty($component) ? $segment : '_' . $segment;
+ if (isset($this->_components[$component])) {
+ $lastMatch = $component;
+ }
+ } while (count($segments));
+
+ if (!$lastMatch) {
+ return false;
+ }
+
+ $final = substr($class, strlen($lastMatch) + 1);
+ $path = $this->_components[$lastMatch];
+ $classPath = $path . '/' . str_replace('_', '/', $final) . '.php';
+
+ if (Zend_Loader::isReadable($classPath)) {
+ return $classPath;
+ }
+
+ return false;
+ }
+
+ /**
+ * Attempt to autoload a class
+ *
+ * @param string $class
+ * @return mixed False if not matched, otherwise result if include operation
+ */
+ public function autoload($class)
+ {
+ $classPath = $this->getClassPath($class);
+ if (false !== $classPath) {
+ return include $classPath;
+ }
+ return false;
+ }
+
+ /**
+ * Set class state from options
+ *
+ * @param array $options
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function setOptions(array $options)
+ {
+ // Set namespace first, see ZF-10836
+ if (isset($options['namespace'])) {
+ $this->setNamespace($options['namespace']);
+ unset($options['namespace']);
+ }
+
+ $methods = get_class_methods($this);
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+ if (in_array($method, $methods)) {
+ $this->$method($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set namespace that this autoloader handles
+ *
+ * @param string $namespace
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function setNamespace($namespace)
+ {
+ $this->_namespace = rtrim((string) $namespace, '_');
+ return $this;
+ }
+
+ /**
+ * Get namespace this autoloader handles
+ *
+ * @return string
+ */
+ public function getNamespace()
+ {
+ return $this->_namespace;
+ }
+
+ /**
+ * Set base path for this set of resources
+ *
+ * @param string $path
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function setBasePath($path)
+ {
+ $this->_basePath = (string) $path;
+ return $this;
+ }
+
+ /**
+ * Get base path to this set of resources
+ *
+ * @return string
+ */
+ public function getBasePath()
+ {
+ return $this->_basePath;
+ }
+
+ /**
+ * Add resource type
+ *
+ * @param string $type identifier for the resource type being loaded
+ * @param string $path path relative to resource base path containing the resource types
+ * @param null|string $namespace sub-component namespace to append to base namespace that qualifies this resource type
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function addResourceType($type, $path, $namespace = null)
+ {
+ $type = strtolower($type);
+ if (!isset($this->_resourceTypes[$type])) {
+ if (null === $namespace) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception('Initial definition of a resource type must include a namespace');
+ }
+ $namespaceTopLevel = $this->getNamespace();
+ $namespace = ucfirst(trim($namespace, '_'));
+ $this->_resourceTypes[$type] = array(
+ 'namespace' => empty($namespaceTopLevel) ? $namespace : $namespaceTopLevel . '_' . $namespace,
+ );
+ }
+ if (!is_string($path)) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception('Invalid path specification provided; must be string');
+ }
+ $this->_resourceTypes[$type]['path'] = $this->getBasePath() . '/' . rtrim($path, '\/');
+
+ $component = $this->_resourceTypes[$type]['namespace'];
+ $this->_components[$component] = $this->_resourceTypes[$type]['path'];
+ return $this;
+ }
+
+ /**
+ * Add multiple resources at once
+ *
+ * $types should be an associative array of resource type => specification
+ * pairs. Each specification should be an associative array containing
+ * minimally the 'path' key (specifying the path relative to the resource
+ * base path) and optionally the 'namespace' key (indicating the subcomponent
+ * namespace to append to the resource namespace).
+ *
+ * As an example:
+ *
+ * $loader->addResourceTypes(array(
+ * 'model' => array(
+ * 'path' => 'models',
+ * 'namespace' => 'Model',
+ * ),
+ * 'form' => array(
+ * 'path' => 'forms',
+ * 'namespace' => 'Form',
+ * ),
+ * ));
+ *
+ *
+ * @param array $types
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function addResourceTypes(array $types)
+ {
+ foreach ($types as $type => $spec) {
+ if (!is_array($spec)) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception('addResourceTypes() expects an array of arrays');
+ }
+ if (!isset($spec['path'])) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception('addResourceTypes() expects each array to include a paths element');
+ }
+ $paths = $spec['path'];
+ $namespace = null;
+ if (isset($spec['namespace'])) {
+ $namespace = $spec['namespace'];
+ }
+ $this->addResourceType($type, $paths, $namespace);
+ }
+ return $this;
+ }
+
+ /**
+ * Overwrite existing and set multiple resource types at once
+ *
+ * @see Zend_Loader_Autoloader_Resource::addResourceTypes()
+ * @param array $types
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function setResourceTypes(array $types)
+ {
+ $this->clearResourceTypes();
+ return $this->addResourceTypes($types);
+ }
+
+ /**
+ * Retrieve resource type mappings
+ *
+ * @return array
+ */
+ public function getResourceTypes()
+ {
+ return $this->_resourceTypes;
+ }
+
+ /**
+ * Is the requested resource type defined?
+ *
+ * @param string $type
+ * @return bool
+ */
+ public function hasResourceType($type)
+ {
+ return isset($this->_resourceTypes[$type]);
+ }
+
+ /**
+ * Remove the requested resource type
+ *
+ * @param string $type
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function removeResourceType($type)
+ {
+ if ($this->hasResourceType($type)) {
+ $namespace = $this->_resourceTypes[$type]['namespace'];
+ unset($this->_components[$namespace]);
+ unset($this->_resourceTypes[$type]);
+ }
+ return $this;
+ }
+
+ /**
+ * Clear all resource types
+ *
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function clearResourceTypes()
+ {
+ $this->_resourceTypes = array();
+ $this->_components = array();
+ return $this;
+ }
+
+ /**
+ * Set default resource type to use when calling load()
+ *
+ * @param string $type
+ * @return Zend_Loader_Autoloader_Resource
+ */
+ public function setDefaultResourceType($type)
+ {
+ if ($this->hasResourceType($type)) {
+ $this->_defaultResourceType = $type;
+ }
+ return $this;
+ }
+
+ /**
+ * Get default resource type to use when calling load()
+ *
+ * @return string|null
+ */
+ public function getDefaultResourceType()
+ {
+ return $this->_defaultResourceType;
+ }
+
+ /**
+ * Object registry and factory
+ *
+ * Loads the requested resource of type $type (or uses the default resource
+ * type if none provided). If the resource has been loaded previously,
+ * returns the previous instance; otherwise, instantiates it.
+ *
+ * @param string $resource
+ * @param string $type
+ * @return object
+ * @throws Zend_Loader_Exception if resource type not specified or invalid
+ */
+ public function load($resource, $type = null)
+ {
+ if (null === $type) {
+ $type = $this->getDefaultResourceType();
+ if (empty($type)) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception('No resource type specified');
+ }
+ }
+ if (!$this->hasResourceType($type)) {
+ require_once 'Zend/Loader/Exception.php';
+ throw new Zend_Loader_Exception('Invalid resource type specified');
+ }
+ $namespace = $this->_resourceTypes[$type]['namespace'];
+ $class = $namespace . '_' . ucfirst($resource);
+ if (!isset($this->_resources[$class])) {
+ $this->_resources[$class] = new $class;
+ }
+ return $this->_resources[$class];
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Exception.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Exception.php
new file mode 100644
index 0000000..5075791
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Loader/Exception.php
@@ -0,0 +1,35 @@
+_useStaticRegistry = $staticRegistryName;
+ if(!isset(self::$_staticPrefixToPaths[$staticRegistryName])) {
+ self::$_staticPrefixToPaths[$staticRegistryName] = array();
+ }
+ if(!isset(self::$_staticLoadedPlugins[$staticRegistryName])) {
+ self::$_staticLoadedPlugins[$staticRegistryName] = array();
+ }
+ }
+
+ foreach ($prefixToPaths as $prefix => $path) {
+ $this->addPrefixPath($prefix, $path);
+ }
+ }
+
+ /**
+ * Format prefix for internal use
+ *
+ * @param string $prefix
+ * @return string
+ */
+ protected function _formatPrefix($prefix)
+ {
+ if($prefix == "") {
+ return $prefix;
+ }
+
+ $nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_';
+ return rtrim($prefix, $nsSeparator) . $nsSeparator;
+ }
+
+ /**
+ * Add prefixed paths to the registry of paths
+ *
+ * @param string $prefix
+ * @param string $path
+ * @return Zend_Loader_PluginLoader
+ */
+ public function addPrefixPath($prefix, $path)
+ {
+ if (!is_string($prefix) || !is_string($path)) {
+ require_once 'Zend/Loader/PluginLoader/Exception.php';
+ throw new Zend_Loader_PluginLoader_Exception('Zend_Loader_PluginLoader::addPrefixPath() method only takes strings for prefix and path.');
+ }
+
+ $prefix = $this->_formatPrefix($prefix);
+ $path = rtrim($path, '/\\') . '/';
+
+ if ($this->_useStaticRegistry) {
+ self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix][] = $path;
+ } else {
+ if (!isset($this->_prefixToPaths[$prefix])) {
+ $this->_prefixToPaths[$prefix] = array();
+ }
+ if (!in_array($path, $this->_prefixToPaths[$prefix])) {
+ $this->_prefixToPaths[$prefix][] = $path;
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Get path stack
+ *
+ * @param string $prefix
+ * @return false|array False if prefix does not exist, array otherwise
+ */
+ public function getPaths($prefix = null)
+ {
+ if ((null !== $prefix) && is_string($prefix)) {
+ $prefix = $this->_formatPrefix($prefix);
+ if ($this->_useStaticRegistry) {
+ if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
+ return self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix];
+ }
+
+ return false;
+ }
+
+ if (isset($this->_prefixToPaths[$prefix])) {
+ return $this->_prefixToPaths[$prefix];
+ }
+
+ return false;
+ }
+
+ if ($this->_useStaticRegistry) {
+ return self::$_staticPrefixToPaths[$this->_useStaticRegistry];
+ }
+
+ return $this->_prefixToPaths;
+ }
+
+ /**
+ * Clear path stack
+ *
+ * @param string $prefix
+ * @return bool False only if $prefix does not exist
+ */
+ public function clearPaths($prefix = null)
+ {
+ if ((null !== $prefix) && is_string($prefix)) {
+ $prefix = $this->_formatPrefix($prefix);
+ if ($this->_useStaticRegistry) {
+ if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
+ unset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix]);
+ return true;
+ }
+
+ return false;
+ }
+
+ if (isset($this->_prefixToPaths[$prefix])) {
+ unset($this->_prefixToPaths[$prefix]);
+ return true;
+ }
+
+ return false;
+ }
+
+ if ($this->_useStaticRegistry) {
+ self::$_staticPrefixToPaths[$this->_useStaticRegistry] = array();
+ } else {
+ $this->_prefixToPaths = array();
+ }
+
+ return true;
+ }
+
+ /**
+ * Remove a prefix (or prefixed-path) from the registry
+ *
+ * @param string $prefix
+ * @param string $path OPTIONAL
+ * @return Zend_Loader_PluginLoader
+ */
+ public function removePrefixPath($prefix, $path = null)
+ {
+ $prefix = $this->_formatPrefix($prefix);
+ if ($this->_useStaticRegistry) {
+ $registry =& self::$_staticPrefixToPaths[$this->_useStaticRegistry];
+ } else {
+ $registry =& $this->_prefixToPaths;
+ }
+
+ if (!isset($registry[$prefix])) {
+ require_once 'Zend/Loader/PluginLoader/Exception.php';
+ throw new Zend_Loader_PluginLoader_Exception('Prefix ' . $prefix . ' was not found in the PluginLoader.');
+ }
+
+ if ($path != null) {
+ $pos = array_search($path, $registry[$prefix]);
+ if (false === $pos) {
+ require_once 'Zend/Loader/PluginLoader/Exception.php';
+ throw new Zend_Loader_PluginLoader_Exception('Prefix ' . $prefix . ' / Path ' . $path . ' was not found in the PluginLoader.');
+ }
+ unset($registry[$prefix][$pos]);
+ } else {
+ unset($registry[$prefix]);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Normalize plugin name
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function _formatName($name)
+ {
+ return ucfirst((string) $name);
+ }
+
+ /**
+ * Whether or not a Plugin by a specific name is loaded
+ *
+ * @param string $name
+ * @return Zend_Loader_PluginLoader
+ */
+ public function isLoaded($name)
+ {
+ $name = $this->_formatName($name);
+ if ($this->_useStaticRegistry) {
+ return isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name]);
+ }
+
+ return isset($this->_loadedPlugins[$name]);
+ }
+
+ /**
+ * Return full class name for a named plugin
+ *
+ * @param string $name
+ * @return string|false False if class not found, class name otherwise
+ */
+ public function getClassName($name)
+ {
+ $name = $this->_formatName($name);
+ if ($this->_useStaticRegistry
+ && isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name])
+ ) {
+ return self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name];
+ } elseif (isset($this->_loadedPlugins[$name])) {
+ return $this->_loadedPlugins[$name];
+ }
+
+ return false;
+ }
+
+ /**
+ * Get path to plugin class
+ *
+ * @param mixed $name
+ * @return string|false False if not found
+ */
+ public function getClassPath($name)
+ {
+ $name = $this->_formatName($name);
+ if ($this->_useStaticRegistry
+ && !empty(self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name])
+ ) {
+ return self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name];
+ } elseif (!empty($this->_loadedPluginPaths[$name])) {
+ return $this->_loadedPluginPaths[$name];
+ }
+
+ if ($this->isLoaded($name)) {
+ $class = $this->getClassName($name);
+ $r = new ReflectionClass($class);
+ $path = $r->getFileName();
+ if ($this->_useStaticRegistry) {
+ self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name] = $path;
+ } else {
+ $this->_loadedPluginPaths[$name] = $path;
+ }
+ return $path;
+ }
+
+ return false;
+ }
+
+ /**
+ * Load a plugin via the name provided
+ *
+ * @param string $name
+ * @param bool $throwExceptions Whether or not to throw exceptions if the
+ * class is not resolved
+ * @return string|false Class name of loaded class; false if $throwExceptions
+ * if false and no class found
+ * @throws Zend_Loader_Exception if class not found
+ */
+ public function load($name, $throwExceptions = true)
+ {
+ $name = $this->_formatName($name);
+ if ($this->isLoaded($name)) {
+ return $this->getClassName($name);
+ }
+
+ if ($this->_useStaticRegistry) {
+ $registry = self::$_staticPrefixToPaths[$this->_useStaticRegistry];
+ } else {
+ $registry = $this->_prefixToPaths;
+ }
+
+ $registry = array_reverse($registry, true);
+ $found = false;
+ if (false !== strpos($name, '\\')) {
+ $classFile = str_replace('\\', DIRECTORY_SEPARATOR, $name) . '.php';
+ } else {
+ $classFile = str_replace('_', DIRECTORY_SEPARATOR, $name) . '.php';
+ }
+ $incFile = self::getIncludeFileCache();
+ foreach ($registry as $prefix => $paths) {
+ $className = $prefix . $name;
+
+ if (class_exists($className, false)) {
+ $found = true;
+ break;
+ }
+
+ $paths = array_reverse($paths, true);
+
+ foreach ($paths as $path) {
+ $loadFile = $path . $classFile;
+ if (Zend_Loader::isReadable($loadFile)) {
+ include_once $loadFile;
+ if (class_exists($className, false)) {
+ if (null !== $incFile) {
+ self::_appendIncFile($loadFile);
+ }
+ $found = true;
+ break 2;
+ }
+ }
+ }
+ }
+
+ if (!$found) {
+ if (!$throwExceptions) {
+ return false;
+ }
+
+ $message = "Plugin by name '$name' was not found in the registry; used paths:";
+ foreach ($registry as $prefix => $paths) {
+ $message .= "\n$prefix: " . implode(PATH_SEPARATOR, $paths);
+ }
+ require_once 'Zend/Loader/PluginLoader/Exception.php';
+ throw new Zend_Loader_PluginLoader_Exception($message);
+ }
+
+ if ($this->_useStaticRegistry) {
+ self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name] = $className;
+ } else {
+ $this->_loadedPlugins[$name] = $className;
+ }
+ return $className;
+ }
+
+ /**
+ * Set path to class file cache
+ *
+ * Specify a path to a file that will add include_once statements for each
+ * plugin class loaded. This is an opt-in feature for performance purposes.
+ *
+ * @param string $file
+ * @return void
+ * @throws Zend_Loader_PluginLoader_Exception if file is not writeable or path does not exist
+ */
+ public static function setIncludeFileCache($file)
+ {
+ if (null === $file) {
+ self::$_includeFileCache = null;
+ return;
+ }
+
+ if (!file_exists($file) && !file_exists(dirname($file))) {
+ require_once 'Zend/Loader/PluginLoader/Exception.php';
+ throw new Zend_Loader_PluginLoader_Exception('Specified file does not exist and/or directory does not exist (' . $file . ')');
+ }
+ if (file_exists($file) && !is_writable($file)) {
+ require_once 'Zend/Loader/PluginLoader/Exception.php';
+ throw new Zend_Loader_PluginLoader_Exception('Specified file is not writeable (' . $file . ')');
+ }
+ if (!file_exists($file) && file_exists(dirname($file)) && !is_writable(dirname($file))) {
+ require_once 'Zend/Loader/PluginLoader/Exception.php';
+ throw new Zend_Loader_PluginLoader_Exception('Specified file is not writeable (' . $file . ')');
+ }
+
+ self::$_includeFileCache = $file;
+ }
+
+ /**
+ * Retrieve class file cache path
+ *
+ * @return string|null
+ */
+ public static function getIncludeFileCache()
+ {
+ return self::$_includeFileCache;
+ }
+
+ /**
+ * Append an include_once statement to the class file cache
+ *
+ * @param string $incFile
+ * @return void
+ */
+ protected static function _appendIncFile($incFile)
+ {
+ if (!file_exists(self::$_includeFileCache)) {
+ $file = ' true, 'aa_DJ' => true, 'aa_ER' => true, 'aa_ET' => true, 'aa' => true,
+ 'af_NA' => true, 'af_ZA' => true, 'af' => true, 'ak_GH' => true, 'ak' => true,
+ 'am_ET' => true, 'am' => true, 'ar_AE' => true, 'ar_BH' => true, 'ar_DZ' => true,
+ 'ar_EG' => true, 'ar_IQ' => true, 'ar_JO' => true, 'ar_KW' => true, 'ar_LB' => true,
+ 'ar_LY' => true, 'ar_MA' => true, 'ar_OM' => true, 'ar_QA' => true, 'ar_SA' => true,
+ 'ar_SD' => true, 'ar_SY' => true, 'ar_TN' => true, 'ar_YE' => true, 'ar' => true,
+ 'as_IN' => true, 'as' => true, 'az_AZ' => true, 'az' => true, 'be_BY' => true,
+ 'be' => true, 'bg_BG' => true, 'bg' => true, 'bn_BD' => true, 'bn_IN' => true,
+ 'bn' => true, 'bo_CN' => true, 'bo_IN' => true, 'bo' => true, 'bs_BA' => true,
+ 'bs' => true, 'byn_ER'=> true, 'byn' => true, 'ca_ES' => true, 'ca' => true,
+ 'cch_NG'=> true, 'cch' => true, 'cop' => true, 'cs_CZ' => true, 'cs' => true,
+ 'cy_GB' => true, 'cy' => true, 'da_DK' => true, 'da' => true, 'de_AT' => true,
+ 'de_BE' => true, 'de_CH' => true, 'de_DE' => true, 'de_LI' => true, 'de_LU' => true,
+ 'de' => true, 'dv_MV' => true, 'dv' => true, 'dz_BT' => true, 'dz' => true,
+ 'ee_GH' => true, 'ee_TG' => true, 'ee' => true, 'el_CY' => true, 'el_GR' => true,
+ 'el' => true, 'en_AS' => true, 'en_AU' => true, 'en_BE' => true, 'en_BW' => true,
+ 'en_BZ' => true, 'en_CA' => true, 'en_GB' => true, 'en_GU' => true, 'en_HK' => true,
+ 'en_IE' => true, 'en_IN' => true, 'en_JM' => true, 'en_MH' => true, 'en_MP' => true,
+ 'en_MT' => true, 'en_NA' => true, 'en_NZ' => true, 'en_PH' => true, 'en_PK' => true,
+ 'en_SG' => true, 'en_TT' => true, 'en_UM' => true, 'en_US' => true, 'en_VI' => true,
+ 'en_ZA' => true, 'en_ZW' => true, 'en' => true, 'eo' => true, 'es_AR' => true,
+ 'es_BO' => true, 'es_CL' => true, 'es_CO' => true, 'es_CR' => true, 'es_DO' => true,
+ 'es_EC' => true, 'es_ES' => true, 'es_GT' => true, 'es_HN' => true, 'es_MX' => true,
+ 'es_NI' => true, 'es_PA' => true, 'es_PE' => true, 'es_PR' => true, 'es_PY' => true,
+ 'es_SV' => true, 'es_US' => true, 'es_UY' => true, 'es_VE' => true, 'es' => true,
+ 'et_EE' => true, 'et' => true, 'eu_ES' => true, 'eu' => true, 'fa_AF' => true,
+ 'fa_IR' => true, 'fa' => true, 'fi_FI' => true, 'fi' => true, 'fil_PH'=> true,
+ 'fil' => true, 'fo_FO' => true, 'fo' => true, 'fr_BE' => true, 'fr_CA' => true,
+ 'fr_CH' => true, 'fr_FR' => true, 'fr_LU' => true, 'fr_MC' => true, 'fr_SN' => true,
+ 'fr' => true, 'fur_IT'=> true, 'fur' => true, 'ga_IE' => true, 'ga' => true,
+ 'gaa_GH'=> true, 'gaa' => true, 'gez_ER'=> true, 'gez_ET'=> true, 'gez' => true,
+ 'gl_ES' => true, 'gl' => true, 'gsw_CH'=> true, 'gsw' => true, 'gu_IN' => true,
+ 'gu' => true, 'gv_GB' => true, 'gv' => true, 'ha_GH' => true, 'ha_NE' => true,
+ 'ha_NG' => true, 'ha_SD' => true, 'ha' => true, 'haw_US'=> true, 'haw' => true,
+ 'he_IL' => true, 'he' => true, 'hi_IN' => true, 'hi' => true, 'hr_HR' => true,
+ 'hr' => true, 'hu_HU' => true, 'hu' => true, 'hy_AM' => true, 'hy' => true,
+ 'ia' => true, 'id_ID' => true, 'id' => true, 'ig_NG' => true, 'ig' => true,
+ 'ii_CN' => true, 'ii' => true, 'in' => true, 'is_IS' => true, 'is' => true,
+ 'it_CH' => true, 'it_IT' => true, 'it' => true, 'iu' => true, 'iw' => true,
+ 'ja_JP' => true, 'ja' => true, 'ka_GE' => true, 'ka' => true, 'kaj_NG'=> true,
+ 'kaj' => true, 'kam_KE'=> true, 'kam' => true, 'kcg_NG'=> true, 'kcg' => true,
+ 'kfo_CI'=> true, 'kfo' => true, 'kk_KZ' => true, 'kk' => true, 'kl_GL' => true,
+ 'kl' => true, 'km_KH' => true, 'km' => true, 'kn_IN' => true, 'kn' => true,
+ 'ko_KR' => true, 'ko' => true, 'kok_IN'=> true, 'kok' => true, 'kpe_GN'=> true,
+ 'kpe_LR'=> true, 'kpe' => true, 'ku_IQ' => true, 'ku_IR' => true, 'ku_SY' => true,
+ 'ku_TR' => true, 'ku' => true, 'kw_GB' => true, 'kw' => true, 'ky_KG' => true,
+ 'ky' => true, 'ln_CD' => true, 'ln_CG' => true, 'ln' => true, 'lo_LA' => true,
+ 'lo' => true, 'lt_LT' => true, 'lt' => true, 'lv_LV' => true, 'lv' => true,
+ 'mk_MK' => true, 'mk' => true, 'ml_IN' => true, 'ml' => true, 'mn_CN' => true,
+ 'mn_MN' => true, 'mn' => true, 'mo' => true, 'mr_IN' => true, 'mr' => true,
+ 'ms_BN' => true, 'ms_MY' => true, 'ms' => true, 'mt_MT' => true, 'mt' => true,
+ 'my_MM' => true, 'my' => true, 'nb_NO' => true, 'nb' => true, 'nds_DE'=> true,
+ 'nds' => true, 'ne_IN' => true, 'ne_NP' => true, 'ne' => true, 'nl_BE' => true,
+ 'nl_NL' => true, 'nl' => true, 'nn_NO' => true, 'nn' => true, 'no' => true,
+ 'nr_ZA' => true, 'nr' => true, 'nso_ZA'=> true, 'nso' => true, 'ny_MW' => true,
+ 'ny' => true, 'oc_FR' => true, 'oc' => true, 'om_ET' => true, 'om_KE' => true,
+ 'om' => true, 'or_IN' => true, 'or' => true, 'pa_IN' => true, 'pa_PK' => true,
+ 'pa' => true, 'pl_PL' => true, 'pl' => true, 'ps_AF' => true, 'ps' => true,
+ 'pt_BR' => true, 'pt_PT' => true, 'pt' => true, 'ro_MD' => true, 'ro_RO' => true,
+ 'ro' => true, 'ru_RU' => true, 'ru_UA' => true, 'ru' => true, 'rw_RW' => true,
+ 'rw' => true, 'sa_IN' => true, 'sa' => true, 'se_FI' => true, 'se_NO' => true,
+ 'se' => true, 'sh_BA' => true, 'sh_CS' => true, 'sh_YU' => true, 'sh' => true,
+ 'si_LK' => true, 'si' => true, 'sid_ET'=> true, 'sid' => true, 'sk_SK' => true,
+ 'sk' => true, 'sl_SI' => true, 'sl' => true, 'so_DJ' => true, 'so_ET' => true,
+ 'so_KE' => true, 'so_SO' => true, 'so' => true, 'sq_AL' => true, 'sq' => true,
+ 'sr_BA' => true, 'sr_CS' => true, 'sr_ME' => true, 'sr_RS' => true, 'sr_YU' => true,
+ 'sr' => true, 'ss_SZ' => true, 'ss_ZA' => true, 'ss' => true, 'st_LS' => true,
+ 'st_ZA' => true, 'st' => true, 'sv_FI' => true, 'sv_SE' => true, 'sv' => true,
+ 'sw_KE' => true, 'sw_TZ' => true, 'sw' => true, 'syr_SY'=> true, 'syr' => true,
+ 'ta_IN' => true, 'ta' => true, 'te_IN' => true, 'te' => true, 'tg_TJ' => true,
+ 'tg' => true, 'th_TH' => true, 'th' => true, 'ti_ER' => true, 'ti_ET' => true,
+ 'ti' => true, 'tig_ER'=> true, 'tig' => true, 'tl' => true, 'tn_ZA' => true,
+ 'tn' => true, 'to_TO' => true, 'to' => true, 'tr_TR' => true, 'tr' => true,
+ 'trv_TW'=> true, 'trv' => true, 'ts_ZA' => true, 'ts' => true, 'tt_RU' => true,
+ 'tt' => true, 'ug_CN' => true, 'ug' => true, 'uk_UA' => true, 'uk' => true,
+ 'ur_IN' => true, 'ur_PK' => true, 'ur' => true, 'uz_AF' => true, 'uz_UZ' => true,
+ 'uz' => true, 've_ZA' => true, 've' => true, 'vi_VN' => true, 'vi' => true,
+ 'wal_ET'=> true, 'wal' => true, 'wo_SN' => true, 'wo' => true, 'xh_ZA' => true,
+ 'xh' => true, 'yo_NG' => true, 'yo' => true, 'zh_CN' => true, 'zh_HK' => true,
+ 'zh_MO' => true, 'zh_SG' => true, 'zh_TW' => true, 'zh' => true, 'zu_ZA' => true,
+ 'zu' => true
+ );
+
+ /**
+ * Class wide Locale Constants
+ *
+ * @var array $_territoryData
+ */
+ private static $_territoryData = array(
+ 'AD' => 'ca_AD', 'AE' => 'ar_AE', 'AF' => 'fa_AF', 'AG' => 'en_AG', 'AI' => 'en_AI',
+ 'AL' => 'sq_AL', 'AM' => 'hy_AM', 'AN' => 'pap_AN', 'AO' => 'pt_AO', 'AQ' => 'und_AQ',
+ 'AR' => 'es_AR', 'AS' => 'sm_AS', 'AT' => 'de_AT', 'AU' => 'en_AU', 'AW' => 'nl_AW',
+ 'AX' => 'sv_AX', 'AZ' => 'az_Latn_AZ', 'BA' => 'bs_BA', 'BB' => 'en_BB', 'BD' => 'bn_BD',
+ 'BE' => 'nl_BE', 'BF' => 'mos_BF', 'BG' => 'bg_BG', 'BH' => 'ar_BH', 'BI' => 'rn_BI',
+ 'BJ' => 'fr_BJ', 'BL' => 'fr_BL', 'BM' => 'en_BM', 'BN' => 'ms_BN', 'BO' => 'es_BO',
+ 'BR' => 'pt_BR', 'BS' => 'en_BS', 'BT' => 'dz_BT', 'BV' => 'und_BV', 'BW' => 'en_BW',
+ 'BY' => 'be_BY', 'BZ' => 'en_BZ', 'CA' => 'en_CA', 'CC' => 'ms_CC', 'CD' => 'sw_CD',
+ 'CF' => 'fr_CF', 'CG' => 'fr_CG', 'CH' => 'de_CH', 'CI' => 'fr_CI', 'CK' => 'en_CK',
+ 'CL' => 'es_CL', 'CM' => 'fr_CM', 'CN' => 'zh_Hans_CN', 'CO' => 'es_CO', 'CR' => 'es_CR',
+ 'CU' => 'es_CU', 'CV' => 'kea_CV', 'CX' => 'en_CX', 'CY' => 'el_CY', 'CZ' => 'cs_CZ',
+ 'DE' => 'de_DE', 'DJ' => 'aa_DJ', 'DK' => 'da_DK', 'DM' => 'en_DM', 'DO' => 'es_DO',
+ 'DZ' => 'ar_DZ', 'EC' => 'es_EC', 'EE' => 'et_EE', 'EG' => 'ar_EG', 'EH' => 'ar_EH',
+ 'ER' => 'ti_ER', 'ES' => 'es_ES', 'ET' => 'en_ET', 'FI' => 'fi_FI', 'FJ' => 'hi_FJ',
+ 'FK' => 'en_FK', 'FM' => 'chk_FM', 'FO' => 'fo_FO', 'FR' => 'fr_FR', 'GA' => 'fr_GA',
+ 'GB' => 'en_GB', 'GD' => 'en_GD', 'GE' => 'ka_GE', 'GF' => 'fr_GF', 'GG' => 'en_GG',
+ 'GH' => 'ak_GH', 'GI' => 'en_GI', 'GL' => 'iu_GL', 'GM' => 'en_GM', 'GN' => 'fr_GN',
+ 'GP' => 'fr_GP', 'GQ' => 'fan_GQ', 'GR' => 'el_GR', 'GS' => 'und_GS', 'GT' => 'es_GT',
+ 'GU' => 'en_GU', 'GW' => 'pt_GW', 'GY' => 'en_GY', 'HK' => 'zh_Hant_HK', 'HM' => 'und_HM',
+ 'HN' => 'es_HN', 'HR' => 'hr_HR', 'HT' => 'ht_HT', 'HU' => 'hu_HU', 'ID' => 'id_ID',
+ 'IE' => 'en_IE', 'IL' => 'he_IL', 'IM' => 'en_IM', 'IN' => 'hi_IN', 'IO' => 'und_IO',
+ 'IQ' => 'ar_IQ', 'IR' => 'fa_IR', 'IS' => 'is_IS', 'IT' => 'it_IT', 'JE' => 'en_JE',
+ 'JM' => 'en_JM', 'JO' => 'ar_JO', 'JP' => 'ja_JP', 'KE' => 'en_KE', 'KG' => 'ky_Cyrl_KG',
+ 'KH' => 'km_KH', 'KI' => 'en_KI', 'KM' => 'ar_KM', 'KN' => 'en_KN', 'KP' => 'ko_KP',
+ 'KR' => 'ko_KR', 'KW' => 'ar_KW', 'KY' => 'en_KY', 'KZ' => 'ru_KZ', 'LA' => 'lo_LA',
+ 'LB' => 'ar_LB', 'LC' => 'en_LC', 'LI' => 'de_LI', 'LK' => 'si_LK', 'LR' => 'en_LR',
+ 'LS' => 'st_LS', 'LT' => 'lt_LT', 'LU' => 'fr_LU', 'LV' => 'lv_LV', 'LY' => 'ar_LY',
+ 'MA' => 'ar_MA', 'MC' => 'fr_MC', 'MD' => 'ro_MD', 'ME' => 'sr_Latn_ME', 'MF' => 'fr_MF',
+ 'MG' => 'mg_MG', 'MH' => 'mh_MH', 'MK' => 'mk_MK', 'ML' => 'bm_ML', 'MM' => 'my_MM',
+ 'MN' => 'mn_Cyrl_MN', 'MO' => 'zh_Hant_MO', 'MP' => 'en_MP', 'MQ' => 'fr_MQ', 'MR' => 'ar_MR',
+ 'MS' => 'en_MS', 'MT' => 'mt_MT', 'MU' => 'mfe_MU', 'MV' => 'dv_MV', 'MW' => 'ny_MW',
+ 'MX' => 'es_MX', 'MY' => 'ms_MY', 'MZ' => 'pt_MZ', 'NA' => 'kj_NA', 'NC' => 'fr_NC',
+ 'NE' => 'ha_Latn_NE', 'NF' => 'en_NF', 'NG' => 'en_NG', 'NI' => 'es_NI', 'NL' => 'nl_NL',
+ 'NO' => 'nb_NO', 'NP' => 'ne_NP', 'NR' => 'en_NR', 'NU' => 'niu_NU', 'NZ' => 'en_NZ',
+ 'OM' => 'ar_OM', 'PA' => 'es_PA', 'PE' => 'es_PE', 'PF' => 'fr_PF', 'PG' => 'tpi_PG',
+ 'PH' => 'fil_PH', 'PK' => 'ur_PK', 'PL' => 'pl_PL', 'PM' => 'fr_PM', 'PN' => 'en_PN',
+ 'PR' => 'es_PR', 'PS' => 'ar_PS', 'PT' => 'pt_PT', 'PW' => 'pau_PW', 'PY' => 'gn_PY',
+ 'QA' => 'ar_QA', 'RE' => 'fr_RE', 'RO' => 'ro_RO', 'RS' => 'sr_Cyrl_RS', 'RU' => 'ru_RU',
+ 'RW' => 'rw_RW', 'SA' => 'ar_SA', 'SB' => 'en_SB', 'SC' => 'crs_SC', 'SD' => 'ar_SD',
+ 'SE' => 'sv_SE', 'SG' => 'en_SG', 'SH' => 'en_SH', 'SI' => 'sl_SI', 'SJ' => 'nb_SJ',
+ 'SK' => 'sk_SK', 'SL' => 'kri_SL', 'SM' => 'it_SM', 'SN' => 'fr_SN', 'SO' => 'sw_SO',
+ 'SR' => 'srn_SR', 'ST' => 'pt_ST', 'SV' => 'es_SV', 'SY' => 'ar_SY', 'SZ' => 'en_SZ',
+ 'TC' => 'en_TC', 'TD' => 'fr_TD', 'TF' => 'und_TF', 'TG' => 'fr_TG', 'TH' => 'th_TH',
+ 'TJ' => 'tg_Cyrl_TJ', 'TK' => 'tkl_TK', 'TL' => 'pt_TL', 'TM' => 'tk_TM', 'TN' => 'ar_TN',
+ 'TO' => 'to_TO', 'TR' => 'tr_TR', 'TT' => 'en_TT', 'TV' => 'tvl_TV', 'TW' => 'zh_Hant_TW',
+ 'TZ' => 'sw_TZ', 'UA' => 'uk_UA', 'UG' => 'sw_UG', 'UM' => 'en_UM', 'US' => 'en_US',
+ 'UY' => 'es_UY', 'UZ' => 'uz_Cyrl_UZ', 'VA' => 'it_VA', 'VC' => 'en_VC', 'VE' => 'es_VE',
+ 'VG' => 'en_VG', 'VI' => 'en_VI', 'VU' => 'bi_VU', 'WF' => 'wls_WF', 'WS' => 'sm_WS',
+ 'YE' => 'ar_YE', 'YT' => 'swb_YT', 'ZA' => 'en_ZA', 'ZM' => 'en_ZM', 'ZW' => 'sn_ZW'
+ );
+
+ /**
+ * Autosearch constants
+ */
+ const BROWSER = 'browser';
+ const ENVIRONMENT = 'environment';
+ const ZFDEFAULT = 'default';
+
+ /**
+ * Defines if old behaviour should be supported
+ * Old behaviour throws notices and will be deleted in future releases
+ *
+ * @var boolean
+ */
+ public static $compatibilityMode = false;
+
+ /**
+ * Internal variable
+ *
+ * @var boolean
+ */
+ private static $_breakChain = false;
+
+ /**
+ * Actual set locale
+ *
+ * @var string Locale
+ */
+ protected $_locale;
+
+ /**
+ * Automatic detected locale
+ *
+ * @var string Locales
+ */
+ protected static $_auto;
+
+ /**
+ * Browser detected locale
+ *
+ * @var string Locales
+ */
+ protected static $_browser;
+
+ /**
+ * Environment detected locale
+ *
+ * @var string Locales
+ */
+ protected static $_environment;
+
+ /**
+ * Default locale
+ *
+ * @var string Locales
+ */
+ protected static $_default = array('en' => true);
+
+ /**
+ * Generates a locale object
+ * If no locale is given a automatic search is done
+ * Then the most probable locale will be automatically set
+ * Search order is
+ * 1. Given Locale
+ * 2. HTTP Client
+ * 3. Server Environment
+ * 4. Framework Standard
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for parsing input
+ * @throws Zend_Locale_Exception When autodetection has been failed
+ */
+ public function __construct($locale = null)
+ {
+ $this->setLocale($locale);
+ }
+
+ /**
+ * Serialization Interface
+ *
+ * @return string
+ */
+ public function serialize()
+ {
+ return serialize($this);
+ }
+
+ /**
+ * Returns a string representation of the object
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return (string) $this->_locale;
+ }
+
+ /**
+ * Returns a string representation of the object
+ * Alias for toString
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toString();
+ }
+
+ /**
+ * Return the default locale
+ *
+ * @return array Returns an array of all locale string
+ */
+ public static function getDefault()
+ {
+ if ((self::$compatibilityMode === true) or (func_num_args() > 0)) {
+ if (!self::$_breakChain) {
+ self::$_breakChain = true;
+ trigger_error('You are running Zend_Locale in compatibility mode... please migrate your scripts', E_USER_NOTICE);
+ $params = func_get_args();
+ $param = null;
+ if (isset($params[0])) {
+ $param = $params[0];
+ }
+ return self::getOrder($param);
+ }
+
+ self::$_breakChain = false;
+ }
+
+ return self::$_default;
+ }
+
+ /**
+ * Sets a new default locale which will be used when no locale can be detected
+ * If provided you can set a quality between 0 and 1 (or 2 and 100)
+ * which represents the percent of quality the browser
+ * requested within HTTP
+ *
+ * @param string|Zend_Locale $locale Locale to set
+ * @param float $quality The quality to set from 0 to 1
+ * @throws Zend_Locale_Exception When a autolocale was given
+ * @throws Zend_Locale_Exception When a unknown locale was given
+ * @return void
+ */
+ public static function setDefault($locale, $quality = 1)
+ {
+ if (($locale === 'auto') or ($locale === 'root') or ($locale === 'default') or
+ ($locale === 'environment') or ($locale === 'browser')) {
+ require_once 'Zend/Locale/Exception.php';
+ throw new Zend_Locale_Exception('Only full qualified locales can be used as default!');
+ }
+
+ if (($quality < 0.1) or ($quality > 100)) {
+ require_once 'Zend/Locale/Exception.php';
+ throw new Zend_Locale_Exception("Quality must be between 0.1 and 100");
+ }
+
+ if ($quality > 1) {
+ $quality /= 100;
+ }
+
+ $locale = self::_prepareLocale($locale);
+ if (isset(self::$_localeData[(string) $locale]) === true) {
+ self::$_default = array((string) $locale => $quality);
+ } else {
+ $elocale = explode('_', (string) $locale);
+ if (isset(self::$_localeData[$elocale[0]]) === true) {
+ self::$_default = array($elocale[0] => $quality);
+ } else {
+ require_once 'Zend/Locale/Exception.php';
+ throw new Zend_Locale_Exception("Unknown locale '" . (string) $locale . "' can not be set as default!");
+ }
+ }
+
+ self::$_auto = self::getBrowser() + self::getEnvironment() + self::getDefault();
+ }
+
+ /**
+ * Expects the Systems standard locale
+ *
+ * For Windows:
+ * f.e.: LC_COLLATE=C;LC_CTYPE=German_Austria.1252;LC_MONETARY=C
+ * would be recognised as de_AT
+ *
+ * @return array
+ */
+ public static function getEnvironment()
+ {
+ if (self::$_environment !== null) {
+ return self::$_environment;
+ }
+
+ require_once 'Zend/Locale/Data/Translation.php';
+
+ $language = setlocale(LC_ALL, 0);
+ $languages = explode(';', $language);
+ $languagearray = array();
+
+ foreach ($languages as $locale) {
+ if (strpos($locale, '=') !== false) {
+ $language = substr($locale, strpos($locale, '='));
+ $language = substr($language, 1);
+ }
+
+ if ($language !== 'C') {
+ if (strpos($language, '.') !== false) {
+ $language = substr($language, 0, strpos($language, '.'));
+ } else if (strpos($language, '@') !== false) {
+ $language = substr($language, 0, strpos($language, '@'));
+ }
+
+ $language = str_ireplace(
+ array_keys(Zend_Locale_Data_Translation::$languageTranslation),
+ array_values(Zend_Locale_Data_Translation::$languageTranslation),
+ (string) $language
+ );
+
+ $language = str_ireplace(
+ array_keys(Zend_Locale_Data_Translation::$regionTranslation),
+ array_values(Zend_Locale_Data_Translation::$regionTranslation),
+ $language
+ );
+
+ if (isset(self::$_localeData[$language]) === true) {
+ $languagearray[$language] = 1;
+ if (strpos($language, '_') !== false) {
+ $languagearray[substr($language, 0, strpos($language, '_'))] = 1;
+ }
+ }
+ }
+ }
+
+ self::$_environment = $languagearray;
+ return $languagearray;
+ }
+
+ /**
+ * Return an array of all accepted languages of the client
+ * Expects RFC compilant Header !!
+ *
+ * The notation can be :
+ * de,en-UK-US;q=0.5,fr-FR;q=0.2
+ *
+ * @return array - list of accepted languages including quality
+ */
+ public static function getBrowser()
+ {
+ if (self::$_browser !== null) {
+ return self::$_browser;
+ }
+
+ $httplanguages = getenv('HTTP_ACCEPT_LANGUAGE');
+ if (empty($httplanguages) && array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {
+ $httplanguages = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
+ }
+
+ $languages = array();
+ if (empty($httplanguages)) {
+ return $languages;
+ }
+
+ $accepted = preg_split('/,\s*/', $httplanguages);
+
+ foreach ($accepted as $accept) {
+ $match = null;
+ $result = preg_match('/^([a-z]{1,8}(?:[-_][a-z]{1,8})*)(?:;\s*q=(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3})?))?$/i',
+ $accept, $match);
+
+ if ($result < 1) {
+ continue;
+ }
+
+ if (isset($match[2]) === true) {
+ $quality = (float) $match[2];
+ } else {
+ $quality = 1.0;
+ }
+
+ $countrys = explode('-', $match[1]);
+ $region = array_shift($countrys);
+
+ $country2 = explode('_', $region);
+ $region = array_shift($country2);
+
+ foreach ($countrys as $country) {
+ $languages[$region . '_' . strtoupper($country)] = $quality;
+ }
+
+ foreach ($country2 as $country) {
+ $languages[$region . '_' . strtoupper($country)] = $quality;
+ }
+
+ if ((isset($languages[$region]) === false) || ($languages[$region] < $quality)) {
+ $languages[$region] = $quality;
+ }
+ }
+
+ self::$_browser = $languages;
+ return $languages;
+ }
+
+ /**
+ * Sets a new locale
+ *
+ * @param string|Zend_Locale $locale (Optional) New locale to set
+ * @return void
+ */
+ public function setLocale($locale = null)
+ {
+ $locale = self::_prepareLocale($locale);
+
+ if (isset(self::$_localeData[(string) $locale]) === false) {
+ $region = substr((string) $locale, 0, 3);
+ if (isset($region[2]) === true) {
+ if (($region[2] === '_') or ($region[2] === '-')) {
+ $region = substr($region, 0, 2);
+ }
+ }
+
+ if (isset(self::$_localeData[(string) $region]) === true) {
+ $this->_locale = $region;
+ } else {
+ $this->_locale = 'root';
+ }
+ } else {
+ $this->_locale = $locale;
+ }
+ }
+
+ /**
+ * Returns the language part of the locale
+ *
+ * @return string
+ */
+ public function getLanguage()
+ {
+ $locale = explode('_', $this->_locale);
+ return $locale[0];
+ }
+
+ /**
+ * Returns the region part of the locale if available
+ *
+ * @return string|false - Regionstring
+ */
+ public function getRegion()
+ {
+ $locale = explode('_', $this->_locale);
+ if (isset($locale[1]) === true) {
+ return $locale[1];
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the accepted charset of the client
+ *
+ * @return string
+ */
+ public static function getHttpCharset()
+ {
+ $httpcharsets = getenv('HTTP_ACCEPT_CHARSET');
+
+ $charsets = array();
+ if ($httpcharsets === false) {
+ return $charsets;
+ }
+
+ $accepted = preg_split('/,\s*/', $httpcharsets);
+ foreach ($accepted as $accept) {
+ if (empty($accept) === true) {
+ continue;
+ }
+
+ if (strpos($accept, ';') !== false) {
+ $quality = (float) substr($accept, (strpos($accept, '=') + 1));
+ $pos = substr($accept, 0, strpos($accept, ';'));
+ $charsets[$pos] = $quality;
+ } else {
+ $quality = 1.0;
+ $charsets[$accept] = $quality;
+ }
+ }
+
+ return $charsets;
+ }
+
+ /**
+ * Returns true if both locales are equal
+ *
+ * @param Zend_Locale $object Locale to check for equality
+ * @return boolean
+ */
+ public function equals(Zend_Locale $object)
+ {
+ if ($object->toString() === $this->toString()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns localized informations as array, supported are several
+ * types of informations.
+ * For detailed information about the types look into the documentation
+ *
+ * @param string $path (Optional) Type of information to return
+ * @param string|Zend_Locale $locale (Optional) Locale|Language for which this informations should be returned
+ * @param string $value (Optional) Value for detail list
+ * @return array Array with the wished information in the given language
+ */
+ public static function getTranslationList($path = null, $locale = null, $value = null)
+ {
+ require_once 'Zend/Locale/Data.php';
+ $locale = self::findLocale($locale);
+ $result = Zend_Locale_Data::getList($locale, $path, $value);
+ if (empty($result) === true) {
+ return false;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns an array with the name of all languages translated to the given language
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for language translation
+ * @return array
+ * @deprecated
+ */
+ public static function getLanguageTranslationList($locale = null)
+ {
+ trigger_error("The method getLanguageTranslationList is deprecated. Use getTranslationList('language', $locale) instead", E_USER_NOTICE);
+ return self::getTranslationList('language', $locale);
+ }
+
+ /**
+ * Returns an array with the name of all scripts translated to the given language
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for script translation
+ * @return array
+ * @deprecated
+ */
+ public static function getScriptTranslationList($locale = null)
+ {
+ trigger_error("The method getScriptTranslationList is deprecated. Use getTranslationList('script', $locale) instead", E_USER_NOTICE);
+ return self::getTranslationList('script', $locale);
+ }
+
+ /**
+ * Returns an array with the name of all countries translated to the given language
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for country translation
+ * @return array
+ * @deprecated
+ */
+ public static function getCountryTranslationList($locale = null)
+ {
+ trigger_error("The method getCountryTranslationList is deprecated. Use getTranslationList('territory', $locale, 2) instead", E_USER_NOTICE);
+ return self::getTranslationList('territory', $locale, 2);
+ }
+
+ /**
+ * Returns an array with the name of all territories translated to the given language
+ * All territories contains other countries.
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for territory translation
+ * @return array
+ * @deprecated
+ */
+ public static function getTerritoryTranslationList($locale = null)
+ {
+ trigger_error("The method getTerritoryTranslationList is deprecated. Use getTranslationList('territory', $locale, 1) instead", E_USER_NOTICE);
+ return self::getTranslationList('territory', $locale, 1);
+ }
+
+ /**
+ * Returns a localized information string, supported are several types of informations.
+ * For detailed information about the types look into the documentation
+ *
+ * @param string $value Name to get detailed information about
+ * @param string $path (Optional) Type of information to return
+ * @param string|Zend_Locale $locale (Optional) Locale|Language for which this informations should be returned
+ * @return string|false The wished information in the given language
+ */
+ public static function getTranslation($value = null, $path = null, $locale = null)
+ {
+ require_once 'Zend/Locale/Data.php';
+ $locale = self::findLocale($locale);
+ $result = Zend_Locale_Data::getContent($locale, $path, $value);
+ if (empty($result) === true && '0' !== $result) {
+ return false;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns the localized language name
+ *
+ * @param string $value Name to get detailed information about
+ * @param string $locale (Optional) Locale for language translation
+ * @return array
+ * @deprecated
+ */
+ public static function getLanguageTranslation($value, $locale = null)
+ {
+ trigger_error("The method getLanguageTranslation is deprecated. Use getTranslation($value, 'language', $locale) instead", E_USER_NOTICE);
+ return self::getTranslation($value, 'language', $locale);
+ }
+
+ /**
+ * Returns the localized script name
+ *
+ * @param string $value Name to get detailed information about
+ * @param string $locale (Optional) locale for script translation
+ * @return array
+ * @deprecated
+ */
+ public static function getScriptTranslation($value, $locale = null)
+ {
+ trigger_error("The method getScriptTranslation is deprecated. Use getTranslation($value, 'script', $locale) instead", E_USER_NOTICE);
+ return self::getTranslation($value, 'script', $locale);
+ }
+
+ /**
+ * Returns the localized country name
+ *
+ * @param string $value Name to get detailed information about
+ * @param string|Zend_Locale $locale (Optional) Locale for country translation
+ * @return array
+ * @deprecated
+ */
+ public static function getCountryTranslation($value, $locale = null)
+ {
+ trigger_error("The method getCountryTranslation is deprecated. Use getTranslation($value, 'country', $locale) instead", E_USER_NOTICE);
+ return self::getTranslation($value, 'country', $locale);
+ }
+
+ /**
+ * Returns the localized territory name
+ * All territories contains other countries.
+ *
+ * @param string $value Name to get detailed information about
+ * @param string|Zend_Locale $locale (Optional) Locale for territory translation
+ * @return array
+ * @deprecated
+ */
+ public static function getTerritoryTranslation($value, $locale = null)
+ {
+ trigger_error("The method getTerritoryTranslation is deprecated. Use getTranslation($value, 'territory', $locale) instead", E_USER_NOTICE);
+ return self::getTranslation($value, 'territory', $locale);
+ }
+
+ /**
+ * Returns an array with translated yes strings
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for language translation (defaults to $this locale)
+ * @return array
+ */
+ public static function getQuestion($locale = null)
+ {
+ require_once 'Zend/Locale/Data.php';
+ $locale = self::findLocale($locale);
+ $quest = Zend_Locale_Data::getList($locale, 'question');
+ $yes = explode(':', $quest['yes']);
+ $no = explode(':', $quest['no']);
+ $quest['yes'] = $yes[0];
+ $quest['yesarray'] = $yes;
+ $quest['no'] = $no[0];
+ $quest['noarray'] = $no;
+ $quest['yesexpr'] = self::_prepareQuestionString($yes);
+ $quest['noexpr'] = self::_prepareQuestionString($no);
+
+ return $quest;
+ }
+
+ /**
+ * Internal function for preparing the returned question regex string
+ *
+ * @param string $input Regex to parse
+ * @return string
+ */
+ private static function _prepareQuestionString($input)
+ {
+ $regex = '';
+ if (is_array($input) === true) {
+ $regex = '^';
+ $start = true;
+ foreach ($input as $row) {
+ if ($start === false) {
+ $regex .= '|';
+ }
+
+ $start = false;
+ $regex .= '(';
+ $one = null;
+ if (strlen($row) > 2) {
+ $one = true;
+ }
+
+ foreach (str_split($row, 1) as $char) {
+ $regex .= '[' . $char;
+ $regex .= strtoupper($char) . ']';
+ if ($one === true) {
+ $one = false;
+ $regex .= '(';
+ }
+ }
+
+ if ($one === false) {
+ $regex .= ')';
+ }
+
+ $regex .= '?)';
+ }
+ }
+
+ return $regex;
+ }
+
+ /**
+ * Checks if a locale identifier is a real locale or not
+ * Examples:
+ * "en_XX" refers to "en", which returns true
+ * "XX_yy" refers to "root", which returns false
+ *
+ * @param string|Zend_Locale $locale Locale to check for
+ * @param boolean $strict (Optional) If true, no rerouting will be done when checking
+ * @param boolean $compatible (DEPRECATED) Only for internal usage, brakes compatibility mode
+ * @return boolean If the locale is known dependend on the settings
+ */
+ public static function isLocale($locale, $strict = false, $compatible = true)
+ {
+ if (($locale instanceof Zend_Locale)
+ || (is_string($locale) && array_key_exists($locale, self::$_localeData))
+ ) {
+ return true;
+ }
+
+ if (($locale === null) || (!is_string($locale) and !is_array($locale))) {
+ return false;
+ }
+
+ try {
+ $locale = self::_prepareLocale($locale, $strict);
+ } catch (Zend_Locale_Exception $e) {
+ return false;
+ }
+
+ if (($compatible === true) and (self::$compatibilityMode === true)) {
+ trigger_error('You are running Zend_Locale in compatibility mode... please migrate your scripts', E_USER_NOTICE);
+ if (isset(self::$_localeData[$locale]) === true) {
+ return $locale;
+ } else if (!$strict) {
+ $locale = explode('_', $locale);
+ if (isset(self::$_localeData[$locale[0]]) === true) {
+ return $locale[0];
+ }
+ }
+ } else {
+ if (isset(self::$_localeData[$locale]) === true) {
+ return true;
+ } else if (!$strict) {
+ $locale = explode('_', $locale);
+ if (isset(self::$_localeData[$locale[0]]) === true) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Finds the proper locale based on the input
+ * Checks if it exists, degrades it when necessary
+ * Detects registry locale and when all fails tries to detect a automatic locale
+ * Returns the found locale as string
+ *
+ * @param string $locale
+ * @throws Zend_Locale_Exception When the given locale is no locale or the autodetection fails
+ * @return string
+ */
+ public static function findLocale($locale = null)
+ {
+ if ($locale === null) {
+ require_once 'Zend/Registry.php';
+ if (Zend_Registry::isRegistered('Zend_Locale')) {
+ $locale = Zend_Registry::get('Zend_Locale');
+ }
+ }
+
+ if ($locale === null) {
+ $locale = new Zend_Locale();
+ }
+
+ if (!Zend_Locale::isLocale($locale, true, false)) {
+ if (!Zend_Locale::isLocale($locale, false, false)) {
+ $locale = Zend_Locale::getLocaleToTerritory($locale);
+
+ if (empty($locale)) {
+ require_once 'Zend/Locale/Exception.php';
+ throw new Zend_Locale_Exception("The locale '$locale' is no known locale");
+ }
+ } else {
+ $locale = new Zend_Locale($locale);
+ }
+ }
+
+ $locale = self::_prepareLocale($locale);
+ return $locale;
+ }
+
+ /**
+ * Returns the expected locale for a given territory
+ *
+ * @param string $territory Territory for which the locale is being searched
+ * @return string|null Locale string or null when no locale has been found
+ */
+ public static function getLocaleToTerritory($territory)
+ {
+ $territory = strtoupper($territory);
+ if (array_key_exists($territory, self::$_territoryData)) {
+ return self::$_territoryData[$territory];
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns a list of all known locales where the locale is the key
+ * Only real locales are returned, the internal locales 'root', 'auto', 'browser'
+ * and 'environment' are suppressed
+ *
+ * @return array List of all Locales
+ */
+ public static function getLocaleList()
+ {
+ $list = self::$_localeData;
+ unset($list['root']);
+ unset($list['auto']);
+ unset($list['browser']);
+ unset($list['environment']);
+ return $list;
+ }
+
+ /**
+ * Returns the set cache
+ *
+ * @return Zend_Cache_Core The set cache
+ */
+ public static function getCache()
+ {
+ require_once 'Zend/Locale/Data.php';
+ return Zend_Locale_Data::getCache();
+ }
+
+ /**
+ * Sets a cache
+ *
+ * @param Zend_Cache_Core $cache Cache to set
+ * @return void
+ */
+ public static function setCache(Zend_Cache_Core $cache)
+ {
+ require_once 'Zend/Locale/Data.php';
+ Zend_Locale_Data::setCache($cache);
+ }
+
+ /**
+ * Returns true when a cache is set
+ *
+ * @return boolean
+ */
+ public static function hasCache()
+ {
+ require_once 'Zend/Locale/Data.php';
+ return Zend_Locale_Data::hasCache();
+ }
+
+ /**
+ * Removes any set cache
+ *
+ * @return void
+ */
+ public static function removeCache()
+ {
+ require_once 'Zend/Locale/Data.php';
+ Zend_Locale_Data::removeCache();
+ }
+
+ /**
+ * Clears all set cache data
+ *
+ * @param string $tag Tag to clear when the default tag name is not used
+ * @return void
+ */
+ public static function clearCache($tag = null)
+ {
+ require_once 'Zend/Locale/Data.php';
+ Zend_Locale_Data::clearCache($tag);
+ }
+
+ /**
+ * Disables the set cache
+ *
+ * @param boolean $flag True disables any set cache, default is false
+ * @return void
+ */
+ public static function disableCache($flag)
+ {
+ require_once 'Zend/Locale/Data.php';
+ Zend_Locale_Data::disableCache($flag);
+ }
+
+ /**
+ * Internal function, returns a single locale on detection
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale to work on
+ * @param boolean $strict (Optional) Strict preparation
+ * @throws Zend_Locale_Exception When no locale is set which is only possible when the class was wrong extended
+ * @return string
+ */
+ private static function _prepareLocale($locale, $strict = false)
+ {
+ if ($locale instanceof Zend_Locale) {
+ $locale = $locale->toString();
+ }
+
+ if (is_array($locale)) {
+ return '';
+ }
+
+ if (empty(self::$_auto) === true) {
+ self::$_browser = self::getBrowser();
+ self::$_environment = self::getEnvironment();
+ self::$_breakChain = true;
+ self::$_auto = self::getBrowser() + self::getEnvironment() + self::getDefault();
+ }
+
+ if (!$strict) {
+ if ($locale === 'browser') {
+ $locale = self::$_browser;
+ }
+
+ if ($locale === 'environment') {
+ $locale = self::$_environment;
+ }
+
+ if ($locale === 'default') {
+ $locale = self::$_default;
+ }
+
+ if (($locale === 'auto') or ($locale === null)) {
+ $locale = self::$_auto;
+ }
+
+ if (is_array($locale) === true) {
+ $locale = key($locale);
+ }
+ }
+
+ // This can only happen when someone extends Zend_Locale and erases the default
+ if ($locale === null) {
+ require_once 'Zend/Locale/Exception.php';
+ throw new Zend_Locale_Exception('Autodetection of Locale has been failed!');
+ }
+
+ if (strpos($locale, '-') !== false) {
+ $locale = strtr($locale, '-', '_');
+ }
+
+ $parts = explode('_', $locale);
+ if (!isset(self::$_localeData[$parts[0]])) {
+ if ((count($parts) == 1) && array_key_exists($parts[0], self::$_territoryData)) {
+ return self::$_territoryData[$parts[0]];
+ }
+
+ return '';
+ }
+
+ foreach($parts as $key => $value) {
+ if ((strlen($value) < 2) || (strlen($value) > 3)) {
+ unset($parts[$key]);
+ }
+ }
+
+ $locale = implode('_', $parts);
+ return (string) $locale;
+ }
+
+ /**
+ * Search the locale automatically and return all used locales
+ * ordered by quality
+ *
+ * Standard Searchorder is Browser, Environment, Default
+ *
+ * @param string $searchorder (Optional) Searchorder
+ * @return array Returns an array of all detected locales
+ */
+ public static function getOrder($order = null)
+ {
+ switch ($order) {
+ case self::ENVIRONMENT:
+ self::$_breakChain = true;
+ $languages = self::getEnvironment() + self::getBrowser() + self::getDefault();
+ break;
+
+ case self::ZFDEFAULT:
+ self::$_breakChain = true;
+ $languages = self::getDefault() + self::getEnvironment() + self::getBrowser();
+ break;
+
+ default:
+ self::$_breakChain = true;
+ $languages = self::getBrowser() + self::getEnvironment() + self::getDefault();
+ break;
+ }
+
+ return $languages;
+ }
+}
diff --git a/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Locale/Data.php b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Locale/Data.php
new file mode 100644
index 0000000..7c8836c
--- /dev/null
+++ b/includes/plugins/wirecard_checkout_page/version/105/paymentmethod/classes/lib/Zend/Locale/Data.php
@@ -0,0 +1,1518 @@
+
+ * If not, please click here
+ + + +