diff --git a/composer.json b/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..89f122fac35b7a8dc748be3e771f75e810e04184 --- /dev/null +++ b/composer.json @@ -0,0 +1,65 @@ +{ + "name": "vufind/vufind", + "description": "A flexible discovery layer.", + "authors": [ + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu" + } + ], + "license": "GPL-2.0", + "repositories": [ + { + "type": "composer", + "url": "https://packages.zendframework.com/" + }, + { + "type": "pear", + "url": "http://pear.php.net" + }, + { + "type": "vcs", + "url": "https://github.com/demiankatz/Summon" + }, + { + "type": "package", + "package": { + "name": "mobileesp/mdetect", + "version": "dev-master", + "dist": { + "url": "http://mobileesp.googlecode.com/svn/PHP/mdetect.php", + "type": "file" + }, + "autoload": { + "classmap": ["/"] + } + } + }, + { + "type": "package", + "package": { + "name": "johnwohlers/sip2", + "version": "dev-master", + "dist": { + "url": "https://php-sip2.googlecode.com/svn/trunk/sip2.class.php", + "type": "file" + }, + "autoload": { + "classmap": ["/"] + } + } + } + ], + "require": { + "johnwohlers/sip2": "dev-master", + "mobileesp/mdetect": "dev-master", + "pear-pear.php.net/file_marc": "*", + "pear-pear.php.net/pear": "*", + "pear-pear.php.net/validate_ispn": "*", + "serialssolutions/summon": "dev-master", + "symfony/yaml": "*", + "zendframework/zendframework": "2.1.2", + "zendframework/zendrest": "2.*", + "zendframework/zendservice-amazon": "2.*" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000000000000000000000000000000000000..15a460da409b9ed1c74d8189d84e51ad474b6bb8 --- /dev/null +++ b/composer.lock @@ -0,0 +1,564 @@ +{ + "hash": "709e2b5d13b45aebfbf45b88c857b8dd", + "packages": [ + { + "name": "johnwohlers/sip2", + "version": "dev-master", + "dist": { + "type": "file", + "url": "https://php-sip2.googlecode.com/svn/trunk/sip2.class.php", + "reference": null, + "shasum": null + }, + "type": "library", + "autoload": { + "classmap": [ + "/" + ] + } + }, + { + "name": "mobileesp/mdetect", + "version": "dev-master", + "dist": { + "type": "file", + "url": "http://mobileesp.googlecode.com/svn/PHP/mdetect.php", + "reference": null, + "shasum": null + }, + "type": "library", + "autoload": { + "classmap": [ + "/" + ] + } + }, + { + "name": "pear-pear.php.net/Archive_Tar", + "version": "1.3.11", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Archive_Tar-1.3.11.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.3.0.0" + }, + "replace": { + "pear-pear/archive_tar": "== 1.3.11.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "This class provides handling of tar files in PHP.\nIt supports creating, listing, extracting and adding to tar files.\nGzip support is available if PHP has the zlib extension built-in or\nloaded. Bz2 compression is also supported with the bz2 extension loaded." + }, + { + "name": "pear-pear.php.net/Console_Getopt", + "version": "1.3.1", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Console_Getopt-1.3.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.3.0.0" + }, + "replace": { + "pear-pear/console_getopt": "== 1.3.1.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "This is a PHP implementation of "getopt" supporting both\nshort and long options." + }, + { + "name": "pear-pear.php.net/File_MARC", + "version": "0.7.1", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/File_MARC-0.7.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "pear-pear.php.net/structures_linkedlist": "*", + "php": ">=5.2.0.0" + }, + "replace": { + "pear-pear/file_marc": "== 0.7.1.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "The standard for machine-readable cataloging (MARC) records is documented at http://loc.gov/marc/. This package enables you to read existing MARC records from a file, string, or (using the YAZ extension), from a Z39.50 source. You can also use this package to create new MARC records.\n\nThis package is based on the PHP MARC package, originally called "php-marc", that is part of the Emilda Project (http://www.emilda.org). Christoffer Landtman generously agreed to make the "php-marc" code available under the GNU LGPL so it could be used as the basis of this PEAR package." + }, + { + "name": "pear-pear.php.net/PEAR", + "version": "1.9.4", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/PEAR-1.9.4.tgz", + "reference": null, + "shasum": null + }, + "require": { + "ext-pcre": "*", + "ext-xml": "*", + "pear-pear.php.net/archive_tar": ">=1.3.7.0", + "pear-pear.php.net/console_getopt": ">=1.2.0.0", + "pear-pear.php.net/structures_graph": ">=1.0.2.0", + "pear-pear.php.net/xml_util": ">=1.2.0.0", + "php": ">=4.4.0.0,!=5.0.0.0,!=5.1.0.0,!=5.1.1.0,!=5.1.2.0,!=5.1.3.0,!=5.1.4.0,!=5.1.5.0" + }, + "conflict": { + "pear-pear.php.net/pear_frontend_gtk": "<0.4.0.0", + "pear-pear.php.net/pear_frontend_web": "<=0.4.0.0" + }, + "replace": { + "pear-pear/pear": "== 1.9.4.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "The PEAR package contains:\n * the PEAR installer, for creating, distributing\n and installing packages\n * the PEAR_Exception PHP5 error handling mechanism\n * the PEAR_ErrorStack advanced error handling mechanism\n * the PEAR_Error error handling mechanism\n * the OS_Guess class for retrieving info about the OS\n where PHP is running on\n * the System class for quick handling of common operations\n with files and directories\n * the PEAR base class\n Features in a nutshell:\n * full support for channels\n * pre-download dependency validation\n * new package.xml 2.0 format allows tremendous flexibility while maintaining BC\n * support for optional dependency groups and limited support for sub-packaging\n * robust dependency support\n * full dependency validation on uninstall\n * remote install for hosts with only ftp access - no more problems with\n restricted host installation\n * full support for mirroring\n * support for bundling several packages into a single tarball\n * support for static dependencies on a url-based package\n * support for custom file roles and installation tasks" + }, + { + "name": "pear-pear.php.net/Structures_Graph", + "version": "1.0.4", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Structures_Graph-1.0.4.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.2.0.0" + }, + "replace": { + "pear-pear/structures_graph": "== 1.0.4.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "Structures_Graph is a package for creating and manipulating graph datastructures. It allows building of directed\nand undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing\nas well as for characteristic extraction from the graph topology." + }, + { + "name": "pear-pear.php.net/Structures_LinkedList", + "version": "0.2.2", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Structures_LinkedList-0.2.2.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.0.0.0" + }, + "replace": { + "pear-pear/structures_linkedlist": "== 0.2.2.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "A singly-linked list offers the ability to insert or delete\n nodes at any point within the list. A doubly-linked list also offers the\n ability to request previous nodes in the list." + }, + { + "name": "pear-pear.php.net/Validate", + "version": "0.8.5", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Validate-0.8.5.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.2.0.0" + }, + "replace": { + "pear-pear/validate": "== 0.8.5.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "Package to validate various datas. It includes :\n - numbers (min/max, decimal or not)\n - email (syntax, domain check, rfc822)\n - string (predifined type alpha upper and/or lowercase, numeric,...)\n - date (min, max, rfc822 compliant)\n - uri (RFC2396)\n - possibility valid multiple data with a single method call (::multiple)" + }, + { + "name": "pear-pear.php.net/Validate_ISPN", + "version": "0.6.1", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Validate_ISPN-0.6.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "pear-pear.php.net/validate": ">=0.5.0.0", + "php": ">=4.1.0.0" + }, + "replace": { + "pear-pear/validate_ispn": "== 0.6.1.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "Package containes ISPN (International Standard Product Numbers) validations such as:\n * ISSN\n * ISBN\n * ISMN\n * ISRC (International Standard Recording Code)\n * EAN8\n * EAN13\n * EAN14\n * UCC12\n * SSCC" + }, + { + "name": "pear-pear.php.net/XML_Util", + "version": "1.2.1", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/XML_Util-1.2.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "ext-pcre": "*", + "php": ">=4.3.0.0" + }, + "replace": { + "pear-pear/xml_util": "== 1.2.1.0" + }, + "type": "pear-library", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "Selection of methods that are often needed when working with XML documents. Functionality includes creating of attribute lists from arrays, creation of tags, validation of XML names and more." + }, + { + "name": "serialssolutions/summon", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/demiankatz/Summon.git", + "reference": "c77862d88e5d928d04ef8491d63177c91a4732de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/demiankatz/Summon/zipball/c77862d88e5d928d04ef8491d63177c91a4732de", + "reference": "c77862d88e5d928d04ef8491d63177c91a4732de", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "SerialsSolutions": "" + } + }, + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu" + } + ], + "description": "Library for interacting with Serials Solutions' Summon API.", + "support": { + "source": "https://github.com/demiankatz/Summon/tree/master", + "issues": "https://github.com/demiankatz/Summon/issues" + }, + "time": "2013-02-22 14:04:58" + }, + { + "name": "symfony/yaml", + "version": "v2.1.7", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml", + "reference": "v2.1.7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.1.7", + "reference": "v2.1.7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml": "" + } + }, + "notification-url": "http://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2013-01-17 21:21:51" + }, + { + "name": "zendframework/zendframework", + "version": "2.1.2", + "source": { + "type": "git", + "url": "git://github.com/zendframework/zf2.git", + "reference": "release-2.1.2" + }, + "dist": { + "type": "zip", + "url": "http://packages.zendframework.com/releases/ZendFramework-2.1.2/ZendFramework-2.1.2.zip", + "reference": "release-2.1.2", + "shasum": "fd99fc5ce007c5856e3817f351a2184f7e1f4a98" + }, + "require": { + "php": ">=5.3.3" + }, + "replace": { + "zendframework/zend-acl": "self.version", + "zendframework/zend-authentication": "self.version", + "zendframework/zend-barcode": "self.version", + "zendframework/zend-cache": "self.version", + "zendframework/zend-captcha": "self.version", + "zendframework/zend-code": "self.version", + "zendframework/zend-config": "self.version", + "zendframework/zend-console": "self.version", + "zendframework/zend-crypt": "self.version", + "zendframework/zend-db": "self.version", + "zendframework/zend-di": "self.version", + "zendframework/zend-dom": "self.version", + "zendframework/zend-escaper": "self.version", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-feed": "self.version", + "zendframework/zend-file": "self.version", + "zendframework/zend-filter": "self.version", + "zendframework/zend-form": "self.version", + "zendframework/zend-http": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-inputfilter": "self.version", + "zendframework/zend-json": "self.version", + "zendframework/zend-ldap": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-log": "self.version", + "zendframework/zend-mail": "self.version", + "zendframework/zend-markup": "self.version", + "zendframework/zend-math": "self.version", + "zendframework/zend-memory": "self.version", + "zendframework/zend-mime": "self.version", + "zendframework/zend-modulemanager": "self.version", + "zendframework/zend-mvc": "self.version", + "zendframework/zend-navigation": "self.version", + "zendframework/zend-paginator": "self.version", + "zendframework/zend-progressbar": "self.version", + "zendframework/zend-serializer": "self.version", + "zendframework/zend-server": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-session": "self.version", + "zendframework/zend-soap": "self.version", + "zendframework/zend-stdlib": "self.version", + "zendframework/zend-tag": "self.version", + "zendframework/zend-text": "self.version", + "zendframework/zend-uri": "self.version", + "zendframework/zend-validator": "self.version", + "zendframework/zend-view": "self.version", + "zendframework/zend-xmlrpc": "self.version" + }, + "require-dev": { + "doctrine/common": ">=2.1" + }, + "suggest": { + "doctrine/common": "Doctrine\\Common >=2.1 for annotation features", + "ext-intl": "ext/intl for i18n features", + "pecl-weakref": "Implementation of weak references for Zend\\Stdlib\\CallbackHandler", + "zendframework/zendpdf": "ZendPdf for creating PDF representations of barcodes", + "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha for rendering ReCaptchas in Zend\\Captcha and/or Zend\\Form" + }, + "type": "library", + "autoload": { + "psr-0": { + "Zend\\": "library/", + "ZendTest\\": "tests/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": "Zend Framework 2", + "keywords": [ + "framework", + "zf2" + ], + "support": { + "email": "fw-general-subscribe@lists.zend.com", + "irc": "irc://irc.freenode.net/zftalk", + "issues": "https://github.com/zendframework/zf2/issues", + "source": "https://github.com/zendframework/zf2" + } + }, + { + "name": "zendframework/zendrest", + "version": "2.0.1", + "dist": { + "type": "zip", + "url": "http://packages.zendframework.com/composer/ZendRest-2.0.1.zip", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-http": ">=2.0.0", + "zendframework/zend-uri": ">=2.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "ZendRest": "library/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": " ", + "homepage": "http://packages.zendframework.com/", + "keywords": [ + "rest", + "zf2" + ], + "support": { + "email": "fw-general-subscribe@lists.zend.com", + "irc": "irc://irc.freenode.net/zftalk", + "issues": "https://github.com/zendframework/zf2/issues", + "source": "https://github.com/zendframework/zf2" + } + }, + { + "name": "zendframework/zendservice-amazon", + "version": "2.0.2", + "dist": { + "type": "zip", + "url": "http://packages.zendframework.com/composer/ZendService_Amazon-2.0.2.zip", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-crypt": ">=2.0.0", + "zendframework/zend-http": ">=2.0.0", + "zendframework/zend-json": ">=2.0.0", + "zendframework/zendrest": ">=2.0.0" + }, + "require-dev": { + "zendframework/zend-i18n": ">=2.0.0" + }, + "suggest": { + "zendframework/zend-uri": "Zend\\Uri component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "ZendService": "library/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": "OOP wrapper for the Amazon web service", + "homepage": "http://packages.zendframework.com/", + "keywords": [ + "amazon", + "ec2", + "s3", + "simpledb", + "sqs", + "zf2" + ], + "support": { + "email": "fw-general-subscribe@lists.zend.com", + "irc": "irc://irc.freenode.net/zftalk", + "issues": "https://github.com/zendframework/zf2/issues", + "source": "https://github.com/zendframework/zf2" + } + } + ], + "packages-dev": null, + "aliases": [ + + ], + "minimum-stability": "stable", + "stability-flags": { + "johnwohlers/sip2": 20, + "mobileesp/mdetect": 20, + "serialssolutions/summon": 20 + } +} diff --git a/vendor/README.md b/vendor/README.md deleted file mode 100644 index 52144c946fd5cee9f03018a3a077fa8199ce4eec..0000000000000000000000000000000000000000 --- a/vendor/README.md +++ /dev/null @@ -1 +0,0 @@ -This vendor/ directory is where third-party modules should be installed. diff --git a/vendor/Symfony/Component/Yaml/.gitattributes b/vendor/Symfony/Component/Yaml/.gitattributes deleted file mode 100644 index 80481513cff2c5c6cde0c1bff5655bcde5f34976..0000000000000000000000000000000000000000 --- a/vendor/Symfony/Component/Yaml/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/Tests export-ignore -phpunit.xml.dist export-ignore diff --git a/vendor/autoload.php b/vendor/autoload.php index 85087dda3e7fc32eb7f4b480a3835b36eb76cadd..4177d578fc3d8994aff7033e0f90f2ddda5b62fe 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -1,25 +1,7 @@ <?php // autoload.php generated by Composer -if (!class_exists('Composer\\Autoload\\ClassLoader', false)) { - require __DIR__ . '/composer' . '/ClassLoader.php'; -} -return call_user_func(function() { - $loader = new \Composer\Autoload\ClassLoader(); - $composerDir = __DIR__ . '/composer'; +require_once __DIR__ . '/composer' . '/autoload_real.php'; - $map = require $composerDir . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->add($namespace, $path); - } - - $classMap = require $composerDir . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - - $loader->register(); - - return $loader; -}); +return ComposerAutoloaderInit2d7591a4f6c6287536d5b7aa8ddbb5d9::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 5b9574e9329f386cefe47a2476f01763571dedff..596c65d0fe522b477bb6c0e26422e9d04013aca6 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -75,34 +75,67 @@ class ClassLoader } /** - * Registers a set of classes + * Registers a set of classes, merging with any others previously set. * - * @param string $prefix The classes prefix - * @param array|string $paths The location(s) of the classes + * @param string $prefix The classes prefix + * @param array|string $paths The location(s) of the classes + * @param bool $prepend Prepend the location(s) */ - public function add($prefix, $paths) + public function add($prefix, $paths, $prepend = false) { if (!$prefix) { - foreach ((array) $paths as $path) { - $this->fallbackDirs[] = $path; + if ($prepend) { + $this->fallbackDirs = array_merge( + (array) $paths, + $this->fallbackDirs + ); + } else { + $this->fallbackDirs = array_merge( + $this->fallbackDirs, + (array) $paths + ); } return; } - if (isset($this->prefixes[$prefix])) { + if (!isset($this->prefixes[$prefix])) { + $this->prefixes[$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixes[$prefix] = array_merge( + (array) $paths, + $this->prefixes[$prefix] + ); + } else { $this->prefixes[$prefix] = array_merge( $this->prefixes[$prefix], (array) $paths ); - } else { - $this->prefixes[$prefix] = (array) $paths; } } + /** + * Registers a set of classes, replacing any others previously set. + * + * @param string $prefix The classes prefix + * @param array|string $paths The location(s) of the classes + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirs = (array) $paths; + + return; + } + $this->prefixes[$prefix] = (array) $paths; + } + /** * Turns on searching the include path for class files. * - * @param Boolean $useIncludePath + * @param bool $useIncludePath */ public function setUseIncludePath($useIncludePath) { @@ -113,7 +146,7 @@ class ClassLoader * Can be used to check if the autoloader uses the include path to check * for classes. * - * @return Boolean + * @return bool */ public function getUseIncludePath() { @@ -123,7 +156,7 @@ class ClassLoader /** * Registers this instance as an autoloader. * - * @param Boolean $prepend Whether to prepend the autoloader or not + * @param bool $prepend Whether to prepend the autoloader or not */ public function register($prepend = false) { @@ -141,8 +174,8 @@ class ClassLoader /** * Loads the given class or interface. * - * @param string $class The name of the class - * @return Boolean|null True, if loaded + * @param string $class The name of the class + * @return bool|null True, if loaded */ public function loadClass($class) { @@ -162,14 +195,14 @@ class ClassLoader */ public function findFile($class) { - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ('\\' == $class[0]) { $class = substr($class, 1); } + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; @@ -201,5 +234,7 @@ class ClassLoader if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) { return $file; } + + return $this->classMap[$class] = false; } } diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index 9ba2183bc29938a952bf327c71bdec056ba7917b..0000000000000000000000000000000000000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 8d2b763445b4ad11825f9642e88393ec60a19247..69f148062056e06754f97d7e5f756420fe1b1ab9 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -1,9 +1,108 @@ <?php +// autoload_classmap.php generated by Composer + $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - 'uagent_info' => $vendorDir . '/mobileesp/mdetect.php', - 'sip2' => $vendorDir . '/3rdparty/sip2.class.php' + 'Archive_Tar' => $baseDir . '/vendor/pear-pear.php.net/Archive_Tar/Archive/Tar.php', + 'Console_Getopt' => $baseDir . '/vendor/pear-pear.php.net/Console_Getopt/Console/Getopt.php', + 'File_MARC' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC.php', + 'File_MARCBASE' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARCBASE.php', + 'File_MARCXML' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARCXML.php', + 'File_MARC_Control_Field' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/Control_Field.php', + 'File_MARC_Data_Field' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/Data_Field.php', + 'File_MARC_Exception' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/Exception.php', + 'File_MARC_Field' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/Field.php', + 'File_MARC_Lint' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/Lint.php', + 'File_MARC_Lint_CodeData' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/Lint/CodeData.php', + 'File_MARC_List' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/List.php', + 'File_MARC_Record' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/Record.php', + 'File_MARC_Subfield' => $baseDir . '/vendor/pear-pear.php.net/File_MARC/File/MARC/Subfield.php', + 'OS_Guess' => $baseDir . '/vendor/pear-pear.php.net/PEAR/OS/Guess.php', + 'PEAR' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR.php', + 'PEAR5' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR5.php', + 'PEAR_Autoloader' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Autoloader.php', + 'PEAR_Builder' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Builder.php', + 'PEAR_ChannelFile' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/ChannelFile.php', + 'PEAR_ChannelFile_Parser' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/ChannelFile/Parser.php', + 'PEAR_Command' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command.php', + 'PEAR_Command_Auth' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Auth.php', + 'PEAR_Command_Build' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Build.php', + 'PEAR_Command_Channels' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Channels.php', + 'PEAR_Command_Common' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Common.php', + 'PEAR_Command_Config' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Config.php', + 'PEAR_Command_Install' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Install.php', + 'PEAR_Command_Mirror' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Mirror.php', + 'PEAR_Command_Package' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Package.php', + 'PEAR_Command_Pickle' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Pickle.php', + 'PEAR_Command_Registry' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Registry.php', + 'PEAR_Command_Remote' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Remote.php', + 'PEAR_Command_Test' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Command/Test.php', + 'PEAR_Common' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Common.php', + 'PEAR_Config' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Config.php', + 'PEAR_Dependency2' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Dependency2.php', + 'PEAR_DependencyDB' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/DependencyDB.php', + 'PEAR_Downloader' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Downloader.php', + 'PEAR_Downloader_Package' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Downloader/Package.php', + 'PEAR_Error' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR.php', + 'PEAR_ErrorStack' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/ErrorStack.php', + 'PEAR_Exception' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Exception.php', + 'PEAR_Frontend' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Frontend.php', + 'PEAR_Frontend_CLI' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Frontend/CLI.php', + 'PEAR_Installer' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer.php', + 'PEAR_Installer_Role' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role.php', + 'PEAR_Installer_Role_Cfg' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Cfg.php', + 'PEAR_Installer_Role_Common' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Common.php', + 'PEAR_Installer_Role_Data' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Data.php', + 'PEAR_Installer_Role_Doc' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Doc.php', + 'PEAR_Installer_Role_Ext' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Ext.php', + 'PEAR_Installer_Role_Php' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Php.php', + 'PEAR_Installer_Role_Script' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Script.php', + 'PEAR_Installer_Role_Src' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Src.php', + 'PEAR_Installer_Role_Test' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Test.php', + 'PEAR_Installer_Role_Www' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Www.php', + 'PEAR_PackageFile' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile.php', + 'PEAR_PackageFile_Generator_v1' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Generator/v1.php', + 'PEAR_PackageFile_Generator_v2' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Generator/v2.php', + 'PEAR_PackageFile_Parser_v1' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Parser/v1.php', + 'PEAR_PackageFile_Parser_v2' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Parser/v2.php', + 'PEAR_PackageFile_v1' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v1.php', + 'PEAR_PackageFile_v2' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2.php', + 'PEAR_PackageFile_v2_Validator' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2/Validator.php', + 'PEAR_PackageFile_v2_rw' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2/rw.php', + 'PEAR_Packager' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Packager.php', + 'PEAR_REST' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/REST.php', + 'PEAR_REST_10' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/REST/10.php', + 'PEAR_REST_11' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/REST/11.php', + 'PEAR_REST_13' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/REST/13.php', + 'PEAR_Registry' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Registry.php', + 'PEAR_RunTest' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/RunTest.php', + 'PEAR_Task_Common' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Common.php', + 'PEAR_Task_Postinstallscript' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Postinstallscript.php', + 'PEAR_Task_Postinstallscript_rw' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Postinstallscript/rw.php', + 'PEAR_Task_Replace' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Replace.php', + 'PEAR_Task_Replace_rw' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Replace/rw.php', + 'PEAR_Task_Unixeol' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Unixeol.php', + 'PEAR_Task_Unixeol_rw' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Unixeol/rw.php', + 'PEAR_Task_Windowseol' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Windowseol.php', + 'PEAR_Task_Windowseol_rw' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Task/Windowseol/rw.php', + 'PEAR_Validate' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Validate.php', + 'PEAR_Validator_PECL' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/Validator/PECL.php', + 'PEAR_XMLParser' => $baseDir . '/vendor/pear-pear.php.net/PEAR/PEAR/XMLParser.php', + 'Structures_Graph' => $baseDir . '/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph.php', + 'Structures_Graph_Manipulator_AcyclicTest' => $baseDir . '/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Manipulator/AcyclicTest.php', + 'Structures_Graph_Manipulator_TopologicalSorter' => $baseDir . '/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Manipulator/TopologicalSorter.php', + 'Structures_Graph_Node' => $baseDir . '/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Node.php', + 'Structures_LinkedList_Double' => $baseDir . '/vendor/pear-pear.php.net/Structures_LinkedList/Structures/LinkedList/Double.php', + 'Structures_LinkedList_DoubleNode' => $baseDir . '/vendor/pear-pear.php.net/Structures_LinkedList/Structures/LinkedList/Double.php', + 'Structures_LinkedList_Single' => $baseDir . '/vendor/pear-pear.php.net/Structures_LinkedList/Structures/LinkedList/Single.php', + 'Structures_LinkedList_SingleNode' => $baseDir . '/vendor/pear-pear.php.net/Structures_LinkedList/Structures/LinkedList/Single.php', + 'System' => $baseDir . '/vendor/pear-pear.php.net/PEAR/System.php', + 'Validate' => $baseDir . '/vendor/pear-pear.php.net/Validate/Validate.php', + 'Validate_ISPN' => $baseDir . '/vendor/pear-pear.php.net/Validate_ISPN/Validate/ISPN.php', + 'XML_Util' => $baseDir . '/vendor/pear-pear.php.net/XML_Util/XML/Util.php', + 'sip2' => $baseDir . '/vendor/johnwohlers/sip2/sip2.class.php', + 'uagent_info' => $baseDir . '/vendor/mobileesp/mdetect/mdetect.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index a177118d8fed903a34d3fae2ffd41d597624dc76..ed20a0ce4be826f01e8c0f20567a990c7e681cef 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -1,16 +1,15 @@ <?php +// autoload_namespaces.php generated by Composer + $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - 'File' => $vendorDir, - 'PEAR' => $vendorDir, - 'SerialsSolutions' => $vendorDir, - 'Structures' => $vendorDir, - 'Symfony' => $vendorDir, - 'Validate' => $vendorDir, - 'Zend' => $vendorDir . '/ZF2/library/', - 'ZendRest' => $vendorDir . '/ZendRest/library/', - 'ZendService' => $vendorDir . '/ZendService/library/', + 'Zend\\' => $vendorDir . '/zendframework/zendframework/library/', + 'ZendTest\\' => $vendorDir . '/zendframework/zendframework/tests/', + 'ZendService' => $vendorDir . '/zendframework/zendservice-amazon/library/', + 'ZendRest' => $vendorDir . '/zendframework/zendrest/library/', + 'Symfony\\Component\\Yaml' => $vendorDir . '/symfony/yaml/', + 'SerialsSolutions' => $vendorDir . '/serialssolutions/summon/', ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 0000000000000000000000000000000000000000..3c55a37a9979272d209782781ae27862ffa2ea44 --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,47 @@ +<?php + +// autoload_real.php generated by Composer + +class ComposerAutoloaderInit2d7591a4f6c6287536d5b7aa8ddbb5d9 +{ + private static $loader; + + public static function loadClassLoader($class) + { + if ('Composer\Autoload\ClassLoader' === $class) { + require __DIR__ . '/ClassLoader.php'; + } + } + + public static function getLoader() + { + if (null !== self::$loader) { + return self::$loader; + } + + spl_autoload_register(array('ComposerAutoloaderInit2d7591a4f6c6287536d5b7aa8ddbb5d9', 'loadClassLoader')); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(); + spl_autoload_unregister(array('ComposerAutoloaderInit2d7591a4f6c6287536d5b7aa8ddbb5d9', 'loadClassLoader')); + + $vendorDir = dirname(__DIR__); + $baseDir = dirname($vendorDir); + + $includePaths = require __DIR__ . '/include_paths.php'; + array_push($includePaths, get_include_path()); + set_include_path(join(PATH_SEPARATOR, $includePaths)); + + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->add($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + + $loader->register(true); + + return $loader; + } +} diff --git a/vendor/composer/include_paths.php b/vendor/composer/include_paths.php new file mode 100644 index 0000000000000000000000000000000000000000..86a54c07bfd8f76c750526258f12eda96713374c --- /dev/null +++ b/vendor/composer/include_paths.php @@ -0,0 +1,18 @@ +<?php + +// include_paths.php generated by Composer + +$vendorDir = dirname(__DIR__); +$baseDir = dirname($vendorDir); + +return array( + $vendorDir . '/pear-pear.php.net/Structures_LinkedList/', + $vendorDir . '/pear-pear.php.net/File_MARC/', + $vendorDir . '/pear-pear.php.net/XML_Util/', + $vendorDir . '/pear-pear.php.net/Console_Getopt/', + $vendorDir . '/pear-pear.php.net/Structures_Graph/', + $vendorDir . '/pear-pear.php.net/Archive_Tar/', + $vendorDir . '/pear-pear.php.net/PEAR/', + $vendorDir . '/pear-pear.php.net/Validate/', + $vendorDir . '/pear-pear.php.net/Validate_ISPN/', +); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 0000000000000000000000000000000000000000..4ad991f5abde94a535e497a4f95ce0fb01cf211c --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,583 @@ +[ + { + "name": "johnwohlers/sip2", + "version": "dev-master", + "version_normalized": "9999999-dev", + "dist": { + "type": "file", + "url": "https://php-sip2.googlecode.com/svn/trunk/sip2.class.php", + "reference": null, + "shasum": null + }, + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "/" + ] + } + }, + { + "name": "mobileesp/mdetect", + "version": "dev-master", + "version_normalized": "9999999-dev", + "dist": { + "type": "file", + "url": "http://mobileesp.googlecode.com/svn/PHP/mdetect.php", + "reference": null, + "shasum": null + }, + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "/" + ] + } + }, + { + "name": "serialssolutions/summon", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/demiankatz/Summon.git", + "reference": "c77862d88e5d928d04ef8491d63177c91a4732de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/demiankatz/Summon/zipball/c77862d88e5d928d04ef8491d63177c91a4732de", + "reference": "c77862d88e5d928d04ef8491d63177c91a4732de", + "shasum": "" + }, + "time": "2013-02-22 14:04:58", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "SerialsSolutions": "" + } + }, + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu" + } + ], + "description": "Library for interacting with Serials Solutions' Summon API.", + "support": { + "source": "https://github.com/demiankatz/Summon/tree/master", + "issues": "https://github.com/demiankatz/Summon/issues" + } + }, + { + "name": "pear-pear.php.net/Structures_LinkedList", + "version": "0.2.2", + "version_normalized": "0.2.2.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Structures_LinkedList-0.2.2.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.0.0.0" + }, + "replace": { + "pear-pear/structures_linkedlist": "== 0.2.2.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "A singly-linked list offers the ability to insert or delete\n nodes at any point within the list. A doubly-linked list also offers the\n ability to request previous nodes in the list." + }, + { + "name": "pear-pear.php.net/File_MARC", + "version": "0.7.1", + "version_normalized": "0.7.1.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/File_MARC-0.7.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "pear-pear.php.net/structures_linkedlist": "*", + "php": ">=5.2.0.0" + }, + "replace": { + "pear-pear/file_marc": "== 0.7.1.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "The standard for machine-readable cataloging (MARC) records is documented at http://loc.gov/marc/. This package enables you to read existing MARC records from a file, string, or (using the YAZ extension), from a Z39.50 source. You can also use this package to create new MARC records.\n\nThis package is based on the PHP MARC package, originally called "php-marc", that is part of the Emilda Project (http://www.emilda.org). Christoffer Landtman generously agreed to make the "php-marc" code available under the GNU LGPL so it could be used as the basis of this PEAR package." + }, + { + "name": "pear-pear.php.net/XML_Util", + "version": "1.2.1", + "version_normalized": "1.2.1.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/XML_Util-1.2.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "ext-pcre": "*", + "php": ">=4.3.0.0" + }, + "replace": { + "pear-pear/xml_util": "== 1.2.1.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "Selection of methods that are often needed when working with XML documents. Functionality includes creating of attribute lists from arrays, creation of tags, validation of XML names and more." + }, + { + "name": "pear-pear.php.net/Console_Getopt", + "version": "1.3.1", + "version_normalized": "1.3.1.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Console_Getopt-1.3.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.3.0.0" + }, + "replace": { + "pear-pear/console_getopt": "== 1.3.1.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "This is a PHP implementation of "getopt" supporting both\nshort and long options." + }, + { + "name": "pear-pear.php.net/Structures_Graph", + "version": "1.0.4", + "version_normalized": "1.0.4.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Structures_Graph-1.0.4.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.2.0.0" + }, + "replace": { + "pear-pear/structures_graph": "== 1.0.4.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "Structures_Graph is a package for creating and manipulating graph datastructures. It allows building of directed\nand undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing\nas well as for characteristic extraction from the graph topology." + }, + { + "name": "pear-pear.php.net/Archive_Tar", + "version": "1.3.11", + "version_normalized": "1.3.11.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Archive_Tar-1.3.11.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.3.0.0" + }, + "replace": { + "pear-pear/archive_tar": "== 1.3.11.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "This class provides handling of tar files in PHP.\nIt supports creating, listing, extracting and adding to tar files.\nGzip support is available if PHP has the zlib extension built-in or\nloaded. Bz2 compression is also supported with the bz2 extension loaded." + }, + { + "name": "pear-pear.php.net/PEAR", + "version": "1.9.4", + "version_normalized": "1.9.4.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/PEAR-1.9.4.tgz", + "reference": null, + "shasum": null + }, + "require": { + "ext-pcre": "*", + "ext-xml": "*", + "pear-pear.php.net/archive_tar": ">=1.3.7.0", + "pear-pear.php.net/console_getopt": ">=1.2.0.0", + "pear-pear.php.net/structures_graph": ">=1.0.2.0", + "pear-pear.php.net/xml_util": ">=1.2.0.0", + "php": ">=4.4.0.0,!=5.0.0.0,!=5.1.0.0,!=5.1.1.0,!=5.1.2.0,!=5.1.3.0,!=5.1.4.0,!=5.1.5.0" + }, + "conflict": { + "pear-pear.php.net/pear_frontend_gtk": "<0.4.0.0", + "pear-pear.php.net/pear_frontend_web": "<=0.4.0.0" + }, + "replace": { + "pear-pear/pear": "== 1.9.4.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "The PEAR package contains:\n * the PEAR installer, for creating, distributing\n and installing packages\n * the PEAR_Exception PHP5 error handling mechanism\n * the PEAR_ErrorStack advanced error handling mechanism\n * the PEAR_Error error handling mechanism\n * the OS_Guess class for retrieving info about the OS\n where PHP is running on\n * the System class for quick handling of common operations\n with files and directories\n * the PEAR base class\n Features in a nutshell:\n * full support for channels\n * pre-download dependency validation\n * new package.xml 2.0 format allows tremendous flexibility while maintaining BC\n * support for optional dependency groups and limited support for sub-packaging\n * robust dependency support\n * full dependency validation on uninstall\n * remote install for hosts with only ftp access - no more problems with\n restricted host installation\n * full support for mirroring\n * support for bundling several packages into a single tarball\n * support for static dependencies on a url-based package\n * support for custom file roles and installation tasks" + }, + { + "name": "pear-pear.php.net/Validate", + "version": "0.8.5", + "version_normalized": "0.8.5.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Validate-0.8.5.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=4.2.0.0" + }, + "replace": { + "pear-pear/validate": "== 0.8.5.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "Package to validate various datas. It includes :\n - numbers (min/max, decimal or not)\n - email (syntax, domain check, rfc822)\n - string (predifined type alpha upper and/or lowercase, numeric,...)\n - date (min, max, rfc822 compliant)\n - uri (RFC2396)\n - possibility valid multiple data with a single method call (::multiple)" + }, + { + "name": "pear-pear.php.net/Validate_ISPN", + "version": "0.6.1", + "version_normalized": "0.6.1.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Validate_ISPN-0.6.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "pear-pear.php.net/validate": ">=0.5.0.0", + "php": ">=4.1.0.0" + }, + "replace": { + "pear-pear/validate_ispn": "== 0.6.1.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "description": "Package containes ISPN (International Standard Product Numbers) validations such as:\n * ISSN\n * ISBN\n * ISMN\n * ISRC (International Standard Recording Code)\n * EAN8\n * EAN13\n * EAN14\n * UCC12\n * SSCC" + }, + { + "name": "symfony/yaml", + "version": "v2.1.7", + "version_normalized": "2.1.7.0", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml", + "reference": "v2.1.7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.1.7", + "reference": "v2.1.7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2013-01-17 21:21:51", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml": "" + } + }, + "notification-url": "http://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com" + }, + { + "name": "zendframework/zendframework", + "version": "2.1.2", + "version_normalized": "2.1.2.0", + "source": { + "type": "git", + "url": "git://github.com/zendframework/zf2.git", + "reference": "release-2.1.2" + }, + "dist": { + "type": "zip", + "url": "http://packages.zendframework.com/releases/ZendFramework-2.1.2/ZendFramework-2.1.2.zip", + "reference": "release-2.1.2", + "shasum": "fd99fc5ce007c5856e3817f351a2184f7e1f4a98" + }, + "require": { + "php": ">=5.3.3" + }, + "replace": { + "zendframework/zend-acl": "self.version", + "zendframework/zend-authentication": "self.version", + "zendframework/zend-barcode": "self.version", + "zendframework/zend-cache": "self.version", + "zendframework/zend-captcha": "self.version", + "zendframework/zend-code": "self.version", + "zendframework/zend-config": "self.version", + "zendframework/zend-console": "self.version", + "zendframework/zend-crypt": "self.version", + "zendframework/zend-db": "self.version", + "zendframework/zend-di": "self.version", + "zendframework/zend-dom": "self.version", + "zendframework/zend-escaper": "self.version", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-feed": "self.version", + "zendframework/zend-file": "self.version", + "zendframework/zend-filter": "self.version", + "zendframework/zend-form": "self.version", + "zendframework/zend-http": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-inputfilter": "self.version", + "zendframework/zend-json": "self.version", + "zendframework/zend-ldap": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-log": "self.version", + "zendframework/zend-mail": "self.version", + "zendframework/zend-markup": "self.version", + "zendframework/zend-math": "self.version", + "zendframework/zend-memory": "self.version", + "zendframework/zend-mime": "self.version", + "zendframework/zend-modulemanager": "self.version", + "zendframework/zend-mvc": "self.version", + "zendframework/zend-navigation": "self.version", + "zendframework/zend-paginator": "self.version", + "zendframework/zend-progressbar": "self.version", + "zendframework/zend-serializer": "self.version", + "zendframework/zend-server": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-session": "self.version", + "zendframework/zend-soap": "self.version", + "zendframework/zend-stdlib": "self.version", + "zendframework/zend-tag": "self.version", + "zendframework/zend-text": "self.version", + "zendframework/zend-uri": "self.version", + "zendframework/zend-validator": "self.version", + "zendframework/zend-view": "self.version", + "zendframework/zend-xmlrpc": "self.version" + }, + "require-dev": { + "doctrine/common": ">=2.1" + }, + "suggest": { + "doctrine/common": "Doctrine\\Common >=2.1 for annotation features", + "ext-intl": "ext/intl for i18n features", + "pecl-weakref": "Implementation of weak references for Zend\\Stdlib\\CallbackHandler", + "zendframework/zendpdf": "ZendPdf for creating PDF representations of barcodes", + "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha for rendering ReCaptchas in Zend\\Captcha and/or Zend\\Form" + }, + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\": "library/", + "ZendTest\\": "tests/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": "Zend Framework 2", + "keywords": [ + "framework", + "zf2" + ], + "support": { + "email": "fw-general-subscribe@lists.zend.com", + "irc": "irc://irc.freenode.net/zftalk", + "issues": "https://github.com/zendframework/zf2/issues", + "source": "https://github.com/zendframework/zf2" + } + }, + { + "name": "zendframework/zendrest", + "version": "2.0.1", + "version_normalized": "2.0.1.0", + "dist": { + "type": "zip", + "url": "http://packages.zendframework.com/composer/ZendRest-2.0.1.zip", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-http": ">=2.0.0", + "zendframework/zend-uri": ">=2.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "ZendRest": "library/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": " ", + "homepage": "http://packages.zendframework.com/", + "keywords": [ + "rest", + "zf2" + ], + "support": { + "email": "fw-general-subscribe@lists.zend.com", + "irc": "irc://irc.freenode.net/zftalk", + "issues": "https://github.com/zendframework/zf2/issues", + "source": "https://github.com/zendframework/zf2" + } + }, + { + "name": "zendframework/zendservice-amazon", + "version": "2.0.2", + "version_normalized": "2.0.2.0", + "dist": { + "type": "zip", + "url": "http://packages.zendframework.com/composer/ZendService_Amazon-2.0.2.zip", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-crypt": ">=2.0.0", + "zendframework/zend-http": ">=2.0.0", + "zendframework/zend-json": ">=2.0.0", + "zendframework/zendrest": ">=2.0.0" + }, + "require-dev": { + "zendframework/zend-i18n": ">=2.0.0" + }, + "suggest": { + "zendframework/zend-uri": "Zend\\Uri component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "ZendService": "library/" + } + }, + "license": [ + "BSD-3-Clause" + ], + "description": "OOP wrapper for the Amazon web service", + "homepage": "http://packages.zendframework.com/", + "keywords": [ + "amazon", + "ec2", + "s3", + "simpledb", + "sqs", + "zf2" + ], + "support": { + "email": "fw-general-subscribe@lists.zend.com", + "irc": "irc://irc.freenode.net/zftalk", + "issues": "https://github.com/zendframework/zf2/issues", + "source": "https://github.com/zendframework/zf2" + } + } +] diff --git a/vendor/3rdparty/sip2.class.php b/vendor/johnwohlers/sip2/sip2.class.php similarity index 100% rename from vendor/3rdparty/sip2.class.php rename to vendor/johnwohlers/sip2/sip2.class.php diff --git a/vendor/mobileesp/mdetect.php b/vendor/mobileesp/mdetect/mdetect.php similarity index 100% rename from vendor/mobileesp/mdetect.php rename to vendor/mobileesp/mdetect/mdetect.php diff --git a/vendor/pear-pear.php.net/Archive_Tar/Archive/Tar.php b/vendor/pear-pear.php.net/Archive_Tar/Archive/Tar.php new file mode 100644 index 0000000000000000000000000000000000000000..9249a0686453bf213616079a9c2f1c9fe79367e2 --- /dev/null +++ b/vendor/pear-pear.php.net/Archive_Tar/Archive/Tar.php @@ -0,0 +1,1993 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ + +/** + * File::CSV + * + * PHP versions 4 and 5 + * + * Copyright (c) 1997-2008, + * Vincent Blavet <vincent@phpconcept.net> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category File_Formats + * @package Archive_Tar + * @author Vincent Blavet <vincent@phpconcept.net> + * @copyright 1997-2010 The Authors + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id$ + * @link http://pear.php.net/package/Archive_Tar + */ + +require_once 'PEAR.php'; + +define('ARCHIVE_TAR_ATT_SEPARATOR', 90001); +define('ARCHIVE_TAR_END_BLOCK', pack("a512", '')); + +/** +* Creates a (compressed) Tar archive +* +* @package Archive_Tar +* @author Vincent Blavet <vincent@phpconcept.net> +* @license http://www.opensource.org/licenses/bsd-license.php New BSD License +* @version $Revision$ +*/ +class Archive_Tar extends PEAR +{ + /** + * @var string Name of the Tar + */ + var $_tarname=''; + + /** + * @var boolean if true, the Tar file will be gzipped + */ + var $_compress=false; + + /** + * @var string Type of compression : 'none', 'gz' or 'bz2' + */ + var $_compress_type='none'; + + /** + * @var string Explode separator + */ + var $_separator=' '; + + /** + * @var file descriptor + */ + var $_file=0; + + /** + * @var string Local Tar name of a remote Tar (http:// or ftp://) + */ + var $_temp_tarname=''; + + /** + * @var string regular expression for ignoring files or directories + */ + var $_ignore_regexp=''; + + /** + * @var object PEAR_Error object + */ + var $error_object=null; + + // {{{ constructor + /** + * Archive_Tar Class constructor. This flavour of the constructor only + * declare a new Archive_Tar object, identifying it by the name of the + * tar file. + * If the compress argument is set the tar will be read or created as a + * gzip or bz2 compressed TAR file. + * + * @param string $p_tarname The name of the tar archive to create + * @param string $p_compress can be null, 'gz' or 'bz2'. This + * parameter indicates if gzip or bz2 compression + * is required. For compatibility reason the + * boolean value 'true' means 'gz'. + * + * @access public + */ + function Archive_Tar($p_tarname, $p_compress = null) + { + $this->PEAR(); + $this->_compress = false; + $this->_compress_type = 'none'; + if (($p_compress === null) || ($p_compress == '')) { + if (@file_exists($p_tarname)) { + if ($fp = @fopen($p_tarname, "rb")) { + // look for gzip magic cookie + $data = fread($fp, 2); + fclose($fp); + if ($data == "\37\213") { + $this->_compress = true; + $this->_compress_type = 'gz'; + // No sure it's enought for a magic code .... + } elseif ($data == "BZ") { + $this->_compress = true; + $this->_compress_type = 'bz2'; + } + } + } else { + // probably a remote file or some file accessible + // through a stream interface + if (substr($p_tarname, -2) == 'gz') { + $this->_compress = true; + $this->_compress_type = 'gz'; + } elseif ((substr($p_tarname, -3) == 'bz2') || + (substr($p_tarname, -2) == 'bz')) { + $this->_compress = true; + $this->_compress_type = 'bz2'; + } + } + } else { + if (($p_compress === true) || ($p_compress == 'gz')) { + $this->_compress = true; + $this->_compress_type = 'gz'; + } else if ($p_compress == 'bz2') { + $this->_compress = true; + $this->_compress_type = 'bz2'; + } else { + $this->_error("Unsupported compression type '$p_compress'\n". + "Supported types are 'gz' and 'bz2'.\n"); + return false; + } + } + $this->_tarname = $p_tarname; + if ($this->_compress) { // assert zlib or bz2 extension support + if ($this->_compress_type == 'gz') + $extname = 'zlib'; + else if ($this->_compress_type == 'bz2') + $extname = 'bz2'; + + if (!extension_loaded($extname)) { + PEAR::loadExtension($extname); + } + if (!extension_loaded($extname)) { + $this->_error("The extension '$extname' couldn't be found.\n". + "Please make sure your version of PHP was built ". + "with '$extname' support.\n"); + return false; + } + } + } + // }}} + + // {{{ destructor + function _Archive_Tar() + { + $this->_close(); + // ----- Look for a local copy to delete + if ($this->_temp_tarname != '') + @unlink($this->_temp_tarname); + $this->_PEAR(); + } + // }}} + + // {{{ create() + /** + * This method creates the archive file and add the files / directories + * that are listed in $p_filelist. + * If a file with the same name exist and is writable, it is replaced + * by the new tar. + * The method return false and a PEAR error text. + * The $p_filelist parameter can be an array of string, each string + * representing a filename or a directory name with their path if + * needed. It can also be a single string with names separated by a + * single blank. + * For each directory added in the archive, the files and + * sub-directories are also added. + * See also createModify() method for more details. + * + * @param array $p_filelist An array of filenames and directory names, or a + * single string with names separated by a single + * blank space. + * + * @return true on success, false on error. + * @see createModify() + * @access public + */ + function create($p_filelist) + { + return $this->createModify($p_filelist, '', ''); + } + // }}} + + // {{{ add() + /** + * This method add the files / directories that are listed in $p_filelist in + * the archive. If the archive does not exist it is created. + * The method return false and a PEAR error text. + * The files and directories listed are only added at the end of the archive, + * even if a file with the same name is already archived. + * See also createModify() method for more details. + * + * @param array $p_filelist An array of filenames and directory names, or a + * single string with names separated by a single + * blank space. + * + * @return true on success, false on error. + * @see createModify() + * @access public + */ + function add($p_filelist) + { + return $this->addModify($p_filelist, '', ''); + } + // }}} + + // {{{ extract() + function extract($p_path='', $p_preserve=false) + { + return $this->extractModify($p_path, '', $p_preserve); + } + // }}} + + // {{{ listContent() + function listContent() + { + $v_list_detail = array(); + + if ($this->_openRead()) { + if (!$this->_extractList('', $v_list_detail, "list", '', '')) { + unset($v_list_detail); + $v_list_detail = 0; + } + $this->_close(); + } + + return $v_list_detail; + } + // }}} + + // {{{ createModify() + /** + * This method creates the archive file and add the files / directories + * that are listed in $p_filelist. + * If the file already exists and is writable, it is replaced by the + * new tar. It is a create and not an add. If the file exists and is + * read-only or is a directory it is not replaced. The method return + * false and a PEAR error text. + * The $p_filelist parameter can be an array of string, each string + * representing a filename or a directory name with their path if + * needed. It can also be a single string with names separated by a + * single blank. + * The path indicated in $p_remove_dir will be removed from the + * memorized path of each file / directory listed when this path + * exists. By default nothing is removed (empty path '') + * The path indicated in $p_add_dir will be added at the beginning of + * the memorized path of each file / directory listed. However it can + * be set to empty ''. The adding of a path is done after the removing + * of path. + * The path add/remove ability enables the user to prepare an archive + * for extraction in a different path than the origin files are. + * See also addModify() method for file adding properties. + * + * @param array $p_filelist An array of filenames and directory names, + * or a single string with names separated by + * a single blank space. + * @param string $p_add_dir A string which contains a path to be added + * to the memorized path of each element in + * the list. + * @param string $p_remove_dir A string which contains a path to be + * removed from the memorized path of each + * element in the list, when relevant. + * + * @return boolean true on success, false on error. + * @access public + * @see addModify() + */ + function createModify($p_filelist, $p_add_dir, $p_remove_dir='') + { + $v_result = true; + + if (!$this->_openWrite()) + return false; + + if ($p_filelist != '') { + if (is_array($p_filelist)) + $v_list = $p_filelist; + elseif (is_string($p_filelist)) + $v_list = explode($this->_separator, $p_filelist); + else { + $this->_cleanFile(); + $this->_error('Invalid file list'); + return false; + } + + $v_result = $this->_addList($v_list, $p_add_dir, $p_remove_dir); + } + + if ($v_result) { + $this->_writeFooter(); + $this->_close(); + } else + $this->_cleanFile(); + + return $v_result; + } + // }}} + + // {{{ addModify() + /** + * This method add the files / directories listed in $p_filelist at the + * end of the existing archive. If the archive does not yet exists it + * is created. + * The $p_filelist parameter can be an array of string, each string + * representing a filename or a directory name with their path if + * needed. It can also be a single string with names separated by a + * single blank. + * The path indicated in $p_remove_dir will be removed from the + * memorized path of each file / directory listed when this path + * exists. By default nothing is removed (empty path '') + * The path indicated in $p_add_dir will be added at the beginning of + * the memorized path of each file / directory listed. However it can + * be set to empty ''. The adding of a path is done after the removing + * of path. + * The path add/remove ability enables the user to prepare an archive + * for extraction in a different path than the origin files are. + * If a file/dir is already in the archive it will only be added at the + * end of the archive. There is no update of the existing archived + * file/dir. However while extracting the archive, the last file will + * replace the first one. This results in a none optimization of the + * archive size. + * If a file/dir does not exist the file/dir is ignored. However an + * error text is send to PEAR error. + * If a file/dir is not readable the file/dir is ignored. However an + * error text is send to PEAR error. + * + * @param array $p_filelist An array of filenames and directory + * names, or a single string with names + * separated by a single blank space. + * @param string $p_add_dir A string which contains a path to be + * added to the memorized path of each + * element in the list. + * @param string $p_remove_dir A string which contains a path to be + * removed from the memorized path of + * each element in the list, when + * relevant. + * + * @return true on success, false on error. + * @access public + */ + function addModify($p_filelist, $p_add_dir, $p_remove_dir='') + { + $v_result = true; + + if (!$this->_isArchive()) + $v_result = $this->createModify($p_filelist, $p_add_dir, + $p_remove_dir); + else { + if (is_array($p_filelist)) + $v_list = $p_filelist; + elseif (is_string($p_filelist)) + $v_list = explode($this->_separator, $p_filelist); + else { + $this->_error('Invalid file list'); + return false; + } + + $v_result = $this->_append($v_list, $p_add_dir, $p_remove_dir); + } + + return $v_result; + } + // }}} + + // {{{ addString() + /** + * This method add a single string as a file at the + * end of the existing archive. If the archive does not yet exists it + * is created. + * + * @param string $p_filename A string which contains the full + * filename path that will be associated + * with the string. + * @param string $p_string The content of the file added in + * the archive. + * @param int $p_datetime A custom date/time (unix timestamp) + * for the file (optional). + * + * @return true on success, false on error. + * @access public + */ + function addString($p_filename, $p_string, $p_datetime = false) + { + $v_result = true; + + if (!$this->_isArchive()) { + if (!$this->_openWrite()) { + return false; + } + $this->_close(); + } + + if (!$this->_openAppend()) + return false; + + // Need to check the get back to the temporary file ? .... + $v_result = $this->_addString($p_filename, $p_string, $p_datetime); + + $this->_writeFooter(); + + $this->_close(); + + return $v_result; + } + // }}} + + // {{{ extractModify() + /** + * This method extract all the content of the archive in the directory + * indicated by $p_path. When relevant the memorized path of the + * files/dir can be modified by removing the $p_remove_path path at the + * beginning of the file/dir path. + * While extracting a file, if the directory path does not exists it is + * created. + * While extracting a file, if the file already exists it is replaced + * without looking for last modification date. + * While extracting a file, if the file already exists and is write + * protected, the extraction is aborted. + * While extracting a file, if a directory with the same name already + * exists, the extraction is aborted. + * While extracting a directory, if a file with the same name already + * exists, the extraction is aborted. + * While extracting a file/directory if the destination directory exist + * and is write protected, or does not exist but can not be created, + * the extraction is aborted. + * If after extraction an extracted file does not show the correct + * stored file size, the extraction is aborted. + * When the extraction is aborted, a PEAR error text is set and false + * is returned. However the result can be a partial extraction that may + * need to be manually cleaned. + * + * @param string $p_path The path of the directory where the + * files/dir need to by extracted. + * @param string $p_remove_path Part of the memorized path that can be + * removed if present at the beginning of + * the file/dir path. + * @param boolean $p_preserve Preserve user/group ownership of files + * + * @return boolean true on success, false on error. + * @access public + * @see extractList() + */ + function extractModify($p_path, $p_remove_path, $p_preserve=false) + { + $v_result = true; + $v_list_detail = array(); + + if ($v_result = $this->_openRead()) { + $v_result = $this->_extractList($p_path, $v_list_detail, + "complete", 0, $p_remove_path, $p_preserve); + $this->_close(); + } + + return $v_result; + } + // }}} + + // {{{ extractInString() + /** + * This method extract from the archive one file identified by $p_filename. + * The return value is a string with the file content, or NULL on error. + * + * @param string $p_filename The path of the file to extract in a string. + * + * @return a string with the file content or NULL. + * @access public + */ + function extractInString($p_filename) + { + if ($this->_openRead()) { + $v_result = $this->_extractInString($p_filename); + $this->_close(); + } else { + $v_result = null; + } + + return $v_result; + } + // }}} + + // {{{ extractList() + /** + * This method extract from the archive only the files indicated in the + * $p_filelist. These files are extracted in the current directory or + * in the directory indicated by the optional $p_path parameter. + * If indicated the $p_remove_path can be used in the same way as it is + * used in extractModify() method. + * + * @param array $p_filelist An array of filenames and directory names, + * or a single string with names separated + * by a single blank space. + * @param string $p_path The path of the directory where the + * files/dir need to by extracted. + * @param string $p_remove_path Part of the memorized path that can be + * removed if present at the beginning of + * the file/dir path. + * @param boolean $p_preserve Preserve user/group ownership of files + * + * @return true on success, false on error. + * @access public + * @see extractModify() + */ + function extractList($p_filelist, $p_path='', $p_remove_path='', $p_preserve=false) + { + $v_result = true; + $v_list_detail = array(); + + if (is_array($p_filelist)) + $v_list = $p_filelist; + elseif (is_string($p_filelist)) + $v_list = explode($this->_separator, $p_filelist); + else { + $this->_error('Invalid string list'); + return false; + } + + if ($v_result = $this->_openRead()) { + $v_result = $this->_extractList($p_path, $v_list_detail, "partial", + $v_list, $p_remove_path, $p_preserve); + $this->_close(); + } + + return $v_result; + } + // }}} + + // {{{ setAttribute() + /** + * This method set specific attributes of the archive. It uses a variable + * list of parameters, in the format attribute code + attribute values : + * $arch->setAttribute(ARCHIVE_TAR_ATT_SEPARATOR, ','); + * + * @param mixed $argv variable list of attributes and values + * + * @return true on success, false on error. + * @access public + */ + function setAttribute() + { + $v_result = true; + + // ----- Get the number of variable list of arguments + if (($v_size = func_num_args()) == 0) { + return true; + } + + // ----- Get the arguments + $v_att_list = &func_get_args(); + + // ----- Read the attributes + $i=0; + while ($i<$v_size) { + + // ----- Look for next option + switch ($v_att_list[$i]) { + // ----- Look for options that request a string value + case ARCHIVE_TAR_ATT_SEPARATOR : + // ----- Check the number of parameters + if (($i+1) >= $v_size) { + $this->_error('Invalid number of parameters for ' + .'attribute ARCHIVE_TAR_ATT_SEPARATOR'); + return false; + } + + // ----- Get the value + $this->_separator = $v_att_list[$i+1]; + $i++; + break; + + default : + $this->_error('Unknow attribute code '.$v_att_list[$i].''); + return false; + } + + // ----- Next attribute + $i++; + } + + return $v_result; + } + // }}} + + // {{{ setIgnoreRegexp() + /** + * This method sets the regular expression for ignoring files and directories + * at import, for example: + * $arch->setIgnoreRegexp("#CVS|\.svn#"); + * + * @param string $regexp regular expression defining which files or directories to ignore + * + * @access public + */ + function setIgnoreRegexp($regexp) + { + $this->_ignore_regexp = $regexp; + } + // }}} + + // {{{ setIgnoreList() + /** + * This method sets the regular expression for ignoring all files and directories + * matching the filenames in the array list at import, for example: + * $arch->setIgnoreList(array('CVS', '.svn', 'bin/tool')); + * + * @param array $list a list of file or directory names to ignore + * + * @access public + */ + function setIgnoreList($list) + { + $regexp = str_replace(array('#', '.', '^', '$'), array('\#', '\.', '\^', '\$'), $list); + $regexp = '#/'.join('$|/', $list).'#'; + $this->setIgnoreRegexp($regexp); + } + // }}} + + // {{{ _error() + function _error($p_message) + { + $this->error_object = &$this->raiseError($p_message); + } + // }}} + + // {{{ _warning() + function _warning($p_message) + { + $this->error_object = &$this->raiseError($p_message); + } + // }}} + + // {{{ _isArchive() + function _isArchive($p_filename=null) + { + if ($p_filename == null) { + $p_filename = $this->_tarname; + } + clearstatcache(); + return @is_file($p_filename) && !@is_link($p_filename); + } + // }}} + + // {{{ _openWrite() + function _openWrite() + { + if ($this->_compress_type == 'gz' && function_exists('gzopen')) + $this->_file = @gzopen($this->_tarname, "wb9"); + else if ($this->_compress_type == 'bz2' && function_exists('bzopen')) + $this->_file = @bzopen($this->_tarname, "w"); + else if ($this->_compress_type == 'none') + $this->_file = @fopen($this->_tarname, "wb"); + else { + $this->_error('Unknown or missing compression type (' + .$this->_compress_type.')'); + return false; + } + + if ($this->_file == 0) { + $this->_error('Unable to open in write mode \'' + .$this->_tarname.'\''); + return false; + } + + return true; + } + // }}} + + // {{{ _openRead() + function _openRead() + { + if (strtolower(substr($this->_tarname, 0, 7)) == 'http://') { + + // ----- Look if a local copy need to be done + if ($this->_temp_tarname == '') { + $this->_temp_tarname = uniqid('tar').'.tmp'; + if (!$v_file_from = @fopen($this->_tarname, 'rb')) { + $this->_error('Unable to open in read mode \'' + .$this->_tarname.'\''); + $this->_temp_tarname = ''; + return false; + } + if (!$v_file_to = @fopen($this->_temp_tarname, 'wb')) { + $this->_error('Unable to open in write mode \'' + .$this->_temp_tarname.'\''); + $this->_temp_tarname = ''; + return false; + } + while ($v_data = @fread($v_file_from, 1024)) + @fwrite($v_file_to, $v_data); + @fclose($v_file_from); + @fclose($v_file_to); + } + + // ----- File to open if the local copy + $v_filename = $this->_temp_tarname; + + } else + // ----- File to open if the normal Tar file + $v_filename = $this->_tarname; + + if ($this->_compress_type == 'gz' && function_exists('gzopen')) + $this->_file = @gzopen($v_filename, "rb"); + else if ($this->_compress_type == 'bz2' && function_exists('bzopen')) + $this->_file = @bzopen($v_filename, "r"); + else if ($this->_compress_type == 'none') + $this->_file = @fopen($v_filename, "rb"); + else { + $this->_error('Unknown or missing compression type (' + .$this->_compress_type.')'); + return false; + } + + if ($this->_file == 0) { + $this->_error('Unable to open in read mode \''.$v_filename.'\''); + return false; + } + + return true; + } + // }}} + + // {{{ _openReadWrite() + function _openReadWrite() + { + if ($this->_compress_type == 'gz') + $this->_file = @gzopen($this->_tarname, "r+b"); + else if ($this->_compress_type == 'bz2') { + $this->_error('Unable to open bz2 in read/write mode \'' + .$this->_tarname.'\' (limitation of bz2 extension)'); + return false; + } else if ($this->_compress_type == 'none') + $this->_file = @fopen($this->_tarname, "r+b"); + else { + $this->_error('Unknown or missing compression type (' + .$this->_compress_type.')'); + return false; + } + + if ($this->_file == 0) { + $this->_error('Unable to open in read/write mode \'' + .$this->_tarname.'\''); + return false; + } + + return true; + } + // }}} + + // {{{ _close() + function _close() + { + //if (isset($this->_file)) { + if (is_resource($this->_file)) { + if ($this->_compress_type == 'gz') + @gzclose($this->_file); + else if ($this->_compress_type == 'bz2') + @bzclose($this->_file); + else if ($this->_compress_type == 'none') + @fclose($this->_file); + else + $this->_error('Unknown or missing compression type (' + .$this->_compress_type.')'); + + $this->_file = 0; + } + + // ----- Look if a local copy need to be erase + // Note that it might be interesting to keep the url for a time : ToDo + if ($this->_temp_tarname != '') { + @unlink($this->_temp_tarname); + $this->_temp_tarname = ''; + } + + return true; + } + // }}} + + // {{{ _cleanFile() + function _cleanFile() + { + $this->_close(); + + // ----- Look for a local copy + if ($this->_temp_tarname != '') { + // ----- Remove the local copy but not the remote tarname + @unlink($this->_temp_tarname); + $this->_temp_tarname = ''; + } else { + // ----- Remove the local tarname file + @unlink($this->_tarname); + } + $this->_tarname = ''; + + return true; + } + // }}} + + // {{{ _writeBlock() + function _writeBlock($p_binary_data, $p_len=null) + { + if (is_resource($this->_file)) { + if ($p_len === null) { + if ($this->_compress_type == 'gz') + @gzputs($this->_file, $p_binary_data); + else if ($this->_compress_type == 'bz2') + @bzwrite($this->_file, $p_binary_data); + else if ($this->_compress_type == 'none') + @fputs($this->_file, $p_binary_data); + else + $this->_error('Unknown or missing compression type (' + .$this->_compress_type.')'); + } else { + if ($this->_compress_type == 'gz') + @gzputs($this->_file, $p_binary_data, $p_len); + else if ($this->_compress_type == 'bz2') + @bzwrite($this->_file, $p_binary_data, $p_len); + else if ($this->_compress_type == 'none') + @fputs($this->_file, $p_binary_data, $p_len); + else + $this->_error('Unknown or missing compression type (' + .$this->_compress_type.')'); + + } + } + return true; + } + // }}} + + // {{{ _readBlock() + function _readBlock() + { + $v_block = null; + if (is_resource($this->_file)) { + if ($this->_compress_type == 'gz') + $v_block = @gzread($this->_file, 512); + else if ($this->_compress_type == 'bz2') + $v_block = @bzread($this->_file, 512); + else if ($this->_compress_type == 'none') + $v_block = @fread($this->_file, 512); + else + $this->_error('Unknown or missing compression type (' + .$this->_compress_type.')'); + } + return $v_block; + } + // }}} + + // {{{ _jumpBlock() + function _jumpBlock($p_len=null) + { + if (is_resource($this->_file)) { + if ($p_len === null) + $p_len = 1; + + if ($this->_compress_type == 'gz') { + @gzseek($this->_file, gztell($this->_file)+($p_len*512)); + } + else if ($this->_compress_type == 'bz2') { + // ----- Replace missing bztell() and bzseek() + for ($i=0; $i<$p_len; $i++) + $this->_readBlock(); + } else if ($this->_compress_type == 'none') + @fseek($this->_file, $p_len*512, SEEK_CUR); + else + $this->_error('Unknown or missing compression type (' + .$this->_compress_type.')'); + + } + return true; + } + // }}} + + // {{{ _writeFooter() + function _writeFooter() + { + if (is_resource($this->_file)) { + // ----- Write the last 0 filled block for end of archive + $v_binary_data = pack('a1024', ''); + $this->_writeBlock($v_binary_data); + } + return true; + } + // }}} + + // {{{ _addList() + function _addList($p_list, $p_add_dir, $p_remove_dir) + { + $v_result=true; + $v_header = array(); + + // ----- Remove potential windows directory separator + $p_add_dir = $this->_translateWinPath($p_add_dir); + $p_remove_dir = $this->_translateWinPath($p_remove_dir, false); + + if (!$this->_file) { + $this->_error('Invalid file descriptor'); + return false; + } + + if (sizeof($p_list) == 0) + return true; + + foreach ($p_list as $v_filename) { + if (!$v_result) { + break; + } + + // ----- Skip the current tar name + if ($v_filename == $this->_tarname) + continue; + + if ($v_filename == '') + continue; + + // ----- ignore files and directories matching the ignore regular expression + if ($this->_ignore_regexp && preg_match($this->_ignore_regexp, '/'.$v_filename)) { + $this->_warning("File '$v_filename' ignored"); + continue; + } + + if (!file_exists($v_filename) && !is_link($v_filename)) { + $this->_warning("File '$v_filename' does not exist"); + continue; + } + + // ----- Add the file or directory header + if (!$this->_addFile($v_filename, $v_header, $p_add_dir, $p_remove_dir)) + return false; + + if (@is_dir($v_filename) && !@is_link($v_filename)) { + if (!($p_hdir = opendir($v_filename))) { + $this->_warning("Directory '$v_filename' can not be read"); + continue; + } + while (false !== ($p_hitem = readdir($p_hdir))) { + if (($p_hitem != '.') && ($p_hitem != '..')) { + if ($v_filename != ".") + $p_temp_list[0] = $v_filename.'/'.$p_hitem; + else + $p_temp_list[0] = $p_hitem; + + $v_result = $this->_addList($p_temp_list, + $p_add_dir, + $p_remove_dir); + } + } + + unset($p_temp_list); + unset($p_hdir); + unset($p_hitem); + } + } + + return $v_result; + } + // }}} + + // {{{ _addFile() + function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir) + { + if (!$this->_file) { + $this->_error('Invalid file descriptor'); + return false; + } + + if ($p_filename == '') { + $this->_error('Invalid file name'); + return false; + } + + // ----- Calculate the stored filename + $p_filename = $this->_translateWinPath($p_filename, false);; + $v_stored_filename = $p_filename; + if (strcmp($p_filename, $p_remove_dir) == 0) { + return true; + } + if ($p_remove_dir != '') { + if (substr($p_remove_dir, -1) != '/') + $p_remove_dir .= '/'; + + if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir) + $v_stored_filename = substr($p_filename, strlen($p_remove_dir)); + } + $v_stored_filename = $this->_translateWinPath($v_stored_filename); + if ($p_add_dir != '') { + if (substr($p_add_dir, -1) == '/') + $v_stored_filename = $p_add_dir.$v_stored_filename; + else + $v_stored_filename = $p_add_dir.'/'.$v_stored_filename; + } + + $v_stored_filename = $this->_pathReduction($v_stored_filename); + + if ($this->_isArchive($p_filename)) { + if (($v_file = @fopen($p_filename, "rb")) == 0) { + $this->_warning("Unable to open file '".$p_filename + ."' in binary read mode"); + return true; + } + + if (!$this->_writeHeader($p_filename, $v_stored_filename)) + return false; + + while (($v_buffer = fread($v_file, 512)) != '') { + $v_binary_data = pack("a512", "$v_buffer"); + $this->_writeBlock($v_binary_data); + } + + fclose($v_file); + + } else { + // ----- Only header for dir + if (!$this->_writeHeader($p_filename, $v_stored_filename)) + return false; + } + + return true; + } + // }}} + + // {{{ _addString() + function _addString($p_filename, $p_string, $p_datetime = false) + { + if (!$this->_file) { + $this->_error('Invalid file descriptor'); + return false; + } + + if ($p_filename == '') { + $this->_error('Invalid file name'); + return false; + } + + // ----- Calculate the stored filename + $p_filename = $this->_translateWinPath($p_filename, false);; + + // ----- If datetime is not specified, set current time + if ($p_datetime === false) { + $p_datetime = time(); + } + + if (!$this->_writeHeaderBlock($p_filename, strlen($p_string), + $p_datetime, 384, "", 0, 0)) + return false; + + $i=0; + while (($v_buffer = substr($p_string, (($i++)*512), 512)) != '') { + $v_binary_data = pack("a512", $v_buffer); + $this->_writeBlock($v_binary_data); + } + + return true; + } + // }}} + + // {{{ _writeHeader() + function _writeHeader($p_filename, $p_stored_filename) + { + if ($p_stored_filename == '') + $p_stored_filename = $p_filename; + $v_reduce_filename = $this->_pathReduction($p_stored_filename); + + if (strlen($v_reduce_filename) > 99) { + if (!$this->_writeLongHeader($v_reduce_filename)) + return false; + } + + $v_info = lstat($p_filename); + $v_uid = sprintf("%07s", DecOct($v_info[4])); + $v_gid = sprintf("%07s", DecOct($v_info[5])); + $v_perms = sprintf("%07s", DecOct($v_info['mode'] & 000777)); + + $v_mtime = sprintf("%011s", DecOct($v_info['mtime'])); + + $v_linkname = ''; + + if (@is_link($p_filename)) { + $v_typeflag = '2'; + $v_linkname = readlink($p_filename); + $v_size = sprintf("%011s", DecOct(0)); + } elseif (@is_dir($p_filename)) { + $v_typeflag = "5"; + $v_size = sprintf("%011s", DecOct(0)); + } else { + $v_typeflag = '0'; + clearstatcache(); + $v_size = sprintf("%011s", DecOct($v_info['size'])); + } + + $v_magic = 'ustar '; + + $v_version = ' '; + + if (function_exists('posix_getpwuid')) + { + $userinfo = posix_getpwuid($v_info[4]); + $groupinfo = posix_getgrgid($v_info[5]); + + $v_uname = $userinfo['name']; + $v_gname = $groupinfo['name']; + } + else + { + $v_uname = ''; + $v_gname = ''; + } + + $v_devmajor = ''; + + $v_devminor = ''; + + $v_prefix = ''; + + $v_binary_data_first = pack("a100a8a8a8a12a12", + $v_reduce_filename, $v_perms, $v_uid, + $v_gid, $v_size, $v_mtime); + $v_binary_data_last = pack("a1a100a6a2a32a32a8a8a155a12", + $v_typeflag, $v_linkname, $v_magic, + $v_version, $v_uname, $v_gname, + $v_devmajor, $v_devminor, $v_prefix, ''); + + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + for ($i=0; $i<148; $i++) + $v_checksum += ord(substr($v_binary_data_first,$i,1)); + // ..... Ignore the checksum value and replace it by ' ' (space) + for ($i=148; $i<156; $i++) + $v_checksum += ord(' '); + // ..... Last part of the header + for ($i=156, $j=0; $i<512; $i++, $j++) + $v_checksum += ord(substr($v_binary_data_last,$j,1)); + + // ----- Write the first 148 bytes of the header in the archive + $this->_writeBlock($v_binary_data_first, 148); + + // ----- Write the calculated checksum + $v_checksum = sprintf("%06s ", DecOct($v_checksum)); + $v_binary_data = pack("a8", $v_checksum); + $this->_writeBlock($v_binary_data, 8); + + // ----- Write the last 356 bytes of the header in the archive + $this->_writeBlock($v_binary_data_last, 356); + + return true; + } + // }}} + + // {{{ _writeHeaderBlock() + function _writeHeaderBlock($p_filename, $p_size, $p_mtime=0, $p_perms=0, + $p_type='', $p_uid=0, $p_gid=0) + { + $p_filename = $this->_pathReduction($p_filename); + + if (strlen($p_filename) > 99) { + if (!$this->_writeLongHeader($p_filename)) + return false; + } + + if ($p_type == "5") { + $v_size = sprintf("%011s", DecOct(0)); + } else { + $v_size = sprintf("%011s", DecOct($p_size)); + } + + $v_uid = sprintf("%07s", DecOct($p_uid)); + $v_gid = sprintf("%07s", DecOct($p_gid)); + $v_perms = sprintf("%07s", DecOct($p_perms & 000777)); + + $v_mtime = sprintf("%11s", DecOct($p_mtime)); + + $v_linkname = ''; + + $v_magic = 'ustar '; + + $v_version = ' '; + + if (function_exists('posix_getpwuid')) + { + $userinfo = posix_getpwuid($p_uid); + $groupinfo = posix_getgrgid($p_gid); + + $v_uname = $userinfo['name']; + $v_gname = $groupinfo['name']; + } + else + { + $v_uname = ''; + $v_gname = ''; + } + + $v_devmajor = ''; + + $v_devminor = ''; + + $v_prefix = ''; + + $v_binary_data_first = pack("a100a8a8a8a12A12", + $p_filename, $v_perms, $v_uid, $v_gid, + $v_size, $v_mtime); + $v_binary_data_last = pack("a1a100a6a2a32a32a8a8a155a12", + $p_type, $v_linkname, $v_magic, + $v_version, $v_uname, $v_gname, + $v_devmajor, $v_devminor, $v_prefix, ''); + + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + for ($i=0; $i<148; $i++) + $v_checksum += ord(substr($v_binary_data_first,$i,1)); + // ..... Ignore the checksum value and replace it by ' ' (space) + for ($i=148; $i<156; $i++) + $v_checksum += ord(' '); + // ..... Last part of the header + for ($i=156, $j=0; $i<512; $i++, $j++) + $v_checksum += ord(substr($v_binary_data_last,$j,1)); + + // ----- Write the first 148 bytes of the header in the archive + $this->_writeBlock($v_binary_data_first, 148); + + // ----- Write the calculated checksum + $v_checksum = sprintf("%06s ", DecOct($v_checksum)); + $v_binary_data = pack("a8", $v_checksum); + $this->_writeBlock($v_binary_data, 8); + + // ----- Write the last 356 bytes of the header in the archive + $this->_writeBlock($v_binary_data_last, 356); + + return true; + } + // }}} + + // {{{ _writeLongHeader() + function _writeLongHeader($p_filename) + { + $v_size = sprintf("%11s ", DecOct(strlen($p_filename))); + + $v_typeflag = 'L'; + + $v_linkname = ''; + + $v_magic = ''; + + $v_version = ''; + + $v_uname = ''; + + $v_gname = ''; + + $v_devmajor = ''; + + $v_devminor = ''; + + $v_prefix = ''; + + $v_binary_data_first = pack("a100a8a8a8a12a12", + '././@LongLink', 0, 0, 0, $v_size, 0); + $v_binary_data_last = pack("a1a100a6a2a32a32a8a8a155a12", + $v_typeflag, $v_linkname, $v_magic, + $v_version, $v_uname, $v_gname, + $v_devmajor, $v_devminor, $v_prefix, ''); + + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + for ($i=0; $i<148; $i++) + $v_checksum += ord(substr($v_binary_data_first,$i,1)); + // ..... Ignore the checksum value and replace it by ' ' (space) + for ($i=148; $i<156; $i++) + $v_checksum += ord(' '); + // ..... Last part of the header + for ($i=156, $j=0; $i<512; $i++, $j++) + $v_checksum += ord(substr($v_binary_data_last,$j,1)); + + // ----- Write the first 148 bytes of the header in the archive + $this->_writeBlock($v_binary_data_first, 148); + + // ----- Write the calculated checksum + $v_checksum = sprintf("%06s ", DecOct($v_checksum)); + $v_binary_data = pack("a8", $v_checksum); + $this->_writeBlock($v_binary_data, 8); + + // ----- Write the last 356 bytes of the header in the archive + $this->_writeBlock($v_binary_data_last, 356); + + // ----- Write the filename as content of the block + $i=0; + while (($v_buffer = substr($p_filename, (($i++)*512), 512)) != '') { + $v_binary_data = pack("a512", "$v_buffer"); + $this->_writeBlock($v_binary_data); + } + + return true; + } + // }}} + + // {{{ _readHeader() + function _readHeader($v_binary_data, &$v_header) + { + if (strlen($v_binary_data)==0) { + $v_header['filename'] = ''; + return true; + } + + if (strlen($v_binary_data) != 512) { + $v_header['filename'] = ''; + $this->_error('Invalid block size : '.strlen($v_binary_data)); + return false; + } + + if (!is_array($v_header)) { + $v_header = array(); + } + // ----- Calculate the checksum + $v_checksum = 0; + // ..... First part of the header + for ($i=0; $i<148; $i++) + $v_checksum+=ord(substr($v_binary_data,$i,1)); + // ..... Ignore the checksum value and replace it by ' ' (space) + for ($i=148; $i<156; $i++) + $v_checksum += ord(' '); + // ..... Last part of the header + for ($i=156; $i<512; $i++) + $v_checksum+=ord(substr($v_binary_data,$i,1)); + + if (version_compare(PHP_VERSION,"5.5.0-dev")<0) { + $fmt = "a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/" . + "a8checksum/a1typeflag/a100link/a6magic/a2version/" . + "a32uname/a32gname/a8devmajor/a8devminor/a131prefix"; + } else { + $fmt = "Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/" . + "Z8checksum/Z1typeflag/Z100link/Z6magic/Z2version/" . + "Z32uname/Z32gname/Z8devmajor/Z8devminor/Z131prefix"; + } + $v_data = unpack($fmt, $v_binary_data); + + if (strlen($v_data["prefix"]) > 0) { + $v_data["filename"] = "$v_data[prefix]/$v_data[filename]"; + } + + // ----- Extract the checksum + $v_header['checksum'] = OctDec(trim($v_data['checksum'])); + if ($v_header['checksum'] != $v_checksum) { + $v_header['filename'] = ''; + + // ----- Look for last block (empty block) + if (($v_checksum == 256) && ($v_header['checksum'] == 0)) + return true; + + $this->_error('Invalid checksum for file "'.$v_data['filename'] + .'" : '.$v_checksum.' calculated, ' + .$v_header['checksum'].' expected'); + return false; + } + + // ----- Extract the properties + $v_header['filename'] = $v_data['filename']; + if ($this->_maliciousFilename($v_header['filename'])) { + $this->_error('Malicious .tar detected, file "' . $v_header['filename'] . + '" will not install in desired directory tree'); + return false; + } + $v_header['mode'] = OctDec(trim($v_data['mode'])); + $v_header['uid'] = OctDec(trim($v_data['uid'])); + $v_header['gid'] = OctDec(trim($v_data['gid'])); + $v_header['size'] = OctDec(trim($v_data['size'])); + $v_header['mtime'] = OctDec(trim($v_data['mtime'])); + if (($v_header['typeflag'] = $v_data['typeflag']) == "5") { + $v_header['size'] = 0; + } + $v_header['link'] = trim($v_data['link']); + /* ----- All these fields are removed form the header because + they do not carry interesting info + $v_header[magic] = trim($v_data[magic]); + $v_header[version] = trim($v_data[version]); + $v_header[uname] = trim($v_data[uname]); + $v_header[gname] = trim($v_data[gname]); + $v_header[devmajor] = trim($v_data[devmajor]); + $v_header[devminor] = trim($v_data[devminor]); + */ + + return true; + } + // }}} + + // {{{ _maliciousFilename() + /** + * Detect and report a malicious file name + * + * @param string $file + * + * @return bool + * @access private + */ + function _maliciousFilename($file) + { + if (strpos($file, '/../') !== false) { + return true; + } + if (strpos($file, '../') === 0) { + return true; + } + return false; + } + // }}} + + // {{{ _readLongHeader() + function _readLongHeader(&$v_header) + { + $v_filename = ''; + $n = floor($v_header['size']/512); + for ($i=0; $i<$n; $i++) { + $v_content = $this->_readBlock(); + $v_filename .= $v_content; + } + if (($v_header['size'] % 512) != 0) { + $v_content = $this->_readBlock(); + $v_filename .= trim($v_content); + } + + // ----- Read the next header + $v_binary_data = $this->_readBlock(); + + if (!$this->_readHeader($v_binary_data, $v_header)) + return false; + + $v_filename = trim($v_filename); + $v_header['filename'] = $v_filename; + if ($this->_maliciousFilename($v_filename)) { + $this->_error('Malicious .tar detected, file "' . $v_filename . + '" will not install in desired directory tree'); + return false; + } + + return true; + } + // }}} + + // {{{ _extractInString() + /** + * This method extract from the archive one file identified by $p_filename. + * The return value is a string with the file content, or null on error. + * + * @param string $p_filename The path of the file to extract in a string. + * + * @return a string with the file content or null. + * @access private + */ + function _extractInString($p_filename) + { + $v_result_str = ""; + + While (strlen($v_binary_data = $this->_readBlock()) != 0) + { + if (!$this->_readHeader($v_binary_data, $v_header)) + return null; + + if ($v_header['filename'] == '') + continue; + + // ----- Look for long filename + if ($v_header['typeflag'] == 'L') { + if (!$this->_readLongHeader($v_header)) + return null; + } + + if ($v_header['filename'] == $p_filename) { + if ($v_header['typeflag'] == "5") { + $this->_error('Unable to extract in string a directory ' + .'entry {'.$v_header['filename'].'}'); + return null; + } else { + $n = floor($v_header['size']/512); + for ($i=0; $i<$n; $i++) { + $v_result_str .= $this->_readBlock(); + } + if (($v_header['size'] % 512) != 0) { + $v_content = $this->_readBlock(); + $v_result_str .= substr($v_content, 0, + ($v_header['size'] % 512)); + } + return $v_result_str; + } + } else { + $this->_jumpBlock(ceil(($v_header['size']/512))); + } + } + + return null; + } + // }}} + + // {{{ _extractList() + function _extractList($p_path, &$p_list_detail, $p_mode, + $p_file_list, $p_remove_path, $p_preserve=false) + { + $v_result=true; + $v_nb = 0; + $v_extract_all = true; + $v_listing = false; + + $p_path = $this->_translateWinPath($p_path, false); + if ($p_path == '' || (substr($p_path, 0, 1) != '/' + && substr($p_path, 0, 3) != "../" && !strpos($p_path, ':'))) { + $p_path = "./".$p_path; + } + $p_remove_path = $this->_translateWinPath($p_remove_path); + + // ----- Look for path to remove format (should end by /) + if (($p_remove_path != '') && (substr($p_remove_path, -1) != '/')) + $p_remove_path .= '/'; + $p_remove_path_size = strlen($p_remove_path); + + switch ($p_mode) { + case "complete" : + $v_extract_all = true; + $v_listing = false; + break; + case "partial" : + $v_extract_all = false; + $v_listing = false; + break; + case "list" : + $v_extract_all = false; + $v_listing = true; + break; + default : + $this->_error('Invalid extract mode ('.$p_mode.')'); + return false; + } + + clearstatcache(); + + while (strlen($v_binary_data = $this->_readBlock()) != 0) + { + $v_extract_file = FALSE; + $v_extraction_stopped = 0; + + if (!$this->_readHeader($v_binary_data, $v_header)) + return false; + + if ($v_header['filename'] == '') { + continue; + } + + // ----- Look for long filename + if ($v_header['typeflag'] == 'L') { + if (!$this->_readLongHeader($v_header)) + return false; + } + + if ((!$v_extract_all) && (is_array($p_file_list))) { + // ----- By default no unzip if the file is not found + $v_extract_file = false; + + for ($i=0; $i<sizeof($p_file_list); $i++) { + // ----- Look if it is a directory + if (substr($p_file_list[$i], -1) == '/') { + // ----- Look if the directory is in the filename path + if ((strlen($v_header['filename']) > strlen($p_file_list[$i])) + && (substr($v_header['filename'], 0, strlen($p_file_list[$i])) + == $p_file_list[$i])) { + $v_extract_file = true; + break; + } + } + + // ----- It is a file, so compare the file names + elseif ($p_file_list[$i] == $v_header['filename']) { + $v_extract_file = true; + break; + } + } + } else { + $v_extract_file = true; + } + + // ----- Look if this file need to be extracted + if (($v_extract_file) && (!$v_listing)) + { + if (($p_remove_path != '') + && (substr($v_header['filename'].'/', 0, $p_remove_path_size) + == $p_remove_path)) { + $v_header['filename'] = substr($v_header['filename'], + $p_remove_path_size); + if( $v_header['filename'] == '' ){ + continue; + } + } + if (($p_path != './') && ($p_path != '/')) { + while (substr($p_path, -1) == '/') + $p_path = substr($p_path, 0, strlen($p_path)-1); + + if (substr($v_header['filename'], 0, 1) == '/') + $v_header['filename'] = $p_path.$v_header['filename']; + else + $v_header['filename'] = $p_path.'/'.$v_header['filename']; + } + if (file_exists($v_header['filename'])) { + if ( (@is_dir($v_header['filename'])) + && ($v_header['typeflag'] == '')) { + $this->_error('File '.$v_header['filename'] + .' already exists as a directory'); + return false; + } + if ( ($this->_isArchive($v_header['filename'])) + && ($v_header['typeflag'] == "5")) { + $this->_error('Directory '.$v_header['filename'] + .' already exists as a file'); + return false; + } + if (!is_writeable($v_header['filename'])) { + $this->_error('File '.$v_header['filename'] + .' already exists and is write protected'); + return false; + } + if (filemtime($v_header['filename']) > $v_header['mtime']) { + // To be completed : An error or silent no replace ? + } + } + + // ----- Check the directory availability and create it if necessary + elseif (($v_result + = $this->_dirCheck(($v_header['typeflag'] == "5" + ?$v_header['filename'] + :dirname($v_header['filename'])))) != 1) { + $this->_error('Unable to create path for '.$v_header['filename']); + return false; + } + + if ($v_extract_file) { + if ($v_header['typeflag'] == "5") { + if (!@file_exists($v_header['filename'])) { + if (!@mkdir($v_header['filename'], 0777)) { + $this->_error('Unable to create directory {' + .$v_header['filename'].'}'); + return false; + } + } + } elseif ($v_header['typeflag'] == "2") { + if (@file_exists($v_header['filename'])) { + @unlink($v_header['filename']); + } + if (!@symlink($v_header['link'], $v_header['filename'])) { + $this->_error('Unable to extract symbolic link {' + .$v_header['filename'].'}'); + return false; + } + } else { + if (($v_dest_file = @fopen($v_header['filename'], "wb")) == 0) { + $this->_error('Error while opening {'.$v_header['filename'] + .'} in write binary mode'); + return false; + } else { + $n = floor($v_header['size']/512); + for ($i=0; $i<$n; $i++) { + $v_content = $this->_readBlock(); + fwrite($v_dest_file, $v_content, 512); + } + if (($v_header['size'] % 512) != 0) { + $v_content = $this->_readBlock(); + fwrite($v_dest_file, $v_content, ($v_header['size'] % 512)); + } + + @fclose($v_dest_file); + + if ($p_preserve) { + @chown($v_header['filename'], $v_header['uid']); + @chgrp($v_header['filename'], $v_header['gid']); + } + + // ----- Change the file mode, mtime + @touch($v_header['filename'], $v_header['mtime']); + if ($v_header['mode'] & 0111) { + // make file executable, obey umask + $mode = fileperms($v_header['filename']) | (~umask() & 0111); + @chmod($v_header['filename'], $mode); + } + } + + // ----- Check the file size + clearstatcache(); + if (!is_file($v_header['filename'])) { + $this->_error('Extracted file '.$v_header['filename'] + .'does not exist. Archive may be corrupted.'); + return false; + } + + $filesize = filesize($v_header['filename']); + if ($filesize != $v_header['size']) { + $this->_error('Extracted file '.$v_header['filename'] + .' does not have the correct file size \'' + .$filesize + .'\' ('.$v_header['size'] + .' expected). Archive may be corrupted.'); + return false; + } + } + } else { + $this->_jumpBlock(ceil(($v_header['size']/512))); + } + } else { + $this->_jumpBlock(ceil(($v_header['size']/512))); + } + + /* TBC : Seems to be unused ... + if ($this->_compress) + $v_end_of_file = @gzeof($this->_file); + else + $v_end_of_file = @feof($this->_file); + */ + + if ($v_listing || $v_extract_file || $v_extraction_stopped) { + // ----- Log extracted files + if (($v_file_dir = dirname($v_header['filename'])) + == $v_header['filename']) + $v_file_dir = ''; + if ((substr($v_header['filename'], 0, 1) == '/') && ($v_file_dir == '')) + $v_file_dir = '/'; + + $p_list_detail[$v_nb++] = $v_header; + if (is_array($p_file_list) && (count($p_list_detail) == count($p_file_list))) { + return true; + } + } + } + + return true; + } + // }}} + + // {{{ _openAppend() + function _openAppend() + { + if (filesize($this->_tarname) == 0) + return $this->_openWrite(); + + if ($this->_compress) { + $this->_close(); + + if (!@rename($this->_tarname, $this->_tarname.".tmp")) { + $this->_error('Error while renaming \''.$this->_tarname + .'\' to temporary file \''.$this->_tarname + .'.tmp\''); + return false; + } + + if ($this->_compress_type == 'gz') + $v_temp_tar = @gzopen($this->_tarname.".tmp", "rb"); + elseif ($this->_compress_type == 'bz2') + $v_temp_tar = @bzopen($this->_tarname.".tmp", "r"); + + if ($v_temp_tar == 0) { + $this->_error('Unable to open file \''.$this->_tarname + .'.tmp\' in binary read mode'); + @rename($this->_tarname.".tmp", $this->_tarname); + return false; + } + + if (!$this->_openWrite()) { + @rename($this->_tarname.".tmp", $this->_tarname); + return false; + } + + if ($this->_compress_type == 'gz') { + $end_blocks = 0; + + while (!@gzeof($v_temp_tar)) { + $v_buffer = @gzread($v_temp_tar, 512); + if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { + $end_blocks++; + // do not copy end blocks, we will re-make them + // after appending + continue; + } elseif ($end_blocks > 0) { + for ($i = 0; $i < $end_blocks; $i++) { + $this->_writeBlock(ARCHIVE_TAR_END_BLOCK); + } + $end_blocks = 0; + } + $v_binary_data = pack("a512", $v_buffer); + $this->_writeBlock($v_binary_data); + } + + @gzclose($v_temp_tar); + } + elseif ($this->_compress_type == 'bz2') { + $end_blocks = 0; + + while (strlen($v_buffer = @bzread($v_temp_tar, 512)) > 0) { + if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { + $end_blocks++; + // do not copy end blocks, we will re-make them + // after appending + continue; + } elseif ($end_blocks > 0) { + for ($i = 0; $i < $end_blocks; $i++) { + $this->_writeBlock(ARCHIVE_TAR_END_BLOCK); + } + $end_blocks = 0; + } + $v_binary_data = pack("a512", $v_buffer); + $this->_writeBlock($v_binary_data); + } + + @bzclose($v_temp_tar); + } + + if (!@unlink($this->_tarname.".tmp")) { + $this->_error('Error while deleting temporary file \'' + .$this->_tarname.'.tmp\''); + } + + } else { + // ----- For not compressed tar, just add files before the last + // one or two 512 bytes block + if (!$this->_openReadWrite()) + return false; + + clearstatcache(); + $v_size = filesize($this->_tarname); + + // We might have zero, one or two end blocks. + // The standard is two, but we should try to handle + // other cases. + fseek($this->_file, $v_size - 1024); + if (fread($this->_file, 512) == ARCHIVE_TAR_END_BLOCK) { + fseek($this->_file, $v_size - 1024); + } + elseif (fread($this->_file, 512) == ARCHIVE_TAR_END_BLOCK) { + fseek($this->_file, $v_size - 512); + } + } + + return true; + } + // }}} + + // {{{ _append() + function _append($p_filelist, $p_add_dir='', $p_remove_dir='') + { + if (!$this->_openAppend()) + return false; + + if ($this->_addList($p_filelist, $p_add_dir, $p_remove_dir)) + $this->_writeFooter(); + + $this->_close(); + + return true; + } + // }}} + + // {{{ _dirCheck() + + /** + * Check if a directory exists and create it (including parent + * dirs) if not. + * + * @param string $p_dir directory to check + * + * @return bool true if the directory exists or was created + */ + function _dirCheck($p_dir) + { + clearstatcache(); + if ((@is_dir($p_dir)) || ($p_dir == '')) + return true; + + $p_parent_dir = dirname($p_dir); + + if (($p_parent_dir != $p_dir) && + ($p_parent_dir != '') && + (!$this->_dirCheck($p_parent_dir))) + return false; + + if (!@mkdir($p_dir, 0777)) { + $this->_error("Unable to create directory '$p_dir'"); + return false; + } + + return true; + } + + // }}} + + // {{{ _pathReduction() + + /** + * Compress path by changing for example "/dir/foo/../bar" to "/dir/bar", + * rand emove double slashes. + * + * @param string $p_dir path to reduce + * + * @return string reduced path + * + * @access private + * + */ + function _pathReduction($p_dir) + { + $v_result = ''; + + // ----- Look for not empty path + if ($p_dir != '') { + // ----- Explode path by directory names + $v_list = explode('/', $p_dir); + + // ----- Study directories from last to first + for ($i=sizeof($v_list)-1; $i>=0; $i--) { + // ----- Look for current path + if ($v_list[$i] == ".") { + // ----- Ignore this directory + // Should be the first $i=0, but no check is done + } + else if ($v_list[$i] == "..") { + // ----- Ignore it and ignore the $i-1 + $i--; + } + else if ( ($v_list[$i] == '') + && ($i!=(sizeof($v_list)-1)) + && ($i!=0)) { + // ----- Ignore only the double '//' in path, + // but not the first and last / + } else { + $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?'/' + .$v_result:''); + } + } + } + + if (defined('OS_WINDOWS') && OS_WINDOWS) { + $v_result = strtr($v_result, '\\', '/'); + } + + return $v_result; + } + + // }}} + + // {{{ _translateWinPath() + function _translateWinPath($p_path, $p_remove_disk_letter=true) + { + if (defined('OS_WINDOWS') && OS_WINDOWS) { + // ----- Look for potential disk letter + if ( ($p_remove_disk_letter) + && (($v_position = strpos($p_path, ':')) != false)) { + $p_path = substr($p_path, $v_position+1); + } + // ----- Change potential windows directory separator + if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { + $p_path = strtr($p_path, '\\', '/'); + } + } + return $p_path; + } + // }}} + +} +?> diff --git a/vendor/pear-pear.php.net/Console_Getopt/Console/Getopt.php b/vendor/pear-pear.php.net/Console_Getopt/Console/Getopt.php new file mode 100644 index 0000000000000000000000000000000000000000..d8abfc491d444a85ca35ed1f7165abd3ef821d1c --- /dev/null +++ b/vendor/pear-pear.php.net/Console_Getopt/Console/Getopt.php @@ -0,0 +1,366 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** + * PHP Version 5 + * + * Copyright (c) 1997-2004 The PHP Group + * + * This source file is subject to version 3.0 of the PHP license, + * that is bundled with this package in the file LICENSE, and is + * available through the world-wide-web at the following url: + * http://www.php.net/license/3_0.txt. + * If you did not receive a copy of the PHP license and are unable to + * obtain it through the world-wide-web, please send a note to + * license@php.net so we can mail you a copy immediately. + * + * @category Console + * @package Console_Getopt + * @author Andrei Zmievski <andrei@php.net> + * @license http://www.php.net/license/3_0.txt PHP 3.0 + * @version CVS: $Id: Getopt.php 306067 2010-12-08 00:13:31Z dufuz $ + * @link http://pear.php.net/package/Console_Getopt + */ + +require_once 'PEAR.php'; + +/** + * Command-line options parsing class. + * + * @category Console + * @package Console_Getopt + * @author Andrei Zmievski <andrei@php.net> + * @license http://www.php.net/license/3_0.txt PHP 3.0 + * @link http://pear.php.net/package/Console_Getopt + */ +class Console_Getopt +{ + + /** + * Parses the command-line options. + * + * The first parameter to this function should be the list of command-line + * arguments without the leading reference to the running program. + * + * The second parameter is a string of allowed short options. Each of the + * option letters can be followed by a colon ':' to specify that the option + * requires an argument, or a double colon '::' to specify that the option + * takes an optional argument. + * + * The third argument is an optional array of allowed long options. The + * leading '--' should not be included in the option name. Options that + * require an argument should be followed by '=', and options that take an + * option argument should be followed by '=='. + * + * The return value is an array of two elements: the list of parsed + * options and the list of non-option command-line arguments. Each entry in + * the list of parsed options is a pair of elements - the first one + * specifies the option, and the second one specifies the option argument, + * if there was one. + * + * Long and short options can be mixed. + * + * Most of the semantics of this function are based on GNU getopt_long(). + * + * @param array $args an array of command-line arguments + * @param string $short_options specifies the list of allowed short options + * @param array $long_options specifies the list of allowed long options + * @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option + * + * @return array two-element array containing the list of parsed options and + * the non-option arguments + * @access public + */ + function getopt2($args, $short_options, $long_options = null, $skip_unknown = false) + { + return Console_Getopt::doGetopt(2, $args, $short_options, $long_options, $skip_unknown); + } + + /** + * This function expects $args to start with the script name (POSIX-style). + * Preserved for backwards compatibility. + * + * @param array $args an array of command-line arguments + * @param string $short_options specifies the list of allowed short options + * @param array $long_options specifies the list of allowed long options + * + * @see getopt2() + * @return array two-element array containing the list of parsed options and + * the non-option arguments + */ + function getopt($args, $short_options, $long_options = null, $skip_unknown = false) + { + return Console_Getopt::doGetopt(1, $args, $short_options, $long_options, $skip_unknown); + } + + /** + * The actual implementation of the argument parsing code. + * + * @param int $version Version to use + * @param array $args an array of command-line arguments + * @param string $short_options specifies the list of allowed short options + * @param array $long_options specifies the list of allowed long options + * @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option + * + * @return array + */ + function doGetopt($version, $args, $short_options, $long_options = null, $skip_unknown = false) + { + // in case you pass directly readPHPArgv() as the first arg + if (PEAR::isError($args)) { + return $args; + } + + if (empty($args)) { + return array(array(), array()); + } + + $non_opts = $opts = array(); + + settype($args, 'array'); + + if ($long_options) { + sort($long_options); + } + + /* + * Preserve backwards compatibility with callers that relied on + * erroneous POSIX fix. + */ + if ($version < 2) { + if (isset($args[0]{0}) && $args[0]{0} != '-') { + array_shift($args); + } + } + + reset($args); + while (list($i, $arg) = each($args)) { + /* The special element '--' means explicit end of + options. Treat the rest of the arguments as non-options + and end the loop. */ + if ($arg == '--') { + $non_opts = array_merge($non_opts, array_slice($args, $i + 1)); + break; + } + + if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) { + $non_opts = array_merge($non_opts, array_slice($args, $i)); + break; + } elseif (strlen($arg) > 1 && $arg{1} == '-') { + $error = Console_Getopt::_parseLongOption(substr($arg, 2), + $long_options, + $opts, + $args, + $skip_unknown); + if (PEAR::isError($error)) { + return $error; + } + } elseif ($arg == '-') { + // - is stdin + $non_opts = array_merge($non_opts, array_slice($args, $i)); + break; + } else { + $error = Console_Getopt::_parseShortOption(substr($arg, 1), + $short_options, + $opts, + $args, + $skip_unknown); + if (PEAR::isError($error)) { + return $error; + } + } + } + + return array($opts, $non_opts); + } + + /** + * Parse short option + * + * @param string $arg Argument + * @param string[] $short_options Available short options + * @param string[][] &$opts + * @param string[] &$args + * @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option + * + * @access private + * @return void + */ + function _parseShortOption($arg, $short_options, &$opts, &$args, $skip_unknown) + { + for ($i = 0; $i < strlen($arg); $i++) { + $opt = $arg{$i}; + $opt_arg = null; + + /* Try to find the short option in the specifier string. */ + if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':') { + if ($skip_unknown === true) { + break; + } + + $msg = "Console_Getopt: unrecognized option -- $opt"; + return PEAR::raiseError($msg); + } + + if (strlen($spec) > 1 && $spec{1} == ':') { + if (strlen($spec) > 2 && $spec{2} == ':') { + if ($i + 1 < strlen($arg)) { + /* Option takes an optional argument. Use the remainder of + the arg string if there is anything left. */ + $opts[] = array($opt, substr($arg, $i + 1)); + break; + } + } else { + /* Option requires an argument. Use the remainder of the arg + string if there is anything left. */ + if ($i + 1 < strlen($arg)) { + $opts[] = array($opt, substr($arg, $i + 1)); + break; + } else if (list(, $opt_arg) = each($args)) { + /* Else use the next argument. */; + if (Console_Getopt::_isShortOpt($opt_arg) + || Console_Getopt::_isLongOpt($opt_arg)) { + $msg = "option requires an argument --$opt"; + return PEAR::raiseError("Console_Getopt:" . $msg); + } + } else { + $msg = "option requires an argument --$opt"; + return PEAR::raiseError("Console_Getopt:" . $msg); + } + } + } + + $opts[] = array($opt, $opt_arg); + } + } + + /** + * Checks if an argument is a short option + * + * @param string $arg Argument to check + * + * @access private + * @return bool + */ + function _isShortOpt($arg) + { + return strlen($arg) == 2 && $arg[0] == '-' + && preg_match('/[a-zA-Z]/', $arg[1]); + } + + /** + * Checks if an argument is a long option + * + * @param string $arg Argument to check + * + * @access private + * @return bool + */ + function _isLongOpt($arg) + { + return strlen($arg) > 2 && $arg[0] == '-' && $arg[1] == '-' && + preg_match('/[a-zA-Z]+$/', substr($arg, 2)); + } + + /** + * Parse long option + * + * @param string $arg Argument + * @param string[] $long_options Available long options + * @param string[][] &$opts + * @param string[] &$args + * + * @access private + * @return void|PEAR_Error + */ + function _parseLongOption($arg, $long_options, &$opts, &$args, $skip_unknown) + { + @list($opt, $opt_arg) = explode('=', $arg, 2); + + $opt_len = strlen($opt); + + for ($i = 0; $i < count($long_options); $i++) { + $long_opt = $long_options[$i]; + $opt_start = substr($long_opt, 0, $opt_len); + + $long_opt_name = str_replace('=', '', $long_opt); + + /* Option doesn't match. Go on to the next one. */ + if ($long_opt_name != $opt) { + continue; + } + + $opt_rest = substr($long_opt, $opt_len); + + /* Check that the options uniquely matches one of the allowed + options. */ + if ($i + 1 < count($long_options)) { + $next_option_rest = substr($long_options[$i + 1], $opt_len); + } else { + $next_option_rest = ''; + } + + if ($opt_rest != '' && $opt{0} != '=' && + $i + 1 < count($long_options) && + $opt == substr($long_options[$i+1], 0, $opt_len) && + $next_option_rest != '' && + $next_option_rest{0} != '=') { + + $msg = "Console_Getopt: option --$opt is ambiguous"; + return PEAR::raiseError($msg); + } + + if (substr($long_opt, -1) == '=') { + if (substr($long_opt, -2) != '==') { + /* Long option requires an argument. + Take the next argument if one wasn't specified. */; + if (!strlen($opt_arg) && !(list(, $opt_arg) = each($args))) { + $msg = "Console_Getopt: option requires an argument --$opt"; + return PEAR::raiseError($msg); + } + + if (Console_Getopt::_isShortOpt($opt_arg) + || Console_Getopt::_isLongOpt($opt_arg)) { + $msg = "Console_Getopt: option requires an argument --$opt"; + return PEAR::raiseError($msg); + } + } + } else if ($opt_arg) { + $msg = "Console_Getopt: option --$opt doesn't allow an argument"; + return PEAR::raiseError($msg); + } + + $opts[] = array('--' . $opt, $opt_arg); + return; + } + + if ($skip_unknown === true) { + return; + } + + return PEAR::raiseError("Console_Getopt: unrecognized option --$opt"); + } + + /** + * Safely read the $argv PHP array across different PHP configurations. + * Will take care on register_globals and register_argc_argv ini directives + * + * @access public + * @return mixed the $argv PHP array or PEAR error if not registered + */ + function readPHPArgv() + { + global $argv; + if (!is_array($argv)) { + if (!@is_array($_SERVER['argv'])) { + if (!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) { + $msg = "Could not read cmd args (register_argc_argv=Off?)"; + return PEAR::raiseError("Console_Getopt: " . $msg); + } + return $GLOBALS['HTTP_SERVER_VARS']['argv']; + } + return $_SERVER['argv']; + } + return $argv; + } + +} \ No newline at end of file diff --git a/vendor/File/MARC.php b/vendor/pear-pear.php.net/File_MARC/File/MARC.php similarity index 100% rename from vendor/File/MARC.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC.php diff --git a/vendor/File/MARC/Control_Field.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/Control_Field.php similarity index 100% rename from vendor/File/MARC/Control_Field.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/Control_Field.php diff --git a/vendor/File/MARC/Data_Field.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/Data_Field.php similarity index 100% rename from vendor/File/MARC/Data_Field.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/Data_Field.php diff --git a/vendor/File/MARC/Exception.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/Exception.php similarity index 100% rename from vendor/File/MARC/Exception.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/Exception.php diff --git a/vendor/File/MARC/Field.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/Field.php similarity index 100% rename from vendor/File/MARC/Field.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/Field.php diff --git a/vendor/File/MARC/Lint.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/Lint.php similarity index 100% rename from vendor/File/MARC/Lint.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/Lint.php diff --git a/vendor/File/MARC/Lint/CodeData.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/Lint/CodeData.php similarity index 100% rename from vendor/File/MARC/Lint/CodeData.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/Lint/CodeData.php diff --git a/vendor/File/MARC/List.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/List.php similarity index 100% rename from vendor/File/MARC/List.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/List.php diff --git a/vendor/File/MARC/Record.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/Record.php similarity index 100% rename from vendor/File/MARC/Record.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/Record.php diff --git a/vendor/File/MARC/Subfield.php b/vendor/pear-pear.php.net/File_MARC/File/MARC/Subfield.php similarity index 100% rename from vendor/File/MARC/Subfield.php rename to vendor/pear-pear.php.net/File_MARC/File/MARC/Subfield.php diff --git a/vendor/File/MARCBASE.php b/vendor/pear-pear.php.net/File_MARC/File/MARCBASE.php similarity index 100% rename from vendor/File/MARCBASE.php rename to vendor/pear-pear.php.net/File_MARC/File/MARCBASE.php diff --git a/vendor/File/MARCXML.php b/vendor/pear-pear.php.net/File_MARC/File/MARCXML.php similarity index 100% rename from vendor/File/MARCXML.php rename to vendor/pear-pear.php.net/File_MARC/File/MARCXML.php diff --git a/vendor/pear-pear.php.net/PEAR/OS/Guess.php b/vendor/pear-pear.php.net/PEAR/OS/Guess.php new file mode 100644 index 0000000000000000000000000000000000000000..d3f2cc764ebfde597f3b6442cdcc54dc6cb513f6 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/OS/Guess.php @@ -0,0 +1,338 @@ +<?php +/** + * The OS_Guess class + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Gregory Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Guess.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since PEAR 0.1 + */ + +// {{{ uname examples + +// php_uname() without args returns the same as 'uname -a', or a PHP-custom +// string for Windows. +// PHP versions prior to 4.3 return the uname of the host where PHP was built, +// as of 4.3 it returns the uname of the host running the PHP code. +// +// PC RedHat Linux 7.1: +// Linux host.example.com 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown +// +// PC Debian Potato: +// Linux host 2.4.17 #2 SMP Tue Feb 12 15:10:04 CET 2002 i686 unknown +// +// PC FreeBSD 3.3: +// FreeBSD host.example.com 3.3-STABLE FreeBSD 3.3-STABLE #0: Mon Feb 21 00:42:31 CET 2000 root@example.com:/usr/src/sys/compile/CONFIG i386 +// +// PC FreeBSD 4.3: +// FreeBSD host.example.com 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Mon Jun 25 11:19:43 EDT 2001 root@example.com:/usr/src/sys/compile/CONFIG i386 +// +// PC FreeBSD 4.5: +// FreeBSD host.example.com 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Feb 6 23:59:23 CET 2002 root@example.com:/usr/src/sys/compile/CONFIG i386 +// +// PC FreeBSD 4.5 w/uname from GNU shellutils: +// FreeBSD host.example.com 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Feb i386 unknown +// +// HP 9000/712 HP-UX 10: +// HP-UX iq B.10.10 A 9000/712 2008429113 two-user license +// +// HP 9000/712 HP-UX 10 w/uname from GNU shellutils: +// HP-UX host B.10.10 A 9000/712 unknown +// +// IBM RS6000/550 AIX 4.3: +// AIX host 3 4 000003531C00 +// +// AIX 4.3 w/uname from GNU shellutils: +// AIX host 3 4 000003531C00 unknown +// +// SGI Onyx IRIX 6.5 w/uname from GNU shellutils: +// IRIX64 host 6.5 01091820 IP19 mips +// +// SGI Onyx IRIX 6.5: +// IRIX64 host 6.5 01091820 IP19 +// +// SparcStation 20 Solaris 8 w/uname from GNU shellutils: +// SunOS host.example.com 5.8 Generic_108528-12 sun4m sparc +// +// SparcStation 20 Solaris 8: +// SunOS host.example.com 5.8 Generic_108528-12 sun4m sparc SUNW,SPARCstation-20 +// +// Mac OS X (Darwin) +// Darwin home-eden.local 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug 5 19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC Power Macintosh +// +// Mac OS X early versions +// + +// }}} + +/* TODO: + * - define endianness, to allow matchSignature("bigend") etc. + */ + +/** + * Retrieves information about the current operating system + * + * This class uses php_uname() to grok information about the current OS + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Gregory Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class OS_Guess +{ + var $sysname; + var $nodename; + var $cpu; + var $release; + var $extra; + + function OS_Guess($uname = null) + { + list($this->sysname, + $this->release, + $this->cpu, + $this->extra, + $this->nodename) = $this->parseSignature($uname); + } + + function parseSignature($uname = null) + { + static $sysmap = array( + 'HP-UX' => 'hpux', + 'IRIX64' => 'irix', + ); + static $cpumap = array( + 'i586' => 'i386', + 'i686' => 'i386', + 'ppc' => 'powerpc', + ); + if ($uname === null) { + $uname = php_uname(); + } + $parts = preg_split('/\s+/', trim($uname)); + $n = count($parts); + + $release = $machine = $cpu = ''; + $sysname = $parts[0]; + $nodename = $parts[1]; + $cpu = $parts[$n-1]; + $extra = ''; + if ($cpu == 'unknown') { + $cpu = $parts[$n - 2]; + } + + switch ($sysname) { + case 'AIX' : + $release = "$parts[3].$parts[2]"; + break; + case 'Windows' : + switch ($parts[1]) { + case '95/98': + $release = '9x'; + break; + default: + $release = $parts[1]; + break; + } + $cpu = 'i386'; + break; + case 'Linux' : + $extra = $this->_detectGlibcVersion(); + // use only the first two digits from the kernel version + $release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1', $parts[2]); + break; + case 'Mac' : + $sysname = 'darwin'; + $nodename = $parts[2]; + $release = $parts[3]; + if ($cpu == 'Macintosh') { + if ($parts[$n - 2] == 'Power') { + $cpu = 'powerpc'; + } + } + break; + case 'Darwin' : + if ($cpu == 'Macintosh') { + if ($parts[$n - 2] == 'Power') { + $cpu = 'powerpc'; + } + } + $release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1', $parts[2]); + break; + default: + $release = preg_replace('/-.*/', '', $parts[2]); + break; + } + + if (isset($sysmap[$sysname])) { + $sysname = $sysmap[$sysname]; + } else { + $sysname = strtolower($sysname); + } + if (isset($cpumap[$cpu])) { + $cpu = $cpumap[$cpu]; + } + return array($sysname, $release, $cpu, $extra, $nodename); + } + + function _detectGlibcVersion() + { + static $glibc = false; + if ($glibc !== false) { + return $glibc; // no need to run this multiple times + } + $major = $minor = 0; + include_once "System.php"; + // Use glibc's <features.h> header file to + // get major and minor version number: + if (@file_exists('/usr/include/features.h') && + @is_readable('/usr/include/features.h')) { + if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) { + $features_file = fopen('/usr/include/features.h', 'rb'); + while (!feof($features_file)) { + $line = fgets($features_file, 8192); + if (!$line || (strpos($line, '#define') === false)) { + continue; + } + if (strpos($line, '__GLIBC__')) { + // major version number #define __GLIBC__ version + $line = preg_split('/\s+/', $line); + $glibc_major = trim($line[2]); + if (isset($glibc_minor)) { + break; + } + continue; + } + + if (strpos($line, '__GLIBC_MINOR__')) { + // got the minor version number + // #define __GLIBC_MINOR__ version + $line = preg_split('/\s+/', $line); + $glibc_minor = trim($line[2]); + if (isset($glibc_major)) { + break; + } + continue; + } + } + fclose($features_file); + if (!isset($glibc_major) || !isset($glibc_minor)) { + return $glibc = ''; + } + return $glibc = 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ; + } // no cpp + + $tmpfile = System::mktemp("glibctest"); + $fp = fopen($tmpfile, "w"); + fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n"); + fclose($fp); + $cpp = popen("/usr/bin/cpp $tmpfile", "r"); + while ($line = fgets($cpp, 1024)) { + if ($line{0} == '#' || trim($line) == '') { + continue; + } + + if (list($major, $minor) = explode(' ', trim($line))) { + break; + } + } + pclose($cpp); + unlink($tmpfile); + } // features.h + + if (!($major && $minor) && @is_link('/lib/libc.so.6')) { + // Let's try reading the libc.so.6 symlink + if (preg_match('/^libc-(.*)\.so$/', basename(readlink('/lib/libc.so.6')), $matches)) { + list($major, $minor) = explode('.', $matches[1]); + } + } + + if (!($major && $minor)) { + return $glibc = ''; + } + + return $glibc = "glibc{$major}.{$minor}"; + } + + function getSignature() + { + if (empty($this->extra)) { + return "{$this->sysname}-{$this->release}-{$this->cpu}"; + } + return "{$this->sysname}-{$this->release}-{$this->cpu}-{$this->extra}"; + } + + function getSysname() + { + return $this->sysname; + } + + function getNodename() + { + return $this->nodename; + } + + function getCpu() + { + return $this->cpu; + } + + function getRelease() + { + return $this->release; + } + + function getExtra() + { + return $this->extra; + } + + function matchSignature($match) + { + $fragments = is_array($match) ? $match : explode('-', $match); + $n = count($fragments); + $matches = 0; + if ($n > 0) { + $matches += $this->_matchFragment($fragments[0], $this->sysname); + } + if ($n > 1) { + $matches += $this->_matchFragment($fragments[1], $this->release); + } + if ($n > 2) { + $matches += $this->_matchFragment($fragments[2], $this->cpu); + } + if ($n > 3) { + $matches += $this->_matchFragment($fragments[3], $this->extra); + } + return ($matches == $n); + } + + function _matchFragment($fragment, $value) + { + if (strcspn($fragment, '*?') < strlen($fragment)) { + $reg = '/^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '\\z/'; + return preg_match($reg, $value); + } + return ($fragment == '*' || !strcasecmp($fragment, $value)); + } + +} +/* + * Local Variables: + * indent-tabs-mode: nil + * c-basic-offset: 4 + * End: + */ \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR.php b/vendor/pear-pear.php.net/PEAR/PEAR.php new file mode 100644 index 0000000000000000000000000000000000000000..2aa85259d62dc69c0cad3f38320bc82fdcf28af9 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR.php @@ -0,0 +1,1063 @@ +<?php +/** + * PEAR, the PHP Extension and Application Repository + * + * PEAR class and PEAR_Error class + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Sterling Hughes <sterling@php.net> + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V.Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2010 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: PEAR.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/**#@+ + * ERROR constants + */ +define('PEAR_ERROR_RETURN', 1); +define('PEAR_ERROR_PRINT', 2); +define('PEAR_ERROR_TRIGGER', 4); +define('PEAR_ERROR_DIE', 8); +define('PEAR_ERROR_CALLBACK', 16); +/** + * WARNING: obsolete + * @deprecated + */ +define('PEAR_ERROR_EXCEPTION', 32); +/**#@-*/ +define('PEAR_ZE2', (function_exists('version_compare') && + version_compare(zend_version(), "2-dev", "ge"))); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + define('OS_WINDOWS', true); + define('OS_UNIX', false); + define('PEAR_OS', 'Windows'); +} else { + define('OS_WINDOWS', false); + define('OS_UNIX', true); + define('PEAR_OS', 'Unix'); // blatant assumption +} + +$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; +$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; +$GLOBALS['_PEAR_destructor_object_list'] = array(); +$GLOBALS['_PEAR_shutdown_funcs'] = array(); +$GLOBALS['_PEAR_error_handler_stack'] = array(); + +@ini_set('track_errors', true); + +/** + * Base class for other PEAR classes. Provides rudimentary + * emulation of destructors. + * + * If you want a destructor in your class, inherit PEAR and make a + * destructor method called _yourclassname (same name as the + * constructor, but with a "_" prefix). Also, in your constructor you + * have to call the PEAR constructor: $this->PEAR();. + * The destructor method will be called without parameters. Note that + * at in some SAPI implementations (such as Apache), any output during + * the request shutdown (in which destructors are called) seems to be + * discarded. If you need to get any debug information from your + * destructor, use error_log(), syslog() or something similar. + * + * IMPORTANT! To use the emulated destructors you need to create the + * objects by reference: $obj =& new PEAR_child; + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V. Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2006 The PHP Group + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @see PEAR_Error + * @since Class available since PHP 4.0.2 + * @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear + */ +class PEAR +{ + /** + * Whether to enable internal debug messages. + * + * @var bool + * @access private + */ + var $_debug = false; + + /** + * Default error mode for this object. + * + * @var int + * @access private + */ + var $_default_error_mode = null; + + /** + * Default error options used for this object when error mode + * is PEAR_ERROR_TRIGGER. + * + * @var int + * @access private + */ + var $_default_error_options = null; + + /** + * Default error handler (callback) for this object, if error mode is + * PEAR_ERROR_CALLBACK. + * + * @var string + * @access private + */ + var $_default_error_handler = ''; + + /** + * Which class to use for error objects. + * + * @var string + * @access private + */ + var $_error_class = 'PEAR_Error'; + + /** + * An array of expected errors. + * + * @var array + * @access private + */ + var $_expected_errors = array(); + + /** + * Constructor. Registers this object in + * $_PEAR_destructor_object_list for destructor emulation if a + * destructor object exists. + * + * @param string $error_class (optional) which class to use for + * error objects, defaults to PEAR_Error. + * @access public + * @return void + */ + function PEAR($error_class = null) + { + $classname = strtolower(get_class($this)); + if ($this->_debug) { + print "PEAR constructor called, class=$classname\n"; + } + + if ($error_class !== null) { + $this->_error_class = $error_class; + } + + while ($classname && strcasecmp($classname, "pear")) { + $destructor = "_$classname"; + if (method_exists($this, $destructor)) { + global $_PEAR_destructor_object_list; + $_PEAR_destructor_object_list[] = &$this; + if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { + register_shutdown_function("_PEAR_call_destructors"); + $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; + } + break; + } else { + $classname = get_parent_class($classname); + } + } + } + + /** + * Destructor (the emulated type of...). Does nothing right now, + * but is included for forward compatibility, so subclass + * destructors should always call it. + * + * See the note in the class desciption about output from + * destructors. + * + * @access public + * @return void + */ + function _PEAR() { + if ($this->_debug) { + printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); + } + } + + /** + * If you have a class that's mostly/entirely static, and you need static + * properties, you can use this method to simulate them. Eg. in your method(s) + * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); + * You MUST use a reference, or they will not persist! + * + * @access public + * @param string $class The calling classname, to prevent clashes + * @param string $var The variable to retrieve. + * @return mixed A reference to the variable. If not set it will be + * auto initialised to NULL. + */ + function &getStaticProperty($class, $var) + { + static $properties; + if (!isset($properties[$class])) { + $properties[$class] = array(); + } + + if (!array_key_exists($var, $properties[$class])) { + $properties[$class][$var] = null; + } + + return $properties[$class][$var]; + } + + /** + * Use this function to register a shutdown method for static + * classes. + * + * @access public + * @param mixed $func The function name (or array of class/method) to call + * @param mixed $args The arguments to pass to the function + * @return void + */ + function registerShutdownFunc($func, $args = array()) + { + // if we are called statically, there is a potential + // that no shutdown func is registered. Bug #6445 + if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { + register_shutdown_function("_PEAR_call_destructors"); + $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; + } + $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); + } + + /** + * Tell whether a value is a PEAR error. + * + * @param mixed $data the value to test + * @param int $code if $data is an error object, return true + * only if $code is a string and + * $obj->getMessage() == $code or + * $code is an integer and $obj->getCode() == $code + * @access public + * @return bool true if parameter is an error + */ + function isError($data, $code = null) + { + if (!is_a($data, 'PEAR_Error')) { + return false; + } + + if (is_null($code)) { + return true; + } elseif (is_string($code)) { + return $data->getMessage() == $code; + } + + return $data->getCode() == $code; + } + + /** + * Sets how errors generated by this object should be handled. + * Can be invoked both in objects and statically. If called + * statically, setErrorHandling sets the default behaviour for all + * PEAR objects. If called in an object, setErrorHandling sets + * the default behaviour for that object. + * + * @param int $mode + * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. + * + * @param mixed $options + * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one + * of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * + * When $mode is PEAR_ERROR_CALLBACK, this parameter is expected + * to be the callback function or method. A callback + * function is a string with the name of the function, a + * callback method is an array of two elements: the element + * at index 0 is the object, and the element at index 1 is + * the name of the method to call in the object. + * + * When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is + * a printf format string used when printing the error + * message. + * + * @access public + * @return void + * @see PEAR_ERROR_RETURN + * @see PEAR_ERROR_PRINT + * @see PEAR_ERROR_TRIGGER + * @see PEAR_ERROR_DIE + * @see PEAR_ERROR_CALLBACK + * @see PEAR_ERROR_EXCEPTION + * + * @since PHP 4.0.5 + */ + function setErrorHandling($mode = null, $options = null) + { + if (isset($this) && is_a($this, 'PEAR')) { + $setmode = &$this->_default_error_mode; + $setoptions = &$this->_default_error_options; + } else { + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + } + + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + } + + /** + * This method is used to tell which errors you expect to get. + * Expected errors are always returned with error mode + * PEAR_ERROR_RETURN. Expected error codes are stored in a stack, + * and this method pushes a new element onto it. The list of + * expected errors are in effect until they are popped off the + * stack with the popExpect() method. + * + * Note that this method can not be called statically + * + * @param mixed $code a single error code or an array of error codes to expect + * + * @return int the new depth of the "expected errors" stack + * @access public + */ + function expectError($code = '*') + { + if (is_array($code)) { + array_push($this->_expected_errors, $code); + } else { + array_push($this->_expected_errors, array($code)); + } + return count($this->_expected_errors); + } + + /** + * This method pops one element off the expected error codes + * stack. + * + * @return array the list of error codes that were popped + */ + function popExpect() + { + return array_pop($this->_expected_errors); + } + + /** + * This method checks unsets an error code if available + * + * @param mixed error code + * @return bool true if the error code was unset, false otherwise + * @access private + * @since PHP 4.3.0 + */ + function _checkDelExpect($error_code) + { + $deleted = false; + foreach ($this->_expected_errors as $key => $error_array) { + if (in_array($error_code, $error_array)) { + unset($this->_expected_errors[$key][array_search($error_code, $error_array)]); + $deleted = true; + } + + // clean up empty arrays + if (0 == count($this->_expected_errors[$key])) { + unset($this->_expected_errors[$key]); + } + } + + return $deleted; + } + + /** + * This method deletes all occurences of the specified element from + * the expected error codes stack. + * + * @param mixed $error_code error code that should be deleted + * @return mixed list of error codes that were deleted or error + * @access public + * @since PHP 4.3.0 + */ + function delExpect($error_code) + { + $deleted = false; + if ((is_array($error_code) && (0 != count($error_code)))) { + // $error_code is a non-empty array here; we walk through it trying + // to unset all values + foreach ($error_code as $key => $error) { + $deleted = $this->_checkDelExpect($error) ? true : false; + } + + return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } elseif (!empty($error_code)) { + // $error_code comes alone, trying to unset it + if ($this->_checkDelExpect($error_code)) { + return true; + } + + return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME + } + + // $error_code is empty + return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME + } + + /** + * This method is a wrapper that returns an instance of the + * configured error class with this object's default error + * handling applied. If the $mode and $options parameters are not + * specified, the object's defaults are used. + * + * @param mixed $message a text error message or a PEAR error object + * + * @param int $code a numeric error code (it is up to your class + * to define these if you want to use codes) + * + * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, + * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, + * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. + * + * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter + * specifies the PHP-internal error level (one of + * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). + * If $mode is PEAR_ERROR_CALLBACK, this + * parameter specifies the callback function or + * method. In other error modes this parameter + * is ignored. + * + * @param string $userinfo If you need to pass along for example debug + * information, this parameter is meant for that. + * + * @param string $error_class The returned error object will be + * instantiated from this class, if specified. + * + * @param bool $skipmsg If true, raiseError will only pass error codes, + * the error message parameter will be dropped. + * + * @access public + * @return object a PEAR error object + * @see PEAR::setErrorHandling + * @since PHP 4.0.5 + */ + function &raiseError($message = null, + $code = null, + $mode = null, + $options = null, + $userinfo = null, + $error_class = null, + $skipmsg = false) + { + // The error is yet a PEAR error object + if (is_object($message)) { + $code = $message->getCode(); + $userinfo = $message->getUserInfo(); + $error_class = $message->getType(); + $message->error_message_prefix = ''; + $message = $message->getMessage(); + } + + if ( + isset($this) && + isset($this->_expected_errors) && + count($this->_expected_errors) > 0 && + count($exp = end($this->_expected_errors)) + ) { + if ($exp[0] == "*" || + (is_int(reset($exp)) && in_array($code, $exp)) || + (is_string(reset($exp)) && in_array($message, $exp)) + ) { + $mode = PEAR_ERROR_RETURN; + } + } + + // No mode given, try global ones + if ($mode === null) { + // Class error handler + if (isset($this) && isset($this->_default_error_mode)) { + $mode = $this->_default_error_mode; + $options = $this->_default_error_options; + // Global error handler + } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { + $mode = $GLOBALS['_PEAR_default_error_mode']; + $options = $GLOBALS['_PEAR_default_error_options']; + } + } + + if ($error_class !== null) { + $ec = $error_class; + } elseif (isset($this) && isset($this->_error_class)) { + $ec = $this->_error_class; + } else { + $ec = 'PEAR_Error'; + } + + if (intval(PHP_VERSION) < 5) { + // little non-eval hack to fix bug #12147 + include 'PEAR/FixPHP5PEARWarnings.php'; + return $a; + } + + if ($skipmsg) { + $a = new $ec($code, $mode, $options, $userinfo); + } else { + $a = new $ec($message, $code, $mode, $options, $userinfo); + } + + return $a; + } + + /** + * Simpler form of raiseError with fewer options. In most cases + * message, code and userinfo are enough. + * + * @param mixed $message a text error message or a PEAR error object + * + * @param int $code a numeric error code (it is up to your class + * to define these if you want to use codes) + * + * @param string $userinfo If you need to pass along for example debug + * information, this parameter is meant for that. + * + * @access public + * @return object a PEAR error object + * @see PEAR::raiseError + */ + function &throwError($message = null, $code = null, $userinfo = null) + { + if (isset($this) && is_a($this, 'PEAR')) { + $a = &$this->raiseError($message, $code, null, null, $userinfo); + return $a; + } + + $a = &PEAR::raiseError($message, $code, null, null, $userinfo); + return $a; + } + + function staticPushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + $stack[] = array($def_mode, $def_options); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $def_mode = $mode; + $def_options = $options; + break; + + case PEAR_ERROR_CALLBACK: + $def_mode = $mode; + // class/object method callback + if (is_callable($options)) { + $def_options = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + $stack[] = array($mode, $options); + return true; + } + + function staticPopErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + $setmode = &$GLOBALS['_PEAR_default_error_mode']; + $setoptions = &$GLOBALS['_PEAR_default_error_options']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + switch ($mode) { + case PEAR_ERROR_EXCEPTION: + case PEAR_ERROR_RETURN: + case PEAR_ERROR_PRINT: + case PEAR_ERROR_TRIGGER: + case PEAR_ERROR_DIE: + case null: + $setmode = $mode; + $setoptions = $options; + break; + + case PEAR_ERROR_CALLBACK: + $setmode = $mode; + // class/object method callback + if (is_callable($options)) { + $setoptions = $options; + } else { + trigger_error("invalid error callback", E_USER_WARNING); + } + break; + + default: + trigger_error("invalid error mode", E_USER_WARNING); + break; + } + return true; + } + + /** + * Push a new error handler on top of the error handler options stack. With this + * you can easily override the actual error handler for some code and restore + * it later with popErrorHandling. + * + * @param mixed $mode (same as setErrorHandling) + * @param mixed $options (same as setErrorHandling) + * + * @return bool Always true + * + * @see PEAR::setErrorHandling + */ + function pushErrorHandling($mode, $options = null) + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + if (isset($this) && is_a($this, 'PEAR')) { + $def_mode = &$this->_default_error_mode; + $def_options = &$this->_default_error_options; + } else { + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; + } + $stack[] = array($def_mode, $def_options); + + if (isset($this) && is_a($this, 'PEAR')) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + $stack[] = array($mode, $options); + return true; + } + + /** + * Pop the last error handler used + * + * @return bool Always true + * + * @see PEAR::pushErrorHandling + */ + function popErrorHandling() + { + $stack = &$GLOBALS['_PEAR_error_handler_stack']; + array_pop($stack); + list($mode, $options) = $stack[sizeof($stack) - 1]; + array_pop($stack); + if (isset($this) && is_a($this, 'PEAR')) { + $this->setErrorHandling($mode, $options); + } else { + PEAR::setErrorHandling($mode, $options); + } + return true; + } + + /** + * OS independant PHP extension load. Remember to take care + * on the correct extension name for case sensitive OSes. + * + * @param string $ext The extension name + * @return bool Success or not on the dl() call + */ + function loadExtension($ext) + { + if (extension_loaded($ext)) { + return true; + } + + // if either returns true dl() will produce a FATAL error, stop that + if ( + function_exists('dl') === false || + ini_get('enable_dl') != 1 || + ini_get('safe_mode') == 1 + ) { + return false; + } + + if (OS_WINDOWS) { + $suffix = '.dll'; + } elseif (PHP_OS == 'HP-UX') { + $suffix = '.sl'; + } elseif (PHP_OS == 'AIX') { + $suffix = '.a'; + } elseif (PHP_OS == 'OSX') { + $suffix = '.bundle'; + } else { + $suffix = '.so'; + } + + return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); + } +} + +if (PEAR_ZE2) { + include_once 'PEAR5.php'; +} + +function _PEAR_call_destructors() +{ + global $_PEAR_destructor_object_list; + if (is_array($_PEAR_destructor_object_list) && + sizeof($_PEAR_destructor_object_list)) + { + reset($_PEAR_destructor_object_list); + if (PEAR_ZE2) { + $destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo'); + } else { + $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo'); + } + + if ($destructLifoExists) { + $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); + } + + while (list($k, $objref) = each($_PEAR_destructor_object_list)) { + $classname = get_class($objref); + while ($classname) { + $destructor = "_$classname"; + if (method_exists($objref, $destructor)) { + $objref->$destructor(); + break; + } else { + $classname = get_parent_class($classname); + } + } + } + // Empty the object list to ensure that destructors are + // not called more than once. + $_PEAR_destructor_object_list = array(); + } + + // Now call the shutdown functions + if ( + isset($GLOBALS['_PEAR_shutdown_funcs']) && + is_array($GLOBALS['_PEAR_shutdown_funcs']) && + !empty($GLOBALS['_PEAR_shutdown_funcs']) + ) { + foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) { + call_user_func_array($value[0], $value[1]); + } + } +} + +/** + * Standard PEAR error class for PHP 4 + * + * This class is supserseded by {@link PEAR_Exception} in PHP 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V. Cox <cox@idecnet.com> + * @author Gregory Beaver <cellog@php.net> + * @copyright 1997-2006 The PHP Group + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/manual/en/core.pear.pear-error.php + * @see PEAR::raiseError(), PEAR::throwError() + * @since Class available since PHP 4.0.2 + */ +class PEAR_Error +{ + var $error_message_prefix = ''; + var $mode = PEAR_ERROR_RETURN; + var $level = E_USER_NOTICE; + var $code = -1; + var $message = ''; + var $userinfo = ''; + var $backtrace = null; + + /** + * PEAR_Error constructor + * + * @param string $message message + * + * @param int $code (optional) error code + * + * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN, + * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER, + * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION + * + * @param mixed $options (optional) error level, _OR_ in the case of + * PEAR_ERROR_CALLBACK, the callback function or object/method + * tuple. + * + * @param string $userinfo (optional) additional user/debug info + * + * @access public + * + */ + function PEAR_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + if ($mode === null) { + $mode = PEAR_ERROR_RETURN; + } + $this->message = $message; + $this->code = $code; + $this->mode = $mode; + $this->userinfo = $userinfo; + + if (PEAR_ZE2) { + $skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace'); + } else { + $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace'); + } + + if (!$skiptrace) { + $this->backtrace = debug_backtrace(); + if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) { + unset($this->backtrace[0]['object']); + } + } + + if ($mode & PEAR_ERROR_CALLBACK) { + $this->level = E_USER_NOTICE; + $this->callback = $options; + } else { + if ($options === null) { + $options = E_USER_NOTICE; + } + + $this->level = $options; + $this->callback = null; + } + + if ($this->mode & PEAR_ERROR_PRINT) { + if (is_null($options) || is_int($options)) { + $format = "%s"; + } else { + $format = $options; + } + + printf($format, $this->getMessage()); + } + + if ($this->mode & PEAR_ERROR_TRIGGER) { + trigger_error($this->getMessage(), $this->level); + } + + if ($this->mode & PEAR_ERROR_DIE) { + $msg = $this->getMessage(); + if (is_null($options) || is_int($options)) { + $format = "%s"; + if (substr($msg, -1) != "\n") { + $msg .= "\n"; + } + } else { + $format = $options; + } + die(sprintf($format, $msg)); + } + + if ($this->mode & PEAR_ERROR_CALLBACK && is_callable($this->callback)) { + call_user_func($this->callback, $this); + } + + if ($this->mode & PEAR_ERROR_EXCEPTION) { + trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING); + eval('$e = new Exception($this->message, $this->code);throw($e);'); + } + } + + /** + * Get the error mode from an error object. + * + * @return int error mode + * @access public + */ + function getMode() + { + return $this->mode; + } + + /** + * Get the callback function/method from an error object. + * + * @return mixed callback function or object/method array + * @access public + */ + function getCallback() + { + return $this->callback; + } + + /** + * Get the error message from an error object. + * + * @return string full error message + * @access public + */ + function getMessage() + { + return ($this->error_message_prefix . $this->message); + } + + /** + * Get error code from an error object + * + * @return int error code + * @access public + */ + function getCode() + { + return $this->code; + } + + /** + * Get the name of this error/exception. + * + * @return string error/exception name (type) + * @access public + */ + function getType() + { + return get_class($this); + } + + /** + * Get additional user-supplied information. + * + * @return string user-supplied information + * @access public + */ + function getUserInfo() + { + return $this->userinfo; + } + + /** + * Get additional debug information supplied by the application. + * + * @return string debug information + * @access public + */ + function getDebugInfo() + { + return $this->getUserInfo(); + } + + /** + * Get the call backtrace from where the error was generated. + * Supported with PHP 4.3.0 or newer. + * + * @param int $frame (optional) what frame to fetch + * @return array Backtrace, or NULL if not available. + * @access public + */ + function getBacktrace($frame = null) + { + if (defined('PEAR_IGNORE_BACKTRACE')) { + return null; + } + if ($frame === null) { + return $this->backtrace; + } + return $this->backtrace[$frame]; + } + + function addUserInfo($info) + { + if (empty($this->userinfo)) { + $this->userinfo = $info; + } else { + $this->userinfo .= " ** $info"; + } + } + + function __toString() + { + return $this->getMessage(); + } + + /** + * Make a string representation of this object. + * + * @return string a string with an object summary + * @access public + */ + function toString() + { + $modes = array(); + $levels = array(E_USER_NOTICE => 'notice', + E_USER_WARNING => 'warning', + E_USER_ERROR => 'error'); + if ($this->mode & PEAR_ERROR_CALLBACK) { + if (is_array($this->callback)) { + $callback = (is_object($this->callback[0]) ? + strtolower(get_class($this->callback[0])) : + $this->callback[0]) . '::' . + $this->callback[1]; + } else { + $callback = $this->callback; + } + return sprintf('[%s: message="%s" code=%d mode=callback '. + 'callback=%s prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + $callback, $this->error_message_prefix, + $this->userinfo); + } + if ($this->mode & PEAR_ERROR_PRINT) { + $modes[] = 'print'; + } + if ($this->mode & PEAR_ERROR_TRIGGER) { + $modes[] = 'trigger'; + } + if ($this->mode & PEAR_ERROR_DIE) { + $modes[] = 'die'; + } + if ($this->mode & PEAR_ERROR_RETURN) { + $modes[] = 'return'; + } + return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. + 'prefix="%s" info="%s"]', + strtolower(get_class($this)), $this->message, $this->code, + implode("|", $modes), $levels[$this->level], + $this->error_message_prefix, + $this->userinfo); + } +} + +/* + * Local Variables: + * mode: php + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Autoloader.php b/vendor/pear-pear.php.net/PEAR/PEAR/Autoloader.php new file mode 100644 index 0000000000000000000000000000000000000000..0ed707ec842f577ca1649d74e0b4e3446170fb24 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Autoloader.php @@ -0,0 +1,218 @@ +<?php +/** + * Class auto-loader + * + * PHP versions 4 + + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Autoloader.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader + * @since File available since Release 0.1 + * @deprecated File deprecated in Release 1.4.0a1 + */ + +// /* vim: set expandtab tabstop=4 shiftwidth=4: */ + +if (!extension_loaded("overload")) { + // die hard without ext/overload + die("Rebuild PHP with the `overload' extension to use PEAR_Autoloader"); +} + +/** + * Include for PEAR_Error and PEAR classes + */ +require_once "PEAR.php"; + +/** + * This class is for objects where you want to separate the code for + * some methods into separate classes. This is useful if you have a + * class with not-frequently-used methods that contain lots of code + * that you would like to avoid always parsing. + * + * The PEAR_Autoloader class provides autoloading and aggregation. + * The autoloading lets you set up in which classes the separated + * methods are found. Aggregation is the technique used to import new + * methods, an instance of each class providing separated methods is + * stored and called every time the aggregated method is called. + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader + * @since File available since Release 0.1 + * @deprecated File deprecated in Release 1.4.0a1 + */ +class PEAR_Autoloader extends PEAR +{ + // {{{ properties + + /** + * Map of methods and classes where they are defined + * + * @var array + * + * @access private + */ + var $_autoload_map = array(); + + /** + * Map of methods and aggregate objects + * + * @var array + * + * @access private + */ + var $_method_map = array(); + + // }}} + // {{{ addAutoload() + + /** + * Add one or more autoload entries. + * + * @param string $method which method to autoload + * + * @param string $classname (optional) which class to find the method in. + * If the $method parameter is an array, this + * parameter may be omitted (and will be ignored + * if not), and the $method parameter will be + * treated as an associative array with method + * names as keys and class names as values. + * + * @return void + * + * @access public + */ + function addAutoload($method, $classname = null) + { + if (is_array($method)) { + array_walk($method, create_function('$a,&$b', '$b = strtolower($b);')); + $this->_autoload_map = array_merge($this->_autoload_map, $method); + } else { + $this->_autoload_map[strtolower($method)] = $classname; + } + } + + // }}} + // {{{ removeAutoload() + + /** + * Remove an autoload entry. + * + * @param string $method which method to remove the autoload entry for + * + * @return bool TRUE if an entry was removed, FALSE if not + * + * @access public + */ + function removeAutoload($method) + { + $method = strtolower($method); + $ok = isset($this->_autoload_map[$method]); + unset($this->_autoload_map[$method]); + return $ok; + } + + // }}} + // {{{ addAggregateObject() + + /** + * Add an aggregate object to this object. If the specified class + * is not defined, loading it will be attempted following PEAR's + * file naming scheme. All the methods in the class will be + * aggregated, except private ones (name starting with an + * underscore) and constructors. + * + * @param string $classname what class to instantiate for the object. + * + * @return void + * + * @access public + */ + function addAggregateObject($classname) + { + $classname = strtolower($classname); + if (!class_exists($classname)) { + $include_file = preg_replace('/[^a-z0-9]/i', '_', $classname); + include_once $include_file; + } + $obj =& new $classname; + $methods = get_class_methods($classname); + foreach ($methods as $method) { + // don't import priviate methods and constructors + if ($method{0} != '_' && $method != $classname) { + $this->_method_map[$method] = $obj; + } + } + } + + // }}} + // {{{ removeAggregateObject() + + /** + * Remove an aggregate object. + * + * @param string $classname the class of the object to remove + * + * @return bool TRUE if an object was removed, FALSE if not + * + * @access public + */ + function removeAggregateObject($classname) + { + $ok = false; + $classname = strtolower($classname); + reset($this->_method_map); + while (list($method, $obj) = each($this->_method_map)) { + if (is_a($obj, $classname)) { + unset($this->_method_map[$method]); + $ok = true; + } + } + return $ok; + } + + // }}} + // {{{ __call() + + /** + * Overloaded object call handler, called each time an + * undefined/aggregated method is invoked. This method repeats + * the call in the right aggregate object and passes on the return + * value. + * + * @param string $method which method that was called + * + * @param string $args An array of the parameters passed in the + * original call + * + * @return mixed The return value from the aggregated method, or a PEAR + * error if the called method was unknown. + */ + function __call($method, $args, &$retval) + { + $method = strtolower($method); + if (empty($this->_method_map[$method]) && isset($this->_autoload_map[$method])) { + $this->addAggregateObject($this->_autoload_map[$method]); + } + if (isset($this->_method_map[$method])) { + $retval = call_user_func_array(array($this->_method_map[$method], $method), $args); + return true; + } + return false; + } + + // }}} +} + +overload("PEAR_Autoloader"); + +?> diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Builder.php b/vendor/pear-pear.php.net/PEAR/PEAR/Builder.php new file mode 100644 index 0000000000000000000000000000000000000000..90f3a1455524a48454e2d3dd17ea5897b6789660 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Builder.php @@ -0,0 +1,489 @@ +<?php +/** + * PEAR_Builder for building PHP extensions (PECL packages) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Builder.php 313024 2011-07-06 19:51:24Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + * + * TODO: log output parameters in PECL command line + * TODO: msdev path in configuration + */ + +/** + * Needed for extending PEAR_Builder + */ +require_once 'PEAR/Common.php'; +require_once 'PEAR/PackageFile.php'; + +/** + * Class to handle building (compiling) extensions. + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since PHP 4.0.2 + * @see http://pear.php.net/manual/en/core.ppm.pear-builder.php + */ +class PEAR_Builder extends PEAR_Common +{ + var $php_api_version = 0; + var $zend_module_api_no = 0; + var $zend_extension_api_no = 0; + + var $extensions_built = array(); + + /** + * @var string Used for reporting when it is not possible to pass function + * via extra parameter, e.g. log, msdevCallback + */ + var $current_callback = null; + + // used for msdev builds + var $_lastline = null; + var $_firstline = null; + + /** + * PEAR_Builder constructor. + * + * @param object $ui user interface object (instance of PEAR_Frontend_*) + * + * @access public + */ + function PEAR_Builder(&$ui) + { + parent::PEAR_Common(); + $this->setFrontendObject($ui); + } + + /** + * Build an extension from source on windows. + * requires msdev + */ + function _build_win32($descfile, $callback = null) + { + if (is_object($descfile)) { + $pkg = $descfile; + $descfile = $pkg->getPackageFile(); + } else { + $pf = &new PEAR_PackageFile($this->config, $this->debug); + $pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL); + if (PEAR::isError($pkg)) { + return $pkg; + } + } + $dir = dirname($descfile); + $old_cwd = getcwd(); + + if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) { + return $this->raiseError("could not chdir to $dir"); + } + + // packages that were in a .tar have the packagefile in this directory + $vdir = $pkg->getPackage() . '-' . $pkg->getVersion(); + if (file_exists($dir) && is_dir($vdir)) { + if (!chdir($vdir)) { + return $this->raiseError("could not chdir to " . realpath($vdir)); + } + + $dir = getcwd(); + } + + $this->log(2, "building in $dir"); + + $dsp = $pkg->getPackage().'.dsp'; + if (!file_exists("$dir/$dsp")) { + return $this->raiseError("The DSP $dsp does not exist."); + } + // XXX TODO: make release build type configurable + $command = 'msdev '.$dsp.' /MAKE "'.$pkg->getPackage(). ' - Release"'; + + $err = $this->_runCommand($command, array(&$this, 'msdevCallback')); + if (PEAR::isError($err)) { + return $err; + } + + // figure out the build platform and type + $platform = 'Win32'; + $buildtype = 'Release'; + if (preg_match('/.*?'.$pkg->getPackage().'\s-\s(\w+)\s(.*?)-+/i',$this->_firstline,$matches)) { + $platform = $matches[1]; + $buildtype = $matches[2]; + } + + if (preg_match('/(.*)?\s-\s(\d+).*?(\d+)/', $this->_lastline, $matches)) { + if ($matches[2]) { + // there were errors in the build + return $this->raiseError("There were errors during compilation."); + } + $out = $matches[1]; + } else { + return $this->raiseError("Did not understand the completion status returned from msdev.exe."); + } + + // msdev doesn't tell us the output directory :/ + // open the dsp, find /out and use that directory + $dsptext = join(file($dsp),''); + + // this regex depends on the build platform and type having been + // correctly identified above. + $regex ='/.*?!IF\s+"\$\(CFG\)"\s+==\s+("'. + $pkg->getPackage().'\s-\s'. + $platform.'\s'. + $buildtype.'").*?'. + '\/out:"(.*?)"/is'; + + if ($dsptext && preg_match($regex, $dsptext, $matches)) { + // what we get back is a relative path to the output file itself. + $outfile = realpath($matches[2]); + } else { + return $this->raiseError("Could not retrieve output information from $dsp."); + } + // realpath returns false if the file doesn't exist + if ($outfile && copy($outfile, "$dir/$out")) { + $outfile = "$dir/$out"; + } + + $built_files[] = array( + 'file' => "$outfile", + 'php_api' => $this->php_api_version, + 'zend_mod_api' => $this->zend_module_api_no, + 'zend_ext_api' => $this->zend_extension_api_no, + ); + + return $built_files; + } + // }}} + + // {{{ msdevCallback() + function msdevCallback($what, $data) + { + if (!$this->_firstline) + $this->_firstline = $data; + $this->_lastline = $data; + call_user_func($this->current_callback, $what, $data); + } + + /** + * @param string + * @param string + * @param array + * @access private + */ + function _harvestInstDir($dest_prefix, $dirname, &$built_files) + { + $d = opendir($dirname); + if (!$d) + return false; + + $ret = true; + while (($ent = readdir($d)) !== false) { + if ($ent{0} == '.') + continue; + + $full = $dirname . DIRECTORY_SEPARATOR . $ent; + if (is_dir($full)) { + if (!$this->_harvestInstDir( + $dest_prefix . DIRECTORY_SEPARATOR . $ent, + $full, $built_files)) { + $ret = false; + break; + } + } else { + $dest = $dest_prefix . DIRECTORY_SEPARATOR . $ent; + $built_files[] = array( + 'file' => $full, + 'dest' => $dest, + 'php_api' => $this->php_api_version, + 'zend_mod_api' => $this->zend_module_api_no, + 'zend_ext_api' => $this->zend_extension_api_no, + ); + } + } + closedir($d); + return $ret; + } + + /** + * Build an extension from source. Runs "phpize" in the source + * directory, but compiles in a temporary directory + * (TMPDIR/pear-build-USER/PACKAGE-VERSION). + * + * @param string|PEAR_PackageFile_v* $descfile path to XML package description file, or + * a PEAR_PackageFile object + * + * @param mixed $callback callback function used to report output, + * see PEAR_Builder::_runCommand for details + * + * @return array an array of associative arrays with built files, + * format: + * array( array( 'file' => '/path/to/ext.so', + * 'php_api' => YYYYMMDD, + * 'zend_mod_api' => YYYYMMDD, + * 'zend_ext_api' => YYYYMMDD ), + * ... ) + * + * @access public + * + * @see PEAR_Builder::_runCommand + */ + function build($descfile, $callback = null) + { + if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php(.+)?$/', + $this->config->get('php_bin'), $matches)) { + if (isset($matches[2]) && strlen($matches[2]) && + trim($matches[2]) != trim($this->config->get('php_prefix'))) { + $this->log(0, 'WARNING: php_bin ' . $this->config->get('php_bin') . + ' appears to have a prefix ' . $matches[2] . ', but' . + ' config variable php_prefix does not match'); + } + + if (isset($matches[3]) && strlen($matches[3]) && + trim($matches[3]) != trim($this->config->get('php_suffix'))) { + $this->log(0, 'WARNING: php_bin ' . $this->config->get('php_bin') . + ' appears to have a suffix ' . $matches[3] . ', but' . + ' config variable php_suffix does not match'); + } + } + + $this->current_callback = $callback; + if (PEAR_OS == "Windows") { + return $this->_build_win32($descfile, $callback); + } + + if (PEAR_OS != 'Unix') { + return $this->raiseError("building extensions not supported on this platform"); + } + + if (is_object($descfile)) { + $pkg = $descfile; + $descfile = $pkg->getPackageFile(); + if (is_a($pkg, 'PEAR_PackageFile_v1')) { + $dir = dirname($descfile); + } else { + $dir = $pkg->_config->get('temp_dir') . '/' . $pkg->getName(); + // automatically delete at session end + $this->addTempFile($dir); + } + } else { + $pf = &new PEAR_PackageFile($this->config); + $pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL); + if (PEAR::isError($pkg)) { + return $pkg; + } + $dir = dirname($descfile); + } + + // Find config. outside of normal path - e.g. config.m4 + foreach (array_keys($pkg->getInstallationFileList()) as $item) { + if (stristr(basename($item), 'config.m4') && dirname($item) != '.') { + $dir .= DIRECTORY_SEPARATOR . dirname($item); + break; + } + } + + $old_cwd = getcwd(); + if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) { + return $this->raiseError("could not chdir to $dir"); + } + + $vdir = $pkg->getPackage() . '-' . $pkg->getVersion(); + if (is_dir($vdir)) { + chdir($vdir); + } + + $dir = getcwd(); + $this->log(2, "building in $dir"); + putenv('PATH=' . $this->config->get('bin_dir') . ':' . getenv('PATH')); + $err = $this->_runCommand($this->config->get('php_prefix') + . "phpize" . + $this->config->get('php_suffix'), + array(&$this, 'phpizeCallback')); + if (PEAR::isError($err)) { + return $err; + } + + if (!$err) { + return $this->raiseError("`phpize' failed"); + } + + // {{{ start of interactive part + $configure_command = "$dir/configure"; + $configure_options = $pkg->getConfigureOptions(); + if ($configure_options) { + foreach ($configure_options as $o) { + $default = array_key_exists('default', $o) ? $o['default'] : null; + list($r) = $this->ui->userDialog('build', + array($o['prompt']), + array('text'), + array($default)); + if (substr($o['name'], 0, 5) == 'with-' && + ($r == 'yes' || $r == 'autodetect')) { + $configure_command .= " --$o[name]"; + } else { + $configure_command .= " --$o[name]=".trim($r); + } + } + } + // }}} end of interactive part + + // FIXME make configurable + if (!$user=getenv('USER')) { + $user='defaultuser'; + } + + $tmpdir = $this->config->get('temp_dir'); + $build_basedir = System::mktemp(' -t "' . $tmpdir . '" -d "pear-build-' . $user . '"'); + $build_dir = "$build_basedir/$vdir"; + $inst_dir = "$build_basedir/install-$vdir"; + $this->log(1, "building in $build_dir"); + if (is_dir($build_dir)) { + System::rm(array('-rf', $build_dir)); + } + + if (!System::mkDir(array('-p', $build_dir))) { + return $this->raiseError("could not create build dir: $build_dir"); + } + + $this->addTempFile($build_dir); + if (!System::mkDir(array('-p', $inst_dir))) { + return $this->raiseError("could not create temporary install dir: $inst_dir"); + } + $this->addTempFile($inst_dir); + + $make_command = getenv('MAKE') ? getenv('MAKE') : 'make'; + + $to_run = array( + $configure_command, + $make_command, + "$make_command INSTALL_ROOT=\"$inst_dir\" install", + "find \"$inst_dir\" | xargs ls -dils" + ); + if (!file_exists($build_dir) || !is_dir($build_dir) || !chdir($build_dir)) { + return $this->raiseError("could not chdir to $build_dir"); + } + putenv('PHP_PEAR_VERSION=1.9.4'); + foreach ($to_run as $cmd) { + $err = $this->_runCommand($cmd, $callback); + if (PEAR::isError($err)) { + chdir($old_cwd); + return $err; + } + if (!$err) { + chdir($old_cwd); + return $this->raiseError("`$cmd' failed"); + } + } + if (!($dp = opendir("modules"))) { + chdir($old_cwd); + return $this->raiseError("no `modules' directory found"); + } + $built_files = array(); + $prefix = exec($this->config->get('php_prefix') + . "php-config" . + $this->config->get('php_suffix') . " --prefix"); + $this->_harvestInstDir($prefix, $inst_dir . DIRECTORY_SEPARATOR . $prefix, $built_files); + chdir($old_cwd); + return $built_files; + } + + /** + * Message callback function used when running the "phpize" + * program. Extracts the API numbers used. Ignores other message + * types than "cmdoutput". + * + * @param string $what the type of message + * @param mixed $data the message + * + * @return void + * + * @access public + */ + function phpizeCallback($what, $data) + { + if ($what != 'cmdoutput') { + return; + } + $this->log(1, rtrim($data)); + if (preg_match('/You should update your .aclocal.m4/', $data)) { + return; + } + $matches = array(); + if (preg_match('/^\s+(\S[^:]+):\s+(\d{8})/', $data, $matches)) { + $member = preg_replace('/[^a-z]/', '_', strtolower($matches[1])); + $apino = (int)$matches[2]; + if (isset($this->$member)) { + $this->$member = $apino; + //$msg = sprintf("%-22s : %d", $matches[1], $apino); + //$this->log(1, $msg); + } + } + } + + /** + * Run an external command, using a message callback to report + * output. The command will be run through popen and output is + * reported for every line with a "cmdoutput" message with the + * line string, including newlines, as payload. + * + * @param string $command the command to run + * + * @param mixed $callback (optional) function to use as message + * callback + * + * @return bool whether the command was successful (exit code 0 + * means success, any other means failure) + * + * @access private + */ + function _runCommand($command, $callback = null) + { + $this->log(1, "running: $command"); + $pp = popen("$command 2>&1", "r"); + if (!$pp) { + return $this->raiseError("failed to run `$command'"); + } + if ($callback && $callback[0]->debug == 1) { + $olddbg = $callback[0]->debug; + $callback[0]->debug = 2; + } + + while ($line = fgets($pp, 1024)) { + if ($callback) { + call_user_func($callback, 'cmdoutput', $line); + } else { + $this->log(2, rtrim($line)); + } + } + if ($callback && isset($olddbg)) { + $callback[0]->debug = $olddbg; + } + + $exitcode = is_resource($pp) ? pclose($pp) : -1; + return ($exitcode == 0); + } + + function log($level, $msg) + { + if ($this->current_callback) { + if ($this->debug >= $level) { + call_user_func($this->current_callback, 'output', $msg); + } + return; + } + return PEAR_Common::log($level, $msg); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/ChannelFile.php b/vendor/pear-pear.php.net/PEAR/PEAR/ChannelFile.php new file mode 100644 index 0000000000000000000000000000000000000000..f2c02ab42b78848676665937a6eaa954ba6af23a --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/ChannelFile.php @@ -0,0 +1,1559 @@ +<?php +/** + * PEAR_ChannelFile, the channel handling class + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: ChannelFile.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * Needed for error handling + */ +require_once 'PEAR/ErrorStack.php'; +require_once 'PEAR/XMLParser.php'; +require_once 'PEAR/Common.php'; + +/** + * Error code if the channel.xml <channel> tag does not contain a valid version + */ +define('PEAR_CHANNELFILE_ERROR_NO_VERSION', 1); +/** + * Error code if the channel.xml <channel> tag version is not supported (version 1.0 is the only supported version, + * currently + */ +define('PEAR_CHANNELFILE_ERROR_INVALID_VERSION', 2); + +/** + * Error code if parsing is attempted with no xml extension + */ +define('PEAR_CHANNELFILE_ERROR_NO_XML_EXT', 3); + +/** + * Error code if creating the xml parser resource fails + */ +define('PEAR_CHANNELFILE_ERROR_CANT_MAKE_PARSER', 4); + +/** + * Error code used for all sax xml parsing errors + */ +define('PEAR_CHANNELFILE_ERROR_PARSER_ERROR', 5); + +/**#@+ + * Validation errors + */ +/** + * Error code when channel name is missing + */ +define('PEAR_CHANNELFILE_ERROR_NO_NAME', 6); +/** + * Error code when channel name is invalid + */ +define('PEAR_CHANNELFILE_ERROR_INVALID_NAME', 7); +/** + * Error code when channel summary is missing + */ +define('PEAR_CHANNELFILE_ERROR_NO_SUMMARY', 8); +/** + * Error code when channel summary is multi-line + */ +define('PEAR_CHANNELFILE_ERROR_MULTILINE_SUMMARY', 9); +/** + * Error code when channel server is missing for protocol + */ +define('PEAR_CHANNELFILE_ERROR_NO_HOST', 10); +/** + * Error code when channel server is invalid for protocol + */ +define('PEAR_CHANNELFILE_ERROR_INVALID_HOST', 11); +/** + * Error code when a mirror name is invalid + */ +define('PEAR_CHANNELFILE_ERROR_INVALID_MIRROR', 21); +/** + * Error code when a mirror type is invalid + */ +define('PEAR_CHANNELFILE_ERROR_INVALID_MIRRORTYPE', 22); +/** + * Error code when an attempt is made to generate xml, but the parsed content is invalid + */ +define('PEAR_CHANNELFILE_ERROR_INVALID', 23); +/** + * Error code when an empty package name validate regex is passed in + */ +define('PEAR_CHANNELFILE_ERROR_EMPTY_REGEX', 24); +/** + * Error code when a <function> tag has no version + */ +define('PEAR_CHANNELFILE_ERROR_NO_FUNCTIONVERSION', 25); +/** + * Error code when a <function> tag has no name + */ +define('PEAR_CHANNELFILE_ERROR_NO_FUNCTIONNAME', 26); +/** + * Error code when a <validatepackage> tag has no name + */ +define('PEAR_CHANNELFILE_ERROR_NOVALIDATE_NAME', 27); +/** + * Error code when a <validatepackage> tag has no version attribute + */ +define('PEAR_CHANNELFILE_ERROR_NOVALIDATE_VERSION', 28); +/** + * Error code when a mirror does not exist but is called for in one of the set* + * methods. + */ +define('PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND', 32); +/** + * Error code when a server port is not numeric + */ +define('PEAR_CHANNELFILE_ERROR_INVALID_PORT', 33); +/** + * Error code when <static> contains no version attribute + */ +define('PEAR_CHANNELFILE_ERROR_NO_STATICVERSION', 34); +/** + * Error code when <baseurl> contains no type attribute in a <rest> protocol definition + */ +define('PEAR_CHANNELFILE_ERROR_NOBASEURLTYPE', 35); +/** + * Error code when a mirror is defined and the channel.xml represents the __uri pseudo-channel + */ +define('PEAR_CHANNELFILE_URI_CANT_MIRROR', 36); +/** + * Error code when ssl attribute is present and is not "yes" + */ +define('PEAR_CHANNELFILE_ERROR_INVALID_SSL', 37); +/**#@-*/ + +/** + * Mirror types allowed. Currently only internet servers are recognized. + */ +$GLOBALS['_PEAR_CHANNELS_MIRROR_TYPES'] = array('server'); + + +/** + * The Channel handling class + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_ChannelFile +{ + /** + * @access private + * @var PEAR_ErrorStack + * @access private + */ + var $_stack; + + /** + * Supported channel.xml versions, for parsing + * @var array + * @access private + */ + var $_supportedVersions = array('1.0'); + + /** + * Parsed channel information + * @var array + * @access private + */ + var $_channelInfo; + + /** + * index into the subchannels array, used for parsing xml + * @var int + * @access private + */ + var $_subchannelIndex; + + /** + * index into the mirrors array, used for parsing xml + * @var int + * @access private + */ + var $_mirrorIndex; + + /** + * Flag used to determine the validity of parsed content + * @var boolean + * @access private + */ + var $_isValid = false; + + function PEAR_ChannelFile() + { + $this->_stack = &new PEAR_ErrorStack('PEAR_ChannelFile'); + $this->_stack->setErrorMessageTemplate($this->_getErrorMessage()); + $this->_isValid = false; + } + + /** + * @return array + * @access protected + */ + function _getErrorMessage() + { + return + array( + PEAR_CHANNELFILE_ERROR_INVALID_VERSION => + 'While parsing channel.xml, an invalid version number "%version% was passed in, expecting one of %versions%', + PEAR_CHANNELFILE_ERROR_NO_VERSION => + 'No version number found in <channel> tag', + PEAR_CHANNELFILE_ERROR_NO_XML_EXT => + '%error%', + PEAR_CHANNELFILE_ERROR_CANT_MAKE_PARSER => + 'Unable to create XML parser', + PEAR_CHANNELFILE_ERROR_PARSER_ERROR => + '%error%', + PEAR_CHANNELFILE_ERROR_NO_NAME => + 'Missing channel name', + PEAR_CHANNELFILE_ERROR_INVALID_NAME => + 'Invalid channel %tag% "%name%"', + PEAR_CHANNELFILE_ERROR_NO_SUMMARY => + 'Missing channel summary', + PEAR_CHANNELFILE_ERROR_MULTILINE_SUMMARY => + 'Channel summary should be on one line, but is multi-line', + PEAR_CHANNELFILE_ERROR_NO_HOST => + 'Missing channel server for %type% server', + PEAR_CHANNELFILE_ERROR_INVALID_HOST => + 'Server name "%server%" is invalid for %type% server', + PEAR_CHANNELFILE_ERROR_INVALID_MIRROR => + 'Invalid mirror name "%name%", mirror type %type%', + PEAR_CHANNELFILE_ERROR_INVALID_MIRRORTYPE => + 'Invalid mirror type "%type%"', + PEAR_CHANNELFILE_ERROR_INVALID => + 'Cannot generate xml, contents are invalid', + PEAR_CHANNELFILE_ERROR_EMPTY_REGEX => + 'packagenameregex cannot be empty', + PEAR_CHANNELFILE_ERROR_NO_FUNCTIONVERSION => + '%parent% %protocol% function has no version', + PEAR_CHANNELFILE_ERROR_NO_FUNCTIONNAME => + '%parent% %protocol% function has no name', + PEAR_CHANNELFILE_ERROR_NOBASEURLTYPE => + '%parent% rest baseurl has no type', + PEAR_CHANNELFILE_ERROR_NOVALIDATE_NAME => + 'Validation package has no name in <validatepackage> tag', + PEAR_CHANNELFILE_ERROR_NOVALIDATE_VERSION => + 'Validation package "%package%" has no version', + PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND => + 'Mirror "%mirror%" does not exist', + PEAR_CHANNELFILE_ERROR_INVALID_PORT => + 'Port "%port%" must be numeric', + PEAR_CHANNELFILE_ERROR_NO_STATICVERSION => + '<static> tag must contain version attribute', + PEAR_CHANNELFILE_URI_CANT_MIRROR => + 'The __uri pseudo-channel cannot have mirrors', + PEAR_CHANNELFILE_ERROR_INVALID_SSL => + '%server% has invalid ssl attribute "%ssl%" can only be yes or not present', + ); + } + + /** + * @param string contents of package.xml file + * @return bool success of parsing + */ + function fromXmlString($data) + { + if (preg_match('/<channel\s+version="([0-9]+\.[0-9]+)"/', $data, $channelversion)) { + if (!in_array($channelversion[1], $this->_supportedVersions)) { + $this->_stack->push(PEAR_CHANNELFILE_ERROR_INVALID_VERSION, 'error', + array('version' => $channelversion[1])); + return false; + } + $parser = new PEAR_XMLParser; + $result = $parser->parse($data); + if ($result !== true) { + if ($result->getCode() == 1) { + $this->_stack->push(PEAR_CHANNELFILE_ERROR_NO_XML_EXT, 'error', + array('error' => $result->getMessage())); + } else { + $this->_stack->push(PEAR_CHANNELFILE_ERROR_CANT_MAKE_PARSER, 'error'); + } + return false; + } + $this->_channelInfo = $parser->getData(); + return true; + } else { + $this->_stack->push(PEAR_CHANNELFILE_ERROR_NO_VERSION, 'error', array('xml' => $data)); + return false; + } + } + + /** + * @return array + */ + function toArray() + { + if (!$this->_isValid && !$this->validate()) { + return false; + } + return $this->_channelInfo; + } + + /** + * @param array + * @static + * @return PEAR_ChannelFile|false false if invalid + */ + function &fromArray($data, $compatibility = false, $stackClass = 'PEAR_ErrorStack') + { + $a = new PEAR_ChannelFile($compatibility, $stackClass); + $a->_fromArray($data); + if (!$a->validate()) { + $a = false; + return $a; + } + return $a; + } + + /** + * Unlike {@link fromArray()} this does not do any validation + * @param array + * @static + * @return PEAR_ChannelFile + */ + function &fromArrayWithErrors($data, $compatibility = false, + $stackClass = 'PEAR_ErrorStack') + { + $a = new PEAR_ChannelFile($compatibility, $stackClass); + $a->_fromArray($data); + return $a; + } + + /** + * @param array + * @access private + */ + function _fromArray($data) + { + $this->_channelInfo = $data; + } + + /** + * Wrapper to {@link PEAR_ErrorStack::getErrors()} + * @param boolean determines whether to purge the error stack after retrieving + * @return array + */ + function getErrors($purge = false) + { + return $this->_stack->getErrors($purge); + } + + /** + * Unindent given string (?) + * + * @param string $str The string that has to be unindented. + * @return string + * @access private + */ + function _unIndent($str) + { + // remove leading newlines + $str = preg_replace('/^[\r\n]+/', '', $str); + // find whitespace at the beginning of the first line + $indent_len = strspn($str, " \t"); + $indent = substr($str, 0, $indent_len); + $data = ''; + // remove the same amount of whitespace from following lines + foreach (explode("\n", $str) as $line) { + if (substr($line, 0, $indent_len) == $indent) { + $data .= substr($line, $indent_len) . "\n"; + } + } + return $data; + } + + /** + * Parse a channel.xml file. Expects the name of + * a channel xml file as input. + * + * @param string $descfile name of channel xml file + * @return bool success of parsing + */ + function fromXmlFile($descfile) + { + if (!file_exists($descfile) || !is_file($descfile) || !is_readable($descfile) || + (!$fp = fopen($descfile, 'r'))) { + require_once 'PEAR.php'; + return PEAR::raiseError("Unable to open $descfile"); + } + + // read the whole thing so we only get one cdata callback + // for each block of cdata + fclose($fp); + $data = file_get_contents($descfile); + return $this->fromXmlString($data); + } + + /** + * Parse channel information from different sources + * + * This method is able to extract information about a channel + * from an .xml file or a string + * + * @access public + * @param string Filename of the source or the source itself + * @return bool + */ + function fromAny($info) + { + if (is_string($info) && file_exists($info) && strlen($info) < 255) { + $tmp = substr($info, -4); + if ($tmp == '.xml') { + $info = $this->fromXmlFile($info); + } else { + $fp = fopen($info, "r"); + $test = fread($fp, 5); + fclose($fp); + if ($test == "<?xml") { + $info = $this->fromXmlFile($info); + } + } + if (PEAR::isError($info)) { + require_once 'PEAR.php'; + return PEAR::raiseError($info); + } + } + if (is_string($info)) { + $info = $this->fromXmlString($info); + } + return $info; + } + + /** + * Return an XML document based on previous parsing and modifications + * + * @return string XML data + * + * @access public + */ + function toXml() + { + if (!$this->_isValid && !$this->validate()) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID); + return false; + } + if (!isset($this->_channelInfo['attribs']['version'])) { + $this->_channelInfo['attribs']['version'] = '1.0'; + } + $channelInfo = $this->_channelInfo; + $ret = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"; + $ret .= "<channel version=\"" . + $channelInfo['attribs']['version'] . "\" xmlns=\"http://pear.php.net/channel-1.0\" + xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" + xsi:schemaLocation=\"http://pear.php.net/dtd/channel-" + . $channelInfo['attribs']['version'] . " http://pear.php.net/dtd/channel-" . + $channelInfo['attribs']['version'] . ".xsd\"> + <name>$channelInfo[name]</name> + <summary>" . htmlspecialchars($channelInfo['summary'])."</summary> +"; + if (isset($channelInfo['suggestedalias'])) { + $ret .= ' <suggestedalias>' . $channelInfo['suggestedalias'] . "</suggestedalias>\n"; + } + if (isset($channelInfo['validatepackage'])) { + $ret .= ' <validatepackage version="' . + $channelInfo['validatepackage']['attribs']['version']. '">' . + htmlspecialchars($channelInfo['validatepackage']['_content']) . + "</validatepackage>\n"; + } + $ret .= " <servers>\n"; + $ret .= ' <primary'; + if (isset($channelInfo['servers']['primary']['attribs']['ssl'])) { + $ret .= ' ssl="' . $channelInfo['servers']['primary']['attribs']['ssl'] . '"'; + } + if (isset($channelInfo['servers']['primary']['attribs']['port'])) { + $ret .= ' port="' . $channelInfo['servers']['primary']['attribs']['port'] . '"'; + } + $ret .= ">\n"; + if (isset($channelInfo['servers']['primary']['rest'])) { + $ret .= $this->_makeRestXml($channelInfo['servers']['primary']['rest'], ' '); + } + $ret .= " </primary>\n"; + if (isset($channelInfo['servers']['mirror'])) { + $ret .= $this->_makeMirrorsXml($channelInfo); + } + $ret .= " </servers>\n"; + $ret .= "</channel>"; + return str_replace("\r", "\n", str_replace("\r\n", "\n", $ret)); + } + + /** + * Generate the <rest> tag + * @access private + */ + function _makeRestXml($info, $indent) + { + $ret = $indent . "<rest>\n"; + if (isset($info['baseurl']) && !isset($info['baseurl'][0])) { + $info['baseurl'] = array($info['baseurl']); + } + + if (isset($info['baseurl'])) { + foreach ($info['baseurl'] as $url) { + $ret .= "$indent <baseurl type=\"" . $url['attribs']['type'] . "\""; + $ret .= ">" . $url['_content'] . "</baseurl>\n"; + } + } + $ret .= $indent . "</rest>\n"; + return $ret; + } + + /** + * Generate the <mirrors> tag + * @access private + */ + function _makeMirrorsXml($channelInfo) + { + $ret = ""; + if (!isset($channelInfo['servers']['mirror'][0])) { + $channelInfo['servers']['mirror'] = array($channelInfo['servers']['mirror']); + } + foreach ($channelInfo['servers']['mirror'] as $mirror) { + $ret .= ' <mirror host="' . $mirror['attribs']['host'] . '"'; + if (isset($mirror['attribs']['port'])) { + $ret .= ' port="' . $mirror['attribs']['port'] . '"'; + } + if (isset($mirror['attribs']['ssl'])) { + $ret .= ' ssl="' . $mirror['attribs']['ssl'] . '"'; + } + $ret .= ">\n"; + if (isset($mirror['rest'])) { + if (isset($mirror['rest'])) { + $ret .= $this->_makeRestXml($mirror['rest'], ' '); + } + $ret .= " </mirror>\n"; + } else { + $ret .= "/>\n"; + } + } + return $ret; + } + + /** + * Generate the <functions> tag + * @access private + */ + function _makeFunctionsXml($functions, $indent, $rest = false) + { + $ret = ''; + if (!isset($functions[0])) { + $functions = array($functions); + } + foreach ($functions as $function) { + $ret .= "$indent<function version=\"" . $function['attribs']['version'] . "\""; + if ($rest) { + $ret .= ' uri="' . $function['attribs']['uri'] . '"'; + } + $ret .= ">" . $function['_content'] . "</function>\n"; + } + return $ret; + } + + /** + * Validation error. Also marks the object contents as invalid + * @param error code + * @param array error information + * @access private + */ + function _validateError($code, $params = array()) + { + $this->_stack->push($code, 'error', $params); + $this->_isValid = false; + } + + /** + * Validation warning. Does not mark the object contents invalid. + * @param error code + * @param array error information + * @access private + */ + function _validateWarning($code, $params = array()) + { + $this->_stack->push($code, 'warning', $params); + } + + /** + * Validate parsed file. + * + * @access public + * @return boolean + */ + function validate() + { + $this->_isValid = true; + $info = $this->_channelInfo; + if (empty($info['name'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NO_NAME); + } elseif (!$this->validChannelServer($info['name'])) { + if ($info['name'] != '__uri') { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_NAME, array('tag' => 'name', + 'name' => $info['name'])); + } + } + if (empty($info['summary'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NO_SUMMARY); + } elseif (strpos(trim($info['summary']), "\n") !== false) { + $this->_validateWarning(PEAR_CHANNELFILE_ERROR_MULTILINE_SUMMARY, + array('summary' => $info['summary'])); + } + if (isset($info['suggestedalias'])) { + if (!$this->validChannelServer($info['suggestedalias'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_NAME, + array('tag' => 'suggestedalias', 'name' =>$info['suggestedalias'])); + } + } + if (isset($info['localalias'])) { + if (!$this->validChannelServer($info['localalias'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_NAME, + array('tag' => 'localalias', 'name' =>$info['localalias'])); + } + } + if (isset($info['validatepackage'])) { + if (!isset($info['validatepackage']['_content'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NOVALIDATE_NAME); + } + if (!isset($info['validatepackage']['attribs']['version'])) { + $content = isset($info['validatepackage']['_content']) ? + $info['validatepackage']['_content'] : + null; + $this->_validateError(PEAR_CHANNELFILE_ERROR_NOVALIDATE_VERSION, + array('package' => $content)); + } + } + + if (isset($info['servers']['primary']['attribs'], $info['servers']['primary']['attribs']['port']) && + !is_numeric($info['servers']['primary']['attribs']['port'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_PORT, + array('port' => $info['servers']['primary']['attribs']['port'])); + } + + if (isset($info['servers']['primary']['attribs'], $info['servers']['primary']['attribs']['ssl']) && + $info['servers']['primary']['attribs']['ssl'] != 'yes') { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_SSL, + array('ssl' => $info['servers']['primary']['attribs']['ssl'], + 'server' => $info['name'])); + } + + if (isset($info['servers']['primary']['rest']) && + isset($info['servers']['primary']['rest']['baseurl'])) { + $this->_validateFunctions('rest', $info['servers']['primary']['rest']['baseurl']); + } + if (isset($info['servers']['mirror'])) { + if ($this->_channelInfo['name'] == '__uri') { + $this->_validateError(PEAR_CHANNELFILE_URI_CANT_MIRROR); + } + if (!isset($info['servers']['mirror'][0])) { + $info['servers']['mirror'] = array($info['servers']['mirror']); + } + foreach ($info['servers']['mirror'] as $mirror) { + if (!isset($mirror['attribs']['host'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NO_HOST, + array('type' => 'mirror')); + } elseif (!$this->validChannelServer($mirror['attribs']['host'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_HOST, + array('server' => $mirror['attribs']['host'], 'type' => 'mirror')); + } + if (isset($mirror['attribs']['ssl']) && $mirror['attribs']['ssl'] != 'yes') { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_SSL, + array('ssl' => $info['ssl'], 'server' => $mirror['attribs']['host'])); + } + if (isset($mirror['rest'])) { + $this->_validateFunctions('rest', $mirror['rest']['baseurl'], + $mirror['attribs']['host']); + } + } + } + return $this->_isValid; + } + + /** + * @param string rest - protocol name this function applies to + * @param array the functions + * @param string the name of the parent element (mirror name, for instance) + */ + function _validateFunctions($protocol, $functions, $parent = '') + { + if (!isset($functions[0])) { + $functions = array($functions); + } + + foreach ($functions as $function) { + if (!isset($function['_content']) || empty($function['_content'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NO_FUNCTIONNAME, + array('parent' => $parent, 'protocol' => $protocol)); + } + + if ($protocol == 'rest') { + if (!isset($function['attribs']['type']) || + empty($function['attribs']['type'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NOBASEURLTYPE, + array('parent' => $parent, 'protocol' => $protocol)); + } + } else { + if (!isset($function['attribs']['version']) || + empty($function['attribs']['version'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NO_FUNCTIONVERSION, + array('parent' => $parent, 'protocol' => $protocol)); + } + } + } + } + + /** + * Test whether a string contains a valid channel server. + * @param string $ver the package version to test + * @return bool + */ + function validChannelServer($server) + { + if ($server == '__uri') { + return true; + } + return (bool) preg_match(PEAR_CHANNELS_SERVER_PREG, $server); + } + + /** + * @return string|false + */ + function getName() + { + if (isset($this->_channelInfo['name'])) { + return $this->_channelInfo['name']; + } + + return false; + } + + /** + * @return string|false + */ + function getServer() + { + if (isset($this->_channelInfo['name'])) { + return $this->_channelInfo['name']; + } + + return false; + } + + /** + * @return int|80 port number to connect to + */ + function getPort($mirror = false) + { + if ($mirror) { + if ($mir = $this->getMirror($mirror)) { + if (isset($mir['attribs']['port'])) { + return $mir['attribs']['port']; + } + + if ($this->getSSL($mirror)) { + return 443; + } + + return 80; + } + + return false; + } + + if (isset($this->_channelInfo['servers']['primary']['attribs']['port'])) { + return $this->_channelInfo['servers']['primary']['attribs']['port']; + } + + if ($this->getSSL()) { + return 443; + } + + return 80; + } + + /** + * @return bool Determines whether secure sockets layer (SSL) is used to connect to this channel + */ + function getSSL($mirror = false) + { + if ($mirror) { + if ($mir = $this->getMirror($mirror)) { + if (isset($mir['attribs']['ssl'])) { + return true; + } + + return false; + } + + return false; + } + + if (isset($this->_channelInfo['servers']['primary']['attribs']['ssl'])) { + return true; + } + + return false; + } + + /** + * @return string|false + */ + function getSummary() + { + if (isset($this->_channelInfo['summary'])) { + return $this->_channelInfo['summary']; + } + + return false; + } + + /** + * @param string protocol type + * @param string Mirror name + * @return array|false + */ + function getFunctions($protocol, $mirror = false) + { + if ($this->getName() == '__uri') { + return false; + } + + $function = $protocol == 'rest' ? 'baseurl' : 'function'; + if ($mirror) { + if ($mir = $this->getMirror($mirror)) { + if (isset($mir[$protocol][$function])) { + return $mir[$protocol][$function]; + } + } + + return false; + } + + if (isset($this->_channelInfo['servers']['primary'][$protocol][$function])) { + return $this->_channelInfo['servers']['primary'][$protocol][$function]; + } + + return false; + } + + /** + * @param string Protocol type + * @param string Function name (null to return the + * first protocol of the type requested) + * @param string Mirror name, if any + * @return array + */ + function getFunction($type, $name = null, $mirror = false) + { + $protocols = $this->getFunctions($type, $mirror); + if (!$protocols) { + return false; + } + + foreach ($protocols as $protocol) { + if ($name === null) { + return $protocol; + } + + if ($protocol['_content'] != $name) { + continue; + } + + return $protocol; + } + + return false; + } + + /** + * @param string protocol type + * @param string protocol name + * @param string version + * @param string mirror name + * @return boolean + */ + function supports($type, $name = null, $mirror = false, $version = '1.0') + { + $protocols = $this->getFunctions($type, $mirror); + if (!$protocols) { + return false; + } + + foreach ($protocols as $protocol) { + if ($protocol['attribs']['version'] != $version) { + continue; + } + + if ($name === null) { + return true; + } + + if ($protocol['_content'] != $name) { + continue; + } + + return true; + } + + return false; + } + + /** + * Determines whether a channel supports Representational State Transfer (REST) protocols + * for retrieving channel information + * @param string + * @return bool + */ + function supportsREST($mirror = false) + { + if ($mirror == $this->_channelInfo['name']) { + $mirror = false; + } + + if ($mirror) { + if ($mir = $this->getMirror($mirror)) { + return isset($mir['rest']); + } + + return false; + } + + return isset($this->_channelInfo['servers']['primary']['rest']); + } + + /** + * Get the URL to access a base resource. + * + * Hyperlinks in the returned xml will be used to retrieve the proper information + * needed. This allows extreme extensibility and flexibility in implementation + * @param string Resource Type to retrieve + */ + function getBaseURL($resourceType, $mirror = false) + { + if ($mirror == $this->_channelInfo['name']) { + $mirror = false; + } + + if ($mirror) { + $mir = $this->getMirror($mirror); + if (!$mir) { + return false; + } + + $rest = $mir['rest']; + } else { + $rest = $this->_channelInfo['servers']['primary']['rest']; + } + + if (!isset($rest['baseurl'][0])) { + $rest['baseurl'] = array($rest['baseurl']); + } + + foreach ($rest['baseurl'] as $baseurl) { + if (strtolower($baseurl['attribs']['type']) == strtolower($resourceType)) { + return $baseurl['_content']; + } + } + + return false; + } + + /** + * Since REST does not implement RPC, provide this as a logical wrapper around + * resetFunctions for REST + * @param string|false mirror name, if any + */ + function resetREST($mirror = false) + { + return $this->resetFunctions('rest', $mirror); + } + + /** + * Empty all protocol definitions + * @param string protocol type + * @param string|false mirror name, if any + */ + function resetFunctions($type, $mirror = false) + { + if ($mirror) { + if (isset($this->_channelInfo['servers']['mirror'])) { + $mirrors = $this->_channelInfo['servers']['mirror']; + if (!isset($mirrors[0])) { + $mirrors = array($mirrors); + } + + foreach ($mirrors as $i => $mir) { + if ($mir['attribs']['host'] == $mirror) { + if (isset($this->_channelInfo['servers']['mirror'][$i][$type])) { + unset($this->_channelInfo['servers']['mirror'][$i][$type]); + } + + return true; + } + } + + return false; + } + + return false; + } + + if (isset($this->_channelInfo['servers']['primary'][$type])) { + unset($this->_channelInfo['servers']['primary'][$type]); + } + + return true; + } + + /** + * Set a channel's protocols to the protocols supported by pearweb + */ + function setDefaultPEARProtocols($version = '1.0', $mirror = false) + { + switch ($version) { + case '1.0' : + $this->resetREST($mirror); + + if (!isset($this->_channelInfo['servers'])) { + $this->_channelInfo['servers'] = array('primary' => + array('rest' => array())); + } elseif (!isset($this->_channelInfo['servers']['primary'])) { + $this->_channelInfo['servers']['primary'] = array('rest' => array()); + } + + return true; + break; + default : + return false; + break; + } + } + + /** + * @return array + */ + function getMirrors() + { + if (isset($this->_channelInfo['servers']['mirror'])) { + $mirrors = $this->_channelInfo['servers']['mirror']; + if (!isset($mirrors[0])) { + $mirrors = array($mirrors); + } + + return $mirrors; + } + + return array(); + } + + /** + * Get the unserialized XML representing a mirror + * @return array|false + */ + function getMirror($server) + { + foreach ($this->getMirrors() as $mirror) { + if ($mirror['attribs']['host'] == $server) { + return $mirror; + } + } + + return false; + } + + /** + * @param string + * @return string|false + * @error PEAR_CHANNELFILE_ERROR_NO_NAME + * @error PEAR_CHANNELFILE_ERROR_INVALID_NAME + */ + function setName($name) + { + return $this->setServer($name); + } + + /** + * Set the socket number (port) that is used to connect to this channel + * @param integer + * @param string|false name of the mirror server, or false for the primary + */ + function setPort($port, $mirror = false) + { + if ($mirror) { + if (!isset($this->_channelInfo['servers']['mirror'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND, + array('mirror' => $mirror)); + return false; + } + + if (isset($this->_channelInfo['servers']['mirror'][0])) { + foreach ($this->_channelInfo['servers']['mirror'] as $i => $mir) { + if ($mirror == $mir['attribs']['host']) { + $this->_channelInfo['servers']['mirror'][$i]['attribs']['port'] = $port; + return true; + } + } + + return false; + } elseif ($this->_channelInfo['servers']['mirror']['attribs']['host'] == $mirror) { + $this->_channelInfo['servers']['mirror']['attribs']['port'] = $port; + $this->_isValid = false; + return true; + } + } + + $this->_channelInfo['servers']['primary']['attribs']['port'] = $port; + $this->_isValid = false; + return true; + } + + /** + * Set the socket number (port) that is used to connect to this channel + * @param bool Determines whether to turn on SSL support or turn it off + * @param string|false name of the mirror server, or false for the primary + */ + function setSSL($ssl = true, $mirror = false) + { + if ($mirror) { + if (!isset($this->_channelInfo['servers']['mirror'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND, + array('mirror' => $mirror)); + return false; + } + + if (isset($this->_channelInfo['servers']['mirror'][0])) { + foreach ($this->_channelInfo['servers']['mirror'] as $i => $mir) { + if ($mirror == $mir['attribs']['host']) { + if (!$ssl) { + if (isset($this->_channelInfo['servers']['mirror'][$i] + ['attribs']['ssl'])) { + unset($this->_channelInfo['servers']['mirror'][$i]['attribs']['ssl']); + } + } else { + $this->_channelInfo['servers']['mirror'][$i]['attribs']['ssl'] = 'yes'; + } + + return true; + } + } + + return false; + } elseif ($this->_channelInfo['servers']['mirror']['attribs']['host'] == $mirror) { + if (!$ssl) { + if (isset($this->_channelInfo['servers']['mirror']['attribs']['ssl'])) { + unset($this->_channelInfo['servers']['mirror']['attribs']['ssl']); + } + } else { + $this->_channelInfo['servers']['mirror']['attribs']['ssl'] = 'yes'; + } + + $this->_isValid = false; + return true; + } + } + + if ($ssl) { + $this->_channelInfo['servers']['primary']['attribs']['ssl'] = 'yes'; + } else { + if (isset($this->_channelInfo['servers']['primary']['attribs']['ssl'])) { + unset($this->_channelInfo['servers']['primary']['attribs']['ssl']); + } + } + + $this->_isValid = false; + return true; + } + + /** + * @param string + * @return string|false + * @error PEAR_CHANNELFILE_ERROR_NO_SERVER + * @error PEAR_CHANNELFILE_ERROR_INVALID_SERVER + */ + function setServer($server, $mirror = false) + { + if (empty($server)) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NO_SERVER); + return false; + } elseif (!$this->validChannelServer($server)) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_NAME, + array('tag' => 'name', 'name' => $server)); + return false; + } + + if ($mirror) { + $found = false; + foreach ($this->_channelInfo['servers']['mirror'] as $i => $mir) { + if ($mirror == $mir['attribs']['host']) { + $found = true; + break; + } + } + + if (!$found) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND, + array('mirror' => $mirror)); + return false; + } + + $this->_channelInfo['mirror'][$i]['attribs']['host'] = $server; + return true; + } + + $this->_channelInfo['name'] = $server; + return true; + } + + /** + * @param string + * @return boolean success + * @error PEAR_CHANNELFILE_ERROR_NO_SUMMARY + * @warning PEAR_CHANNELFILE_ERROR_MULTILINE_SUMMARY + */ + function setSummary($summary) + { + if (empty($summary)) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_NO_SUMMARY); + return false; + } elseif (strpos(trim($summary), "\n") !== false) { + $this->_validateWarning(PEAR_CHANNELFILE_ERROR_MULTILINE_SUMMARY, + array('summary' => $summary)); + } + + $this->_channelInfo['summary'] = $summary; + return true; + } + + /** + * @param string + * @param boolean determines whether the alias is in channel.xml or local + * @return boolean success + */ + function setAlias($alias, $local = false) + { + if (!$this->validChannelServer($alias)) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID_NAME, + array('tag' => 'suggestedalias', 'name' => $alias)); + return false; + } + + if ($local) { + $this->_channelInfo['localalias'] = $alias; + } else { + $this->_channelInfo['suggestedalias'] = $alias; + } + + return true; + } + + /** + * @return string + */ + function getAlias() + { + if (isset($this->_channelInfo['localalias'])) { + return $this->_channelInfo['localalias']; + } + if (isset($this->_channelInfo['suggestedalias'])) { + return $this->_channelInfo['suggestedalias']; + } + if (isset($this->_channelInfo['name'])) { + return $this->_channelInfo['name']; + } + return ''; + } + + /** + * Set the package validation object if it differs from PEAR's default + * The class must be includeable via changing _ in the classname to path separator, + * but no checking of this is made. + * @param string|false pass in false to reset to the default packagename regex + * @return boolean success + */ + function setValidationPackage($validateclass, $version) + { + if (empty($validateclass)) { + unset($this->_channelInfo['validatepackage']); + } + $this->_channelInfo['validatepackage'] = array('_content' => $validateclass); + $this->_channelInfo['validatepackage']['attribs'] = array('version' => $version); + } + + /** + * Add a protocol to the provides section + * @param string protocol type + * @param string protocol version + * @param string protocol name, if any + * @param string mirror name, if this is a mirror's protocol + * @return bool + */ + function addFunction($type, $version, $name = '', $mirror = false) + { + if ($mirror) { + return $this->addMirrorFunction($mirror, $type, $version, $name); + } + + $set = array('attribs' => array('version' => $version), '_content' => $name); + if (!isset($this->_channelInfo['servers']['primary'][$type]['function'])) { + if (!isset($this->_channelInfo['servers'])) { + $this->_channelInfo['servers'] = array('primary' => + array($type => array())); + } elseif (!isset($this->_channelInfo['servers']['primary'])) { + $this->_channelInfo['servers']['primary'] = array($type => array()); + } + + $this->_channelInfo['servers']['primary'][$type]['function'] = $set; + $this->_isValid = false; + return true; + } elseif (!isset($this->_channelInfo['servers']['primary'][$type]['function'][0])) { + $this->_channelInfo['servers']['primary'][$type]['function'] = array( + $this->_channelInfo['servers']['primary'][$type]['function']); + } + + $this->_channelInfo['servers']['primary'][$type]['function'][] = $set; + return true; + } + /** + * Add a protocol to a mirror's provides section + * @param string mirror name (server) + * @param string protocol type + * @param string protocol version + * @param string protocol name, if any + */ + function addMirrorFunction($mirror, $type, $version, $name = '') + { + if (!isset($this->_channelInfo['servers']['mirror'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND, + array('mirror' => $mirror)); + return false; + } + + $setmirror = false; + if (isset($this->_channelInfo['servers']['mirror'][0])) { + foreach ($this->_channelInfo['servers']['mirror'] as $i => $mir) { + if ($mirror == $mir['attribs']['host']) { + $setmirror = &$this->_channelInfo['servers']['mirror'][$i]; + break; + } + } + } else { + if ($this->_channelInfo['servers']['mirror']['attribs']['host'] == $mirror) { + $setmirror = &$this->_channelInfo['servers']['mirror']; + } + } + + if (!$setmirror) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND, + array('mirror' => $mirror)); + return false; + } + + $set = array('attribs' => array('version' => $version), '_content' => $name); + if (!isset($setmirror[$type]['function'])) { + $setmirror[$type]['function'] = $set; + $this->_isValid = false; + return true; + } elseif (!isset($setmirror[$type]['function'][0])) { + $setmirror[$type]['function'] = array($setmirror[$type]['function']); + } + + $setmirror[$type]['function'][] = $set; + $this->_isValid = false; + return true; + } + + /** + * @param string Resource Type this url links to + * @param string URL + * @param string|false mirror name, if this is not a primary server REST base URL + */ + function setBaseURL($resourceType, $url, $mirror = false) + { + if ($mirror) { + if (!isset($this->_channelInfo['servers']['mirror'])) { + $this->_validateError(PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND, + array('mirror' => $mirror)); + return false; + } + + $setmirror = false; + if (isset($this->_channelInfo['servers']['mirror'][0])) { + foreach ($this->_channelInfo['servers']['mirror'] as $i => $mir) { + if ($mirror == $mir['attribs']['host']) { + $setmirror = &$this->_channelInfo['servers']['mirror'][$i]; + break; + } + } + } else { + if ($this->_channelInfo['servers']['mirror']['attribs']['host'] == $mirror) { + $setmirror = &$this->_channelInfo['servers']['mirror']; + } + } + } else { + $setmirror = &$this->_channelInfo['servers']['primary']; + } + + $set = array('attribs' => array('type' => $resourceType), '_content' => $url); + if (!isset($setmirror['rest'])) { + $setmirror['rest'] = array(); + } + + if (!isset($setmirror['rest']['baseurl'])) { + $setmirror['rest']['baseurl'] = $set; + $this->_isValid = false; + return true; + } elseif (!isset($setmirror['rest']['baseurl'][0])) { + $setmirror['rest']['baseurl'] = array($setmirror['rest']['baseurl']); + } + + foreach ($setmirror['rest']['baseurl'] as $i => $url) { + if ($url['attribs']['type'] == $resourceType) { + $this->_isValid = false; + $setmirror['rest']['baseurl'][$i] = $set; + return true; + } + } + + $setmirror['rest']['baseurl'][] = $set; + $this->_isValid = false; + return true; + } + + /** + * @param string mirror server + * @param int mirror http port + * @return boolean + */ + function addMirror($server, $port = null) + { + if ($this->_channelInfo['name'] == '__uri') { + return false; // the __uri channel cannot have mirrors by definition + } + + $set = array('attribs' => array('host' => $server)); + if (is_numeric($port)) { + $set['attribs']['port'] = $port; + } + + if (!isset($this->_channelInfo['servers']['mirror'])) { + $this->_channelInfo['servers']['mirror'] = $set; + return true; + } + + if (!isset($this->_channelInfo['servers']['mirror'][0])) { + $this->_channelInfo['servers']['mirror'] = + array($this->_channelInfo['servers']['mirror']); + } + + $this->_channelInfo['servers']['mirror'][] = $set; + return true; + } + + /** + * Retrieve the name of the validation package for this channel + * @return string|false + */ + function getValidationPackage() + { + if (!$this->_isValid && !$this->validate()) { + return false; + } + + if (!isset($this->_channelInfo['validatepackage'])) { + return array('attribs' => array('version' => 'default'), + '_content' => 'PEAR_Validate'); + } + + return $this->_channelInfo['validatepackage']; + } + + /** + * Retrieve the object that can be used for custom validation + * @param string|false the name of the package to validate. If the package is + * the channel validation package, PEAR_Validate is returned + * @return PEAR_Validate|false false is returned if the validation package + * cannot be located + */ + function &getValidationObject($package = false) + { + if (!class_exists('PEAR_Validate')) { + require_once 'PEAR/Validate.php'; + } + + if (!$this->_isValid) { + if (!$this->validate()) { + $a = false; + return $a; + } + } + + if (isset($this->_channelInfo['validatepackage'])) { + if ($package == $this->_channelInfo['validatepackage']) { + // channel validation packages are always validated by PEAR_Validate + $val = &new PEAR_Validate; + return $val; + } + + if (!class_exists(str_replace('.', '_', + $this->_channelInfo['validatepackage']['_content']))) { + if ($this->isIncludeable(str_replace('_', '/', + $this->_channelInfo['validatepackage']['_content']) . '.php')) { + include_once str_replace('_', '/', + $this->_channelInfo['validatepackage']['_content']) . '.php'; + $vclass = str_replace('.', '_', + $this->_channelInfo['validatepackage']['_content']); + $val = &new $vclass; + } else { + $a = false; + return $a; + } + } else { + $vclass = str_replace('.', '_', + $this->_channelInfo['validatepackage']['_content']); + $val = &new $vclass; + } + } else { + $val = &new PEAR_Validate; + } + + return $val; + } + + function isIncludeable($path) + { + $possibilities = explode(PATH_SEPARATOR, ini_get('include_path')); + foreach ($possibilities as $dir) { + if (file_exists($dir . DIRECTORY_SEPARATOR . $path) + && is_readable($dir . DIRECTORY_SEPARATOR . $path)) { + return true; + } + } + + return false; + } + + /** + * This function is used by the channel updater and retrieves a value set by + * the registry, or the current time if it has not been set + * @return string + */ + function lastModified() + { + if (isset($this->_channelInfo['_lastmodified'])) { + return $this->_channelInfo['_lastmodified']; + } + + return time(); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/ChannelFile/Parser.php b/vendor/pear-pear.php.net/PEAR/PEAR/ChannelFile/Parser.php new file mode 100644 index 0000000000000000000000000000000000000000..e630ace2245d983f005d27bd35dde4bec13d7a5a --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/ChannelFile/Parser.php @@ -0,0 +1,68 @@ +<?php +/** + * PEAR_ChannelFile_Parser for parsing channel.xml + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Parser.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * base xml parser class + */ +require_once 'PEAR/XMLParser.php'; +require_once 'PEAR/ChannelFile.php'; +/** + * Parser for channel.xml + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_ChannelFile_Parser extends PEAR_XMLParser +{ + var $_config; + var $_logger; + var $_registry; + + function setConfig(&$c) + { + $this->_config = &$c; + $this->_registry = &$c->getRegistry(); + } + + function setLogger(&$l) + { + $this->_logger = &$l; + } + + function parse($data, $file) + { + if (PEAR::isError($err = parent::parse($data, $file))) { + return $err; + } + + $ret = new PEAR_ChannelFile; + $ret->setConfig($this->_config); + if (isset($this->_logger)) { + $ret->setLogger($this->_logger); + } + + $ret->fromArray($this->_unserializedData); + // make sure the filelist is in the easy to read format needed + $ret->flattenFilelist(); + $ret->setPackagefile($file, $archive); + return $ret; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command.php new file mode 100644 index 0000000000000000000000000000000000000000..db39b8f36f357f17dc97a2d463d4c5908a207fb4 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command.php @@ -0,0 +1,414 @@ +<?php +/** + * PEAR_Command, command pattern class + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Command.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * Needed for error handling + */ +require_once 'PEAR.php'; +require_once 'PEAR/Frontend.php'; +require_once 'PEAR/XMLParser.php'; + +/** + * List of commands and what classes they are implemented in. + * @var array command => implementing class + */ +$GLOBALS['_PEAR_Command_commandlist'] = array(); + +/** + * List of commands and their descriptions + * @var array command => description + */ +$GLOBALS['_PEAR_Command_commanddesc'] = array(); + +/** + * List of shortcuts to common commands. + * @var array shortcut => command + */ +$GLOBALS['_PEAR_Command_shortcuts'] = array(); + +/** + * Array of command objects + * @var array class => object + */ +$GLOBALS['_PEAR_Command_objects'] = array(); + +/** + * PEAR command class, a simple factory class for administrative + * commands. + * + * How to implement command classes: + * + * - The class must be called PEAR_Command_Nnn, installed in the + * "PEAR/Common" subdir, with a method called getCommands() that + * returns an array of the commands implemented by the class (see + * PEAR/Command/Install.php for an example). + * + * - The class must implement a run() function that is called with three + * params: + * + * (string) command name + * (array) assoc array with options, freely defined by each + * command, for example: + * array('force' => true) + * (array) list of the other parameters + * + * The run() function returns a PEAR_CommandResponse object. Use + * these methods to get information: + * + * int getStatus() Returns PEAR_COMMAND_(SUCCESS|FAILURE|PARTIAL) + * *_PARTIAL means that you need to issue at least + * one more command to complete the operation + * (used for example for validation steps). + * + * string getMessage() Returns a message for the user. Remember, + * no HTML or other interface-specific markup. + * + * If something unexpected happens, run() returns a PEAR error. + * + * - DON'T OUTPUT ANYTHING! Return text for output instead. + * + * - DON'T USE HTML! The text you return will be used from both Gtk, + * web and command-line interfaces, so for now, keep everything to + * plain text. + * + * - DON'T USE EXIT OR DIE! Always use pear errors. From static + * classes do PEAR::raiseError(), from other classes do + * $this->raiseError(). + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Command +{ + // {{{ factory() + + /** + * Get the right object for executing a command. + * + * @param string $command The name of the command + * @param object $config Instance of PEAR_Config object + * + * @return object the command object or a PEAR error + * + * @access public + * @static + */ + function &factory($command, &$config) + { + if (empty($GLOBALS['_PEAR_Command_commandlist'])) { + PEAR_Command::registerCommands(); + } + if (isset($GLOBALS['_PEAR_Command_shortcuts'][$command])) { + $command = $GLOBALS['_PEAR_Command_shortcuts'][$command]; + } + if (!isset($GLOBALS['_PEAR_Command_commandlist'][$command])) { + $a = PEAR::raiseError("unknown command `$command'"); + return $a; + } + $class = $GLOBALS['_PEAR_Command_commandlist'][$command]; + if (!class_exists($class)) { + require_once $GLOBALS['_PEAR_Command_objects'][$class]; + } + if (!class_exists($class)) { + $a = PEAR::raiseError("unknown command `$command'"); + return $a; + } + $ui =& PEAR_Command::getFrontendObject(); + $obj = &new $class($ui, $config); + return $obj; + } + + // }}} + // {{{ & getObject() + function &getObject($command) + { + $class = $GLOBALS['_PEAR_Command_commandlist'][$command]; + if (!class_exists($class)) { + require_once $GLOBALS['_PEAR_Command_objects'][$class]; + } + if (!class_exists($class)) { + return PEAR::raiseError("unknown command `$command'"); + } + $ui =& PEAR_Command::getFrontendObject(); + $config = &PEAR_Config::singleton(); + $obj = &new $class($ui, $config); + return $obj; + } + + // }}} + // {{{ & getFrontendObject() + + /** + * Get instance of frontend object. + * + * @return object|PEAR_Error + * @static + */ + function &getFrontendObject() + { + $a = &PEAR_Frontend::singleton(); + return $a; + } + + // }}} + // {{{ & setFrontendClass() + + /** + * Load current frontend class. + * + * @param string $uiclass Name of class implementing the frontend + * + * @return object the frontend object, or a PEAR error + * @static + */ + function &setFrontendClass($uiclass) + { + $a = &PEAR_Frontend::setFrontendClass($uiclass); + return $a; + } + + // }}} + // {{{ setFrontendType() + + /** + * Set current frontend. + * + * @param string $uitype Name of the frontend type (for example "CLI") + * + * @return object the frontend object, or a PEAR error + * @static + */ + function setFrontendType($uitype) + { + $uiclass = 'PEAR_Frontend_' . $uitype; + return PEAR_Command::setFrontendClass($uiclass); + } + + // }}} + // {{{ registerCommands() + + /** + * Scan through the Command directory looking for classes + * and see what commands they implement. + * + * @param bool (optional) if FALSE (default), the new list of + * commands should replace the current one. If TRUE, + * new entries will be merged with old. + * + * @param string (optional) where (what directory) to look for + * classes, defaults to the Command subdirectory of + * the directory from where this file (__FILE__) is + * included. + * + * @return bool TRUE on success, a PEAR error on failure + * + * @access public + * @static + */ + function registerCommands($merge = false, $dir = null) + { + $parser = new PEAR_XMLParser; + if ($dir === null) { + $dir = dirname(__FILE__) . '/Command'; + } + if (!is_dir($dir)) { + return PEAR::raiseError("registerCommands: opendir($dir) '$dir' does not exist or is not a directory"); + } + $dp = @opendir($dir); + if (empty($dp)) { + return PEAR::raiseError("registerCommands: opendir($dir) failed"); + } + if (!$merge) { + $GLOBALS['_PEAR_Command_commandlist'] = array(); + } + + while ($file = readdir($dp)) { + if ($file{0} == '.' || substr($file, -4) != '.xml') { + continue; + } + + $f = substr($file, 0, -4); + $class = "PEAR_Command_" . $f; + // List of commands + if (empty($GLOBALS['_PEAR_Command_objects'][$class])) { + $GLOBALS['_PEAR_Command_objects'][$class] = "$dir/" . $f . '.php'; + } + + $parser->parse(file_get_contents("$dir/$file")); + $implements = $parser->getData(); + foreach ($implements as $command => $desc) { + if ($command == 'attribs') { + continue; + } + + if (isset($GLOBALS['_PEAR_Command_commandlist'][$command])) { + return PEAR::raiseError('Command "' . $command . '" already registered in ' . + 'class "' . $GLOBALS['_PEAR_Command_commandlist'][$command] . '"'); + } + + $GLOBALS['_PEAR_Command_commandlist'][$command] = $class; + $GLOBALS['_PEAR_Command_commanddesc'][$command] = $desc['summary']; + if (isset($desc['shortcut'])) { + $shortcut = $desc['shortcut']; + if (isset($GLOBALS['_PEAR_Command_shortcuts'][$shortcut])) { + return PEAR::raiseError('Command shortcut "' . $shortcut . '" already ' . + 'registered to command "' . $command . '" in class "' . + $GLOBALS['_PEAR_Command_commandlist'][$command] . '"'); + } + $GLOBALS['_PEAR_Command_shortcuts'][$shortcut] = $command; + } + + if (isset($desc['options']) && $desc['options']) { + foreach ($desc['options'] as $oname => $option) { + if (isset($option['shortopt']) && strlen($option['shortopt']) > 1) { + return PEAR::raiseError('Option "' . $oname . '" short option "' . + $option['shortopt'] . '" must be ' . + 'only 1 character in Command "' . $command . '" in class "' . + $class . '"'); + } + } + } + } + } + + ksort($GLOBALS['_PEAR_Command_shortcuts']); + ksort($GLOBALS['_PEAR_Command_commandlist']); + @closedir($dp); + return true; + } + + // }}} + // {{{ getCommands() + + /** + * Get the list of currently supported commands, and what + * classes implement them. + * + * @return array command => implementing class + * + * @access public + * @static + */ + function getCommands() + { + if (empty($GLOBALS['_PEAR_Command_commandlist'])) { + PEAR_Command::registerCommands(); + } + return $GLOBALS['_PEAR_Command_commandlist']; + } + + // }}} + // {{{ getShortcuts() + + /** + * Get the list of command shortcuts. + * + * @return array shortcut => command + * + * @access public + * @static + */ + function getShortcuts() + { + if (empty($GLOBALS['_PEAR_Command_shortcuts'])) { + PEAR_Command::registerCommands(); + } + return $GLOBALS['_PEAR_Command_shortcuts']; + } + + // }}} + // {{{ getGetoptArgs() + + /** + * Compiles arguments for getopt. + * + * @param string $command command to get optstring for + * @param string $short_args (reference) short getopt format + * @param array $long_args (reference) long getopt format + * + * @return void + * + * @access public + * @static + */ + function getGetoptArgs($command, &$short_args, &$long_args) + { + if (empty($GLOBALS['_PEAR_Command_commandlist'])) { + PEAR_Command::registerCommands(); + } + if (isset($GLOBALS['_PEAR_Command_shortcuts'][$command])) { + $command = $GLOBALS['_PEAR_Command_shortcuts'][$command]; + } + if (!isset($GLOBALS['_PEAR_Command_commandlist'][$command])) { + return null; + } + $obj = &PEAR_Command::getObject($command); + return $obj->getGetoptArgs($command, $short_args, $long_args); + } + + // }}} + // {{{ getDescription() + + /** + * Get description for a command. + * + * @param string $command Name of the command + * + * @return string command description + * + * @access public + * @static + */ + function getDescription($command) + { + if (!isset($GLOBALS['_PEAR_Command_commanddesc'][$command])) { + return null; + } + return $GLOBALS['_PEAR_Command_commanddesc'][$command]; + } + + // }}} + // {{{ getHelp() + + /** + * Get help for command. + * + * @param string $command Name of the command to return help for + * + * @access public + * @static + */ + function getHelp($command) + { + $cmds = PEAR_Command::getCommands(); + if (isset($GLOBALS['_PEAR_Command_shortcuts'][$command])) { + $command = $GLOBALS['_PEAR_Command_shortcuts'][$command]; + } + if (isset($cmds[$command])) { + $obj = &PEAR_Command::getObject($command); + return $obj->getHelp($command); + } + return false; + } + // }}} +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Auth.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Auth.php new file mode 100644 index 0000000000000000000000000000000000000000..63cd152b900735ee8c07a5b342460f9cb8963254 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Auth.php @@ -0,0 +1,81 @@ +<?php +/** + * PEAR_Command_Auth (login, logout commands) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Auth.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + * @deprecated since 1.8.0alpha1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Channels.php'; + +/** + * PEAR commands for login/logout + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + * @deprecated since 1.8.0alpha1 + */ +class PEAR_Command_Auth extends PEAR_Command_Channels +{ + var $commands = array( + 'login' => array( + 'summary' => 'Connects and authenticates to remote server [Deprecated in favor of channel-login]', + 'shortcut' => 'li', + 'function' => 'doLogin', + 'options' => array(), + 'doc' => '<channel name> +WARNING: This function is deprecated in favor of using channel-login + +Log in to a remote channel server. If <channel name> is not supplied, +the default channel is used. To use remote functions in the installer +that require any kind of privileges, you need to log in first. The +username and password you enter here will be stored in your per-user +PEAR configuration (~/.pearrc on Unix-like systems). After logging +in, your username and password will be sent along in subsequent +operations on the remote server.', + ), + 'logout' => array( + 'summary' => 'Logs out from the remote server [Deprecated in favor of channel-logout]', + 'shortcut' => 'lo', + 'function' => 'doLogout', + 'options' => array(), + 'doc' => ' +WARNING: This function is deprecated in favor of using channel-logout + +Logs out from the remote server. This command does not actually +connect to the remote server, it only deletes the stored username and +password from your user configuration.', + ) + + ); + + /** + * PEAR_Command_Auth constructor. + * + * @access public + */ + function PEAR_Command_Auth(&$ui, &$config) + { + parent::PEAR_Command_Channels($ui, $config); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Auth.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Auth.xml new file mode 100644 index 0000000000000000000000000000000000000000..590193d142a989432488be51eb5f32f01285b5a8 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Auth.xml @@ -0,0 +1,30 @@ +<commands version="1.0"> + <login> + <summary>Connects and authenticates to remote server [Deprecated in favor of channel-login]</summary> + <function>doLogin</function> + <shortcut>li</shortcut> + <options /> + <doc><channel name> +WARNING: This function is deprecated in favor of using channel-login + +Log in to a remote channel server. If <channel name> is not supplied, +the default channel is used. To use remote functions in the installer +that require any kind of privileges, you need to log in first. The +username and password you enter here will be stored in your per-user +PEAR configuration (~/.pearrc on Unix-like systems). After logging +in, your username and password will be sent along in subsequent +operations on the remote server.</doc> + </login> + <logout> + <summary>Logs out from the remote server [Deprecated in favor of channel-logout]</summary> + <function>doLogout</function> + <shortcut>lo</shortcut> + <options /> + <doc> +WARNING: This function is deprecated in favor of using channel-logout + +Logs out from the remote server. This command does not actually +connect to the remote server, it only deletes the stored username and +password from your user configuration.</doc> + </logout> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Build.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Build.php new file mode 100644 index 0000000000000000000000000000000000000000..1de7320246a1c292c49f4f5800c1438b10e7cb3b --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Build.php @@ -0,0 +1,85 @@ +<?php +/** + * PEAR_Command_Auth (build command) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V.Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Build.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +/** + * PEAR commands for building extensions. + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V.Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Command_Build extends PEAR_Command_Common +{ + var $commands = array( + 'build' => array( + 'summary' => 'Build an Extension From C Source', + 'function' => 'doBuild', + 'shortcut' => 'b', + 'options' => array(), + 'doc' => '[package.xml] +Builds one or more extensions contained in a package.' + ), + ); + + /** + * PEAR_Command_Build constructor. + * + * @access public + */ + function PEAR_Command_Build(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + function doBuild($command, $options, $params) + { + require_once 'PEAR/Builder.php'; + if (sizeof($params) < 1) { + $params[0] = 'package.xml'; + } + + $builder = &new PEAR_Builder($this->ui); + $this->debug = $this->config->get('verbose'); + $err = $builder->build($params[0], array(&$this, 'buildCallback')); + if (PEAR::isError($err)) { + return $err; + } + + return true; + } + + function buildCallback($what, $data) + { + if (($what == 'cmdoutput' && $this->debug > 1) || + ($what == 'output' && $this->debug > 0)) { + $this->ui->outputData(rtrim($data), 'build'); + } + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Build.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Build.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec4e6f554ca148bf583c77642aa087620a4a46cd --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Build.xml @@ -0,0 +1,10 @@ +<commands version="1.0"> + <build> + <summary>Build an Extension From C Source</summary> + <function>doBuild</function> + <shortcut>b</shortcut> + <options /> + <doc>[package.xml] +Builds one or more extensions contained in a package.</doc> + </build> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Channels.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Channels.php new file mode 100644 index 0000000000000000000000000000000000000000..fcf01b50391c7e58338898e292f0cfd2643a3a8c --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Channels.php @@ -0,0 +1,883 @@ +<?php +// /* vim: set expandtab tabstop=4 shiftwidth=4: */ +/** + * PEAR_Command_Channels (list-channels, update-channels, channel-delete, channel-add, + * channel-update, channel-info, channel-alias, channel-discover commands) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Channels.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +define('PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS', -500); + +/** + * PEAR commands for managing channels. + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Command_Channels extends PEAR_Command_Common +{ + var $commands = array( + 'list-channels' => array( + 'summary' => 'List Available Channels', + 'function' => 'doList', + 'shortcut' => 'lc', + 'options' => array(), + 'doc' => ' +List all available channels for installation. +', + ), + 'update-channels' => array( + 'summary' => 'Update the Channel List', + 'function' => 'doUpdateAll', + 'shortcut' => 'uc', + 'options' => array(), + 'doc' => ' +List all installed packages in all channels. +' + ), + 'channel-delete' => array( + 'summary' => 'Remove a Channel From the List', + 'function' => 'doDelete', + 'shortcut' => 'cde', + 'options' => array(), + 'doc' => '<channel name> +Delete a channel from the registry. You may not +remove any channel that has installed packages. +' + ), + 'channel-add' => array( + 'summary' => 'Add a Channel', + 'function' => 'doAdd', + 'shortcut' => 'ca', + 'options' => array(), + 'doc' => '<channel.xml> +Add a private channel to the channel list. Note that all +public channels should be synced using "update-channels". +Parameter may be either a local file or remote URL to a +channel.xml. +' + ), + 'channel-update' => array( + 'summary' => 'Update an Existing Channel', + 'function' => 'doUpdate', + 'shortcut' => 'cu', + 'options' => array( + 'force' => array( + 'shortopt' => 'f', + 'doc' => 'will force download of new channel.xml if an existing channel name is used', + ), + 'channel' => array( + 'shortopt' => 'c', + 'arg' => 'CHANNEL', + 'doc' => 'will force download of new channel.xml if an existing channel name is used', + ), +), + 'doc' => '[<channel.xml>|<channel name>] +Update a channel in the channel list directly. Note that all +public channels can be synced using "update-channels". +Parameter may be a local or remote channel.xml, or the name of +an existing channel. +' + ), + 'channel-info' => array( + 'summary' => 'Retrieve Information on a Channel', + 'function' => 'doInfo', + 'shortcut' => 'ci', + 'options' => array(), + 'doc' => '<package> +List the files in an installed package. +' + ), + 'channel-alias' => array( + 'summary' => 'Specify an alias to a channel name', + 'function' => 'doAlias', + 'shortcut' => 'cha', + 'options' => array(), + 'doc' => '<channel> <alias> +Specify a specific alias to use for a channel name. +The alias may not be an existing channel name or +alias. +' + ), + 'channel-discover' => array( + 'summary' => 'Initialize a Channel from its server', + 'function' => 'doDiscover', + 'shortcut' => 'di', + 'options' => array(), + 'doc' => '[<channel.xml>|<channel name>] +Initialize a channel from its server and create a local channel.xml. +If <channel name> is in the format "<username>:<password>@<channel>" then +<username> and <password> will be set as the login username/password for +<channel>. Use caution when passing the username/password in this way, as +it may allow other users on your computer to briefly view your username/ +password via the system\'s process list. +' + ), + 'channel-login' => array( + 'summary' => 'Connects and authenticates to remote channel server', + 'shortcut' => 'cli', + 'function' => 'doLogin', + 'options' => array(), + 'doc' => '<channel name> +Log in to a remote channel server. If <channel name> is not supplied, +the default channel is used. To use remote functions in the installer +that require any kind of privileges, you need to log in first. The +username and password you enter here will be stored in your per-user +PEAR configuration (~/.pearrc on Unix-like systems). After logging +in, your username and password will be sent along in subsequent +operations on the remote server.', + ), + 'channel-logout' => array( + 'summary' => 'Logs out from the remote channel server', + 'shortcut' => 'clo', + 'function' => 'doLogout', + 'options' => array(), + 'doc' => '<channel name> +Logs out from a remote channel server. If <channel name> is not supplied, +the default channel is used. This command does not actually connect to the +remote server, it only deletes the stored username and password from your user +configuration.', + ), + ); + + /** + * PEAR_Command_Registry constructor. + * + * @access public + */ + function PEAR_Command_Channels(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + function _sortChannels($a, $b) + { + return strnatcasecmp($a->getName(), $b->getName()); + } + + function doList($command, $options, $params) + { + $reg = &$this->config->getRegistry(); + $registered = $reg->getChannels(); + usort($registered, array(&$this, '_sortchannels')); + $i = $j = 0; + $data = array( + 'caption' => 'Registered Channels:', + 'border' => true, + 'headline' => array('Channel', 'Alias', 'Summary') + ); + foreach ($registered as $channel) { + $data['data'][] = array($channel->getName(), + $channel->getAlias(), + $channel->getSummary()); + } + + if (count($registered) === 0) { + $data = '(no registered channels)'; + } + $this->ui->outputData($data, $command); + return true; + } + + function doUpdateAll($command, $options, $params) + { + $reg = &$this->config->getRegistry(); + $channels = $reg->getChannels(); + + $success = true; + foreach ($channels as $channel) { + if ($channel->getName() != '__uri') { + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $err = $this->doUpdate('channel-update', + $options, + array($channel->getName())); + if (PEAR::isError($err)) { + $this->ui->outputData($err->getMessage(), $command); + $success = false; + } else { + $success &= $err; + } + } + } + return $success; + } + + function doInfo($command, $options, $params) + { + if (count($params) !== 1) { + return $this->raiseError("No channel specified"); + } + + $reg = &$this->config->getRegistry(); + $channel = strtolower($params[0]); + if ($reg->channelExists($channel)) { + $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } + } else { + if (strpos($channel, '://')) { + $downloader = &$this->getDownloader(); + $tmpdir = $this->config->get('temp_dir'); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $loc = $downloader->downloadHttp($channel, $this->ui, $tmpdir); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($loc)) { + return $this->raiseError('Cannot open "' . $channel . + '" (' . $loc->getMessage() . ')'); + } else { + $contents = implode('', file($loc)); + } + } else { + if (!file_exists($params[0])) { + return $this->raiseError('Unknown channel "' . $channel . '"'); + } + + $fp = fopen($params[0], 'r'); + if (!$fp) { + return $this->raiseError('Cannot open "' . $params[0] . '"'); + } + + $contents = ''; + while (!feof($fp)) { + $contents .= fread($fp, 1024); + } + fclose($fp); + } + + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $chan = new PEAR_ChannelFile; + $chan->fromXmlString($contents); + $chan->validate(); + if ($errs = $chan->getErrors(true)) { + foreach ($errs as $err) { + $this->ui->outputData($err['level'] . ': ' . $err['message']); + } + return $this->raiseError('Channel file "' . $params[0] . '" is not valid'); + } + } + + if (!$chan) { + return $this->raiseError('Serious error: Channel "' . $params[0] . + '" has a corrupted registry entry'); + } + + $channel = $chan->getName(); + $caption = 'Channel ' . $channel . ' Information:'; + $data1 = array( + 'caption' => $caption, + 'border' => true); + $data1['data']['server'] = array('Name and Server', $chan->getName()); + if ($chan->getAlias() != $chan->getName()) { + $data1['data']['alias'] = array('Alias', $chan->getAlias()); + } + + $data1['data']['summary'] = array('Summary', $chan->getSummary()); + $validate = $chan->getValidationPackage(); + $data1['data']['vpackage'] = array('Validation Package Name', $validate['_content']); + $data1['data']['vpackageversion'] = + array('Validation Package Version', $validate['attribs']['version']); + $d = array(); + $d['main'] = $data1; + + $data['data'] = array(); + $data['caption'] = 'Server Capabilities'; + $data['headline'] = array('Type', 'Version/REST type', 'Function Name/REST base'); + if ($chan->supportsREST()) { + if ($chan->supportsREST()) { + $funcs = $chan->getFunctions('rest'); + if (!isset($funcs[0])) { + $funcs = array($funcs); + } + foreach ($funcs as $protocol) { + $data['data'][] = array('rest', $protocol['attribs']['type'], + $protocol['_content']); + } + } + } else { + $data['data'][] = array('No supported protocols'); + } + + $d['protocols'] = $data; + $data['data'] = array(); + $mirrors = $chan->getMirrors(); + if ($mirrors) { + $data['caption'] = 'Channel ' . $channel . ' Mirrors:'; + unset($data['headline']); + foreach ($mirrors as $mirror) { + $data['data'][] = array($mirror['attribs']['host']); + $d['mirrors'] = $data; + } + + foreach ($mirrors as $i => $mirror) { + $data['data'] = array(); + $data['caption'] = 'Mirror ' . $mirror['attribs']['host'] . ' Capabilities'; + $data['headline'] = array('Type', 'Version/REST type', 'Function Name/REST base'); + if ($chan->supportsREST($mirror['attribs']['host'])) { + if ($chan->supportsREST($mirror['attribs']['host'])) { + $funcs = $chan->getFunctions('rest', $mirror['attribs']['host']); + if (!isset($funcs[0])) { + $funcs = array($funcs); + } + + foreach ($funcs as $protocol) { + $data['data'][] = array('rest', $protocol['attribs']['type'], + $protocol['_content']); + } + } + } else { + $data['data'][] = array('No supported protocols'); + } + $d['mirrorprotocols' . $i] = $data; + } + } + $this->ui->outputData($d, 'channel-info'); + } + + // }}} + + function doDelete($command, $options, $params) + { + if (count($params) !== 1) { + return $this->raiseError('channel-delete: no channel specified'); + } + + $reg = &$this->config->getRegistry(); + if (!$reg->channelExists($params[0])) { + return $this->raiseError('channel-delete: channel "' . $params[0] . '" does not exist'); + } + + $channel = $reg->channelName($params[0]); + if ($channel == 'pear.php.net') { + return $this->raiseError('Cannot delete the pear.php.net channel'); + } + + if ($channel == 'pecl.php.net') { + return $this->raiseError('Cannot delete the pecl.php.net channel'); + } + + if ($channel == 'doc.php.net') { + return $this->raiseError('Cannot delete the doc.php.net channel'); + } + + if ($channel == '__uri') { + return $this->raiseError('Cannot delete the __uri pseudo-channel'); + } + + if (PEAR::isError($err = $reg->listPackages($channel))) { + return $err; + } + + if (count($err)) { + return $this->raiseError('Channel "' . $channel . + '" has installed packages, cannot delete'); + } + + if (!$reg->deleteChannel($channel)) { + return $this->raiseError('Channel "' . $channel . '" deletion failed'); + } else { + $this->config->deleteChannel($channel); + $this->ui->outputData('Channel "' . $channel . '" deleted', $command); + } + } + + function doAdd($command, $options, $params) + { + if (count($params) !== 1) { + return $this->raiseError('channel-add: no channel file specified'); + } + + if (strpos($params[0], '://')) { + $downloader = &$this->getDownloader(); + $tmpdir = $this->config->get('temp_dir'); + if (!file_exists($tmpdir)) { + require_once 'System.php'; + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $err = System::mkdir(array('-p', $tmpdir)); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($err)) { + return $this->raiseError('channel-add: temp_dir does not exist: "' . + $tmpdir . + '" - You can change this location with "pear config-set temp_dir"'); + } + } + + if (!is_writable($tmpdir)) { + return $this->raiseError('channel-add: temp_dir is not writable: "' . + $tmpdir . + '" - You can change this location with "pear config-set temp_dir"'); + } + + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $loc = $downloader->downloadHttp($params[0], $this->ui, $tmpdir, null, false); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($loc)) { + return $this->raiseError('channel-add: Cannot open "' . $params[0] . + '" (' . $loc->getMessage() . ')'); + } + + list($loc, $lastmodified) = $loc; + $contents = implode('', file($loc)); + } else { + $lastmodified = $fp = false; + if (file_exists($params[0])) { + $fp = fopen($params[0], 'r'); + } + + if (!$fp) { + return $this->raiseError('channel-add: cannot open "' . $params[0] . '"'); + } + + $contents = ''; + while (!feof($fp)) { + $contents .= fread($fp, 1024); + } + fclose($fp); + } + + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $channel = new PEAR_ChannelFile; + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $result = $channel->fromXmlString($contents); + PEAR::staticPopErrorHandling(); + if (!$result) { + $exit = false; + if (count($errors = $channel->getErrors(true))) { + foreach ($errors as $error) { + $this->ui->outputData(ucfirst($error['level'] . ': ' . $error['message'])); + if (!$exit) { + $exit = $error['level'] == 'error' ? true : false; + } + } + if ($exit) { + return $this->raiseError('channel-add: invalid channel.xml file'); + } + } + } + + $reg = &$this->config->getRegistry(); + if ($reg->channelExists($channel->getName())) { + return $this->raiseError('channel-add: Channel "' . $channel->getName() . + '" exists, use channel-update to update entry', PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS); + } + + $ret = $reg->addChannel($channel, $lastmodified); + if (PEAR::isError($ret)) { + return $ret; + } + + if (!$ret) { + return $this->raiseError('channel-add: adding Channel "' . $channel->getName() . + '" to registry failed'); + } + + $this->config->setChannels($reg->listChannels()); + $this->config->writeConfigFile(); + $this->ui->outputData('Adding Channel "' . $channel->getName() . '" succeeded', $command); + } + + function doUpdate($command, $options, $params) + { + if (count($params) !== 1) { + return $this->raiseError("No channel file specified"); + } + + $tmpdir = $this->config->get('temp_dir'); + if (!file_exists($tmpdir)) { + require_once 'System.php'; + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $err = System::mkdir(array('-p', $tmpdir)); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($err)) { + return $this->raiseError('channel-add: temp_dir does not exist: "' . + $tmpdir . + '" - You can change this location with "pear config-set temp_dir"'); + } + } + + if (!is_writable($tmpdir)) { + return $this->raiseError('channel-add: temp_dir is not writable: "' . + $tmpdir . + '" - You can change this location with "pear config-set temp_dir"'); + } + + $reg = &$this->config->getRegistry(); + $lastmodified = false; + if ((!file_exists($params[0]) || is_dir($params[0])) + && $reg->channelExists(strtolower($params[0]))) { + $c = $reg->getChannel(strtolower($params[0])); + if (PEAR::isError($c)) { + return $this->raiseError($c); + } + + $this->ui->outputData("Updating channel \"$params[0]\"", $command); + $dl = &$this->getDownloader(array()); + // if force is specified, use a timestamp of "1" to force retrieval + $lastmodified = isset($options['force']) ? false : $c->lastModified(); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $contents = $dl->downloadHttp('http://' . $c->getName() . '/channel.xml', + $this->ui, $tmpdir, null, $lastmodified); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($contents)) { + // Attempt to fall back to https + $this->ui->outputData("Channel \"$params[0]\" is not responding over http://, failed with message: " . $contents->getMessage()); + $this->ui->outputData("Trying channel \"$params[0]\" over https:// instead"); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $contents = $dl->downloadHttp('https://' . $c->getName() . '/channel.xml', + $this->ui, $tmpdir, null, $lastmodified); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($contents)) { + return $this->raiseError('Cannot retrieve channel.xml for channel "' . + $c->getName() . '" (' . $contents->getMessage() . ')'); + } + } + + list($contents, $lastmodified) = $contents; + if (!$contents) { + $this->ui->outputData("Channel \"$params[0]\" is up to date"); + return; + } + + $contents = implode('', file($contents)); + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $channel = new PEAR_ChannelFile; + $channel->fromXmlString($contents); + if (!$channel->getErrors()) { + // security check: is the downloaded file for the channel we got it from? + if (strtolower($channel->getName()) != strtolower($c->getName())) { + if (!isset($options['force'])) { + return $this->raiseError('ERROR: downloaded channel definition file' . + ' for channel "' . $channel->getName() . '" from channel "' . + strtolower($c->getName()) . '"'); + } + + $this->ui->log(0, 'WARNING: downloaded channel definition file' . + ' for channel "' . $channel->getName() . '" from channel "' . + strtolower($c->getName()) . '"'); + } + } + } else { + if (strpos($params[0], '://')) { + $dl = &$this->getDownloader(); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $loc = $dl->downloadHttp($params[0], + $this->ui, $tmpdir, null, $lastmodified); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($loc)) { + return $this->raiseError("Cannot open " . $params[0] . + ' (' . $loc->getMessage() . ')'); + } + + list($loc, $lastmodified) = $loc; + $contents = implode('', file($loc)); + } else { + $fp = false; + if (file_exists($params[0])) { + $fp = fopen($params[0], 'r'); + } + + if (!$fp) { + return $this->raiseError("Cannot open " . $params[0]); + } + + $contents = ''; + while (!feof($fp)) { + $contents .= fread($fp, 1024); + } + fclose($fp); + } + + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $channel = new PEAR_ChannelFile; + $channel->fromXmlString($contents); + } + + $exit = false; + if (count($errors = $channel->getErrors(true))) { + foreach ($errors as $error) { + $this->ui->outputData(ucfirst($error['level'] . ': ' . $error['message'])); + if (!$exit) { + $exit = $error['level'] == 'error' ? true : false; + } + } + if ($exit) { + return $this->raiseError('Invalid channel.xml file'); + } + } + + if (!$reg->channelExists($channel->getName())) { + return $this->raiseError('Error: Channel "' . $channel->getName() . + '" does not exist, use channel-add to add an entry'); + } + + $ret = $reg->updateChannel($channel, $lastmodified); + if (PEAR::isError($ret)) { + return $ret; + } + + if (!$ret) { + return $this->raiseError('Updating Channel "' . $channel->getName() . + '" in registry failed'); + } + + $this->config->setChannels($reg->listChannels()); + $this->config->writeConfigFile(); + $this->ui->outputData('Update of Channel "' . $channel->getName() . '" succeeded'); + } + + function &getDownloader() + { + if (!class_exists('PEAR_Downloader')) { + require_once 'PEAR/Downloader.php'; + } + $a = new PEAR_Downloader($this->ui, array(), $this->config); + return $a; + } + + function doAlias($command, $options, $params) + { + if (count($params) === 1) { + return $this->raiseError('No channel alias specified'); + } + + if (count($params) !== 2 || (!empty($params[1]) && $params[1]{0} == '-')) { + return $this->raiseError( + 'Invalid format, correct is: channel-alias channel alias'); + } + + $reg = &$this->config->getRegistry(); + if (!$reg->channelExists($params[0], true)) { + $extra = ''; + if ($reg->isAlias($params[0])) { + $extra = ' (use "channel-alias ' . $reg->channelName($params[0]) . ' ' . + strtolower($params[1]) . '")'; + } + + return $this->raiseError('"' . $params[0] . '" is not a valid channel' . $extra); + } + + if ($reg->isAlias($params[1])) { + return $this->raiseError('Channel "' . $reg->channelName($params[1]) . '" is ' . + 'already aliased to "' . strtolower($params[1]) . '", cannot re-alias'); + } + + $chan = &$reg->getChannel($params[0]); + if (PEAR::isError($chan)) { + return $this->raiseError('Corrupt registry? Error retrieving channel "' . $params[0] . + '" information (' . $chan->getMessage() . ')'); + } + + // make it a local alias + if (!$chan->setAlias(strtolower($params[1]), true)) { + return $this->raiseError('Alias "' . strtolower($params[1]) . + '" is not a valid channel alias'); + } + + $reg->updateChannel($chan); + $this->ui->outputData('Channel "' . $chan->getName() . '" aliased successfully to "' . + strtolower($params[1]) . '"'); + } + + /** + * The channel-discover command + * + * @param string $command command name + * @param array $options option_name => value + * @param array $params list of additional parameters. + * $params[0] should contain a string with either: + * - <channel name> or + * - <username>:<password>@<channel name> + * @return null|PEAR_Error + */ + function doDiscover($command, $options, $params) + { + if (count($params) !== 1) { + return $this->raiseError("No channel server specified"); + } + + // Look for the possible input format "<username>:<password>@<channel>" + if (preg_match('/^(.+):(.+)@(.+)\\z/', $params[0], $matches)) { + $username = $matches[1]; + $password = $matches[2]; + $channel = $matches[3]; + } else { + $channel = $params[0]; + } + + $reg = &$this->config->getRegistry(); + if ($reg->channelExists($channel)) { + if (!$reg->isAlias($channel)) { + return $this->raiseError("Channel \"$channel\" is already initialized", PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS); + } + + return $this->raiseError("A channel alias named \"$channel\" " . + 'already exists, aliasing channel "' . $reg->channelName($channel) + . '"'); + } + + $this->pushErrorHandling(PEAR_ERROR_RETURN); + $err = $this->doAdd($command, $options, array('http://' . $channel . '/channel.xml')); + $this->popErrorHandling(); + if (PEAR::isError($err)) { + if ($err->getCode() === PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS) { + return $this->raiseError("Discovery of channel \"$channel\" failed (" . + $err->getMessage() . ')'); + } + // Attempt fetch via https + $this->ui->outputData("Discovering channel $channel over http:// failed with message: " . $err->getMessage()); + $this->ui->outputData("Trying to discover channel $channel over https:// instead"); + $this->pushErrorHandling(PEAR_ERROR_RETURN); + $err = $this->doAdd($command, $options, array('https://' . $channel . '/channel.xml')); + $this->popErrorHandling(); + if (PEAR::isError($err)) { + return $this->raiseError("Discovery of channel \"$channel\" failed (" . + $err->getMessage() . ')'); + } + } + + // Store username/password if they were given + // Arguably we should do a logintest on the channel here, but since + // that's awkward on a REST-based channel (even "pear login" doesn't + // do it for those), and XML-RPC is deprecated, it's fairly pointless. + if (isset($username)) { + $this->config->set('username', $username, 'user', $channel); + $this->config->set('password', $password, 'user', $channel); + $this->config->store(); + $this->ui->outputData("Stored login for channel \"$channel\" using username \"$username\"", $command); + } + + $this->ui->outputData("Discovery of channel \"$channel\" succeeded", $command); + } + + /** + * Execute the 'login' command. + * + * @param string $command command name + * @param array $options option_name => value + * @param array $params list of additional parameters + * + * @return bool TRUE on success or + * a PEAR error on failure + * + * @access public + */ + function doLogin($command, $options, $params) + { + $reg = &$this->config->getRegistry(); + + // If a parameter is supplied, use that as the channel to log in to + $channel = isset($params[0]) ? $params[0] : $this->config->get('default_channel'); + + $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } + + $server = $this->config->get('preferred_mirror', null, $channel); + $username = $this->config->get('username', null, $channel); + if (empty($username)) { + $username = isset($_ENV['USER']) ? $_ENV['USER'] : null; + } + $this->ui->outputData("Logging in to $server.", $command); + + list($username, $password) = $this->ui->userDialog( + $command, + array('Username', 'Password'), + array('text', 'password'), + array($username, '') + ); + $username = trim($username); + $password = trim($password); + + $ourfile = $this->config->getConfFile('user'); + if (!$ourfile) { + $ourfile = $this->config->getConfFile('system'); + } + + $this->config->set('username', $username, 'user', $channel); + $this->config->set('password', $password, 'user', $channel); + + if ($chan->supportsREST()) { + $ok = true; + } + + if ($ok !== true) { + return $this->raiseError('Login failed!'); + } + + $this->ui->outputData("Logged in.", $command); + // avoid changing any temporary settings changed with -d + $ourconfig = new PEAR_Config($ourfile, $ourfile); + $ourconfig->set('username', $username, 'user', $channel); + $ourconfig->set('password', $password, 'user', $channel); + $ourconfig->store(); + + return true; + } + + /** + * Execute the 'logout' command. + * + * @param string $command command name + * @param array $options option_name => value + * @param array $params list of additional parameters + * + * @return bool TRUE on success or + * a PEAR error on failure + * + * @access public + */ + function doLogout($command, $options, $params) + { + $reg = &$this->config->getRegistry(); + + // If a parameter is supplied, use that as the channel to log in to + $channel = isset($params[0]) ? $params[0] : $this->config->get('default_channel'); + + $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } + + $server = $this->config->get('preferred_mirror', null, $channel); + $this->ui->outputData("Logging out from $server.", $command); + $this->config->remove('username', 'user', $channel); + $this->config->remove('password', 'user', $channel); + $this->config->store(); + return true; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Channels.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Channels.xml new file mode 100644 index 0000000000000000000000000000000000000000..47b72066abf928c1d1550772f721dd3bb95cfd40 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Channels.xml @@ -0,0 +1,123 @@ +<commands version="1.0"> + <list-channels> + <summary>List Available Channels</summary> + <function>doList</function> + <shortcut>lc</shortcut> + <options /> + <doc> +List all available channels for installation. +</doc> + </list-channels> + <update-channels> + <summary>Update the Channel List</summary> + <function>doUpdateAll</function> + <shortcut>uc</shortcut> + <options /> + <doc> +List all installed packages in all channels. +</doc> + </update-channels> + <channel-delete> + <summary>Remove a Channel From the List</summary> + <function>doDelete</function> + <shortcut>cde</shortcut> + <options /> + <doc><channel name> +Delete a channel from the registry. You may not +remove any channel that has installed packages. +</doc> + </channel-delete> + <channel-add> + <summary>Add a Channel</summary> + <function>doAdd</function> + <shortcut>ca</shortcut> + <options /> + <doc><channel.xml> +Add a private channel to the channel list. Note that all +public channels should be synced using "update-channels". +Parameter may be either a local file or remote URL to a +channel.xml. +</doc> + </channel-add> + <channel-update> + <summary>Update an Existing Channel</summary> + <function>doUpdate</function> + <shortcut>cu</shortcut> + <options> + <force> + <shortopt>f</shortopt> + <doc>will force download of new channel.xml if an existing channel name is used</doc> + </force> + <channel> + <shortopt>c</shortopt> + <doc>will force download of new channel.xml if an existing channel name is used</doc> + <arg>CHANNEL</arg> + </channel> + </options> + <doc>[<channel.xml>|<channel name>] +Update a channel in the channel list directly. Note that all +public channels can be synced using "update-channels". +Parameter may be a local or remote channel.xml, or the name of +an existing channel. +</doc> + </channel-update> + <channel-info> + <summary>Retrieve Information on a Channel</summary> + <function>doInfo</function> + <shortcut>ci</shortcut> + <options /> + <doc><package> +List the files in an installed package. +</doc> + </channel-info> + <channel-alias> + <summary>Specify an alias to a channel name</summary> + <function>doAlias</function> + <shortcut>cha</shortcut> + <options /> + <doc><channel> <alias> +Specify a specific alias to use for a channel name. +The alias may not be an existing channel name or +alias. +</doc> + </channel-alias> + <channel-discover> + <summary>Initialize a Channel from its server</summary> + <function>doDiscover</function> + <shortcut>di</shortcut> + <options /> + <doc>[<channel.xml>|<channel name>] +Initialize a channel from its server and create a local channel.xml. +If <channel name> is in the format "<username>:<password>@<channel>" then +<username> and <password> will be set as the login username/password for +<channel>. Use caution when passing the username/password in this way, as +it may allow other users on your computer to briefly view your username/ +password via the system's process list. +</doc> + </channel-discover> + <channel-login> + <summary>Connects and authenticates to remote channel server</summary> + <function>doLogin</function> + <shortcut>cli</shortcut> + <options /> + <doc><channel name> +Log in to a remote channel server. If <channel name> is not supplied, +the default channel is used. To use remote functions in the installer +that require any kind of privileges, you need to log in first. The +username and password you enter here will be stored in your per-user +PEAR configuration (~/.pearrc on Unix-like systems). After logging +in, your username and password will be sent along in subsequent +operations on the remote server.</doc> + </channel-login> + <channel-logout> + <summary>Logs out from the remote channel server</summary> + <function>doLogout</function> + <shortcut>clo</shortcut> + <options /> + <doc><channel name> +Logs out from a remote channel server. If <channel name> is not supplied, +the default channel is used. This command does not actually connect to the +remote server, it only deletes the stored username and password from your user +configuration.</doc> + </channel-logout> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Common.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..279a716623df94e22e12b5b86362fe9df612065b --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Common.php @@ -0,0 +1,273 @@ +<?php +/** + * PEAR_Command_Common base class + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR.php'; + +/** + * PEAR commands base class + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Command_Common extends PEAR +{ + /** + * PEAR_Config object used to pass user system and configuration + * on when executing commands + * + * @var PEAR_Config + */ + var $config; + /** + * @var PEAR_Registry + * @access protected + */ + var $_registry; + + /** + * User Interface object, for all interaction with the user. + * @var object + */ + var $ui; + + var $_deps_rel_trans = array( + 'lt' => '<', + 'le' => '<=', + 'eq' => '=', + 'ne' => '!=', + 'gt' => '>', + 'ge' => '>=', + 'has' => '==' + ); + + var $_deps_type_trans = array( + 'pkg' => 'package', + 'ext' => 'extension', + 'php' => 'PHP', + 'prog' => 'external program', + 'ldlib' => 'external library for linking', + 'rtlib' => 'external runtime library', + 'os' => 'operating system', + 'websrv' => 'web server', + 'sapi' => 'SAPI backend' + ); + + /** + * PEAR_Command_Common constructor. + * + * @access public + */ + function PEAR_Command_Common(&$ui, &$config) + { + parent::PEAR(); + $this->config = &$config; + $this->ui = &$ui; + } + + /** + * Return a list of all the commands defined by this class. + * @return array list of commands + * @access public + */ + function getCommands() + { + $ret = array(); + foreach (array_keys($this->commands) as $command) { + $ret[$command] = $this->commands[$command]['summary']; + } + + return $ret; + } + + /** + * Return a list of all the command shortcuts defined by this class. + * @return array shortcut => command + * @access public + */ + function getShortcuts() + { + $ret = array(); + foreach (array_keys($this->commands) as $command) { + if (isset($this->commands[$command]['shortcut'])) { + $ret[$this->commands[$command]['shortcut']] = $command; + } + } + + return $ret; + } + + function getOptions($command) + { + $shortcuts = $this->getShortcuts(); + if (isset($shortcuts[$command])) { + $command = $shortcuts[$command]; + } + + if (isset($this->commands[$command]) && + isset($this->commands[$command]['options'])) { + return $this->commands[$command]['options']; + } + + return null; + } + + function getGetoptArgs($command, &$short_args, &$long_args) + { + $short_args = ''; + $long_args = array(); + if (empty($this->commands[$command]) || empty($this->commands[$command]['options'])) { + return; + } + + reset($this->commands[$command]['options']); + while (list($option, $info) = each($this->commands[$command]['options'])) { + $larg = $sarg = ''; + if (isset($info['arg'])) { + if ($info['arg']{0} == '(') { + $larg = '=='; + $sarg = '::'; + $arg = substr($info['arg'], 1, -1); + } else { + $larg = '='; + $sarg = ':'; + $arg = $info['arg']; + } + } + + if (isset($info['shortopt'])) { + $short_args .= $info['shortopt'] . $sarg; + } + + $long_args[] = $option . $larg; + } + } + + /** + * Returns the help message for the given command + * + * @param string $command The command + * @return mixed A fail string if the command does not have help or + * a two elements array containing [0]=>help string, + * [1]=> help string for the accepted cmd args + */ + function getHelp($command) + { + $config = &PEAR_Config::singleton(); + if (!isset($this->commands[$command])) { + return "No such command \"$command\""; + } + + $help = null; + if (isset($this->commands[$command]['doc'])) { + $help = $this->commands[$command]['doc']; + } + + if (empty($help)) { + // XXX (cox) Fallback to summary if there is no doc (show both?) + if (!isset($this->commands[$command]['summary'])) { + return "No help for command \"$command\""; + } + $help = $this->commands[$command]['summary']; + } + + if (preg_match_all('/{config\s+([^\}]+)}/e', $help, $matches)) { + foreach($matches[0] as $k => $v) { + $help = preg_replace("/$v/", $config->get($matches[1][$k]), $help); + } + } + + return array($help, $this->getHelpArgs($command)); + } + + /** + * Returns the help for the accepted arguments of a command + * + * @param string $command + * @return string The help string + */ + function getHelpArgs($command) + { + if (isset($this->commands[$command]['options']) && + count($this->commands[$command]['options'])) + { + $help = "Options:\n"; + foreach ($this->commands[$command]['options'] as $k => $v) { + if (isset($v['arg'])) { + if ($v['arg'][0] == '(') { + $arg = substr($v['arg'], 1, -1); + $sapp = " [$arg]"; + $lapp = "[=$arg]"; + } else { + $sapp = " $v[arg]"; + $lapp = "=$v[arg]"; + } + } else { + $sapp = $lapp = ""; + } + + if (isset($v['shortopt'])) { + $s = $v['shortopt']; + $help .= " -$s$sapp, --$k$lapp\n"; + } else { + $help .= " --$k$lapp\n"; + } + + $p = " "; + $doc = rtrim(str_replace("\n", "\n$p", $v['doc'])); + $help .= " $doc\n"; + } + + return $help; + } + + return null; + } + + function run($command, $options, $params) + { + if (empty($this->commands[$command]['function'])) { + // look for shortcuts + foreach (array_keys($this->commands) as $cmd) { + if (isset($this->commands[$cmd]['shortcut']) && $this->commands[$cmd]['shortcut'] == $command) { + if (empty($this->commands[$cmd]['function'])) { + return $this->raiseError("unknown command `$command'"); + } else { + $func = $this->commands[$cmd]['function']; + } + $command = $cmd; + + //$command = $this->commands[$cmd]['function']; + break; + } + } + } else { + $func = $this->commands[$command]['function']; + } + + return $this->$func($command, $options, $params); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Config.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..a761b277f5f8460651bcdff5a9d3776cc3d3ecbc --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Config.php @@ -0,0 +1,414 @@ +<?php +/** + * PEAR_Command_Config (config-show, config-get, config-set, config-help, config-create commands) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Config.php 313024 2011-07-06 19:51:24Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +/** + * PEAR commands for managing configuration data. + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Command_Config extends PEAR_Command_Common +{ + var $commands = array( + 'config-show' => array( + 'summary' => 'Show All Settings', + 'function' => 'doConfigShow', + 'shortcut' => 'csh', + 'options' => array( + 'channel' => array( + 'shortopt' => 'c', + 'doc' => 'show configuration variables for another channel', + 'arg' => 'CHAN', + ), +), + 'doc' => '[layer] +Displays all configuration values. An optional argument +may be used to tell which configuration layer to display. Valid +configuration layers are "user", "system" and "default". To display +configurations for different channels, set the default_channel +configuration variable and run config-show again. +', + ), + 'config-get' => array( + 'summary' => 'Show One Setting', + 'function' => 'doConfigGet', + 'shortcut' => 'cg', + 'options' => array( + 'channel' => array( + 'shortopt' => 'c', + 'doc' => 'show configuration variables for another channel', + 'arg' => 'CHAN', + ), +), + 'doc' => '<parameter> [layer] +Displays the value of one configuration parameter. The +first argument is the name of the parameter, an optional second argument +may be used to tell which configuration layer to look in. Valid configuration +layers are "user", "system" and "default". If no layer is specified, a value +will be picked from the first layer that defines the parameter, in the order +just specified. The configuration value will be retrieved for the channel +specified by the default_channel configuration variable. +', + ), + 'config-set' => array( + 'summary' => 'Change Setting', + 'function' => 'doConfigSet', + 'shortcut' => 'cs', + 'options' => array( + 'channel' => array( + 'shortopt' => 'c', + 'doc' => 'show configuration variables for another channel', + 'arg' => 'CHAN', + ), +), + 'doc' => '<parameter> <value> [layer] +Sets the value of one configuration parameter. The first argument is +the name of the parameter, the second argument is the new value. Some +parameters are subject to validation, and the command will fail with +an error message if the new value does not make sense. An optional +third argument may be used to specify in which layer to set the +configuration parameter. The default layer is "user". The +configuration value will be set for the current channel, which +is controlled by the default_channel configuration variable. +', + ), + 'config-help' => array( + 'summary' => 'Show Information About Setting', + 'function' => 'doConfigHelp', + 'shortcut' => 'ch', + 'options' => array(), + 'doc' => '[parameter] +Displays help for a configuration parameter. Without arguments it +displays help for all configuration parameters. +', + ), + 'config-create' => array( + 'summary' => 'Create a Default configuration file', + 'function' => 'doConfigCreate', + 'shortcut' => 'coc', + 'options' => array( + 'windows' => array( + 'shortopt' => 'w', + 'doc' => 'create a config file for a windows install', + ), + ), + 'doc' => '<root path> <filename> +Create a default configuration file with all directory configuration +variables set to subdirectories of <root path>, and save it as <filename>. +This is useful especially for creating a configuration file for a remote +PEAR installation (using the --remoteconfig option of install, upgrade, +and uninstall). +', + ), + ); + + /** + * PEAR_Command_Config constructor. + * + * @access public + */ + function PEAR_Command_Config(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + function doConfigShow($command, $options, $params) + { + $layer = null; + if (is_array($params)) { + $layer = isset($params[0]) ? $params[0] : null; + } + + // $params[0] -> the layer + if ($error = $this->_checkLayer($layer)) { + return $this->raiseError("config-show:$error"); + } + + $keys = $this->config->getKeys(); + sort($keys); + $channel = isset($options['channel']) ? $options['channel'] : + $this->config->get('default_channel'); + $reg = &$this->config->getRegistry(); + if (!$reg->channelExists($channel)) { + return $this->raiseError('Channel "' . $channel . '" does not exist'); + } + + $channel = $reg->channelName($channel); + $data = array('caption' => 'Configuration (channel ' . $channel . '):'); + foreach ($keys as $key) { + $type = $this->config->getType($key); + $value = $this->config->get($key, $layer, $channel); + if ($type == 'password' && $value) { + $value = '********'; + } + + if ($value === false) { + $value = 'false'; + } elseif ($value === true) { + $value = 'true'; + } + + $data['data'][$this->config->getGroup($key)][] = array($this->config->getPrompt($key) , $key, $value); + } + + foreach ($this->config->getLayers() as $layer) { + $data['data']['Config Files'][] = array(ucfirst($layer) . ' Configuration File', 'Filename' , $this->config->getConfFile($layer)); + } + + $this->ui->outputData($data, $command); + return true; + } + + function doConfigGet($command, $options, $params) + { + $args_cnt = is_array($params) ? count($params) : 0; + switch ($args_cnt) { + case 1: + $config_key = $params[0]; + $layer = null; + break; + case 2: + $config_key = $params[0]; + $layer = $params[1]; + if ($error = $this->_checkLayer($layer)) { + return $this->raiseError("config-get:$error"); + } + break; + case 0: + default: + return $this->raiseError("config-get expects 1 or 2 parameters"); + } + + $reg = &$this->config->getRegistry(); + $channel = isset($options['channel']) ? $options['channel'] : $this->config->get('default_channel'); + if (!$reg->channelExists($channel)) { + return $this->raiseError('Channel "' . $channel . '" does not exist'); + } + + $channel = $reg->channelName($channel); + $this->ui->outputData($this->config->get($config_key, $layer, $channel), $command); + return true; + } + + function doConfigSet($command, $options, $params) + { + // $param[0] -> a parameter to set + // $param[1] -> the value for the parameter + // $param[2] -> the layer + $failmsg = ''; + if (count($params) < 2 || count($params) > 3) { + $failmsg .= "config-set expects 2 or 3 parameters"; + return PEAR::raiseError($failmsg); + } + + if (isset($params[2]) && ($error = $this->_checkLayer($params[2]))) { + $failmsg .= $error; + return PEAR::raiseError("config-set:$failmsg"); + } + + $channel = isset($options['channel']) ? $options['channel'] : $this->config->get('default_channel'); + $reg = &$this->config->getRegistry(); + if (!$reg->channelExists($channel)) { + return $this->raiseError('Channel "' . $channel . '" does not exist'); + } + + $channel = $reg->channelName($channel); + if ($params[0] == 'default_channel' && !$reg->channelExists($params[1])) { + return $this->raiseError('Channel "' . $params[1] . '" does not exist'); + } + + if ($params[0] == 'preferred_mirror' + && ( + !$reg->mirrorExists($channel, $params[1]) && + (!$reg->channelExists($params[1]) || $channel != $params[1]) + ) + ) { + $msg = 'Channel Mirror "' . $params[1] . '" does not exist'; + $msg .= ' in your registry for channel "' . $channel . '".'; + $msg .= "\n" . 'Attempt to run "pear channel-update ' . $channel .'"'; + $msg .= ' if you believe this mirror should exist as you may'; + $msg .= ' have outdated channel information.'; + return $this->raiseError($msg); + } + + if (count($params) == 2) { + array_push($params, 'user'); + $layer = 'user'; + } else { + $layer = $params[2]; + } + + array_push($params, $channel); + if (!call_user_func_array(array(&$this->config, 'set'), $params)) { + array_pop($params); + $failmsg = "config-set (" . implode(", ", $params) . ") failed, channel $channel"; + } else { + $this->config->store($layer); + } + + if ($failmsg) { + return $this->raiseError($failmsg); + } + + $this->ui->outputData('config-set succeeded', $command); + return true; + } + + function doConfigHelp($command, $options, $params) + { + if (empty($params)) { + $params = $this->config->getKeys(); + } + + $data['caption'] = "Config help" . ((count($params) == 1) ? " for $params[0]" : ''); + $data['headline'] = array('Name', 'Type', 'Description'); + $data['border'] = true; + foreach ($params as $name) { + $type = $this->config->getType($name); + $docs = $this->config->getDocs($name); + if ($type == 'set') { + $docs = rtrim($docs) . "\nValid set: " . + implode(' ', $this->config->getSetValues($name)); + } + + $data['data'][] = array($name, $type, $docs); + } + + $this->ui->outputData($data, $command); + } + + function doConfigCreate($command, $options, $params) + { + if (count($params) != 2) { + return PEAR::raiseError('config-create: must have 2 parameters, root path and ' . + 'filename to save as'); + } + + $root = $params[0]; + // Clean up the DIRECTORY_SEPARATOR mess + $ds2 = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; + $root = preg_replace(array('!\\\\+!', '!/+!', "!$ds2+!"), + array('/', '/', '/'), + $root); + if ($root{0} != '/') { + if (!isset($options['windows'])) { + return PEAR::raiseError('Root directory must be an absolute path beginning ' . + 'with "/", was: "' . $root . '"'); + } + + if (!preg_match('/^[A-Za-z]:/', $root)) { + return PEAR::raiseError('Root directory must be an absolute path beginning ' . + 'with "\\" or "C:\\", was: "' . $root . '"'); + } + } + + $windows = isset($options['windows']); + if ($windows) { + $root = str_replace('/', '\\', $root); + } + + if (!file_exists($params[1]) && !@touch($params[1])) { + return PEAR::raiseError('Could not create "' . $params[1] . '"'); + } + + $params[1] = realpath($params[1]); + $config = &new PEAR_Config($params[1], '#no#system#config#', false, false); + if ($root{strlen($root) - 1} == '/') { + $root = substr($root, 0, strlen($root) - 1); + } + + $config->noRegistry(); + $config->set('php_dir', $windows ? "$root\\pear\\php" : "$root/pear/php", 'user'); + $config->set('data_dir', $windows ? "$root\\pear\\data" : "$root/pear/data"); + $config->set('www_dir', $windows ? "$root\\pear\\www" : "$root/pear/www"); + $config->set('cfg_dir', $windows ? "$root\\pear\\cfg" : "$root/pear/cfg"); + $config->set('ext_dir', $windows ? "$root\\pear\\ext" : "$root/pear/ext"); + $config->set('doc_dir', $windows ? "$root\\pear\\docs" : "$root/pear/docs"); + $config->set('test_dir', $windows ? "$root\\pear\\tests" : "$root/pear/tests"); + $config->set('cache_dir', $windows ? "$root\\pear\\cache" : "$root/pear/cache"); + $config->set('download_dir', $windows ? "$root\\pear\\download" : "$root/pear/download"); + $config->set('temp_dir', $windows ? "$root\\pear\\temp" : "$root/pear/temp"); + $config->set('bin_dir', $windows ? "$root\\pear" : "$root/pear"); + $config->writeConfigFile(); + $this->_showConfig($config); + $this->ui->outputData('Successfully created default configuration file "' . $params[1] . '"', + $command); + } + + function _showConfig(&$config) + { + $params = array('user'); + $keys = $config->getKeys(); + sort($keys); + $channel = 'pear.php.net'; + $data = array('caption' => 'Configuration (channel ' . $channel . '):'); + foreach ($keys as $key) { + $type = $config->getType($key); + $value = $config->get($key, 'user', $channel); + if ($type == 'password' && $value) { + $value = '********'; + } + + if ($value === false) { + $value = 'false'; + } elseif ($value === true) { + $value = 'true'; + } + $data['data'][$config->getGroup($key)][] = + array($config->getPrompt($key) , $key, $value); + } + + foreach ($config->getLayers() as $layer) { + $data['data']['Config Files'][] = + array(ucfirst($layer) . ' Configuration File', 'Filename' , + $config->getConfFile($layer)); + } + + $this->ui->outputData($data, 'config-show'); + return true; + } + + /** + * Checks if a layer is defined or not + * + * @param string $layer The layer to search for + * @return mixed False on no error or the error message + */ + function _checkLayer($layer = null) + { + if (!empty($layer) && $layer != 'default') { + $layers = $this->config->getLayers(); + if (!in_array($layer, $layers)) { + return " only the layers: \"" . implode('" or "', $layers) . "\" are supported"; + } + } + + return false; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Config.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Config.xml new file mode 100644 index 0000000000000000000000000000000000000000..f64a925f52c38a43c428f471b7b8ac8e6249ea82 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Config.xml @@ -0,0 +1,92 @@ +<commands version="1.0"> + <config-show> + <summary>Show All Settings</summary> + <function>doConfigShow</function> + <shortcut>csh</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>show configuration variables for another channel</doc> + <arg>CHAN</arg> + </channel> + </options> + <doc>[layer] +Displays all configuration values. An optional argument +may be used to tell which configuration layer to display. Valid +configuration layers are "user", "system" and "default". To display +configurations for different channels, set the default_channel +configuration variable and run config-show again. +</doc> + </config-show> + <config-get> + <summary>Show One Setting</summary> + <function>doConfigGet</function> + <shortcut>cg</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>show configuration variables for another channel</doc> + <arg>CHAN</arg> + </channel> + </options> + <doc><parameter> [layer] +Displays the value of one configuration parameter. The +first argument is the name of the parameter, an optional second argument +may be used to tell which configuration layer to look in. Valid configuration +layers are "user", "system" and "default". If no layer is specified, a value +will be picked from the first layer that defines the parameter, in the order +just specified. The configuration value will be retrieved for the channel +specified by the default_channel configuration variable. +</doc> + </config-get> + <config-set> + <summary>Change Setting</summary> + <function>doConfigSet</function> + <shortcut>cs</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>show configuration variables for another channel</doc> + <arg>CHAN</arg> + </channel> + </options> + <doc><parameter> <value> [layer] +Sets the value of one configuration parameter. The first argument is +the name of the parameter, the second argument is the new value. Some +parameters are subject to validation, and the command will fail with +an error message if the new value does not make sense. An optional +third argument may be used to specify in which layer to set the +configuration parameter. The default layer is "user". The +configuration value will be set for the current channel, which +is controlled by the default_channel configuration variable. +</doc> + </config-set> + <config-help> + <summary>Show Information About Setting</summary> + <function>doConfigHelp</function> + <shortcut>ch</shortcut> + <options /> + <doc>[parameter] +Displays help for a configuration parameter. Without arguments it +displays help for all configuration parameters. +</doc> + </config-help> + <config-create> + <summary>Create a Default configuration file</summary> + <function>doConfigCreate</function> + <shortcut>coc</shortcut> + <options> + <windows> + <shortopt>w</shortopt> + <doc>create a config file for a windows install</doc> + </windows> + </options> + <doc><root path> <filename> +Create a default configuration file with all directory configuration +variables set to subdirectories of <root path>, and save it as <filename>. +This is useful especially for creating a configuration file for a remote +PEAR installation (using the --remoteconfig option of install, upgrade, +and uninstall). +</doc> + </config-create> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Install.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Install.php new file mode 100644 index 0000000000000000000000000000000000000000..c035f6d20de1eadcd7e6807718b645de4b336fa8 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Install.php @@ -0,0 +1,1268 @@ +<?php +/** + * PEAR_Command_Install (install, upgrade, upgrade-all, uninstall, bundle, run-scripts commands) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Install.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +/** + * PEAR commands for installation or deinstallation/upgrading of + * packages. + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Command_Install extends PEAR_Command_Common +{ + // {{{ properties + + var $commands = array( + 'install' => array( + 'summary' => 'Install Package', + 'function' => 'doInstall', + 'shortcut' => 'i', + 'options' => array( + 'force' => array( + 'shortopt' => 'f', + 'doc' => 'will overwrite newer installed packages', + ), + 'loose' => array( + 'shortopt' => 'l', + 'doc' => 'do not check for recommended dependency version', + ), + 'nodeps' => array( + 'shortopt' => 'n', + 'doc' => 'ignore dependencies, install anyway', + ), + 'register-only' => array( + 'shortopt' => 'r', + 'doc' => 'do not install files, only register the package as installed', + ), + 'soft' => array( + 'shortopt' => 's', + 'doc' => 'soft install, fail silently, or upgrade if already installed', + ), + 'nobuild' => array( + 'shortopt' => 'B', + 'doc' => 'don\'t build C extensions', + ), + 'nocompress' => array( + 'shortopt' => 'Z', + 'doc' => 'request uncompressed files when downloading', + ), + 'installroot' => array( + 'shortopt' => 'R', + 'arg' => 'DIR', + 'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT), use packagingroot for RPM', + ), + 'packagingroot' => array( + 'shortopt' => 'P', + 'arg' => 'DIR', + 'doc' => 'root directory used when packaging files, like RPM packaging', + ), + 'ignore-errors' => array( + 'doc' => 'force install even if there were errors', + ), + 'alldeps' => array( + 'shortopt' => 'a', + 'doc' => 'install all required and optional dependencies', + ), + 'onlyreqdeps' => array( + 'shortopt' => 'o', + 'doc' => 'install all required dependencies', + ), + 'offline' => array( + 'shortopt' => 'O', + 'doc' => 'do not attempt to download any urls or contact channels', + ), + 'pretend' => array( + 'shortopt' => 'p', + 'doc' => 'Only list the packages that would be downloaded', + ), + ), + 'doc' => '[channel/]<package> ... +Installs one or more PEAR packages. You can specify a package to +install in four ways: + +"Package-1.0.tgz" : installs from a local file + +"http://example.com/Package-1.0.tgz" : installs from +anywhere on the net. + +"package.xml" : installs the package described in +package.xml. Useful for testing, or for wrapping a PEAR package in +another package manager such as RPM. + +"Package[-version/state][.tar]" : queries your default channel\'s server +({config master_server}) and downloads the newest package with +the preferred quality/state ({config preferred_state}). + +To retrieve Package version 1.1, use "Package-1.1," to retrieve +Package state beta, use "Package-beta." To retrieve an uncompressed +file, append .tar (make sure there is no file by the same name first) + +To download a package from another channel, prefix with the channel name like +"channel/Package" + +More than one package may be specified at once. It is ok to mix these +four ways of specifying packages. +'), + 'upgrade' => array( + 'summary' => 'Upgrade Package', + 'function' => 'doInstall', + 'shortcut' => 'up', + 'options' => array( + 'channel' => array( + 'shortopt' => 'c', + 'doc' => 'upgrade packages from a specific channel', + 'arg' => 'CHAN', + ), + 'force' => array( + 'shortopt' => 'f', + 'doc' => 'overwrite newer installed packages', + ), + 'loose' => array( + 'shortopt' => 'l', + 'doc' => 'do not check for recommended dependency version', + ), + 'nodeps' => array( + 'shortopt' => 'n', + 'doc' => 'ignore dependencies, upgrade anyway', + ), + 'register-only' => array( + 'shortopt' => 'r', + 'doc' => 'do not install files, only register the package as upgraded', + ), + 'nobuild' => array( + 'shortopt' => 'B', + 'doc' => 'don\'t build C extensions', + ), + 'nocompress' => array( + 'shortopt' => 'Z', + 'doc' => 'request uncompressed files when downloading', + ), + 'installroot' => array( + 'shortopt' => 'R', + 'arg' => 'DIR', + 'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)', + ), + 'ignore-errors' => array( + 'doc' => 'force install even if there were errors', + ), + 'alldeps' => array( + 'shortopt' => 'a', + 'doc' => 'install all required and optional dependencies', + ), + 'onlyreqdeps' => array( + 'shortopt' => 'o', + 'doc' => 'install all required dependencies', + ), + 'offline' => array( + 'shortopt' => 'O', + 'doc' => 'do not attempt to download any urls or contact channels', + ), + 'pretend' => array( + 'shortopt' => 'p', + 'doc' => 'Only list the packages that would be downloaded', + ), + ), + 'doc' => '<package> ... +Upgrades one or more PEAR packages. See documentation for the +"install" command for ways to specify a package. + +When upgrading, your package will be updated if the provided new +package has a higher version number (use the -f option if you need to +upgrade anyway). + +More than one package may be specified at once. +'), + 'upgrade-all' => array( + 'summary' => 'Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters]', + 'function' => 'doUpgradeAll', + 'shortcut' => 'ua', + 'options' => array( + 'channel' => array( + 'shortopt' => 'c', + 'doc' => 'upgrade packages from a specific channel', + 'arg' => 'CHAN', + ), + 'nodeps' => array( + 'shortopt' => 'n', + 'doc' => 'ignore dependencies, upgrade anyway', + ), + 'register-only' => array( + 'shortopt' => 'r', + 'doc' => 'do not install files, only register the package as upgraded', + ), + 'nobuild' => array( + 'shortopt' => 'B', + 'doc' => 'don\'t build C extensions', + ), + 'nocompress' => array( + 'shortopt' => 'Z', + 'doc' => 'request uncompressed files when downloading', + ), + 'installroot' => array( + 'shortopt' => 'R', + 'arg' => 'DIR', + 'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT), use packagingroot for RPM', + ), + 'ignore-errors' => array( + 'doc' => 'force install even if there were errors', + ), + 'loose' => array( + 'doc' => 'do not check for recommended dependency version', + ), + ), + 'doc' => ' +WARNING: This function is deprecated in favor of using the upgrade command with no params + +Upgrades all packages that have a newer release available. Upgrades are +done only if there is a release available of the state specified in +"preferred_state" (currently {config preferred_state}), or a state considered +more stable. +'), + 'uninstall' => array( + 'summary' => 'Un-install Package', + 'function' => 'doUninstall', + 'shortcut' => 'un', + 'options' => array( + 'nodeps' => array( + 'shortopt' => 'n', + 'doc' => 'ignore dependencies, uninstall anyway', + ), + 'register-only' => array( + 'shortopt' => 'r', + 'doc' => 'do not remove files, only register the packages as not installed', + ), + 'installroot' => array( + 'shortopt' => 'R', + 'arg' => 'DIR', + 'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)', + ), + 'ignore-errors' => array( + 'doc' => 'force install even if there were errors', + ), + 'offline' => array( + 'shortopt' => 'O', + 'doc' => 'do not attempt to uninstall remotely', + ), + ), + 'doc' => '[channel/]<package> ... +Uninstalls one or more PEAR packages. More than one package may be +specified at once. Prefix with channel name to uninstall from a +channel not in your default channel ({config default_channel}) +'), + 'bundle' => array( + 'summary' => 'Unpacks a Pecl Package', + 'function' => 'doBundle', + 'shortcut' => 'bun', + 'options' => array( + 'destination' => array( + 'shortopt' => 'd', + 'arg' => 'DIR', + 'doc' => 'Optional destination directory for unpacking (defaults to current path or "ext" if exists)', + ), + 'force' => array( + 'shortopt' => 'f', + 'doc' => 'Force the unpacking even if there were errors in the package', + ), + ), + 'doc' => '<package> +Unpacks a Pecl Package into the selected location. It will download the +package if needed. +'), + 'run-scripts' => array( + 'summary' => 'Run Post-Install Scripts bundled with a package', + 'function' => 'doRunScripts', + 'shortcut' => 'rs', + 'options' => array( + ), + 'doc' => '<package> +Run post-installation scripts in package <package>, if any exist. +'), + ); + + // }}} + // {{{ constructor + + /** + * PEAR_Command_Install constructor. + * + * @access public + */ + function PEAR_Command_Install(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + // }}} + + /** + * For unit testing purposes + */ + function &getDownloader(&$ui, $options, &$config) + { + if (!class_exists('PEAR_Downloader')) { + require_once 'PEAR/Downloader.php'; + } + $a = &new PEAR_Downloader($ui, $options, $config); + return $a; + } + + /** + * For unit testing purposes + */ + function &getInstaller(&$ui) + { + if (!class_exists('PEAR_Installer')) { + require_once 'PEAR/Installer.php'; + } + $a = &new PEAR_Installer($ui); + return $a; + } + + function enableExtension($binaries, $type) + { + if (!($phpini = $this->config->get('php_ini', null, 'pear.php.net'))) { + return PEAR::raiseError('configuration option "php_ini" is not set to php.ini location'); + } + $ini = $this->_parseIni($phpini); + if (PEAR::isError($ini)) { + return $ini; + } + $line = 0; + if ($type == 'extsrc' || $type == 'extbin') { + $search = 'extensions'; + $enable = 'extension'; + } else { + $search = 'zend_extensions'; + ob_start(); + phpinfo(INFO_GENERAL); + $info = ob_get_contents(); + ob_end_clean(); + $debug = function_exists('leak') ? '_debug' : ''; + $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : ''; + $enable = 'zend_extension' . $debug . $ts; + } + foreach ($ini[$search] as $line => $extension) { + if (in_array($extension, $binaries, true) || in_array( + $ini['extension_dir'] . DIRECTORY_SEPARATOR . $extension, $binaries, true)) { + // already enabled - assume if one is, all are + return true; + } + } + if ($line) { + $newini = array_slice($ini['all'], 0, $line); + } else { + $newini = array(); + } + foreach ($binaries as $binary) { + if ($ini['extension_dir']) { + $binary = basename($binary); + } + $newini[] = $enable . '="' . $binary . '"' . (OS_UNIX ? "\n" : "\r\n"); + } + $newini = array_merge($newini, array_slice($ini['all'], $line)); + $fp = @fopen($phpini, 'wb'); + if (!$fp) { + return PEAR::raiseError('cannot open php.ini "' . $phpini . '" for writing'); + } + foreach ($newini as $line) { + fwrite($fp, $line); + } + fclose($fp); + return true; + } + + function disableExtension($binaries, $type) + { + if (!($phpini = $this->config->get('php_ini', null, 'pear.php.net'))) { + return PEAR::raiseError('configuration option "php_ini" is not set to php.ini location'); + } + $ini = $this->_parseIni($phpini); + if (PEAR::isError($ini)) { + return $ini; + } + $line = 0; + if ($type == 'extsrc' || $type == 'extbin') { + $search = 'extensions'; + $enable = 'extension'; + } else { + $search = 'zend_extensions'; + ob_start(); + phpinfo(INFO_GENERAL); + $info = ob_get_contents(); + ob_end_clean(); + $debug = function_exists('leak') ? '_debug' : ''; + $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : ''; + $enable = 'zend_extension' . $debug . $ts; + } + $found = false; + foreach ($ini[$search] as $line => $extension) { + if (in_array($extension, $binaries, true) || in_array( + $ini['extension_dir'] . DIRECTORY_SEPARATOR . $extension, $binaries, true)) { + $found = true; + break; + } + } + if (!$found) { + // not enabled + return true; + } + $fp = @fopen($phpini, 'wb'); + if (!$fp) { + return PEAR::raiseError('cannot open php.ini "' . $phpini . '" for writing'); + } + if ($line) { + $newini = array_slice($ini['all'], 0, $line); + // delete the enable line + $newini = array_merge($newini, array_slice($ini['all'], $line + 1)); + } else { + $newini = array_slice($ini['all'], 1); + } + foreach ($newini as $line) { + fwrite($fp, $line); + } + fclose($fp); + return true; + } + + function _parseIni($filename) + { + if (!file_exists($filename)) { + return PEAR::raiseError('php.ini "' . $filename . '" does not exist'); + } + + if (filesize($filename) > 300000) { + return PEAR::raiseError('php.ini "' . $filename . '" is too large, aborting'); + } + + ob_start(); + phpinfo(INFO_GENERAL); + $info = ob_get_contents(); + ob_end_clean(); + $debug = function_exists('leak') ? '_debug' : ''; + $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : ''; + $zend_extension_line = 'zend_extension' . $debug . $ts; + $all = @file($filename); + if (!$all) { + return PEAR::raiseError('php.ini "' . $filename .'" could not be read'); + } + $zend_extensions = $extensions = array(); + // assume this is right, but pull from the php.ini if it is found + $extension_dir = ini_get('extension_dir'); + foreach ($all as $linenum => $line) { + $line = trim($line); + if (!$line) { + continue; + } + if ($line[0] == ';') { + continue; + } + if (strtolower(substr($line, 0, 13)) == 'extension_dir') { + $line = trim(substr($line, 13)); + if ($line[0] == '=') { + $x = trim(substr($line, 1)); + $x = explode(';', $x); + $extension_dir = str_replace('"', '', array_shift($x)); + continue; + } + } + if (strtolower(substr($line, 0, 9)) == 'extension') { + $line = trim(substr($line, 9)); + if ($line[0] == '=') { + $x = trim(substr($line, 1)); + $x = explode(';', $x); + $extensions[$linenum] = str_replace('"', '', array_shift($x)); + continue; + } + } + if (strtolower(substr($line, 0, strlen($zend_extension_line))) == + $zend_extension_line) { + $line = trim(substr($line, strlen($zend_extension_line))); + if ($line[0] == '=') { + $x = trim(substr($line, 1)); + $x = explode(';', $x); + $zend_extensions[$linenum] = str_replace('"', '', array_shift($x)); + continue; + } + } + } + return array( + 'extensions' => $extensions, + 'zend_extensions' => $zend_extensions, + 'extension_dir' => $extension_dir, + 'all' => $all, + ); + } + + // {{{ doInstall() + + function doInstall($command, $options, $params) + { + if (!class_exists('PEAR_PackageFile')) { + require_once 'PEAR/PackageFile.php'; + } + + if (isset($options['installroot']) && isset($options['packagingroot'])) { + return $this->raiseError('ERROR: cannot use both --installroot and --packagingroot'); + } + + $reg = &$this->config->getRegistry(); + $channel = isset($options['channel']) ? $options['channel'] : $this->config->get('default_channel'); + if (!$reg->channelExists($channel)) { + return $this->raiseError('Channel "' . $channel . '" does not exist'); + } + + if (empty($this->installer)) { + $this->installer = &$this->getInstaller($this->ui); + } + + if ($command == 'upgrade' || $command == 'upgrade-all') { + // If people run the upgrade command but pass nothing, emulate a upgrade-all + if ($command == 'upgrade' && empty($params)) { + return $this->doUpgradeAll($command, $options, $params); + } + $options['upgrade'] = true; + } else { + $packages = $params; + } + + $instreg = &$reg; // instreg used to check if package is installed + if (isset($options['packagingroot']) && !isset($options['upgrade'])) { + $packrootphp_dir = $this->installer->_prependPath( + $this->config->get('php_dir', null, 'pear.php.net'), + $options['packagingroot']); + $instreg = new PEAR_Registry($packrootphp_dir); // other instreg! + + if ($this->config->get('verbose') > 2) { + $this->ui->outputData('using package root: ' . $options['packagingroot']); + } + } + + $abstractpackages = $otherpackages = array(); + // parse params + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + + foreach ($params as $param) { + if (strpos($param, 'http://') === 0) { + $otherpackages[] = $param; + continue; + } + + if (strpos($param, 'channel://') === false && @file_exists($param)) { + if (isset($options['force'])) { + $otherpackages[] = $param; + continue; + } + + $pkg = new PEAR_PackageFile($this->config); + $pf = $pkg->fromAnyFile($param, PEAR_VALIDATE_DOWNLOADING); + if (PEAR::isError($pf)) { + $otherpackages[] = $param; + continue; + } + + $exists = $reg->packageExists($pf->getPackage(), $pf->getChannel()); + $pversion = $reg->packageInfo($pf->getPackage(), 'version', $pf->getChannel()); + $version_compare = version_compare($pf->getVersion(), $pversion, '<='); + if ($exists && $version_compare) { + if ($this->config->get('verbose')) { + $this->ui->outputData('Ignoring installed package ' . + $reg->parsedPackageNameToString( + array('package' => $pf->getPackage(), + 'channel' => $pf->getChannel()), true)); + } + continue; + } + $otherpackages[] = $param; + continue; + } + + $e = $reg->parsePackageName($param, $channel); + if (PEAR::isError($e)) { + $otherpackages[] = $param; + } else { + $abstractpackages[] = $e; + } + } + PEAR::staticPopErrorHandling(); + + // if there are any local package .tgz or remote static url, we can't + // filter. The filter only works for abstract packages + if (count($abstractpackages) && !isset($options['force'])) { + // when not being forced, only do necessary upgrades/installs + if (isset($options['upgrade'])) { + $abstractpackages = $this->_filterUptodatePackages($abstractpackages, $command); + } else { + $count = count($abstractpackages); + foreach ($abstractpackages as $i => $package) { + if (isset($package['group'])) { + // do not filter out install groups + continue; + } + + if ($instreg->packageExists($package['package'], $package['channel'])) { + if ($count > 1) { + if ($this->config->get('verbose')) { + $this->ui->outputData('Ignoring installed package ' . + $reg->parsedPackageNameToString($package, true)); + } + unset($abstractpackages[$i]); + } elseif ($count === 1) { + // Lets try to upgrade it since it's already installed + $options['upgrade'] = true; + } + } + } + } + $abstractpackages = + array_map(array($reg, 'parsedPackageNameToString'), $abstractpackages); + } elseif (count($abstractpackages)) { + $abstractpackages = + array_map(array($reg, 'parsedPackageNameToString'), $abstractpackages); + } + + $packages = array_merge($abstractpackages, $otherpackages); + if (!count($packages)) { + $c = ''; + if (isset($options['channel'])){ + $c .= ' in channel "' . $options['channel'] . '"'; + } + $this->ui->outputData('Nothing to ' . $command . $c); + return true; + } + + $this->downloader = &$this->getDownloader($this->ui, $options, $this->config); + $errors = $downloaded = $binaries = array(); + $downloaded = &$this->downloader->download($packages); + if (PEAR::isError($downloaded)) { + return $this->raiseError($downloaded); + } + + $errors = $this->downloader->getErrorMsgs(); + if (count($errors)) { + $err = array(); + $err['data'] = array(); + foreach ($errors as $error) { + if ($error !== null) { + $err['data'][] = array($error); + } + } + + if (!empty($err['data'])) { + $err['headline'] = 'Install Errors'; + $this->ui->outputData($err); + } + + if (!count($downloaded)) { + return $this->raiseError("$command failed"); + } + } + + $data = array( + 'headline' => 'Packages that would be Installed' + ); + + if (isset($options['pretend'])) { + foreach ($downloaded as $package) { + $data['data'][] = array($reg->parsedPackageNameToString($package->getParsedPackage())); + } + $this->ui->outputData($data, 'pretend'); + return true; + } + + $this->installer->setOptions($options); + $this->installer->sortPackagesForInstall($downloaded); + if (PEAR::isError($err = $this->installer->setDownloadedPackages($downloaded))) { + $this->raiseError($err->getMessage()); + return true; + } + + $binaries = $extrainfo = array(); + foreach ($downloaded as $param) { + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $info = $this->installer->install($param, $options); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($info)) { + $oldinfo = $info; + $pkg = &$param->getPackageFile(); + if ($info->getCode() != PEAR_INSTALLER_NOBINARY) { + if (!($info = $pkg->installBinary($this->installer))) { + $this->ui->outputData('ERROR: ' .$oldinfo->getMessage()); + continue; + } + + // we just installed a different package than requested, + // let's change the param and info so that the rest of this works + $param = $info[0]; + $info = $info[1]; + } + } + + if (!is_array($info)) { + return $this->raiseError("$command failed"); + } + + if ($param->getPackageType() == 'extsrc' || + $param->getPackageType() == 'extbin' || + $param->getPackageType() == 'zendextsrc' || + $param->getPackageType() == 'zendextbin' + ) { + $pkg = &$param->getPackageFile(); + if ($instbin = $pkg->getInstalledBinary()) { + $instpkg = &$instreg->getPackage($instbin, $pkg->getChannel()); + } else { + $instpkg = &$instreg->getPackage($pkg->getPackage(), $pkg->getChannel()); + } + + foreach ($instpkg->getFilelist() as $name => $atts) { + $pinfo = pathinfo($atts['installed_as']); + if (!isset($pinfo['extension']) || + in_array($pinfo['extension'], array('c', 'h')) + ) { + continue; // make sure we don't match php_blah.h + } + + if ((strpos($pinfo['basename'], 'php_') === 0 && + $pinfo['extension'] == 'dll') || + // most unices + $pinfo['extension'] == 'so' || + // hp-ux + $pinfo['extension'] == 'sl') { + $binaries[] = array($atts['installed_as'], $pinfo); + break; + } + } + + if (count($binaries)) { + foreach ($binaries as $pinfo) { + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $ret = $this->enableExtension(array($pinfo[0]), $param->getPackageType()); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($ret)) { + $extrainfo[] = $ret->getMessage(); + if ($param->getPackageType() == 'extsrc' || + $param->getPackageType() == 'extbin') { + $exttype = 'extension'; + } else { + ob_start(); + phpinfo(INFO_GENERAL); + $info = ob_get_contents(); + ob_end_clean(); + $debug = function_exists('leak') ? '_debug' : ''; + $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : ''; + $exttype = 'zend_extension' . $debug . $ts; + } + $extrainfo[] = 'You should add "' . $exttype . '=' . + $pinfo[1]['basename'] . '" to php.ini'; + } else { + $extrainfo[] = 'Extension ' . $instpkg->getProvidesExtension() . + ' enabled in php.ini'; + } + } + } + } + + if ($this->config->get('verbose') > 0) { + $chan = $param->getChannel(); + $label = $reg->parsedPackageNameToString( + array( + 'channel' => $chan, + 'package' => $param->getPackage(), + 'version' => $param->getVersion(), + )); + $out = array('data' => "$command ok: $label"); + if (isset($info['release_warnings'])) { + $out['release_warnings'] = $info['release_warnings']; + } + $this->ui->outputData($out, $command); + + if (!isset($options['register-only']) && !isset($options['offline'])) { + if ($this->config->isDefinedLayer('ftp')) { + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $info = $this->installer->ftpInstall($param); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($info)) { + $this->ui->outputData($info->getMessage()); + $this->ui->outputData("remote install failed: $label"); + } else { + $this->ui->outputData("remote install ok: $label"); + } + } + } + } + + $deps = $param->getDeps(); + if ($deps) { + if (isset($deps['group'])) { + $groups = $deps['group']; + if (!isset($groups[0])) { + $groups = array($groups); + } + + foreach ($groups as $group) { + if ($group['attribs']['name'] == 'default') { + // default group is always installed, unless the user + // explicitly chooses to install another group + continue; + } + $extrainfo[] = $param->getPackage() . ': Optional feature ' . + $group['attribs']['name'] . ' available (' . + $group['attribs']['hint'] . ')'; + } + + $extrainfo[] = $param->getPackage() . + ': To install optional features use "pear install ' . + $reg->parsedPackageNameToString( + array('package' => $param->getPackage(), + 'channel' => $param->getChannel()), true) . + '#featurename"'; + } + } + + $pkg = &$instreg->getPackage($param->getPackage(), $param->getChannel()); + // $pkg may be NULL if install is a 'fake' install via --packagingroot + if (is_object($pkg)) { + $pkg->setConfig($this->config); + if ($list = $pkg->listPostinstallScripts()) { + $pn = $reg->parsedPackageNameToString(array('channel' => + $param->getChannel(), 'package' => $param->getPackage()), true); + $extrainfo[] = $pn . ' has post-install scripts:'; + foreach ($list as $file) { + $extrainfo[] = $file; + } + $extrainfo[] = $param->getPackage() . + ': Use "pear run-scripts ' . $pn . '" to finish setup.'; + $extrainfo[] = 'DO NOT RUN SCRIPTS FROM UNTRUSTED SOURCES'; + } + } + } + + if (count($extrainfo)) { + foreach ($extrainfo as $info) { + $this->ui->outputData($info); + } + } + + return true; + } + + // }}} + // {{{ doUpgradeAll() + + function doUpgradeAll($command, $options, $params) + { + $reg = &$this->config->getRegistry(); + $upgrade = array(); + + if (isset($options['channel'])) { + $channels = array($options['channel']); + } else { + $channels = $reg->listChannels(); + } + + foreach ($channels as $channel) { + if ($channel == '__uri') { + continue; + } + + // parse name with channel + foreach ($reg->listPackages($channel) as $name) { + $upgrade[] = $reg->parsedPackageNameToString(array( + 'channel' => $channel, + 'package' => $name + )); + } + } + + $err = $this->doInstall($command, $options, $upgrade); + if (PEAR::isError($err)) { + $this->ui->outputData($err->getMessage(), $command); + } + } + + // }}} + // {{{ doUninstall() + + function doUninstall($command, $options, $params) + { + if (count($params) < 1) { + return $this->raiseError("Please supply the package(s) you want to uninstall"); + } + + if (empty($this->installer)) { + $this->installer = &$this->getInstaller($this->ui); + } + + if (isset($options['remoteconfig'])) { + $e = $this->config->readFTPConfigFile($options['remoteconfig']); + if (!PEAR::isError($e)) { + $this->installer->setConfig($this->config); + } + } + + $reg = &$this->config->getRegistry(); + $newparams = array(); + $binaries = array(); + $badparams = array(); + foreach ($params as $pkg) { + $channel = $this->config->get('default_channel'); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $parsed = $reg->parsePackageName($pkg, $channel); + PEAR::staticPopErrorHandling(); + if (!$parsed || PEAR::isError($parsed)) { + $badparams[] = $pkg; + continue; + } + $package = $parsed['package']; + $channel = $parsed['channel']; + $info = &$reg->getPackage($package, $channel); + if ($info === null && + ($channel == 'pear.php.net' || $channel == 'pecl.php.net')) { + // make sure this isn't a package that has flipped from pear to pecl but + // used a package.xml 1.0 + $testc = ($channel == 'pear.php.net') ? 'pecl.php.net' : 'pear.php.net'; + $info = &$reg->getPackage($package, $testc); + if ($info !== null) { + $channel = $testc; + } + } + if ($info === null) { + $badparams[] = $pkg; + } else { + $newparams[] = &$info; + // check for binary packages (this is an alias for those packages if so) + if ($installedbinary = $info->getInstalledBinary()) { + $this->ui->log('adding binary package ' . + $reg->parsedPackageNameToString(array('channel' => $channel, + 'package' => $installedbinary), true)); + $newparams[] = &$reg->getPackage($installedbinary, $channel); + } + // add the contents of a dependency group to the list of installed packages + if (isset($parsed['group'])) { + $group = $info->getDependencyGroup($parsed['group']); + if ($group) { + $installed = $reg->getInstalledGroup($group); + if ($installed) { + foreach ($installed as $i => $p) { + $newparams[] = &$installed[$i]; + } + } + } + } + } + } + $err = $this->installer->sortPackagesForUninstall($newparams); + if (PEAR::isError($err)) { + $this->ui->outputData($err->getMessage(), $command); + return true; + } + $params = $newparams; + // twist this to use it to check on whether dependent packages are also being uninstalled + // for circular dependencies like subpackages + $this->installer->setUninstallPackages($newparams); + $params = array_merge($params, $badparams); + $binaries = array(); + foreach ($params as $pkg) { + $this->installer->pushErrorHandling(PEAR_ERROR_RETURN); + if ($err = $this->installer->uninstall($pkg, $options)) { + $this->installer->popErrorHandling(); + if (PEAR::isError($err)) { + $this->ui->outputData($err->getMessage(), $command); + continue; + } + if ($pkg->getPackageType() == 'extsrc' || + $pkg->getPackageType() == 'extbin' || + $pkg->getPackageType() == 'zendextsrc' || + $pkg->getPackageType() == 'zendextbin') { + if ($instbin = $pkg->getInstalledBinary()) { + continue; // this will be uninstalled later + } + + foreach ($pkg->getFilelist() as $name => $atts) { + $pinfo = pathinfo($atts['installed_as']); + if (!isset($pinfo['extension']) || + in_array($pinfo['extension'], array('c', 'h'))) { + continue; // make sure we don't match php_blah.h + } + if ((strpos($pinfo['basename'], 'php_') === 0 && + $pinfo['extension'] == 'dll') || + // most unices + $pinfo['extension'] == 'so' || + // hp-ux + $pinfo['extension'] == 'sl') { + $binaries[] = array($atts['installed_as'], $pinfo); + break; + } + } + if (count($binaries)) { + foreach ($binaries as $pinfo) { + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $ret = $this->disableExtension(array($pinfo[0]), $pkg->getPackageType()); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($ret)) { + $extrainfo[] = $ret->getMessage(); + if ($pkg->getPackageType() == 'extsrc' || + $pkg->getPackageType() == 'extbin') { + $exttype = 'extension'; + } else { + ob_start(); + phpinfo(INFO_GENERAL); + $info = ob_get_contents(); + ob_end_clean(); + $debug = function_exists('leak') ? '_debug' : ''; + $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : ''; + $exttype = 'zend_extension' . $debug . $ts; + } + $this->ui->outputData('Unable to remove "' . $exttype . '=' . + $pinfo[1]['basename'] . '" from php.ini', $command); + } else { + $this->ui->outputData('Extension ' . $pkg->getProvidesExtension() . + ' disabled in php.ini', $command); + } + } + } + } + $savepkg = $pkg; + if ($this->config->get('verbose') > 0) { + if (is_object($pkg)) { + $pkg = $reg->parsedPackageNameToString($pkg); + } + $this->ui->outputData("uninstall ok: $pkg", $command); + } + if (!isset($options['offline']) && is_object($savepkg) && + defined('PEAR_REMOTEINSTALL_OK')) { + if ($this->config->isDefinedLayer('ftp')) { + $this->installer->pushErrorHandling(PEAR_ERROR_RETURN); + $info = $this->installer->ftpUninstall($savepkg); + $this->installer->popErrorHandling(); + if (PEAR::isError($info)) { + $this->ui->outputData($info->getMessage()); + $this->ui->outputData("remote uninstall failed: $pkg"); + } else { + $this->ui->outputData("remote uninstall ok: $pkg"); + } + } + } + } else { + $this->installer->popErrorHandling(); + if (!is_object($pkg)) { + return $this->raiseError("uninstall failed: $pkg"); + } + $pkg = $reg->parsedPackageNameToString($pkg); + } + } + + return true; + } + + // }}} + + + // }}} + // {{{ doBundle() + /* + (cox) It just downloads and untars the package, does not do + any check that the PEAR_Installer::_installFile() does. + */ + + function doBundle($command, $options, $params) + { + $opts = array( + 'force' => true, + 'nodeps' => true, + 'soft' => true, + 'downloadonly' => true + ); + $downloader = &$this->getDownloader($this->ui, $opts, $this->config); + $reg = &$this->config->getRegistry(); + if (count($params) < 1) { + return $this->raiseError("Please supply the package you want to bundle"); + } + + if (isset($options['destination'])) { + if (!is_dir($options['destination'])) { + System::mkdir('-p ' . $options['destination']); + } + $dest = realpath($options['destination']); + } else { + $pwd = getcwd(); + $dir = $pwd . DIRECTORY_SEPARATOR . 'ext'; + $dest = is_dir($dir) ? $dir : $pwd; + } + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $err = $downloader->setDownloadDir($dest); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($err)) { + return PEAR::raiseError('download directory "' . $dest . + '" is not writeable.'); + } + $result = &$downloader->download(array($params[0])); + if (PEAR::isError($result)) { + return $result; + } + if (!isset($result[0])) { + return $this->raiseError('unable to unpack ' . $params[0]); + } + $pkgfile = &$result[0]->getPackageFile(); + $pkgname = $pkgfile->getName(); + $pkgversion = $pkgfile->getVersion(); + + // Unpacking ------------------------------------------------- + $dest .= DIRECTORY_SEPARATOR . $pkgname; + $orig = $pkgname . '-' . $pkgversion; + + $tar = &new Archive_Tar($pkgfile->getArchiveFile()); + if (!$tar->extractModify($dest, $orig)) { + return $this->raiseError('unable to unpack ' . $pkgfile->getArchiveFile()); + } + $this->ui->outputData("Package ready at '$dest'"); + // }}} + } + + // }}} + + function doRunScripts($command, $options, $params) + { + if (!isset($params[0])) { + return $this->raiseError('run-scripts expects 1 parameter: a package name'); + } + + $reg = &$this->config->getRegistry(); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $parsed = $reg->parsePackageName($params[0], $this->config->get('default_channel')); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($parsed)) { + return $this->raiseError($parsed); + } + + $package = &$reg->getPackage($parsed['package'], $parsed['channel']); + if (!is_object($package)) { + return $this->raiseError('Could not retrieve package "' . $params[0] . '" from registry'); + } + + $package->setConfig($this->config); + $package->runPostinstallScripts(); + $this->ui->outputData('Install scripts complete', $command); + return true; + } + + /** + * Given a list of packages, filter out those ones that are already up to date + * + * @param $packages: packages, in parsed array format ! + * @return list of packages that can be upgraded + */ + function _filterUptodatePackages($packages, $command) + { + $reg = &$this->config->getRegistry(); + $latestReleases = array(); + + $ret = array(); + foreach ($packages as $package) { + if (isset($package['group'])) { + $ret[] = $package; + continue; + } + + $channel = $package['channel']; + $name = $package['package']; + if (!$reg->packageExists($name, $channel)) { + $ret[] = $package; + continue; + } + + if (!isset($latestReleases[$channel])) { + // fill in cache for this channel + $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } + + $base2 = false; + $preferred_mirror = $this->config->get('preferred_mirror', null, $channel); + if ($chan->supportsREST($preferred_mirror) && + ( + //($base2 = $chan->getBaseURL('REST1.4', $preferred_mirror)) || + ($base = $chan->getBaseURL('REST1.0', $preferred_mirror)) + ) + ) { + $dorest = true; + } + + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + if (!isset($package['state'])) { + $state = $this->config->get('preferred_state', null, $channel); + } else { + $state = $package['state']; + } + + if ($dorest) { + if ($base2) { + $rest = &$this->config->getREST('1.4', array()); + $base = $base2; + } else { + $rest = &$this->config->getREST('1.0', array()); + } + + $installed = array_flip($reg->listPackages($channel)); + $latest = $rest->listLatestUpgrades($base, $state, $installed, $channel, $reg); + } + + PEAR::staticPopErrorHandling(); + if (PEAR::isError($latest)) { + $this->ui->outputData('Error getting channel info from ' . $channel . + ': ' . $latest->getMessage()); + continue; + } + + $latestReleases[$channel] = array_change_key_case($latest); + } + + // check package for latest release + $name_lower = strtolower($name); + if (isset($latestReleases[$channel][$name_lower])) { + // if not set, up to date + $inst_version = $reg->packageInfo($name, 'version', $channel); + $channel_version = $latestReleases[$channel][$name_lower]['version']; + if (version_compare($channel_version, $inst_version, 'le')) { + // installed version is up-to-date + continue; + } + + // maintain BC + if ($command == 'upgrade-all') { + $this->ui->outputData(array('data' => 'Will upgrade ' . + $reg->parsedPackageNameToString($package)), $command); + } + $ret[] = $package; + } + } + + return $ret; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Install.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Install.xml new file mode 100644 index 0000000000000000000000000000000000000000..1b1e933c22da92225b6ed73a0e8f76f6df47bcdf --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Install.xml @@ -0,0 +1,276 @@ +<commands version="1.0"> + <install> + <summary>Install Package</summary> + <function>doInstall</function> + <shortcut>i</shortcut> + <options> + <force> + <shortopt>f</shortopt> + <doc>will overwrite newer installed packages</doc> + </force> + <loose> + <shortopt>l</shortopt> + <doc>do not check for recommended dependency version</doc> + </loose> + <nodeps> + <shortopt>n</shortopt> + <doc>ignore dependencies, install anyway</doc> + </nodeps> + <register-only> + <shortopt>r</shortopt> + <doc>do not install files, only register the package as installed</doc> + </register-only> + <soft> + <shortopt>s</shortopt> + <doc>soft install, fail silently, or upgrade if already installed</doc> + </soft> + <nobuild> + <shortopt>B</shortopt> + <doc>don't build C extensions</doc> + </nobuild> + <nocompress> + <shortopt>Z</shortopt> + <doc>request uncompressed files when downloading</doc> + </nocompress> + <installroot> + <shortopt>R</shortopt> + <doc>root directory used when installing files (ala PHP's INSTALL_ROOT), use packagingroot for RPM</doc> + <arg>DIR</arg> + </installroot> + <packagingroot> + <shortopt>P</shortopt> + <doc>root directory used when packaging files, like RPM packaging</doc> + <arg>DIR</arg> + </packagingroot> + <ignore-errors> + <shortopt></shortopt> + <doc>force install even if there were errors</doc> + </ignore-errors> + <alldeps> + <shortopt>a</shortopt> + <doc>install all required and optional dependencies</doc> + </alldeps> + <onlyreqdeps> + <shortopt>o</shortopt> + <doc>install all required dependencies</doc> + </onlyreqdeps> + <offline> + <shortopt>O</shortopt> + <doc>do not attempt to download any urls or contact channels</doc> + </offline> + <pretend> + <shortopt>p</shortopt> + <doc>Only list the packages that would be downloaded</doc> + </pretend> + </options> + <doc>[channel/]<package> ... +Installs one or more PEAR packages. You can specify a package to +install in four ways: + +"Package-1.0.tgz" : installs from a local file + +"http://example.com/Package-1.0.tgz" : installs from +anywhere on the net. + +"package.xml" : installs the package described in +package.xml. Useful for testing, or for wrapping a PEAR package in +another package manager such as RPM. + +"Package[-version/state][.tar]" : queries your default channel's server +({config master_server}) and downloads the newest package with +the preferred quality/state ({config preferred_state}). + +To retrieve Package version 1.1, use "Package-1.1," to retrieve +Package state beta, use "Package-beta." To retrieve an uncompressed +file, append .tar (make sure there is no file by the same name first) + +To download a package from another channel, prefix with the channel name like +"channel/Package" + +More than one package may be specified at once. It is ok to mix these +four ways of specifying packages. +</doc> + </install> + <upgrade> + <summary>Upgrade Package</summary> + <function>doInstall</function> + <shortcut>up</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>upgrade packages from a specific channel</doc> + <arg>CHAN</arg> + </channel> + <force> + <shortopt>f</shortopt> + <doc>overwrite newer installed packages</doc> + </force> + <loose> + <shortopt>l</shortopt> + <doc>do not check for recommended dependency version</doc> + </loose> + <nodeps> + <shortopt>n</shortopt> + <doc>ignore dependencies, upgrade anyway</doc> + </nodeps> + <register-only> + <shortopt>r</shortopt> + <doc>do not install files, only register the package as upgraded</doc> + </register-only> + <nobuild> + <shortopt>B</shortopt> + <doc>don't build C extensions</doc> + </nobuild> + <nocompress> + <shortopt>Z</shortopt> + <doc>request uncompressed files when downloading</doc> + </nocompress> + <installroot> + <shortopt>R</shortopt> + <doc>root directory used when installing files (ala PHP's INSTALL_ROOT)</doc> + <arg>DIR</arg> + </installroot> + <ignore-errors> + <shortopt></shortopt> + <doc>force install even if there were errors</doc> + </ignore-errors> + <alldeps> + <shortopt>a</shortopt> + <doc>install all required and optional dependencies</doc> + </alldeps> + <onlyreqdeps> + <shortopt>o</shortopt> + <doc>install all required dependencies</doc> + </onlyreqdeps> + <offline> + <shortopt>O</shortopt> + <doc>do not attempt to download any urls or contact channels</doc> + </offline> + <pretend> + <shortopt>p</shortopt> + <doc>Only list the packages that would be downloaded</doc> + </pretend> + </options> + <doc><package> ... +Upgrades one or more PEAR packages. See documentation for the +"install" command for ways to specify a package. + +When upgrading, your package will be updated if the provided new +package has a higher version number (use the -f option if you need to +upgrade anyway). + +More than one package may be specified at once. +</doc> + </upgrade> + <upgrade-all> + <summary>Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters]</summary> + <function>doUpgradeAll</function> + <shortcut>ua</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>upgrade packages from a specific channel</doc> + <arg>CHAN</arg> + </channel> + <nodeps> + <shortopt>n</shortopt> + <doc>ignore dependencies, upgrade anyway</doc> + </nodeps> + <register-only> + <shortopt>r</shortopt> + <doc>do not install files, only register the package as upgraded</doc> + </register-only> + <nobuild> + <shortopt>B</shortopt> + <doc>don't build C extensions</doc> + </nobuild> + <nocompress> + <shortopt>Z</shortopt> + <doc>request uncompressed files when downloading</doc> + </nocompress> + <installroot> + <shortopt>R</shortopt> + <doc>root directory used when installing files (ala PHP's INSTALL_ROOT), use packagingroot for RPM</doc> + <arg>DIR</arg> + </installroot> + <ignore-errors> + <shortopt></shortopt> + <doc>force install even if there were errors</doc> + </ignore-errors> + <loose> + <shortopt></shortopt> + <doc>do not check for recommended dependency version</doc> + </loose> + </options> + <doc> +WARNING: This function is deprecated in favor of using the upgrade command with no params + +Upgrades all packages that have a newer release available. Upgrades are +done only if there is a release available of the state specified in +"preferred_state" (currently {config preferred_state}), or a state considered +more stable. +</doc> + </upgrade-all> + <uninstall> + <summary>Un-install Package</summary> + <function>doUninstall</function> + <shortcut>un</shortcut> + <options> + <nodeps> + <shortopt>n</shortopt> + <doc>ignore dependencies, uninstall anyway</doc> + </nodeps> + <register-only> + <shortopt>r</shortopt> + <doc>do not remove files, only register the packages as not installed</doc> + </register-only> + <installroot> + <shortopt>R</shortopt> + <doc>root directory used when installing files (ala PHP's INSTALL_ROOT)</doc> + <arg>DIR</arg> + </installroot> + <ignore-errors> + <shortopt></shortopt> + <doc>force install even if there were errors</doc> + </ignore-errors> + <offline> + <shortopt>O</shortopt> + <doc>do not attempt to uninstall remotely</doc> + </offline> + </options> + <doc>[channel/]<package> ... +Uninstalls one or more PEAR packages. More than one package may be +specified at once. Prefix with channel name to uninstall from a +channel not in your default channel ({config default_channel}) +</doc> + </uninstall> + <bundle> + <summary>Unpacks a Pecl Package</summary> + <function>doBundle</function> + <shortcut>bun</shortcut> + <options> + <destination> + <shortopt>d</shortopt> + <doc>Optional destination directory for unpacking (defaults to current path or "ext" if exists)</doc> + <arg>DIR</arg> + </destination> + <force> + <shortopt>f</shortopt> + <doc>Force the unpacking even if there were errors in the package</doc> + </force> + </options> + <doc><package> +Unpacks a Pecl Package into the selected location. It will download the +package if needed. +</doc> + </bundle> + <run-scripts> + <summary>Run Post-Install Scripts bundled with a package</summary> + <function>doRunScripts</function> + <shortcut>rs</shortcut> + <options /> + <doc><package> +Run post-installation scripts in package <package>, if any exist. +</doc> + </run-scripts> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Mirror.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Mirror.php new file mode 100644 index 0000000000000000000000000000000000000000..4d157c6b8886000edfc0d6dbec85e303087bc368 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Mirror.php @@ -0,0 +1,139 @@ +<?php +/** + * PEAR_Command_Mirror (download-all command) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Alexander Merz <alexmerz@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Mirror.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.2.0 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +/** + * PEAR commands for providing file mirrors + * + * @category pear + * @package PEAR + * @author Alexander Merz <alexmerz@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.2.0 + */ +class PEAR_Command_Mirror extends PEAR_Command_Common +{ + var $commands = array( + 'download-all' => array( + 'summary' => 'Downloads each available package from the default channel', + 'function' => 'doDownloadAll', + 'shortcut' => 'da', + 'options' => array( + 'channel' => + array( + 'shortopt' => 'c', + 'doc' => 'specify a channel other than the default channel', + 'arg' => 'CHAN', + ), + ), + 'doc' => ' +Requests a list of available packages from the default channel ({config default_channel}) +and downloads them to current working directory. Note: only +packages within preferred_state ({config preferred_state}) will be downloaded' + ), + ); + + /** + * PEAR_Command_Mirror constructor. + * + * @access public + * @param object PEAR_Frontend a reference to an frontend + * @param object PEAR_Config a reference to the configuration data + */ + function PEAR_Command_Mirror(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + /** + * For unit-testing + */ + function &factory($a) + { + $a = &PEAR_Command::factory($a, $this->config); + return $a; + } + + /** + * retrieves a list of avaible Packages from master server + * and downloads them + * + * @access public + * @param string $command the command + * @param array $options the command options before the command + * @param array $params the stuff after the command name + * @return bool true if succesful + * @throw PEAR_Error + */ + function doDownloadAll($command, $options, $params) + { + $savechannel = $this->config->get('default_channel'); + $reg = &$this->config->getRegistry(); + $channel = isset($options['channel']) ? $options['channel'] : + $this->config->get('default_channel'); + if (!$reg->channelExists($channel)) { + $this->config->set('default_channel', $savechannel); + return $this->raiseError('Channel "' . $channel . '" does not exist'); + } + $this->config->set('default_channel', $channel); + + $this->ui->outputData('Using Channel ' . $this->config->get('default_channel')); + $chan = $reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $this->raiseError($chan); + } + + if ($chan->supportsREST($this->config->get('preferred_mirror')) && + $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { + $rest = &$this->config->getREST('1.0', array()); + $remoteInfo = array_flip($rest->listPackages($base, $channel)); + } + + if (PEAR::isError($remoteInfo)) { + return $remoteInfo; + } + + $cmd = &$this->factory("download"); + if (PEAR::isError($cmd)) { + return $cmd; + } + + $this->ui->outputData('Using Preferred State of ' . + $this->config->get('preferred_state')); + $this->ui->outputData('Gathering release information, please wait...'); + + /** + * Error handling not necessary, because already done by + * the download command + */ + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $err = $cmd->run('download', array('downloadonly' => true), array_keys($remoteInfo)); + PEAR::staticPopErrorHandling(); + $this->config->set('default_channel', $savechannel); + if (PEAR::isError($err)) { + $this->ui->outputData($err->getMessage()); + } + + return true; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Mirror.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Mirror.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe8be9d03bf94a11aae5fb1fbbe338932bd2c9c8 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Mirror.xml @@ -0,0 +1,18 @@ +<commands version="1.0"> + <download-all> + <summary>Downloads each available package from the default channel</summary> + <function>doDownloadAll</function> + <shortcut>da</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>specify a channel other than the default channel</doc> + <arg>CHAN</arg> + </channel> + </options> + <doc> +Requests a list of available packages from the default channel ({config default_channel}) +and downloads them to current working directory. Note: only +packages within preferred_state ({config preferred_state}) will be downloaded</doc> + </download-all> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Package.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Package.php new file mode 100644 index 0000000000000000000000000000000000000000..81df7bf6945d974923427de420f199cbe6f48ab3 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Package.php @@ -0,0 +1,1124 @@ +<?php +/** + * PEAR_Command_Package (package, package-validate, cvsdiff, cvstag, package-dependencies, + * sign, makerpm, convert commands) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Martin Jansen <mj@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Package.php 313024 2011-07-06 19:51:24Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +/** + * PEAR commands for login/logout + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Martin Jansen <mj@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ + +class PEAR_Command_Package extends PEAR_Command_Common +{ + var $commands = array( + 'package' => array( + 'summary' => 'Build Package', + 'function' => 'doPackage', + 'shortcut' => 'p', + 'options' => array( + 'nocompress' => array( + 'shortopt' => 'Z', + 'doc' => 'Do not gzip the package file' + ), + 'showname' => array( + 'shortopt' => 'n', + 'doc' => 'Print the name of the packaged file.', + ), + ), + 'doc' => '[descfile] [descfile2] +Creates a PEAR package from its description file (usually called +package.xml). If a second packagefile is passed in, then +the packager will check to make sure that one is a package.xml +version 1.0, and the other is a package.xml version 2.0. The +package.xml version 1.0 will be saved as "package.xml" in the archive, +and the other as "package2.xml" in the archive" +' + ), + 'package-validate' => array( + 'summary' => 'Validate Package Consistency', + 'function' => 'doPackageValidate', + 'shortcut' => 'pv', + 'options' => array(), + 'doc' => ' +', + ), + 'cvsdiff' => array( + 'summary' => 'Run a "cvs diff" for all files in a package', + 'function' => 'doCvsDiff', + 'shortcut' => 'cd', + 'options' => array( + 'quiet' => array( + 'shortopt' => 'q', + 'doc' => 'Be quiet', + ), + 'reallyquiet' => array( + 'shortopt' => 'Q', + 'doc' => 'Be really quiet', + ), + 'date' => array( + 'shortopt' => 'D', + 'doc' => 'Diff against revision of DATE', + 'arg' => 'DATE', + ), + 'release' => array( + 'shortopt' => 'R', + 'doc' => 'Diff against tag for package release REL', + 'arg' => 'REL', + ), + 'revision' => array( + 'shortopt' => 'r', + 'doc' => 'Diff against revision REV', + 'arg' => 'REV', + ), + 'context' => array( + 'shortopt' => 'c', + 'doc' => 'Generate context diff', + ), + 'unified' => array( + 'shortopt' => 'u', + 'doc' => 'Generate unified diff', + ), + 'ignore-case' => array( + 'shortopt' => 'i', + 'doc' => 'Ignore case, consider upper- and lower-case letters equivalent', + ), + 'ignore-whitespace' => array( + 'shortopt' => 'b', + 'doc' => 'Ignore changes in amount of white space', + ), + 'ignore-blank-lines' => array( + 'shortopt' => 'B', + 'doc' => 'Ignore changes that insert or delete blank lines', + ), + 'brief' => array( + 'doc' => 'Report only whether the files differ, no details', + ), + 'dry-run' => array( + 'shortopt' => 'n', + 'doc' => 'Don\'t do anything, just pretend', + ), + ), + 'doc' => '<package.xml> +Compares all the files in a package. Without any options, this +command will compare the current code with the last checked-in code. +Using the -r or -R option you may compare the current code with that +of a specific release. +', + ), + 'svntag' => array( + 'summary' => 'Set SVN Release Tag', + 'function' => 'doSvnTag', + 'shortcut' => 'sv', + 'options' => array( + 'quiet' => array( + 'shortopt' => 'q', + 'doc' => 'Be quiet', + ), + 'slide' => array( + 'shortopt' => 'F', + 'doc' => 'Move (slide) tag if it exists', + ), + 'delete' => array( + 'shortopt' => 'd', + 'doc' => 'Remove tag', + ), + 'dry-run' => array( + 'shortopt' => 'n', + 'doc' => 'Don\'t do anything, just pretend', + ), + ), + 'doc' => '<package.xml> [files...] + Sets a SVN tag on all files in a package. Use this command after you have + packaged a distribution tarball with the "package" command to tag what + revisions of what files were in that release. If need to fix something + after running svntag once, but before the tarball is released to the public, + use the "slide" option to move the release tag. + + to include files (such as a second package.xml, or tests not included in the + release), pass them as additional parameters. + ', + ), + 'cvstag' => array( + 'summary' => 'Set CVS Release Tag', + 'function' => 'doCvsTag', + 'shortcut' => 'ct', + 'options' => array( + 'quiet' => array( + 'shortopt' => 'q', + 'doc' => 'Be quiet', + ), + 'reallyquiet' => array( + 'shortopt' => 'Q', + 'doc' => 'Be really quiet', + ), + 'slide' => array( + 'shortopt' => 'F', + 'doc' => 'Move (slide) tag if it exists', + ), + 'delete' => array( + 'shortopt' => 'd', + 'doc' => 'Remove tag', + ), + 'dry-run' => array( + 'shortopt' => 'n', + 'doc' => 'Don\'t do anything, just pretend', + ), + ), + 'doc' => '<package.xml> [files...] +Sets a CVS tag on all files in a package. Use this command after you have +packaged a distribution tarball with the "package" command to tag what +revisions of what files were in that release. If need to fix something +after running cvstag once, but before the tarball is released to the public, +use the "slide" option to move the release tag. + +to include files (such as a second package.xml, or tests not included in the +release), pass them as additional parameters. +', + ), + 'package-dependencies' => array( + 'summary' => 'Show package dependencies', + 'function' => 'doPackageDependencies', + 'shortcut' => 'pd', + 'options' => array(), + 'doc' => '<package-file> or <package.xml> or <install-package-name> +List all dependencies the package has. +Can take a tgz / tar file, package.xml or a package name of an installed package.' + ), + 'sign' => array( + 'summary' => 'Sign a package distribution file', + 'function' => 'doSign', + 'shortcut' => 'si', + 'options' => array( + 'verbose' => array( + 'shortopt' => 'v', + 'doc' => 'Display GnuPG output', + ), + ), + 'doc' => '<package-file> +Signs a package distribution (.tar or .tgz) file with GnuPG.', + ), + 'makerpm' => array( + 'summary' => 'Builds an RPM spec file from a PEAR package', + 'function' => 'doMakeRPM', + 'shortcut' => 'rpm', + 'options' => array( + 'spec-template' => array( + 'shortopt' => 't', + 'arg' => 'FILE', + 'doc' => 'Use FILE as RPM spec file template' + ), + 'rpm-pkgname' => array( + 'shortopt' => 'p', + 'arg' => 'FORMAT', + 'doc' => 'Use FORMAT as format string for RPM package name, %s is replaced +by the PEAR package name, defaults to "PEAR::%s".', + ), + ), + 'doc' => '<package-file> + +Creates an RPM .spec file for wrapping a PEAR package inside an RPM +package. Intended to be used from the SPECS directory, with the PEAR +package tarball in the SOURCES directory: + +$ pear makerpm ../SOURCES/Net_Socket-1.0.tgz +Wrote RPM spec file PEAR::Net_Geo-1.0.spec +$ rpm -bb PEAR::Net_Socket-1.0.spec +... +Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm +', + ), + 'convert' => array( + 'summary' => 'Convert a package.xml 1.0 to package.xml 2.0 format', + 'function' => 'doConvert', + 'shortcut' => 'c2', + 'options' => array( + 'flat' => array( + 'shortopt' => 'f', + 'doc' => 'do not beautify the filelist.', + ), + ), + 'doc' => '[descfile] [descfile2] +Converts a package.xml in 1.0 format into a package.xml +in 2.0 format. The new file will be named package2.xml by default, +and package.xml will be used as the old file by default. +This is not the most intelligent conversion, and should only be +used for automated conversion or learning the format. +' + ), + ); + + var $output; + + /** + * PEAR_Command_Package constructor. + * + * @access public + */ + function PEAR_Command_Package(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + function _displayValidationResults($err, $warn, $strict = false) + { + foreach ($err as $e) { + $this->output .= "Error: $e\n"; + } + foreach ($warn as $w) { + $this->output .= "Warning: $w\n"; + } + $this->output .= sprintf('Validation: %d error(s), %d warning(s)'."\n", + sizeof($err), sizeof($warn)); + if ($strict && count($err) > 0) { + $this->output .= "Fix these errors and try again."; + return false; + } + return true; + } + + function &getPackager() + { + if (!class_exists('PEAR_Packager')) { + require_once 'PEAR/Packager.php'; + } + $a = &new PEAR_Packager; + return $a; + } + + function &getPackageFile($config, $debug = false) + { + if (!class_exists('PEAR_Common')) { + require_once 'PEAR/Common.php'; + } + if (!class_exists('PEAR_PackageFile')) { + require_once 'PEAR/PackageFile.php'; + } + $a = &new PEAR_PackageFile($config, $debug); + $common = new PEAR_Common; + $common->ui = $this->ui; + $a->setLogger($common); + return $a; + } + + function doPackage($command, $options, $params) + { + $this->output = ''; + $pkginfofile = isset($params[0]) ? $params[0] : 'package.xml'; + $pkg2 = isset($params[1]) ? $params[1] : null; + if (!$pkg2 && !isset($params[0]) && file_exists('package2.xml')) { + $pkg2 = 'package2.xml'; + } + + $packager = &$this->getPackager(); + $compress = empty($options['nocompress']) ? true : false; + $result = $packager->package($pkginfofile, $compress, $pkg2); + if (PEAR::isError($result)) { + return $this->raiseError($result); + } + + // Don't want output, only the package file name just created + if (isset($options['showname'])) { + $this->output = $result; + } + + if ($this->output) { + $this->ui->outputData($this->output, $command); + } + + return true; + } + + function doPackageValidate($command, $options, $params) + { + $this->output = ''; + if (count($params) < 1) { + $params[0] = 'package.xml'; + } + + $obj = &$this->getPackageFile($this->config, $this->_debug); + $obj->rawReturn(); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $info = $obj->fromTgzFile($params[0], PEAR_VALIDATE_NORMAL); + if (PEAR::isError($info)) { + $info = $obj->fromPackageFile($params[0], PEAR_VALIDATE_NORMAL); + } else { + $archive = $info->getArchiveFile(); + $tar = &new Archive_Tar($archive); + $tar->extract(dirname($info->getPackageFile())); + $info->setPackageFile(dirname($info->getPackageFile()) . DIRECTORY_SEPARATOR . + $info->getPackage() . '-' . $info->getVersion() . DIRECTORY_SEPARATOR . + basename($info->getPackageFile())); + } + + PEAR::staticPopErrorHandling(); + if (PEAR::isError($info)) { + return $this->raiseError($info); + } + + $valid = false; + if ($info->getPackagexmlVersion() == '2.0') { + if ($valid = $info->validate(PEAR_VALIDATE_NORMAL)) { + $info->flattenFileList(); + $valid = $info->validate(PEAR_VALIDATE_PACKAGING); + } + } else { + $valid = $info->validate(PEAR_VALIDATE_PACKAGING); + } + + $err = $warn = array(); + if ($errors = $info->getValidationWarnings()) { + foreach ($errors as $error) { + if ($error['level'] == 'warning') { + $warn[] = $error['message']; + } else { + $err[] = $error['message']; + } + } + } + + $this->_displayValidationResults($err, $warn); + $this->ui->outputData($this->output, $command); + return true; + } + + function doSvnTag($command, $options, $params) + { + $this->output = ''; + $_cmd = $command; + if (count($params) < 1) { + $help = $this->getHelp($command); + return $this->raiseError("$command: missing parameter: $help[0]"); + } + + $packageFile = realpath($params[0]); + $dir = dirname($packageFile); + $dir = substr($dir, strrpos($dir, DIRECTORY_SEPARATOR) + 1); + $obj = &$this->getPackageFile($this->config, $this->_debug); + $info = $obj->fromAnyFile($packageFile, PEAR_VALIDATE_NORMAL); + if (PEAR::isError($info)) { + return $this->raiseError($info); + } + + $err = $warn = array(); + if (!$info->validate()) { + foreach ($info->getValidationWarnings() as $error) { + if ($error['level'] == 'warning') { + $warn[] = $error['message']; + } else { + $err[] = $error['message']; + } + } + } + + if (!$this->_displayValidationResults($err, $warn, true)) { + $this->ui->outputData($this->output, $command); + return $this->raiseError('SVN tag failed'); + } + + $version = $info->getVersion(); + $package = $info->getName(); + $svntag = "$package-$version"; + + if (isset($options['delete'])) { + return $this->_svnRemoveTag($version, $package, $svntag, $packageFile, $options); + } + + $path = $this->_svnFindPath($packageFile); + + // Check if there are any modified files + $fp = popen('svn st --xml ' . dirname($packageFile), "r"); + $out = ''; + while ($line = fgets($fp, 1024)) { + $out .= rtrim($line)."\n"; + } + pclose($fp); + + if (!isset($options['quiet']) && strpos($out, 'item="modified"')) { + $params = array(array( + 'name' => 'modified', + 'type' => 'yesno', + 'default' => 'no', + 'prompt' => 'You have files in your SVN checkout (' . $path['from'] . ') that have been modified but not commited, do you still want to tag ' . $version . '?', + )); + $answers = $this->ui->confirmDialog($params); + + if (!in_array($answers['modified'], array('y', 'yes', 'on', '1'))) { + return true; + } + } + + if (isset($options['slide'])) { + $this->_svnRemoveTag($version, $package, $svntag, $packageFile, $options); + } + + // Check if tag already exists + $releaseTag = $path['local']['base'] . 'tags' . DIRECTORY_SEPARATOR . $svntag; + $existsCommand = 'svn ls ' . $path['base'] . 'tags/'; + + $fp = popen($existsCommand, "r"); + $out = ''; + while ($line = fgets($fp, 1024)) { + $out .= rtrim($line)."\n"; + } + pclose($fp); + + if (in_array($svntag . DIRECTORY_SEPARATOR, explode("\n", $out))) { + $this->ui->outputData($this->output, $command); + return $this->raiseError('SVN tag ' . $svntag . ' for ' . $package . ' already exists.'); + } elseif (file_exists($path['local']['base'] . 'tags') === false) { + return $this->raiseError('Can not locate the tags directory at ' . $path['local']['base'] . 'tags'); + } elseif (is_writeable($path['local']['base'] . 'tags') === false) { + return $this->raiseError('Can not write to the tag directory at ' . $path['local']['base'] . 'tags'); + } else { + $makeCommand = 'svn mkdir ' . $releaseTag; + $this->output .= "+ $makeCommand\n"; + if (empty($options['dry-run'])) { + // We need to create the tag dir. + $fp = popen($makeCommand, "r"); + $out = ''; + while ($line = fgets($fp, 1024)) { + $out .= rtrim($line)."\n"; + } + pclose($fp); + $this->output .= "$out\n"; + } + } + + $command = 'svn'; + if (isset($options['quiet'])) { + $command .= ' -q'; + } + + $command .= ' copy --parents '; + + $dir = dirname($packageFile); + $dir = substr($dir, strrpos($dir, DIRECTORY_SEPARATOR) + 1); + $files = array_keys($info->getFilelist()); + if (!in_array(basename($packageFile), $files)) { + $files[] = basename($packageFile); + } + + array_shift($params); + if (count($params)) { + // add in additional files to be tagged (package files and such) + $files = array_merge($files, $params); + } + + $commands = array(); + foreach ($files as $file) { + if (!file_exists($file)) { + $file = $dir . DIRECTORY_SEPARATOR . $file; + } + $commands[] = $command . ' ' . escapeshellarg($file) . ' ' . + escapeshellarg($releaseTag . DIRECTORY_SEPARATOR . $file); + } + + $this->output .= implode("\n", $commands) . "\n"; + if (empty($options['dry-run'])) { + foreach ($commands as $command) { + $fp = popen($command, "r"); + while ($line = fgets($fp, 1024)) { + $this->output .= rtrim($line)."\n"; + } + pclose($fp); + } + } + + $command = 'svn ci -m "Tagging the ' . $version . ' release" ' . $releaseTag . "\n"; + $this->output .= "+ $command\n"; + if (empty($options['dry-run'])) { + $fp = popen($command, "r"); + while ($line = fgets($fp, 1024)) { + $this->output .= rtrim($line)."\n"; + } + pclose($fp); + } + + $this->ui->outputData($this->output, $_cmd); + return true; + } + + function _svnFindPath($file) + { + $xml = ''; + $command = "svn info --xml $file"; + $fp = popen($command, "r"); + while ($line = fgets($fp, 1024)) { + $xml .= rtrim($line)."\n"; + } + pclose($fp); + $url_tag = strpos($xml, '<url>'); + $url = substr($xml, $url_tag + 5, strpos($xml, '</url>', $url_tag + 5) - ($url_tag + 5)); + + $path = array(); + $path['from'] = substr($url, 0, strrpos($url, '/')); + $path['base'] = substr($path['from'], 0, strrpos($path['from'], '/') + 1); + + // Figure out the local paths - see http://pear.php.net/bugs/17463 + $pos = strpos($file, DIRECTORY_SEPARATOR . 'trunk' . DIRECTORY_SEPARATOR); + if ($pos === false) { + $pos = strpos($file, DIRECTORY_SEPARATOR . 'branches' . DIRECTORY_SEPARATOR); + } + $path['local']['base'] = substr($file, 0, $pos + 1); + + return $path; + } + + function _svnRemoveTag($version, $package, $tag, $packageFile, $options) + { + $command = 'svn'; + + if (isset($options['quiet'])) { + $command .= ' -q'; + } + + $command .= ' remove'; + $command .= ' -m "Removing tag for the ' . $version . ' release."'; + + $path = $this->_svnFindPath($packageFile); + $command .= ' ' . $path['base'] . 'tags/' . $tag; + + + if ($this->config->get('verbose') > 1) { + $this->output .= "+ $command\n"; + } + + $this->output .= "+ $command\n"; + if (empty($options['dry-run'])) { + $fp = popen($command, "r"); + while ($line = fgets($fp, 1024)) { + $this->output .= rtrim($line)."\n"; + } + pclose($fp); + } + + $this->ui->outputData($this->output, $command); + return true; + } + + function doCvsTag($command, $options, $params) + { + $this->output = ''; + $_cmd = $command; + if (count($params) < 1) { + $help = $this->getHelp($command); + return $this->raiseError("$command: missing parameter: $help[0]"); + } + + $packageFile = realpath($params[0]); + $obj = &$this->getPackageFile($this->config, $this->_debug); + $info = $obj->fromAnyFile($packageFile, PEAR_VALIDATE_NORMAL); + if (PEAR::isError($info)) { + return $this->raiseError($info); + } + + $err = $warn = array(); + if (!$info->validate()) { + foreach ($info->getValidationWarnings() as $error) { + if ($error['level'] == 'warning') { + $warn[] = $error['message']; + } else { + $err[] = $error['message']; + } + } + } + + if (!$this->_displayValidationResults($err, $warn, true)) { + $this->ui->outputData($this->output, $command); + return $this->raiseError('CVS tag failed'); + } + + $version = $info->getVersion(); + $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $version); + $cvstag = "RELEASE_$cvsversion"; + $files = array_keys($info->getFilelist()); + $command = 'cvs'; + if (isset($options['quiet'])) { + $command .= ' -q'; + } + + if (isset($options['reallyquiet'])) { + $command .= ' -Q'; + } + + $command .= ' tag'; + if (isset($options['slide'])) { + $command .= ' -F'; + } + + if (isset($options['delete'])) { + $command .= ' -d'; + } + + $command .= ' ' . $cvstag . ' ' . escapeshellarg($params[0]); + array_shift($params); + if (count($params)) { + // add in additional files to be tagged + $files = array_merge($files, $params); + } + + $dir = dirname($packageFile); + $dir = substr($dir, strrpos($dir, '/') + 1); + foreach ($files as $file) { + if (!file_exists($file)) { + $file = $dir . DIRECTORY_SEPARATOR . $file; + } + $command .= ' ' . escapeshellarg($file); + } + + if ($this->config->get('verbose') > 1) { + $this->output .= "+ $command\n"; + } + + $this->output .= "+ $command\n"; + if (empty($options['dry-run'])) { + $fp = popen($command, "r"); + while ($line = fgets($fp, 1024)) { + $this->output .= rtrim($line)."\n"; + } + pclose($fp); + } + + $this->ui->outputData($this->output, $_cmd); + return true; + } + + function doCvsDiff($command, $options, $params) + { + $this->output = ''; + if (sizeof($params) < 1) { + $help = $this->getHelp($command); + return $this->raiseError("$command: missing parameter: $help[0]"); + } + + $file = realpath($params[0]); + $obj = &$this->getPackageFile($this->config, $this->_debug); + $info = $obj->fromAnyFile($file, PEAR_VALIDATE_NORMAL); + if (PEAR::isError($info)) { + return $this->raiseError($info); + } + + $err = $warn = array(); + if (!$info->validate()) { + foreach ($info->getValidationWarnings() as $error) { + if ($error['level'] == 'warning') { + $warn[] = $error['message']; + } else { + $err[] = $error['message']; + } + } + } + + if (!$this->_displayValidationResults($err, $warn, true)) { + $this->ui->outputData($this->output, $command); + return $this->raiseError('CVS diff failed'); + } + + $info1 = $info->getFilelist(); + $files = $info1; + $cmd = "cvs"; + if (isset($options['quiet'])) { + $cmd .= ' -q'; + unset($options['quiet']); + } + + if (isset($options['reallyquiet'])) { + $cmd .= ' -Q'; + unset($options['reallyquiet']); + } + + if (isset($options['release'])) { + $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $options['release']); + $cvstag = "RELEASE_$cvsversion"; + $options['revision'] = $cvstag; + unset($options['release']); + } + + $execute = true; + if (isset($options['dry-run'])) { + $execute = false; + unset($options['dry-run']); + } + + $cmd .= ' diff'; + // the rest of the options are passed right on to "cvs diff" + foreach ($options as $option => $optarg) { + $arg = $short = false; + if (isset($this->commands[$command]['options'][$option])) { + $arg = $this->commands[$command]['options'][$option]['arg']; + $short = $this->commands[$command]['options'][$option]['shortopt']; + } + $cmd .= $short ? " -$short" : " --$option"; + if ($arg && $optarg) { + $cmd .= ($short ? '' : '=') . escapeshellarg($optarg); + } + } + + foreach ($files as $file) { + $cmd .= ' ' . escapeshellarg($file['name']); + } + + if ($this->config->get('verbose') > 1) { + $this->output .= "+ $cmd\n"; + } + + if ($execute) { + $fp = popen($cmd, "r"); + while ($line = fgets($fp, 1024)) { + $this->output .= rtrim($line)."\n"; + } + pclose($fp); + } + + $this->ui->outputData($this->output, $command); + return true; + } + + function doPackageDependencies($command, $options, $params) + { + // $params[0] -> the PEAR package to list its information + if (count($params) !== 1) { + return $this->raiseError("bad parameter(s), try \"help $command\""); + } + + $obj = &$this->getPackageFile($this->config, $this->_debug); + if (is_file($params[0]) || strpos($params[0], '.xml') > 0) { + $info = $obj->fromAnyFile($params[0], PEAR_VALIDATE_NORMAL); + } else { + $reg = $this->config->getRegistry(); + $info = $obj->fromArray($reg->packageInfo($params[0])); + } + + if (PEAR::isError($info)) { + return $this->raiseError($info); + } + + $deps = $info->getDeps(); + if (is_array($deps)) { + if ($info->getPackagexmlVersion() == '1.0') { + $data = array( + 'caption' => 'Dependencies for pear/' . $info->getPackage(), + 'border' => true, + 'headline' => array("Required?", "Type", "Name", "Relation", "Version"), + ); + + foreach ($deps as $d) { + if (isset($d['optional'])) { + if ($d['optional'] == 'yes') { + $req = 'No'; + } else { + $req = 'Yes'; + } + } else { + $req = 'Yes'; + } + + if (isset($this->_deps_rel_trans[$d['rel']])) { + $rel = $this->_deps_rel_trans[$d['rel']]; + } else { + $rel = $d['rel']; + } + + if (isset($this->_deps_type_trans[$d['type']])) { + $type = ucfirst($this->_deps_type_trans[$d['type']]); + } else { + $type = $d['type']; + } + + if (isset($d['name'])) { + $name = $d['name']; + } else { + $name = ''; + } + + if (isset($d['version'])) { + $version = $d['version']; + } else { + $version = ''; + } + + $data['data'][] = array($req, $type, $name, $rel, $version); + } + } else { // package.xml 2.0 dependencies display + require_once 'PEAR/Dependency2.php'; + $deps = $info->getDependencies(); + $reg = &$this->config->getRegistry(); + if (is_array($deps)) { + $d = new PEAR_Dependency2($this->config, array(), ''); + $data = array( + 'caption' => 'Dependencies for ' . $info->getPackage(), + 'border' => true, + 'headline' => array("Required?", "Type", "Name", 'Versioning', 'Group'), + ); + foreach ($deps as $type => $subd) { + $req = ($type == 'required') ? 'Yes' : 'No'; + if ($type == 'group') { + $group = $subd['attribs']['name']; + } else { + $group = ''; + } + + if (!isset($subd[0])) { + $subd = array($subd); + } + + foreach ($subd as $groupa) { + foreach ($groupa as $deptype => $depinfo) { + if ($deptype == 'attribs') { + continue; + } + + if ($deptype == 'pearinstaller') { + $deptype = 'pear Installer'; + } + + if (!isset($depinfo[0])) { + $depinfo = array($depinfo); + } + + foreach ($depinfo as $inf) { + $name = ''; + if (isset($inf['channel'])) { + $alias = $reg->channelAlias($inf['channel']); + if (!$alias) { + $alias = '(channel?) ' .$inf['channel']; + } + $name = $alias . '/'; + + } + if (isset($inf['name'])) { + $name .= $inf['name']; + } elseif (isset($inf['pattern'])) { + $name .= $inf['pattern']; + } else { + $name .= ''; + } + + if (isset($inf['uri'])) { + $name .= ' [' . $inf['uri'] . ']'; + } + + if (isset($inf['conflicts'])) { + $ver = 'conflicts'; + } else { + $ver = $d->_getExtraString($inf); + } + + $data['data'][] = array($req, ucfirst($deptype), $name, + $ver, $group); + } + } + } + } + } + } + + $this->ui->outputData($data, $command); + return true; + } + + // Fallback + $this->ui->outputData("This package does not have any dependencies.", $command); + } + + function doSign($command, $options, $params) + { + // should move most of this code into PEAR_Packager + // so it'll be easy to implement "pear package --sign" + if (count($params) !== 1) { + return $this->raiseError("bad parameter(s), try \"help $command\""); + } + + require_once 'System.php'; + require_once 'Archive/Tar.php'; + + if (!file_exists($params[0])) { + return $this->raiseError("file does not exist: $params[0]"); + } + + $obj = $this->getPackageFile($this->config, $this->_debug); + $info = $obj->fromTgzFile($params[0], PEAR_VALIDATE_NORMAL); + if (PEAR::isError($info)) { + return $this->raiseError($info); + } + + $tar = new Archive_Tar($params[0]); + + $tmpdir = $this->config->get('temp_dir'); + $tmpdir = System::mktemp(' -t "' . $tmpdir . '" -d pearsign'); + if (!$tar->extractList('package2.xml package.xml package.sig', $tmpdir)) { + return $this->raiseError("failed to extract tar file"); + } + + if (file_exists("$tmpdir/package.sig")) { + return $this->raiseError("package already signed"); + } + + $packagexml = 'package.xml'; + if (file_exists("$tmpdir/package2.xml")) { + $packagexml = 'package2.xml'; + } + + if (file_exists("$tmpdir/package.sig")) { + unlink("$tmpdir/package.sig"); + } + + if (!file_exists("$tmpdir/$packagexml")) { + return $this->raiseError("Extracted file $tmpdir/$packagexml not found."); + } + + $input = $this->ui->userDialog($command, + array('GnuPG Passphrase'), + array('password')); + if (!isset($input[0])) { + //use empty passphrase + $input[0] = ''; + } + + $devnull = (isset($options['verbose'])) ? '' : ' 2>/dev/null'; + $gpg = popen("gpg --batch --passphrase-fd 0 --armor --detach-sign --output $tmpdir/package.sig $tmpdir/$packagexml" . $devnull, "w"); + if (!$gpg) { + return $this->raiseError("gpg command failed"); + } + + fwrite($gpg, "$input[0]\n"); + if (pclose($gpg) || !file_exists("$tmpdir/package.sig")) { + return $this->raiseError("gpg sign failed"); + } + + if (!$tar->addModify("$tmpdir/package.sig", '', $tmpdir)) { + return $this->raiseError('failed adding signature to file'); + } + + $this->ui->outputData("Package signed.", $command); + return true; + } + + /** + * For unit testing purposes + */ + function &getInstaller(&$ui) + { + if (!class_exists('PEAR_Installer')) { + require_once 'PEAR/Installer.php'; + } + $a = &new PEAR_Installer($ui); + return $a; + } + + /** + * For unit testing purposes + */ + function &getCommandPackaging(&$ui, &$config) + { + if (!class_exists('PEAR_Command_Packaging')) { + if ($fp = @fopen('PEAR/Command/Packaging.php', 'r', true)) { + fclose($fp); + include_once 'PEAR/Command/Packaging.php'; + } + } + + if (class_exists('PEAR_Command_Packaging')) { + $a = &new PEAR_Command_Packaging($ui, $config); + } else { + $a = null; + } + + return $a; + } + + function doMakeRPM($command, $options, $params) + { + + // Check to see if PEAR_Command_Packaging is installed, and + // transparently switch to use the "make-rpm-spec" command from it + // instead, if it does. Otherwise, continue to use the old version + // of "makerpm" supplied with this package (PEAR). + $packaging_cmd = $this->getCommandPackaging($this->ui, $this->config); + if ($packaging_cmd !== null) { + $this->ui->outputData('PEAR_Command_Packaging is installed; using '. + 'newer "make-rpm-spec" command instead'); + return $packaging_cmd->run('make-rpm-spec', $options, $params); + } + + $this->ui->outputData('WARNING: "pear makerpm" is no longer available; an '. + 'improved version is available via "pear make-rpm-spec", which '. + 'is available by installing PEAR_Command_Packaging'); + return true; + } + + function doConvert($command, $options, $params) + { + $packagexml = isset($params[0]) ? $params[0] : 'package.xml'; + $newpackagexml = isset($params[1]) ? $params[1] : dirname($packagexml) . + DIRECTORY_SEPARATOR . 'package2.xml'; + $pkg = &$this->getPackageFile($this->config, $this->_debug); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $pf = $pkg->fromPackageFile($packagexml, PEAR_VALIDATE_NORMAL); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($pf)) { + if (is_array($pf->getUserInfo())) { + foreach ($pf->getUserInfo() as $warning) { + $this->ui->outputData($warning['message']); + } + } + return $this->raiseError($pf); + } + + if (is_a($pf, 'PEAR_PackageFile_v2')) { + $this->ui->outputData($packagexml . ' is already a package.xml version 2.0'); + return true; + } + + $gen = &$pf->getDefaultGenerator(); + $newpf = &$gen->toV2(); + $newpf->setPackagefile($newpackagexml); + $gen = &$newpf->getDefaultGenerator(); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $state = (isset($options['flat']) ? PEAR_VALIDATE_PACKAGING : PEAR_VALIDATE_NORMAL); + $saved = $gen->toPackageFile(dirname($newpackagexml), $state, basename($newpackagexml)); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($saved)) { + if (is_array($saved->getUserInfo())) { + foreach ($saved->getUserInfo() as $warning) { + $this->ui->outputData($warning['message']); + } + } + + $this->ui->outputData($saved->getMessage()); + return true; + } + + $this->ui->outputData('Wrote new version 2.0 package.xml to "' . $saved . '"'); + return true; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Package.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Package.xml new file mode 100644 index 0000000000000000000000000000000000000000..d1aff9d48dea7d9cd725afebf93698fa310f3f98 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Package.xml @@ -0,0 +1,237 @@ +<commands version="1.0"> + <package> + <summary>Build Package</summary> + <function>doPackage</function> + <shortcut>p</shortcut> + <options> + <nocompress> + <shortopt>Z</shortopt> + <doc>Do not gzip the package file</doc> + </nocompress> + <showname> + <shortopt>n</shortopt> + <doc>Print the name of the packaged file.</doc> + </showname> + </options> + <doc>[descfile] [descfile2] +Creates a PEAR package from its description file (usually called +package.xml). If a second packagefile is passed in, then +the packager will check to make sure that one is a package.xml +version 1.0, and the other is a package.xml version 2.0. The +package.xml version 1.0 will be saved as "package.xml" in the archive, +and the other as "package2.xml" in the archive" +</doc> + </package> + <package-validate> + <summary>Validate Package Consistency</summary> + <function>doPackageValidate</function> + <shortcut>pv</shortcut> + <options /> + <doc> +</doc> + </package-validate> + <cvsdiff> + <summary>Run a "cvs diff" for all files in a package</summary> + <function>doCvsDiff</function> + <shortcut>cd</shortcut> + <options> + <quiet> + <shortopt>q</shortopt> + <doc>Be quiet</doc> + </quiet> + <reallyquiet> + <shortopt>Q</shortopt> + <doc>Be really quiet</doc> + </reallyquiet> + <date> + <shortopt>D</shortopt> + <doc>Diff against revision of DATE</doc> + <arg>DATE</arg> + </date> + <release> + <shortopt>R</shortopt> + <doc>Diff against tag for package release REL</doc> + <arg>REL</arg> + </release> + <revision> + <shortopt>r</shortopt> + <doc>Diff against revision REV</doc> + <arg>REV</arg> + </revision> + <context> + <shortopt>c</shortopt> + <doc>Generate context diff</doc> + </context> + <unified> + <shortopt>u</shortopt> + <doc>Generate unified diff</doc> + </unified> + <ignore-case> + <shortopt>i</shortopt> + <doc>Ignore case, consider upper- and lower-case letters equivalent</doc> + </ignore-case> + <ignore-whitespace> + <shortopt>b</shortopt> + <doc>Ignore changes in amount of white space</doc> + </ignore-whitespace> + <ignore-blank-lines> + <shortopt>B</shortopt> + <doc>Ignore changes that insert or delete blank lines</doc> + </ignore-blank-lines> + <brief> + <shortopt></shortopt> + <doc>Report only whether the files differ, no details</doc> + </brief> + <dry-run> + <shortopt>n</shortopt> + <doc>Don't do anything, just pretend</doc> + </dry-run> + </options> + <doc><package.xml> +Compares all the files in a package. Without any options, this +command will compare the current code with the last checked-in code. +Using the -r or -R option you may compare the current code with that +of a specific release. +</doc> + </cvsdiff> + <svntag> + <summary>Set SVN Release Tag</summary> + <function>doSvnTag</function> + <shortcut>sv</shortcut> + <options> + <quiet> + <shortopt>q</shortopt> + <doc>Be quiet</doc> + </quiet> + <slide> + <shortopt>F</shortopt> + <doc>Move (slide) tag if it exists</doc> + </slide> + <delete> + <shortopt>d</shortopt> + <doc>Remove tag</doc> + </delete> + <dry-run> + <shortopt>n</shortopt> + <doc>Don't do anything, just pretend</doc> + </dry-run> + </options> + <doc><package.xml> [files...] + Sets a SVN tag on all files in a package. Use this command after you have + packaged a distribution tarball with the "package" command to tag what + revisions of what files were in that release. If need to fix something + after running svntag once, but before the tarball is released to the public, + use the "slide" option to move the release tag. + + to include files (such as a second package.xml, or tests not included in the + release), pass them as additional parameters. + </doc> + </svntag> + <cvstag> + <summary>Set CVS Release Tag</summary> + <function>doCvsTag</function> + <shortcut>ct</shortcut> + <options> + <quiet> + <shortopt>q</shortopt> + <doc>Be quiet</doc> + </quiet> + <reallyquiet> + <shortopt>Q</shortopt> + <doc>Be really quiet</doc> + </reallyquiet> + <slide> + <shortopt>F</shortopt> + <doc>Move (slide) tag if it exists</doc> + </slide> + <delete> + <shortopt>d</shortopt> + <doc>Remove tag</doc> + </delete> + <dry-run> + <shortopt>n</shortopt> + <doc>Don't do anything, just pretend</doc> + </dry-run> + </options> + <doc><package.xml> [files...] +Sets a CVS tag on all files in a package. Use this command after you have +packaged a distribution tarball with the "package" command to tag what +revisions of what files were in that release. If need to fix something +after running cvstag once, but before the tarball is released to the public, +use the "slide" option to move the release tag. + +to include files (such as a second package.xml, or tests not included in the +release), pass them as additional parameters. +</doc> + </cvstag> + <package-dependencies> + <summary>Show package dependencies</summary> + <function>doPackageDependencies</function> + <shortcut>pd</shortcut> + <options /> + <doc><package-file> or <package.xml> or <install-package-name> +List all dependencies the package has. +Can take a tgz / tar file, package.xml or a package name of an installed package.</doc> + </package-dependencies> + <sign> + <summary>Sign a package distribution file</summary> + <function>doSign</function> + <shortcut>si</shortcut> + <options> + <verbose> + <shortopt>v</shortopt> + <doc>Display GnuPG output</doc> + </verbose> + </options> + <doc><package-file> +Signs a package distribution (.tar or .tgz) file with GnuPG.</doc> + </sign> + <makerpm> + <summary>Builds an RPM spec file from a PEAR package</summary> + <function>doMakeRPM</function> + <shortcut>rpm</shortcut> + <options> + <spec-template> + <shortopt>t</shortopt> + <doc>Use FILE as RPM spec file template</doc> + <arg>FILE</arg> + </spec-template> + <rpm-pkgname> + <shortopt>p</shortopt> + <doc>Use FORMAT as format string for RPM package name, %s is replaced +by the PEAR package name, defaults to "PEAR::%s".</doc> + <arg>FORMAT</arg> + </rpm-pkgname> + </options> + <doc><package-file> + +Creates an RPM .spec file for wrapping a PEAR package inside an RPM +package. Intended to be used from the SPECS directory, with the PEAR +package tarball in the SOURCES directory: + +$ pear makerpm ../SOURCES/Net_Socket-1.0.tgz +Wrote RPM spec file PEAR::Net_Geo-1.0.spec +$ rpm -bb PEAR::Net_Socket-1.0.spec +... +Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm +</doc> + </makerpm> + <convert> + <summary>Convert a package.xml 1.0 to package.xml 2.0 format</summary> + <function>doConvert</function> + <shortcut>c2</shortcut> + <options> + <flat> + <shortopt>f</shortopt> + <doc>do not beautify the filelist.</doc> + </flat> + </options> + <doc>[descfile] [descfile2] +Converts a package.xml in 1.0 format into a package.xml +in 2.0 format. The new file will be named package2.xml by default, +and package.xml will be used as the old file by default. +This is not the most intelligent conversion, and should only be +used for automated conversion or learning the format. +</doc> + </convert> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Pickle.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Pickle.php new file mode 100644 index 0000000000000000000000000000000000000000..87aa25ea30c5f2f4d08c6204974a65882787b7b3 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Pickle.php @@ -0,0 +1,421 @@ +<?php +/** + * PEAR_Command_Pickle (pickle command) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 2005-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Pickle.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +/** + * PEAR commands for login/logout + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 2005-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.1 + */ + +class PEAR_Command_Pickle extends PEAR_Command_Common +{ + var $commands = array( + 'pickle' => array( + 'summary' => 'Build PECL Package', + 'function' => 'doPackage', + 'shortcut' => 'pi', + 'options' => array( + 'nocompress' => array( + 'shortopt' => 'Z', + 'doc' => 'Do not gzip the package file' + ), + 'showname' => array( + 'shortopt' => 'n', + 'doc' => 'Print the name of the packaged file.', + ), + ), + 'doc' => '[descfile] +Creates a PECL package from its package2.xml file. + +An automatic conversion will be made to a package.xml 1.0 and written out to +disk in the current directory as "package.xml". Note that +only simple package.xml 2.0 will be converted. package.xml 2.0 with: + + - dependency types other than required/optional PECL package/ext/php/pearinstaller + - more than one extsrcrelease or zendextsrcrelease + - zendextbinrelease, extbinrelease, phprelease, or bundle release type + - dependency groups + - ignore tags in release filelist + - tasks other than replace + - custom roles + +will cause pickle to fail, and output an error message. If your package2.xml +uses any of these features, you are best off using PEAR_PackageFileManager to +generate both package.xml. +' + ), + ); + + /** + * PEAR_Command_Package constructor. + * + * @access public + */ + function PEAR_Command_Pickle(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + /** + * For unit-testing ease + * + * @return PEAR_Packager + */ + function &getPackager() + { + if (!class_exists('PEAR_Packager')) { + require_once 'PEAR/Packager.php'; + } + + $a = &new PEAR_Packager; + return $a; + } + + /** + * For unit-testing ease + * + * @param PEAR_Config $config + * @param bool $debug + * @param string|null $tmpdir + * @return PEAR_PackageFile + */ + function &getPackageFile($config, $debug = false) + { + if (!class_exists('PEAR_Common')) { + require_once 'PEAR/Common.php'; + } + + if (!class_exists('PEAR_PackageFile')) { + require_once 'PEAR/PackageFile.php'; + } + + $a = &new PEAR_PackageFile($config, $debug); + $common = new PEAR_Common; + $common->ui = $this->ui; + $a->setLogger($common); + return $a; + } + + function doPackage($command, $options, $params) + { + $this->output = ''; + $pkginfofile = isset($params[0]) ? $params[0] : 'package2.xml'; + $packager = &$this->getPackager(); + if (PEAR::isError($err = $this->_convertPackage($pkginfofile))) { + return $err; + } + + $compress = empty($options['nocompress']) ? true : false; + $result = $packager->package($pkginfofile, $compress, 'package.xml'); + if (PEAR::isError($result)) { + return $this->raiseError($result); + } + + // Don't want output, only the package file name just created + if (isset($options['showname'])) { + $this->ui->outputData($result, $command); + } + + return true; + } + + function _convertPackage($packagexml) + { + $pkg = &$this->getPackageFile($this->config); + $pf2 = &$pkg->fromPackageFile($packagexml, PEAR_VALIDATE_NORMAL); + if (!is_a($pf2, 'PEAR_PackageFile_v2')) { + return $this->raiseError('Cannot process "' . + $packagexml . '", is not a package.xml 2.0'); + } + + require_once 'PEAR/PackageFile/v1.php'; + $pf = new PEAR_PackageFile_v1; + $pf->setConfig($this->config); + if ($pf2->getPackageType() != 'extsrc' && $pf2->getPackageType() != 'zendextsrc') { + return $this->raiseError('Cannot safely convert "' . $packagexml . + '", is not an extension source package. Using a PEAR_PackageFileManager-based ' . + 'script is an option'); + } + + if (is_array($pf2->getUsesRole())) { + return $this->raiseError('Cannot safely convert "' . $packagexml . + '", contains custom roles. Using a PEAR_PackageFileManager-based script or ' . + 'the convert command is an option'); + } + + if (is_array($pf2->getUsesTask())) { + return $this->raiseError('Cannot safely convert "' . $packagexml . + '", contains custom tasks. Using a PEAR_PackageFileManager-based script or ' . + 'the convert command is an option'); + } + + $deps = $pf2->getDependencies(); + if (isset($deps['group'])) { + return $this->raiseError('Cannot safely convert "' . $packagexml . + '", contains dependency groups. Using a PEAR_PackageFileManager-based script ' . + 'or the convert command is an option'); + } + + if (isset($deps['required']['subpackage']) || + isset($deps['optional']['subpackage'])) { + return $this->raiseError('Cannot safely convert "' . $packagexml . + '", contains subpackage dependencies. Using a PEAR_PackageFileManager-based '. + 'script is an option'); + } + + if (isset($deps['required']['os'])) { + return $this->raiseError('Cannot safely convert "' . $packagexml . + '", contains os dependencies. Using a PEAR_PackageFileManager-based '. + 'script is an option'); + } + + if (isset($deps['required']['arch'])) { + return $this->raiseError('Cannot safely convert "' . $packagexml . + '", contains arch dependencies. Using a PEAR_PackageFileManager-based '. + 'script is an option'); + } + + $pf->setPackage($pf2->getPackage()); + $pf->setSummary($pf2->getSummary()); + $pf->setDescription($pf2->getDescription()); + foreach ($pf2->getMaintainers() as $maintainer) { + $pf->addMaintainer($maintainer['role'], $maintainer['handle'], + $maintainer['name'], $maintainer['email']); + } + + $pf->setVersion($pf2->getVersion()); + $pf->setDate($pf2->getDate()); + $pf->setLicense($pf2->getLicense()); + $pf->setState($pf2->getState()); + $pf->setNotes($pf2->getNotes()); + $pf->addPhpDep($deps['required']['php']['min'], 'ge'); + if (isset($deps['required']['php']['max'])) { + $pf->addPhpDep($deps['required']['php']['max'], 'le'); + } + + if (isset($deps['required']['package'])) { + if (!isset($deps['required']['package'][0])) { + $deps['required']['package'] = array($deps['required']['package']); + } + + foreach ($deps['required']['package'] as $dep) { + if (!isset($dep['channel'])) { + return $this->raiseError('Cannot safely convert "' . $packagexml . '"' . + ' contains uri-based dependency on a package. Using a ' . + 'PEAR_PackageFileManager-based script is an option'); + } + + if ($dep['channel'] != 'pear.php.net' + && $dep['channel'] != 'pecl.php.net' + && $dep['channel'] != 'doc.php.net') { + return $this->raiseError('Cannot safely convert "' . $packagexml . '"' . + ' contains dependency on a non-standard channel package. Using a ' . + 'PEAR_PackageFileManager-based script is an option'); + } + + if (isset($dep['conflicts'])) { + return $this->raiseError('Cannot safely convert "' . $packagexml . '"' . + ' contains conflicts dependency. Using a ' . + 'PEAR_PackageFileManager-based script is an option'); + } + + if (isset($dep['exclude'])) { + $this->ui->outputData('WARNING: exclude tags are ignored in conversion'); + } + + if (isset($dep['min'])) { + $pf->addPackageDep($dep['name'], $dep['min'], 'ge'); + } + + if (isset($dep['max'])) { + $pf->addPackageDep($dep['name'], $dep['max'], 'le'); + } + } + } + + if (isset($deps['required']['extension'])) { + if (!isset($deps['required']['extension'][0])) { + $deps['required']['extension'] = array($deps['required']['extension']); + } + + foreach ($deps['required']['extension'] as $dep) { + if (isset($dep['conflicts'])) { + return $this->raiseError('Cannot safely convert "' . $packagexml . '"' . + ' contains conflicts dependency. Using a ' . + 'PEAR_PackageFileManager-based script is an option'); + } + + if (isset($dep['exclude'])) { + $this->ui->outputData('WARNING: exclude tags are ignored in conversion'); + } + + if (isset($dep['min'])) { + $pf->addExtensionDep($dep['name'], $dep['min'], 'ge'); + } + + if (isset($dep['max'])) { + $pf->addExtensionDep($dep['name'], $dep['max'], 'le'); + } + } + } + + if (isset($deps['optional']['package'])) { + if (!isset($deps['optional']['package'][0])) { + $deps['optional']['package'] = array($deps['optional']['package']); + } + + foreach ($deps['optional']['package'] as $dep) { + if (!isset($dep['channel'])) { + return $this->raiseError('Cannot safely convert "' . $packagexml . '"' . + ' contains uri-based dependency on a package. Using a ' . + 'PEAR_PackageFileManager-based script is an option'); + } + + if ($dep['channel'] != 'pear.php.net' + && $dep['channel'] != 'pecl.php.net' + && $dep['channel'] != 'doc.php.net') { + return $this->raiseError('Cannot safely convert "' . $packagexml . '"' . + ' contains dependency on a non-standard channel package. Using a ' . + 'PEAR_PackageFileManager-based script is an option'); + } + + if (isset($dep['exclude'])) { + $this->ui->outputData('WARNING: exclude tags are ignored in conversion'); + } + + if (isset($dep['min'])) { + $pf->addPackageDep($dep['name'], $dep['min'], 'ge', 'yes'); + } + + if (isset($dep['max'])) { + $pf->addPackageDep($dep['name'], $dep['max'], 'le', 'yes'); + } + } + } + + if (isset($deps['optional']['extension'])) { + if (!isset($deps['optional']['extension'][0])) { + $deps['optional']['extension'] = array($deps['optional']['extension']); + } + + foreach ($deps['optional']['extension'] as $dep) { + if (isset($dep['exclude'])) { + $this->ui->outputData('WARNING: exclude tags are ignored in conversion'); + } + + if (isset($dep['min'])) { + $pf->addExtensionDep($dep['name'], $dep['min'], 'ge', 'yes'); + } + + if (isset($dep['max'])) { + $pf->addExtensionDep($dep['name'], $dep['max'], 'le', 'yes'); + } + } + } + + $contents = $pf2->getContents(); + $release = $pf2->getReleases(); + if (isset($releases[0])) { + return $this->raiseError('Cannot safely process "' . $packagexml . '" contains ' + . 'multiple extsrcrelease/zendextsrcrelease tags. Using a PEAR_PackageFileManager-based script ' . + 'or the convert command is an option'); + } + + if ($configoptions = $pf2->getConfigureOptions()) { + foreach ($configoptions as $option) { + $default = isset($option['default']) ? $option['default'] : false; + $pf->addConfigureOption($option['name'], $option['prompt'], $default); + } + } + + if (isset($release['filelist']['ignore'])) { + return $this->raiseError('Cannot safely process "' . $packagexml . '" contains ' + . 'ignore tags. Using a PEAR_PackageFileManager-based script or the convert' . + ' command is an option'); + } + + if (isset($release['filelist']['install']) && + !isset($release['filelist']['install'][0])) { + $release['filelist']['install'] = array($release['filelist']['install']); + } + + if (isset($contents['dir']['attribs']['baseinstalldir'])) { + $baseinstalldir = $contents['dir']['attribs']['baseinstalldir']; + } else { + $baseinstalldir = false; + } + + if (!isset($contents['dir']['file'][0])) { + $contents['dir']['file'] = array($contents['dir']['file']); + } + + foreach ($contents['dir']['file'] as $file) { + if ($baseinstalldir && !isset($file['attribs']['baseinstalldir'])) { + $file['attribs']['baseinstalldir'] = $baseinstalldir; + } + + $processFile = $file; + unset($processFile['attribs']); + if (count($processFile)) { + foreach ($processFile as $name => $task) { + if ($name != $pf2->getTasksNs() . ':replace') { + return $this->raiseError('Cannot safely process "' . $packagexml . + '" contains tasks other than replace. Using a ' . + 'PEAR_PackageFileManager-based script is an option.'); + } + $file['attribs']['replace'][] = $task; + } + } + + if (!in_array($file['attribs']['role'], PEAR_Common::getFileRoles())) { + return $this->raiseError('Cannot safely convert "' . $packagexml . + '", contains custom roles. Using a PEAR_PackageFileManager-based script ' . + 'or the convert command is an option'); + } + + if (isset($release['filelist']['install'])) { + foreach ($release['filelist']['install'] as $installas) { + if ($installas['attribs']['name'] == $file['attribs']['name']) { + $file['attribs']['install-as'] = $installas['attribs']['as']; + } + } + } + + $pf->addFile('/', $file['attribs']['name'], $file['attribs']); + } + + if ($pf2->getChangeLog()) { + $this->ui->outputData('WARNING: changelog is not translated to package.xml ' . + '1.0, use PEAR_PackageFileManager-based script if you need changelog-' . + 'translation for package.xml 1.0'); + } + + $gen = &$pf->getDefaultGenerator(); + $gen->toPackageFile('.'); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Pickle.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Pickle.xml new file mode 100644 index 0000000000000000000000000000000000000000..721ecea995eba916c775717cfd2c9b9b2fe24b84 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Pickle.xml @@ -0,0 +1,36 @@ +<commands version="1.0"> + <pickle> + <summary>Build PECL Package</summary> + <function>doPackage</function> + <shortcut>pi</shortcut> + <options> + <nocompress> + <shortopt>Z</shortopt> + <doc>Do not gzip the package file</doc> + </nocompress> + <showname> + <shortopt>n</shortopt> + <doc>Print the name of the packaged file.</doc> + </showname> + </options> + <doc>[descfile] +Creates a PECL package from its package2.xml file. + +An automatic conversion will be made to a package.xml 1.0 and written out to +disk in the current directory as "package.xml". Note that +only simple package.xml 2.0 will be converted. package.xml 2.0 with: + + - dependency types other than required/optional PECL package/ext/php/pearinstaller + - more than one extsrcrelease or zendextsrcrelease + - zendextbinrelease, extbinrelease, phprelease, or bundle release type + - dependency groups + - ignore tags in release filelist + - tasks other than replace + - custom roles + +will cause pickle to fail, and output an error message. If your package2.xml +uses any of these features, you are best off using PEAR_PackageFileManager to +generate both package.xml. +</doc> + </pickle> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Registry.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Registry.php new file mode 100644 index 0000000000000000000000000000000000000000..4304db5ddf578f7c420ccb188fa1bbf2e377ef2c --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Registry.php @@ -0,0 +1,1145 @@ +<?php +/** + * PEAR_Command_Registry (list, list-files, shell-test, info commands) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Registry.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +/** + * PEAR commands for registry manipulation + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Command_Registry extends PEAR_Command_Common +{ + var $commands = array( + 'list' => array( + 'summary' => 'List Installed Packages In The Default Channel', + 'function' => 'doList', + 'shortcut' => 'l', + 'options' => array( + 'channel' => array( + 'shortopt' => 'c', + 'doc' => 'list installed packages from this channel', + 'arg' => 'CHAN', + ), + 'allchannels' => array( + 'shortopt' => 'a', + 'doc' => 'list installed packages from all channels', + ), + 'channelinfo' => array( + 'shortopt' => 'i', + 'doc' => 'output fully channel-aware data, even on failure', + ), + ), + 'doc' => '<package> +If invoked without parameters, this command lists the PEAR packages +installed in your php_dir ({config php_dir}). With a parameter, it +lists the files in a package. +', + ), + 'list-files' => array( + 'summary' => 'List Files In Installed Package', + 'function' => 'doFileList', + 'shortcut' => 'fl', + 'options' => array(), + 'doc' => '<package> +List the files in an installed package. +' + ), + 'shell-test' => array( + 'summary' => 'Shell Script Test', + 'function' => 'doShellTest', + 'shortcut' => 'st', + 'options' => array(), + 'doc' => '<package> [[relation] version] +Tests if a package is installed in the system. Will exit(1) if it is not. + <relation> The version comparison operator. One of: + <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne + <version> The version to compare with +'), + 'info' => array( + 'summary' => 'Display information about a package', + 'function' => 'doInfo', + 'shortcut' => 'in', + 'options' => array(), + 'doc' => '<package> +Displays information about a package. The package argument may be a +local package file, an URL to a package file, or the name of an +installed package.' + ) + ); + + /** + * PEAR_Command_Registry constructor. + * + * @access public + */ + function PEAR_Command_Registry(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + function _sortinfo($a, $b) + { + $apackage = isset($a['package']) ? $a['package'] : $a['name']; + $bpackage = isset($b['package']) ? $b['package'] : $b['name']; + return strcmp($apackage, $bpackage); + } + + function doList($command, $options, $params) + { + $reg = &$this->config->getRegistry(); + $channelinfo = isset($options['channelinfo']); + if (isset($options['allchannels']) && !$channelinfo) { + return $this->doListAll($command, array(), $params); + } + + if (isset($options['allchannels']) && $channelinfo) { + // allchannels with $channelinfo + unset($options['allchannels']); + $channels = $reg->getChannels(); + $errors = array(); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + foreach ($channels as $channel) { + $options['channel'] = $channel->getName(); + $ret = $this->doList($command, $options, $params); + + if (PEAR::isError($ret)) { + $errors[] = $ret; + } + } + + PEAR::staticPopErrorHandling(); + if (count($errors)) { + // for now, only give first error + return PEAR::raiseError($errors[0]); + } + + return true; + } + + if (count($params) === 1) { + return $this->doFileList($command, $options, $params); + } + + if (isset($options['channel'])) { + if (!$reg->channelExists($options['channel'])) { + return $this->raiseError('Channel "' . $options['channel'] .'" does not exist'); + } + + $channel = $reg->channelName($options['channel']); + } else { + $channel = $this->config->get('default_channel'); + } + + $installed = $reg->packageInfo(null, null, $channel); + usort($installed, array(&$this, '_sortinfo')); + + $data = array( + 'caption' => 'Installed packages, channel ' . + $channel . ':', + 'border' => true, + 'headline' => array('Package', 'Version', 'State'), + 'channel' => $channel, + ); + if ($channelinfo) { + $data['headline'] = array('Channel', 'Package', 'Version', 'State'); + } + + if (count($installed) && !isset($data['data'])) { + $data['data'] = array(); + } + + foreach ($installed as $package) { + $pobj = $reg->getPackage(isset($package['package']) ? + $package['package'] : $package['name'], $channel); + if ($channelinfo) { + $packageinfo = array($pobj->getChannel(), $pobj->getPackage(), $pobj->getVersion(), + $pobj->getState() ? $pobj->getState() : null); + } else { + $packageinfo = array($pobj->getPackage(), $pobj->getVersion(), + $pobj->getState() ? $pobj->getState() : null); + } + $data['data'][] = $packageinfo; + } + + if (count($installed) === 0) { + if (!$channelinfo) { + $data = '(no packages installed from channel ' . $channel . ')'; + } else { + $data = array( + 'caption' => 'Installed packages, channel ' . + $channel . ':', + 'border' => true, + 'channel' => $channel, + 'data' => array(array('(no packages installed)')), + ); + } + } + + $this->ui->outputData($data, $command); + return true; + } + + function doListAll($command, $options, $params) + { + // This duplicate code is deprecated over + // list --channelinfo, which gives identical + // output for list and list --allchannels. + $reg = &$this->config->getRegistry(); + $installed = $reg->packageInfo(null, null, null); + foreach ($installed as $channel => $packages) { + usort($packages, array($this, '_sortinfo')); + $data = array( + 'caption' => 'Installed packages, channel ' . $channel . ':', + 'border' => true, + 'headline' => array('Package', 'Version', 'State'), + 'channel' => $channel + ); + + foreach ($packages as $package) { + $p = isset($package['package']) ? $package['package'] : $package['name']; + $pobj = $reg->getPackage($p, $channel); + $data['data'][] = array($pobj->getPackage(), $pobj->getVersion(), + $pobj->getState() ? $pobj->getState() : null); + } + + // Adds a blank line after each section + $data['data'][] = array(); + + if (count($packages) === 0) { + $data = array( + 'caption' => 'Installed packages, channel ' . $channel . ':', + 'border' => true, + 'data' => array(array('(no packages installed)'), array()), + 'channel' => $channel + ); + } + $this->ui->outputData($data, $command); + } + return true; + } + + function doFileList($command, $options, $params) + { + if (count($params) !== 1) { + return $this->raiseError('list-files expects 1 parameter'); + } + + $reg = &$this->config->getRegistry(); + $fp = false; + if (!is_dir($params[0]) && (file_exists($params[0]) || $fp = @fopen($params[0], 'r'))) { + if ($fp) { + fclose($fp); + } + + if (!class_exists('PEAR_PackageFile')) { + require_once 'PEAR/PackageFile.php'; + } + + $pkg = &new PEAR_PackageFile($this->config, $this->_debug); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $info = &$pkg->fromAnyFile($params[0], PEAR_VALIDATE_NORMAL); + PEAR::staticPopErrorHandling(); + $headings = array('Package File', 'Install Path'); + $installed = false; + } else { + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $parsed = $reg->parsePackageName($params[0], $this->config->get('default_channel')); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($parsed)) { + return $this->raiseError($parsed); + } + + $info = &$reg->getPackage($parsed['package'], $parsed['channel']); + $headings = array('Type', 'Install Path'); + $installed = true; + } + + if (PEAR::isError($info)) { + return $this->raiseError($info); + } + + if ($info === null) { + return $this->raiseError("`$params[0]' not installed"); + } + + $list = ($info->getPackagexmlVersion() == '1.0' || $installed) ? + $info->getFilelist() : $info->getContents(); + if ($installed) { + $caption = 'Installed Files For ' . $params[0]; + } else { + $caption = 'Contents of ' . basename($params[0]); + } + + $data = array( + 'caption' => $caption, + 'border' => true, + 'headline' => $headings); + if ($info->getPackagexmlVersion() == '1.0' || $installed) { + foreach ($list as $file => $att) { + if ($installed) { + if (empty($att['installed_as'])) { + continue; + } + $data['data'][] = array($att['role'], $att['installed_as']); + } else { + if (isset($att['baseinstalldir']) && !in_array($att['role'], + array('test', 'data', 'doc'))) { + $dest = $att['baseinstalldir'] . DIRECTORY_SEPARATOR . + $file; + } else { + $dest = $file; + } + switch ($att['role']) { + case 'test': + case 'data': + case 'doc': + $role = $att['role']; + if ($role == 'test') { + $role .= 's'; + } + $dest = $this->config->get($role . '_dir') . DIRECTORY_SEPARATOR . + $info->getPackage() . DIRECTORY_SEPARATOR . $dest; + break; + case 'php': + default: + $dest = $this->config->get('php_dir') . DIRECTORY_SEPARATOR . + $dest; + } + $ds2 = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; + $dest = preg_replace(array('!\\\\+!', '!/!', "!$ds2+!"), + array(DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR), + $dest); + $file = preg_replace('!/+!', '/', $file); + $data['data'][] = array($file, $dest); + } + } + } else { // package.xml 2.0, not installed + if (!isset($list['dir']['file'][0])) { + $list['dir']['file'] = array($list['dir']['file']); + } + + foreach ($list['dir']['file'] as $att) { + $att = $att['attribs']; + $file = $att['name']; + $role = &PEAR_Installer_Role::factory($info, $att['role'], $this->config); + $role->setup($this, $info, $att, $file); + if (!$role->isInstallable()) { + $dest = '(not installable)'; + } else { + $dest = $role->processInstallation($info, $att, $file, ''); + if (PEAR::isError($dest)) { + $dest = '(Unknown role "' . $att['role'] . ')'; + } else { + list(,, $dest) = $dest; + } + } + $data['data'][] = array($file, $dest); + } + } + + $this->ui->outputData($data, $command); + return true; + } + + function doShellTest($command, $options, $params) + { + if (count($params) < 1) { + return PEAR::raiseError('ERROR, usage: pear shell-test packagename [[relation] version]'); + } + + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $reg = &$this->config->getRegistry(); + $info = $reg->parsePackageName($params[0], $this->config->get('default_channel')); + if (PEAR::isError($info)) { + exit(1); // invalid package name + } + + $package = $info['package']; + $channel = $info['channel']; + // "pear shell-test Foo" + if (!$reg->packageExists($package, $channel)) { + if ($channel == 'pecl.php.net') { + if ($reg->packageExists($package, 'pear.php.net')) { + $channel = 'pear.php.net'; // magically change channels for extensions + } + } + } + + if (count($params) === 1) { + if (!$reg->packageExists($package, $channel)) { + exit(1); + } + // "pear shell-test Foo 1.0" + } elseif (count($params) === 2) { + $v = $reg->packageInfo($package, 'version', $channel); + if (!$v || !version_compare("$v", "{$params[1]}", "ge")) { + exit(1); + } + // "pear shell-test Foo ge 1.0" + } elseif (count($params) === 3) { + $v = $reg->packageInfo($package, 'version', $channel); + if (!$v || !version_compare("$v", "{$params[2]}", $params[1])) { + exit(1); + } + } else { + PEAR::staticPopErrorHandling(); + $this->raiseError("$command: expects 1 to 3 parameters"); + exit(1); + } + } + + function doInfo($command, $options, $params) + { + if (count($params) !== 1) { + return $this->raiseError('pear info expects 1 parameter'); + } + + $info = $fp = false; + $reg = &$this->config->getRegistry(); + if (is_file($params[0]) && !is_dir($params[0]) && + (file_exists($params[0]) || $fp = @fopen($params[0], 'r')) + ) { + if ($fp) { + fclose($fp); + } + + if (!class_exists('PEAR_PackageFile')) { + require_once 'PEAR/PackageFile.php'; + } + + $pkg = &new PEAR_PackageFile($this->config, $this->_debug); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $obj = &$pkg->fromAnyFile($params[0], PEAR_VALIDATE_NORMAL); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($obj)) { + $uinfo = $obj->getUserInfo(); + if (is_array($uinfo)) { + foreach ($uinfo as $message) { + if (is_array($message)) { + $message = $message['message']; + } + $this->ui->outputData($message); + } + } + + return $this->raiseError($obj); + } + + if ($obj->getPackagexmlVersion() != '1.0') { + return $this->_doInfo2($command, $options, $params, $obj, false); + } + + $info = $obj->toArray(); + } else { + $parsed = $reg->parsePackageName($params[0], $this->config->get('default_channel')); + if (PEAR::isError($parsed)) { + return $this->raiseError($parsed); + } + + $package = $parsed['package']; + $channel = $parsed['channel']; + $info = $reg->packageInfo($package, null, $channel); + if (isset($info['old'])) { + $obj = $reg->getPackage($package, $channel); + return $this->_doInfo2($command, $options, $params, $obj, true); + } + } + + if (PEAR::isError($info)) { + return $info; + } + + if (empty($info)) { + $this->raiseError("No information found for `$params[0]'"); + return; + } + + unset($info['filelist']); + unset($info['dirtree']); + unset($info['changelog']); + if (isset($info['xsdversion'])) { + $info['package.xml version'] = $info['xsdversion']; + unset($info['xsdversion']); + } + + if (isset($info['packagerversion'])) { + $info['packaged with PEAR version'] = $info['packagerversion']; + unset($info['packagerversion']); + } + + $keys = array_keys($info); + $longtext = array('description', 'summary'); + foreach ($keys as $key) { + if (is_array($info[$key])) { + switch ($key) { + case 'maintainers': { + $i = 0; + $mstr = ''; + foreach ($info[$key] as $m) { + if ($i++ > 0) { + $mstr .= "\n"; + } + $mstr .= $m['name'] . " <"; + if (isset($m['email'])) { + $mstr .= $m['email']; + } else { + $mstr .= $m['handle'] . '@php.net'; + } + $mstr .= "> ($m[role])"; + } + $info[$key] = $mstr; + break; + } + case 'release_deps': { + $i = 0; + $dstr = ''; + foreach ($info[$key] as $d) { + if (isset($this->_deps_rel_trans[$d['rel']])) { + $rel = $this->_deps_rel_trans[$d['rel']]; + } else { + $rel = $d['rel']; + } + if (isset($this->_deps_type_trans[$d['type']])) { + $type = ucfirst($this->_deps_type_trans[$d['type']]); + } else { + $type = $d['type']; + } + if (isset($d['name'])) { + $name = $d['name'] . ' '; + } else { + $name = ''; + } + if (isset($d['version'])) { + $version = $d['version'] . ' '; + } else { + $version = ''; + } + if (isset($d['optional']) && $d['optional'] == 'yes') { + $optional = ' (optional)'; + } else { + $optional = ''; + } + $dstr .= "$type $name$rel $version$optional\n"; + } + $info[$key] = $dstr; + break; + } + case 'provides' : { + $debug = $this->config->get('verbose'); + if ($debug < 2) { + $pstr = 'Classes: '; + } else { + $pstr = ''; + } + $i = 0; + foreach ($info[$key] as $p) { + if ($debug < 2 && $p['type'] != "class") { + continue; + } + // Only print classes when verbosity mode is < 2 + if ($debug < 2) { + if ($i++ > 0) { + $pstr .= ", "; + } + $pstr .= $p['name']; + } else { + if ($i++ > 0) { + $pstr .= "\n"; + } + $pstr .= ucfirst($p['type']) . " " . $p['name']; + if (isset($p['explicit']) && $p['explicit'] == 1) { + $pstr .= " (explicit)"; + } + } + } + $info[$key] = $pstr; + break; + } + case 'configure_options' : { + foreach ($info[$key] as $i => $p) { + $info[$key][$i] = array_map(null, array_keys($p), array_values($p)); + $info[$key][$i] = array_map(create_function('$a', + 'return join(" = ",$a);'), $info[$key][$i]); + $info[$key][$i] = implode(', ', $info[$key][$i]); + } + $info[$key] = implode("\n", $info[$key]); + break; + } + default: { + $info[$key] = implode(", ", $info[$key]); + break; + } + } + } + + if ($key == '_lastmodified') { + $hdate = date('Y-m-d', $info[$key]); + unset($info[$key]); + $info['Last Modified'] = $hdate; + } elseif ($key == '_lastversion') { + $info['Previous Installed Version'] = $info[$key] ? $info[$key] : '- None -'; + unset($info[$key]); + } else { + $info[$key] = trim($info[$key]); + if (in_array($key, $longtext)) { + $info[$key] = preg_replace('/ +/', ' ', $info[$key]); + } + } + } + + $caption = 'About ' . $info['package'] . '-' . $info['version']; + $data = array( + 'caption' => $caption, + 'border' => true); + foreach ($info as $key => $value) { + $key = ucwords(trim(str_replace('_', ' ', $key))); + $data['data'][] = array($key, $value); + } + $data['raw'] = $info; + + $this->ui->outputData($data, 'package-info'); + } + + /** + * @access private + */ + function _doInfo2($command, $options, $params, &$obj, $installed) + { + $reg = &$this->config->getRegistry(); + $caption = 'About ' . $obj->getChannel() . '/' .$obj->getPackage() . '-' . + $obj->getVersion(); + $data = array( + 'caption' => $caption, + 'border' => true); + switch ($obj->getPackageType()) { + case 'php' : + $release = 'PEAR-style PHP-based Package'; + break; + case 'extsrc' : + $release = 'PECL-style PHP extension (source code)'; + break; + case 'zendextsrc' : + $release = 'PECL-style Zend extension (source code)'; + break; + case 'extbin' : + $release = 'PECL-style PHP extension (binary)'; + break; + case 'zendextbin' : + $release = 'PECL-style Zend extension (binary)'; + break; + case 'bundle' : + $release = 'Package bundle (collection of packages)'; + break; + } + $extends = $obj->getExtends(); + $extends = $extends ? + $obj->getPackage() . ' (extends ' . $extends . ')' : $obj->getPackage(); + if ($src = $obj->getSourcePackage()) { + $extends .= ' (source package ' . $src['channel'] . '/' . $src['package'] . ')'; + } + + $info = array( + 'Release Type' => $release, + 'Name' => $extends, + 'Channel' => $obj->getChannel(), + 'Summary' => preg_replace('/ +/', ' ', $obj->getSummary()), + 'Description' => preg_replace('/ +/', ' ', $obj->getDescription()), + ); + $info['Maintainers'] = ''; + foreach (array('lead', 'developer', 'contributor', 'helper') as $role) { + $leads = $obj->{"get{$role}s"}(); + if (!$leads) { + continue; + } + + if (isset($leads['active'])) { + $leads = array($leads); + } + + foreach ($leads as $lead) { + if (!empty($info['Maintainers'])) { + $info['Maintainers'] .= "\n"; + } + + $active = $lead['active'] == 'no' ? ', inactive' : ''; + $info['Maintainers'] .= $lead['name'] . ' <'; + $info['Maintainers'] .= $lead['email'] . "> ($role$active)"; + } + } + + $info['Release Date'] = $obj->getDate(); + if ($time = $obj->getTime()) { + $info['Release Date'] .= ' ' . $time; + } + + $info['Release Version'] = $obj->getVersion() . ' (' . $obj->getState() . ')'; + $info['API Version'] = $obj->getVersion('api') . ' (' . $obj->getState('api') . ')'; + $info['License'] = $obj->getLicense(); + $uri = $obj->getLicenseLocation(); + if ($uri) { + if (isset($uri['uri'])) { + $info['License'] .= ' (' . $uri['uri'] . ')'; + } else { + $extra = $obj->getInstalledLocation($info['filesource']); + if ($extra) { + $info['License'] .= ' (' . $uri['filesource'] . ')'; + } + } + } + + $info['Release Notes'] = $obj->getNotes(); + if ($compat = $obj->getCompatible()) { + if (!isset($compat[0])) { + $compat = array($compat); + } + + $info['Compatible with'] = ''; + foreach ($compat as $package) { + $info['Compatible with'] .= $package['channel'] . '/' . $package['name'] . + "\nVersions >= " . $package['min'] . ', <= ' . $package['max']; + if (isset($package['exclude'])) { + if (is_array($package['exclude'])) { + $package['exclude'] = implode(', ', $package['exclude']); + } + + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + $info['Not Compatible with'] .= $package['channel'] . '/' . + $package['name'] . "\nVersions " . $package['exclude']; + } + } + } + + $usesrole = $obj->getUsesrole(); + if ($usesrole) { + if (!isset($usesrole[0])) { + $usesrole = array($usesrole); + } + + foreach ($usesrole as $roledata) { + if (isset($info['Uses Custom Roles'])) { + $info['Uses Custom Roles'] .= "\n"; + } else { + $info['Uses Custom Roles'] = ''; + } + + if (isset($roledata['package'])) { + $rolepackage = $reg->parsedPackageNameToString($roledata, true); + } else { + $rolepackage = $roledata['uri']; + } + $info['Uses Custom Roles'] .= $roledata['role'] . ' (' . $rolepackage . ')'; + } + } + + $usestask = $obj->getUsestask(); + if ($usestask) { + if (!isset($usestask[0])) { + $usestask = array($usestask); + } + + foreach ($usestask as $taskdata) { + if (isset($info['Uses Custom Tasks'])) { + $info['Uses Custom Tasks'] .= "\n"; + } else { + $info['Uses Custom Tasks'] = ''; + } + + if (isset($taskdata['package'])) { + $taskpackage = $reg->parsedPackageNameToString($taskdata, true); + } else { + $taskpackage = $taskdata['uri']; + } + $info['Uses Custom Tasks'] .= $taskdata['task'] . ' (' . $taskpackage . ')'; + } + } + + $deps = $obj->getDependencies(); + $info['Required Dependencies'] = 'PHP version ' . $deps['required']['php']['min']; + if (isset($deps['required']['php']['max'])) { + $info['Required Dependencies'] .= '-' . $deps['required']['php']['max'] . "\n"; + } else { + $info['Required Dependencies'] .= "\n"; + } + + if (isset($deps['required']['php']['exclude'])) { + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + + if (is_array($deps['required']['php']['exclude'])) { + $deps['required']['php']['exclude'] = + implode(', ', $deps['required']['php']['exclude']); + } + $info['Not Compatible with'] .= "PHP versions\n " . + $deps['required']['php']['exclude']; + } + + $info['Required Dependencies'] .= 'PEAR installer version'; + if (isset($deps['required']['pearinstaller']['max'])) { + $info['Required Dependencies'] .= 's ' . + $deps['required']['pearinstaller']['min'] . '-' . + $deps['required']['pearinstaller']['max']; + } else { + $info['Required Dependencies'] .= ' ' . + $deps['required']['pearinstaller']['min'] . ' or newer'; + } + + if (isset($deps['required']['pearinstaller']['exclude'])) { + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + + if (is_array($deps['required']['pearinstaller']['exclude'])) { + $deps['required']['pearinstaller']['exclude'] = + implode(', ', $deps['required']['pearinstaller']['exclude']); + } + $info['Not Compatible with'] .= "PEAR installer\n Versions " . + $deps['required']['pearinstaller']['exclude']; + } + + foreach (array('Package', 'Extension') as $type) { + $index = strtolower($type); + if (isset($deps['required'][$index])) { + if (isset($deps['required'][$index]['name'])) { + $deps['required'][$index] = array($deps['required'][$index]); + } + + foreach ($deps['required'][$index] as $package) { + if (isset($package['conflicts'])) { + $infoindex = 'Not Compatible with'; + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + } else { + $infoindex = 'Required Dependencies'; + $info[$infoindex] .= "\n"; + } + + if ($index == 'extension') { + $name = $package['name']; + } else { + if (isset($package['channel'])) { + $name = $package['channel'] . '/' . $package['name']; + } else { + $name = '__uri/' . $package['name'] . ' (static URI)'; + } + } + + $info[$infoindex] .= "$type $name"; + if (isset($package['uri'])) { + $info[$infoindex] .= "\n Download URI: $package[uri]"; + continue; + } + + if (isset($package['max']) && isset($package['min'])) { + $info[$infoindex] .= " \n Versions " . + $package['min'] . '-' . $package['max']; + } elseif (isset($package['min'])) { + $info[$infoindex] .= " \n Version " . + $package['min'] . ' or newer'; + } elseif (isset($package['max'])) { + $info[$infoindex] .= " \n Version " . + $package['max'] . ' or older'; + } + + if (isset($package['recommended'])) { + $info[$infoindex] .= "\n Recommended version: $package[recommended]"; + } + + if (isset($package['exclude'])) { + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + + if (is_array($package['exclude'])) { + $package['exclude'] = implode(', ', $package['exclude']); + } + + $package['package'] = $package['name']; // for parsedPackageNameToString + if (isset($package['conflicts'])) { + $info['Not Compatible with'] .= '=> except '; + } + $info['Not Compatible with'] .= 'Package ' . + $reg->parsedPackageNameToString($package, true); + $info['Not Compatible with'] .= "\n Versions " . $package['exclude']; + } + } + } + } + + if (isset($deps['required']['os'])) { + if (isset($deps['required']['os']['name'])) { + $dep['required']['os']['name'] = array($dep['required']['os']['name']); + } + + foreach ($dep['required']['os'] as $os) { + if (isset($os['conflicts']) && $os['conflicts'] == 'yes') { + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + $info['Not Compatible with'] .= "$os[name] Operating System"; + } else { + $info['Required Dependencies'] .= "\n"; + $info['Required Dependencies'] .= "$os[name] Operating System"; + } + } + } + + if (isset($deps['required']['arch'])) { + if (isset($deps['required']['arch']['pattern'])) { + $dep['required']['arch']['pattern'] = array($dep['required']['os']['pattern']); + } + + foreach ($dep['required']['arch'] as $os) { + if (isset($os['conflicts']) && $os['conflicts'] == 'yes') { + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + $info['Not Compatible with'] .= "OS/Arch matching pattern '/$os[pattern]/'"; + } else { + $info['Required Dependencies'] .= "\n"; + $info['Required Dependencies'] .= "OS/Arch matching pattern '/$os[pattern]/'"; + } + } + } + + if (isset($deps['optional'])) { + foreach (array('Package', 'Extension') as $type) { + $index = strtolower($type); + if (isset($deps['optional'][$index])) { + if (isset($deps['optional'][$index]['name'])) { + $deps['optional'][$index] = array($deps['optional'][$index]); + } + + foreach ($deps['optional'][$index] as $package) { + if (isset($package['conflicts']) && $package['conflicts'] == 'yes') { + $infoindex = 'Not Compatible with'; + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + } else { + $infoindex = 'Optional Dependencies'; + if (!isset($info['Optional Dependencies'])) { + $info['Optional Dependencies'] = ''; + } else { + $info['Optional Dependencies'] .= "\n"; + } + } + + if ($index == 'extension') { + $name = $package['name']; + } else { + if (isset($package['channel'])) { + $name = $package['channel'] . '/' . $package['name']; + } else { + $name = '__uri/' . $package['name'] . ' (static URI)'; + } + } + + $info[$infoindex] .= "$type $name"; + if (isset($package['uri'])) { + $info[$infoindex] .= "\n Download URI: $package[uri]"; + continue; + } + + if ($infoindex == 'Not Compatible with') { + // conflicts is only used to say that all versions conflict + continue; + } + + if (isset($package['max']) && isset($package['min'])) { + $info[$infoindex] .= " \n Versions " . + $package['min'] . '-' . $package['max']; + } elseif (isset($package['min'])) { + $info[$infoindex] .= " \n Version " . + $package['min'] . ' or newer'; + } elseif (isset($package['max'])) { + $info[$infoindex] .= " \n Version " . + $package['min'] . ' or older'; + } + + if (isset($package['recommended'])) { + $info[$infoindex] .= "\n Recommended version: $package[recommended]"; + } + + if (isset($package['exclude'])) { + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info['Not Compatible with'] .= "\n"; + } + + if (is_array($package['exclude'])) { + $package['exclude'] = implode(', ', $package['exclude']); + } + + $info['Not Compatible with'] .= "Package $package\n Versions " . + $package['exclude']; + } + } + } + } + } + + if (isset($deps['group'])) { + if (!isset($deps['group'][0])) { + $deps['group'] = array($deps['group']); + } + + foreach ($deps['group'] as $group) { + $info['Dependency Group ' . $group['attribs']['name']] = $group['attribs']['hint']; + $groupindex = $group['attribs']['name'] . ' Contents'; + $info[$groupindex] = ''; + foreach (array('Package', 'Extension') as $type) { + $index = strtolower($type); + if (isset($group[$index])) { + if (isset($group[$index]['name'])) { + $group[$index] = array($group[$index]); + } + + foreach ($group[$index] as $package) { + if (!empty($info[$groupindex])) { + $info[$groupindex] .= "\n"; + } + + if ($index == 'extension') { + $name = $package['name']; + } else { + if (isset($package['channel'])) { + $name = $package['channel'] . '/' . $package['name']; + } else { + $name = '__uri/' . $package['name'] . ' (static URI)'; + } + } + + if (isset($package['uri'])) { + if (isset($package['conflicts']) && $package['conflicts'] == 'yes') { + $info[$groupindex] .= "Not Compatible with $type $name"; + } else { + $info[$groupindex] .= "$type $name"; + } + + $info[$groupindex] .= "\n Download URI: $package[uri]"; + continue; + } + + if (isset($package['conflicts']) && $package['conflicts'] == 'yes') { + $info[$groupindex] .= "Not Compatible with $type $name"; + continue; + } + + $info[$groupindex] .= "$type $name"; + if (isset($package['max']) && isset($package['min'])) { + $info[$groupindex] .= " \n Versions " . + $package['min'] . '-' . $package['max']; + } elseif (isset($package['min'])) { + $info[$groupindex] .= " \n Version " . + $package['min'] . ' or newer'; + } elseif (isset($package['max'])) { + $info[$groupindex] .= " \n Version " . + $package['min'] . ' or older'; + } + + if (isset($package['recommended'])) { + $info[$groupindex] .= "\n Recommended version: $package[recommended]"; + } + + if (isset($package['exclude'])) { + if (!isset($info['Not Compatible with'])) { + $info['Not Compatible with'] = ''; + } else { + $info[$groupindex] .= "Not Compatible with\n"; + } + + if (is_array($package['exclude'])) { + $package['exclude'] = implode(', ', $package['exclude']); + } + $info[$groupindex] .= " Package $package\n Versions " . + $package['exclude']; + } + } + } + } + } + } + + if ($obj->getPackageType() == 'bundle') { + $info['Bundled Packages'] = ''; + foreach ($obj->getBundledPackages() as $package) { + if (!empty($info['Bundled Packages'])) { + $info['Bundled Packages'] .= "\n"; + } + + if (isset($package['uri'])) { + $info['Bundled Packages'] .= '__uri/' . $package['name']; + $info['Bundled Packages'] .= "\n (URI: $package[uri]"; + } else { + $info['Bundled Packages'] .= $package['channel'] . '/' . $package['name']; + } + } + } + + $info['package.xml version'] = '2.0'; + if ($installed) { + if ($obj->getLastModified()) { + $info['Last Modified'] = date('Y-m-d H:i', $obj->getLastModified()); + } + + $v = $obj->getLastInstalledVersion(); + $info['Previous Installed Version'] = $v ? $v : '- None -'; + } + + foreach ($info as $key => $value) { + $data['data'][] = array($key, $value); + } + + $data['raw'] = $obj->getArray(); // no validation needed + $this->ui->outputData($data, 'package-info'); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Registry.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Registry.xml new file mode 100644 index 0000000000000000000000000000000000000000..9f4e2149672f9ed2b0b39947292108ac81444d1b --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Registry.xml @@ -0,0 +1,58 @@ +<commands version="1.0"> + <list> + <summary>List Installed Packages In The Default Channel</summary> + <function>doList</function> + <shortcut>l</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>list installed packages from this channel</doc> + <arg>CHAN</arg> + </channel> + <allchannels> + <shortopt>a</shortopt> + <doc>list installed packages from all channels</doc> + </allchannels> + <channelinfo> + <shortopt>i</shortopt> + <doc>output fully channel-aware data, even on failure</doc> + </channelinfo> + </options> + <doc><package> +If invoked without parameters, this command lists the PEAR packages +installed in your php_dir ({config php_dir}). With a parameter, it +lists the files in a package. +</doc> + </list> + <list-files> + <summary>List Files In Installed Package</summary> + <function>doFileList</function> + <shortcut>fl</shortcut> + <options /> + <doc><package> +List the files in an installed package. +</doc> + </list-files> + <shell-test> + <summary>Shell Script Test</summary> + <function>doShellTest</function> + <shortcut>st</shortcut> + <options /> + <doc><package> [[relation] version] +Tests if a package is installed in the system. Will exit(1) if it is not. + <relation> The version comparison operator. One of: + <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne + <version> The version to compare with +</doc> + </shell-test> + <info> + <summary>Display information about a package</summary> + <function>doInfo</function> + <shortcut>in</shortcut> + <options /> + <doc><package> +Displays information about a package. The package argument may be a +local package file, an URL to a package file, or the name of an +installed package.</doc> + </info> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Remote.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Remote.php new file mode 100644 index 0000000000000000000000000000000000000000..74478d83c7a7394a977a0159d61c653bd343b754 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Remote.php @@ -0,0 +1,810 @@ +<?php +/** + * PEAR_Command_Remote (remote-info, list-upgrades, remote-list, search, list-all, download, + * clear-cache commands) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Remote.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; +require_once 'PEAR/REST.php'; + +/** + * PEAR commands for remote server querying + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Command_Remote extends PEAR_Command_Common +{ + var $commands = array( + 'remote-info' => array( + 'summary' => 'Information About Remote Packages', + 'function' => 'doRemoteInfo', + 'shortcut' => 'ri', + 'options' => array(), + 'doc' => '<package> +Get details on a package from the server.', + ), + 'list-upgrades' => array( + 'summary' => 'List Available Upgrades', + 'function' => 'doListUpgrades', + 'shortcut' => 'lu', + 'options' => array( + 'channelinfo' => array( + 'shortopt' => 'i', + 'doc' => 'output fully channel-aware data, even on failure', + ), + ), + 'doc' => '[preferred_state] +List releases on the server of packages you have installed where +a newer version is available with the same release state (stable etc.) +or the state passed as the second parameter.' + ), + 'remote-list' => array( + 'summary' => 'List Remote Packages', + 'function' => 'doRemoteList', + 'shortcut' => 'rl', + 'options' => array( + 'channel' => + array( + 'shortopt' => 'c', + 'doc' => 'specify a channel other than the default channel', + 'arg' => 'CHAN', + ) + ), + 'doc' => ' +Lists the packages available on the configured server along with the +latest stable release of each package.', + ), + 'search' => array( + 'summary' => 'Search remote package database', + 'function' => 'doSearch', + 'shortcut' => 'sp', + 'options' => array( + 'channel' => + array( + 'shortopt' => 'c', + 'doc' => 'specify a channel other than the default channel', + 'arg' => 'CHAN', + ), + 'allchannels' => array( + 'shortopt' => 'a', + 'doc' => 'search packages from all known channels', + ), + 'channelinfo' => array( + 'shortopt' => 'i', + 'doc' => 'output fully channel-aware data, even on failure', + ), + ), + 'doc' => '[packagename] [packageinfo] +Lists all packages which match the search parameters. The first +parameter is a fragment of a packagename. The default channel +will be used unless explicitly overridden. The second parameter +will be used to match any portion of the summary/description', + ), + 'list-all' => array( + 'summary' => 'List All Packages', + 'function' => 'doListAll', + 'shortcut' => 'la', + 'options' => array( + 'channel' => + array( + 'shortopt' => 'c', + 'doc' => 'specify a channel other than the default channel', + 'arg' => 'CHAN', + ), + 'channelinfo' => array( + 'shortopt' => 'i', + 'doc' => 'output fully channel-aware data, even on failure', + ), + ), + 'doc' => ' +Lists the packages available on the configured server along with the +latest stable release of each package.', + ), + 'download' => array( + 'summary' => 'Download Package', + 'function' => 'doDownload', + 'shortcut' => 'd', + 'options' => array( + 'nocompress' => array( + 'shortopt' => 'Z', + 'doc' => 'download an uncompressed (.tar) file', + ), + ), + 'doc' => '<package>... +Download package tarballs. The files will be named as suggested by the +server, for example if you download the DB package and the latest stable +version of DB is 1.6.5, the downloaded file will be DB-1.6.5.tgz.', + ), + 'clear-cache' => array( + 'summary' => 'Clear Web Services Cache', + 'function' => 'doClearCache', + 'shortcut' => 'cc', + 'options' => array(), + 'doc' => ' +Clear the REST cache. See also the cache_ttl configuration +parameter. +', + ), + ); + + /** + * PEAR_Command_Remote constructor. + * + * @access public + */ + function PEAR_Command_Remote(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + function _checkChannelForStatus($channel, $chan) + { + if (PEAR::isError($chan)) { + $this->raiseError($chan); + } + if (!is_a($chan, 'PEAR_ChannelFile')) { + return $this->raiseError('Internal corruption error: invalid channel "' . + $channel . '"'); + } + $rest = new PEAR_REST($this->config); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $mirror = $this->config->get('preferred_mirror', null, + $channel); + $a = $rest->downloadHttp('http://' . $channel . + '/channel.xml', $chan->lastModified()); + PEAR::staticPopErrorHandling(); + if (!PEAR::isError($a) && $a) { + $this->ui->outputData('WARNING: channel "' . $channel . '" has ' . + 'updated its protocols, use "' . PEAR_RUNTYPE . ' channel-update ' . $channel . + '" to update'); + } + } + + function doRemoteInfo($command, $options, $params) + { + if (sizeof($params) != 1) { + return $this->raiseError("$command expects one param: the remote package name"); + } + $savechannel = $channel = $this->config->get('default_channel'); + $reg = &$this->config->getRegistry(); + $package = $params[0]; + $parsed = $reg->parsePackageName($package, $channel); + if (PEAR::isError($parsed)) { + return $this->raiseError('Invalid package name "' . $package . '"'); + } + + $channel = $parsed['channel']; + $this->config->set('default_channel', $channel); + $chan = $reg->getChannel($channel); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } + + $mirror = $this->config->get('preferred_mirror'); + if ($chan->supportsREST($mirror) && $base = $chan->getBaseURL('REST1.0', $mirror)) { + $rest = &$this->config->getREST('1.0', array()); + $info = $rest->packageInfo($base, $parsed['package'], $channel); + } + + if (!isset($info)) { + return $this->raiseError('No supported protocol was found'); + } + + if (PEAR::isError($info)) { + $this->config->set('default_channel', $savechannel); + return $this->raiseError($info); + } + + if (!isset($info['name'])) { + return $this->raiseError('No remote package "' . $package . '" was found'); + } + + $installed = $reg->packageInfo($info['name'], null, $channel); + $info['installed'] = $installed['version'] ? $installed['version'] : '- no -'; + if (is_array($info['installed'])) { + $info['installed'] = $info['installed']['release']; + } + + $this->ui->outputData($info, $command); + $this->config->set('default_channel', $savechannel); + + return true; + } + + function doRemoteList($command, $options, $params) + { + $savechannel = $channel = $this->config->get('default_channel'); + $reg = &$this->config->getRegistry(); + if (isset($options['channel'])) { + $channel = $options['channel']; + if (!$reg->channelExists($channel)) { + return $this->raiseError('Channel "' . $channel . '" does not exist'); + } + + $this->config->set('default_channel', $channel); + } + + $chan = $reg->getChannel($channel); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } + + $list_options = false; + if ($this->config->get('preferred_state') == 'stable') { + $list_options = true; + } + + $available = array(); + if ($chan->supportsREST($this->config->get('preferred_mirror')) && + $base = $chan->getBaseURL('REST1.1', $this->config->get('preferred_mirror')) + ) { + // use faster list-all if available + $rest = &$this->config->getREST('1.1', array()); + $available = $rest->listAll($base, $list_options, true, false, false, $chan->getName()); + } elseif ($chan->supportsREST($this->config->get('preferred_mirror')) && + $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { + $rest = &$this->config->getREST('1.0', array()); + $available = $rest->listAll($base, $list_options, true, false, false, $chan->getName()); + } + + if (PEAR::isError($available)) { + $this->config->set('default_channel', $savechannel); + return $this->raiseError($available); + } + + $i = $j = 0; + $data = array( + 'caption' => 'Channel ' . $channel . ' Available packages:', + 'border' => true, + 'headline' => array('Package', 'Version'), + 'channel' => $channel + ); + + if (count($available) == 0) { + $data = '(no packages available yet)'; + } else { + foreach ($available as $name => $info) { + $version = (isset($info['stable']) && $info['stable']) ? $info['stable'] : '-n/a-'; + $data['data'][] = array($name, $version); + } + } + $this->ui->outputData($data, $command); + $this->config->set('default_channel', $savechannel); + return true; + } + + function doListAll($command, $options, $params) + { + $savechannel = $channel = $this->config->get('default_channel'); + $reg = &$this->config->getRegistry(); + if (isset($options['channel'])) { + $channel = $options['channel']; + if (!$reg->channelExists($channel)) { + return $this->raiseError("Channel \"$channel\" does not exist"); + } + + $this->config->set('default_channel', $channel); + } + + $list_options = false; + if ($this->config->get('preferred_state') == 'stable') { + $list_options = true; + } + + $chan = $reg->getChannel($channel); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } + + if ($chan->supportsREST($this->config->get('preferred_mirror')) && + $base = $chan->getBaseURL('REST1.1', $this->config->get('preferred_mirror'))) { + // use faster list-all if available + $rest = &$this->config->getREST('1.1', array()); + $available = $rest->listAll($base, $list_options, false, false, false, $chan->getName()); + } elseif ($chan->supportsREST($this->config->get('preferred_mirror')) && + $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { + $rest = &$this->config->getREST('1.0', array()); + $available = $rest->listAll($base, $list_options, false, false, false, $chan->getName()); + } + + if (PEAR::isError($available)) { + $this->config->set('default_channel', $savechannel); + return $this->raiseError('The package list could not be fetched from the remote server. Please try again. (Debug info: "' . $available->getMessage() . '")'); + } + + $data = array( + 'caption' => 'All packages [Channel ' . $channel . ']:', + 'border' => true, + 'headline' => array('Package', 'Latest', 'Local'), + 'channel' => $channel, + ); + + if (isset($options['channelinfo'])) { + // add full channelinfo + $data['caption'] = 'Channel ' . $channel . ' All packages:'; + $data['headline'] = array('Channel', 'Package', 'Latest', 'Local', + 'Description', 'Dependencies'); + } + $local_pkgs = $reg->listPackages($channel); + + foreach ($available as $name => $info) { + $installed = $reg->packageInfo($name, null, $channel); + if (is_array($installed['version'])) { + $installed['version'] = $installed['version']['release']; + } + $desc = $info['summary']; + if (isset($params[$name])) { + $desc .= "\n\n".$info['description']; + } + if (isset($options['mode'])) + { + if ($options['mode'] == 'installed' && !isset($installed['version'])) { + continue; + } + if ($options['mode'] == 'notinstalled' && isset($installed['version'])) { + continue; + } + if ($options['mode'] == 'upgrades' + && (!isset($installed['version']) || version_compare($installed['version'], + $info['stable'], '>='))) { + continue; + } + } + $pos = array_search(strtolower($name), $local_pkgs); + if ($pos !== false) { + unset($local_pkgs[$pos]); + } + + if (isset($info['stable']) && !$info['stable']) { + $info['stable'] = null; + } + + if (isset($options['channelinfo'])) { + // add full channelinfo + if ($info['stable'] === $info['unstable']) { + $state = $info['state']; + } else { + $state = 'stable'; + } + $latest = $info['stable'].' ('.$state.')'; + $local = ''; + if (isset($installed['version'])) { + $inst_state = $reg->packageInfo($name, 'release_state', $channel); + $local = $installed['version'].' ('.$inst_state.')'; + } + + $packageinfo = array( + $channel, + $name, + $latest, + $local, + isset($desc) ? $desc : null, + isset($info['deps']) ? $info['deps'] : null, + ); + } else { + $packageinfo = array( + $reg->channelAlias($channel) . '/' . $name, + isset($info['stable']) ? $info['stable'] : null, + isset($installed['version']) ? $installed['version'] : null, + isset($desc) ? $desc : null, + isset($info['deps']) ? $info['deps'] : null, + ); + } + $data['data'][$info['category']][] = $packageinfo; + } + + if (isset($options['mode']) && in_array($options['mode'], array('notinstalled', 'upgrades'))) { + $this->config->set('default_channel', $savechannel); + $this->ui->outputData($data, $command); + return true; + } + + foreach ($local_pkgs as $name) { + $info = &$reg->getPackage($name, $channel); + $data['data']['Local'][] = array( + $reg->channelAlias($channel) . '/' . $info->getPackage(), + '', + $info->getVersion(), + $info->getSummary(), + $info->getDeps() + ); + } + + $this->config->set('default_channel', $savechannel); + $this->ui->outputData($data, $command); + return true; + } + + function doSearch($command, $options, $params) + { + if ((!isset($params[0]) || empty($params[0])) + && (!isset($params[1]) || empty($params[1]))) + { + return $this->raiseError('no valid search string supplied'); + } + + $channelinfo = isset($options['channelinfo']); + $reg = &$this->config->getRegistry(); + if (isset($options['allchannels'])) { + // search all channels + unset($options['allchannels']); + $channels = $reg->getChannels(); + $errors = array(); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + foreach ($channels as $channel) { + if ($channel->getName() != '__uri') { + $options['channel'] = $channel->getName(); + $ret = $this->doSearch($command, $options, $params); + if (PEAR::isError($ret)) { + $errors[] = $ret; + } + } + } + + PEAR::staticPopErrorHandling(); + if (count($errors) !== 0) { + // for now, only give first error + return PEAR::raiseError($errors[0]); + } + + return true; + } + + $savechannel = $channel = $this->config->get('default_channel'); + $package = strtolower($params[0]); + $summary = isset($params[1]) ? $params[1] : false; + if (isset($options['channel'])) { + $reg = &$this->config->getRegistry(); + $channel = $options['channel']; + if (!$reg->channelExists($channel)) { + return $this->raiseError('Channel "' . $channel . '" does not exist'); + } + + $this->config->set('default_channel', $channel); + } + + $chan = $reg->getChannel($channel); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } + + if ($chan->supportsREST($this->config->get('preferred_mirror')) && + $base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) { + $rest = &$this->config->getREST('1.0', array()); + $available = $rest->listAll($base, false, false, $package, $summary, $chan->getName()); + } + + if (PEAR::isError($available)) { + $this->config->set('default_channel', $savechannel); + return $this->raiseError($available); + } + + if (!$available && !$channelinfo) { + // clean exit when not found, no error ! + $data = 'no packages found that match pattern "' . $package . '", for channel '.$channel.'.'; + $this->ui->outputData($data); + $this->config->set('default_channel', $channel); + return true; + } + + if ($channelinfo) { + $data = array( + 'caption' => 'Matched packages, channel ' . $channel . ':', + 'border' => true, + 'headline' => array('Channel', 'Package', 'Stable/(Latest)', 'Local'), + 'channel' => $channel + ); + } else { + $data = array( + 'caption' => 'Matched packages, channel ' . $channel . ':', + 'border' => true, + 'headline' => array('Package', 'Stable/(Latest)', 'Local'), + 'channel' => $channel + ); + } + + if (!$available && $channelinfo) { + unset($data['headline']); + $data['data'] = 'No packages found that match pattern "' . $package . '".'; + $available = array(); + } + + foreach ($available as $name => $info) { + $installed = $reg->packageInfo($name, null, $channel); + $desc = $info['summary']; + if (isset($params[$name])) + $desc .= "\n\n".$info['description']; + + if (!isset($info['stable']) || !$info['stable']) { + $version_remote = 'none'; + } else { + if ($info['unstable']) { + $version_remote = $info['unstable']; + } else { + $version_remote = $info['stable']; + } + $version_remote .= ' ('.$info['state'].')'; + } + $version = is_array($installed['version']) ? $installed['version']['release'] : + $installed['version']; + if ($channelinfo) { + $packageinfo = array( + $channel, + $name, + $version_remote, + $version, + $desc, + ); + } else { + $packageinfo = array( + $name, + $version_remote, + $version, + $desc, + ); + } + $data['data'][$info['category']][] = $packageinfo; + } + + $this->ui->outputData($data, $command); + $this->config->set('default_channel', $channel); + return true; + } + + function &getDownloader($options) + { + if (!class_exists('PEAR_Downloader')) { + require_once 'PEAR/Downloader.php'; + } + $a = &new PEAR_Downloader($this->ui, $options, $this->config); + return $a; + } + + function doDownload($command, $options, $params) + { + // make certain that dependencies are ignored + $options['downloadonly'] = 1; + + // eliminate error messages for preferred_state-related errors + /* TODO: Should be an option, but until now download does respect + prefered state */ + /* $options['ignorepreferred_state'] = 1; */ + // eliminate error messages for preferred_state-related errors + + $downloader = &$this->getDownloader($options); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $e = $downloader->setDownloadDir(getcwd()); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($e)) { + return $this->raiseError('Current directory is not writeable, cannot download'); + } + + $errors = array(); + $downloaded = array(); + $err = $downloader->download($params); + if (PEAR::isError($err)) { + return $err; + } + + $errors = $downloader->getErrorMsgs(); + if (count($errors)) { + foreach ($errors as $error) { + if ($error !== null) { + $this->ui->outputData($error); + } + } + + return $this->raiseError("$command failed"); + } + + $downloaded = $downloader->getDownloadedPackages(); + foreach ($downloaded as $pkg) { + $this->ui->outputData("File $pkg[file] downloaded", $command); + } + + return true; + } + + function downloadCallback($msg, $params = null) + { + if ($msg == 'done') { + $this->bytes_downloaded = $params; + } + } + + function doListUpgrades($command, $options, $params) + { + require_once 'PEAR/Common.php'; + if (isset($params[0]) && !is_array(PEAR_Common::betterStates($params[0]))) { + return $this->raiseError($params[0] . ' is not a valid state (stable/beta/alpha/devel/etc.) try "pear help list-upgrades"'); + } + + $savechannel = $channel = $this->config->get('default_channel'); + $reg = &$this->config->getRegistry(); + foreach ($reg->listChannels() as $channel) { + $inst = array_flip($reg->listPackages($channel)); + if (!count($inst)) { + continue; + } + + if ($channel == '__uri') { + continue; + } + + $this->config->set('default_channel', $channel); + $state = empty($params[0]) ? $this->config->get('preferred_state') : $params[0]; + + $caption = $channel . ' Available Upgrades'; + $chan = $reg->getChannel($channel); + if (PEAR::isError($e = $this->_checkChannelForStatus($channel, $chan))) { + return $e; + } + + $latest = array(); + $base2 = false; + $preferred_mirror = $this->config->get('preferred_mirror'); + if ($chan->supportsREST($preferred_mirror) && + ( + //($base2 = $chan->getBaseURL('REST1.4', $preferred_mirror)) || + ($base = $chan->getBaseURL('REST1.0', $preferred_mirror)) + ) + + ) { + if ($base2) { + $rest = &$this->config->getREST('1.4', array()); + $base = $base2; + } else { + $rest = &$this->config->getREST('1.0', array()); + } + + if (empty($state) || $state == 'any') { + $state = false; + } else { + $caption .= ' (' . implode(', ', PEAR_Common::betterStates($state, true)) . ')'; + } + + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $latest = $rest->listLatestUpgrades($base, $state, $inst, $channel, $reg); + PEAR::staticPopErrorHandling(); + } + + if (PEAR::isError($latest)) { + $this->ui->outputData($latest->getMessage()); + continue; + } + + $caption .= ':'; + if (PEAR::isError($latest)) { + $this->config->set('default_channel', $savechannel); + return $latest; + } + + $data = array( + 'caption' => $caption, + 'border' => 1, + 'headline' => array('Channel', 'Package', 'Local', 'Remote', 'Size'), + 'channel' => $channel + ); + + foreach ((array)$latest as $pkg => $info) { + $package = strtolower($pkg); + if (!isset($inst[$package])) { + // skip packages we don't have installed + continue; + } + + extract($info); + $inst_version = $reg->packageInfo($package, 'version', $channel); + $inst_state = $reg->packageInfo($package, 'release_state', $channel); + if (version_compare("$version", "$inst_version", "le")) { + // installed version is up-to-date + continue; + } + + if ($filesize >= 20480) { + $filesize += 1024 - ($filesize % 1024); + $fs = sprintf("%dkB", $filesize / 1024); + } elseif ($filesize > 0) { + $filesize += 103 - ($filesize % 103); + $fs = sprintf("%.1fkB", $filesize / 1024.0); + } else { + $fs = " -"; // XXX center instead + } + + $data['data'][] = array($channel, $pkg, "$inst_version ($inst_state)", "$version ($state)", $fs); + } + + if (isset($options['channelinfo'])) { + if (empty($data['data'])) { + unset($data['headline']); + if (count($inst) == 0) { + $data['data'] = '(no packages installed)'; + } else { + $data['data'] = '(no upgrades available)'; + } + } + $this->ui->outputData($data, $command); + } else { + if (empty($data['data'])) { + $this->ui->outputData('Channel ' . $channel . ': No upgrades available'); + } else { + $this->ui->outputData($data, $command); + } + } + } + + $this->config->set('default_channel', $savechannel); + return true; + } + + function doClearCache($command, $options, $params) + { + $cache_dir = $this->config->get('cache_dir'); + $verbose = $this->config->get('verbose'); + $output = ''; + if (!file_exists($cache_dir) || !is_dir($cache_dir)) { + return $this->raiseError("$cache_dir does not exist or is not a directory"); + } + + if (!($dp = @opendir($cache_dir))) { + return $this->raiseError("opendir($cache_dir) failed: $php_errormsg"); + } + + if ($verbose >= 1) { + $output .= "reading directory $cache_dir\n"; + } + + $num = 0; + while ($ent = readdir($dp)) { + if (preg_match('/rest.cache(file|id)\\z/', $ent)) { + $path = $cache_dir . DIRECTORY_SEPARATOR . $ent; + if (file_exists($path)) { + $ok = @unlink($path); + } else { + $ok = false; + $php_errormsg = ''; + } + + if ($ok) { + if ($verbose >= 2) { + $output .= "deleted $path\n"; + } + $num++; + } elseif ($verbose >= 1) { + $output .= "failed to delete $path $php_errormsg\n"; + } + } + } + + closedir($dp); + if ($verbose >= 1) { + $output .= "$num cache entries cleared\n"; + } + + $this->ui->outputData(rtrim($output), $command); + return $num; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Remote.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Remote.xml new file mode 100644 index 0000000000000000000000000000000000000000..b4f6100c793109d1f8bd66ecbe70055ae348559d --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Remote.xml @@ -0,0 +1,109 @@ +<commands version="1.0"> + <remote-info> + <summary>Information About Remote Packages</summary> + <function>doRemoteInfo</function> + <shortcut>ri</shortcut> + <options /> + <doc><package> +Get details on a package from the server.</doc> + </remote-info> + <list-upgrades> + <summary>List Available Upgrades</summary> + <function>doListUpgrades</function> + <shortcut>lu</shortcut> + <options> + <channelinfo> + <shortopt>i</shortopt> + <doc>output fully channel-aware data, even on failure</doc> + </channelinfo> + </options> + <doc>[preferred_state] +List releases on the server of packages you have installed where +a newer version is available with the same release state (stable etc.) +or the state passed as the second parameter.</doc> + </list-upgrades> + <remote-list> + <summary>List Remote Packages</summary> + <function>doRemoteList</function> + <shortcut>rl</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>specify a channel other than the default channel</doc> + <arg>CHAN</arg> + </channel> + </options> + <doc> +Lists the packages available on the configured server along with the +latest stable release of each package.</doc> + </remote-list> + <search> + <summary>Search remote package database</summary> + <function>doSearch</function> + <shortcut>sp</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>specify a channel other than the default channel</doc> + <arg>CHAN</arg> + </channel> + <allchannels> + <shortopt>a</shortopt> + <doc>search packages from all known channels</doc> + </allchannels> + <channelinfo> + <shortopt>i</shortopt> + <doc>output fully channel-aware data, even on failure</doc> + </channelinfo> + </options> + <doc>[packagename] [packageinfo] +Lists all packages which match the search parameters. The first +parameter is a fragment of a packagename. The default channel +will be used unless explicitly overridden. The second parameter +will be used to match any portion of the summary/description</doc> + </search> + <list-all> + <summary>List All Packages</summary> + <function>doListAll</function> + <shortcut>la</shortcut> + <options> + <channel> + <shortopt>c</shortopt> + <doc>specify a channel other than the default channel</doc> + <arg>CHAN</arg> + </channel> + <channelinfo> + <shortopt>i</shortopt> + <doc>output fully channel-aware data, even on failure</doc> + </channelinfo> + </options> + <doc> +Lists the packages available on the configured server along with the +latest stable release of each package.</doc> + </list-all> + <download> + <summary>Download Package</summary> + <function>doDownload</function> + <shortcut>d</shortcut> + <options> + <nocompress> + <shortopt>Z</shortopt> + <doc>download an uncompressed (.tar) file</doc> + </nocompress> + </options> + <doc><package>... +Download package tarballs. The files will be named as suggested by the +server, for example if you download the DB package and the latest stable +version of DB is 1.6.5, the downloaded file will be DB-1.6.5.tgz.</doc> + </download> + <clear-cache> + <summary>Clear Web Services Cache</summary> + <function>doClearCache</function> + <shortcut>cc</shortcut> + <options /> + <doc> +Clear the XML-RPC/REST cache. See also the cache_ttl configuration +parameter. +</doc> + </clear-cache> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Test.php b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Test.php new file mode 100644 index 0000000000000000000000000000000000000000..a757d9e579091f6d20ce5d6f93eb9cec8b883566 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Test.php @@ -0,0 +1,337 @@ +<?php +/** + * PEAR_Command_Test (run-tests) + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Martin Jansen <mj@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Test.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR/Command/Common.php'; + +/** + * PEAR commands for login/logout + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Martin Jansen <mj@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ + +class PEAR_Command_Test extends PEAR_Command_Common +{ + var $commands = array( + 'run-tests' => array( + 'summary' => 'Run Regression Tests', + 'function' => 'doRunTests', + 'shortcut' => 'rt', + 'options' => array( + 'recur' => array( + 'shortopt' => 'r', + 'doc' => 'Run tests in child directories, recursively. 4 dirs deep maximum', + ), + 'ini' => array( + 'shortopt' => 'i', + 'doc' => 'actual string of settings to pass to php in format " -d setting=blah"', + 'arg' => 'SETTINGS' + ), + 'realtimelog' => array( + 'shortopt' => 'l', + 'doc' => 'Log test runs/results as they are run', + ), + 'quiet' => array( + 'shortopt' => 'q', + 'doc' => 'Only display detail for failed tests', + ), + 'simple' => array( + 'shortopt' => 's', + 'doc' => 'Display simple output for all tests', + ), + 'package' => array( + 'shortopt' => 'p', + 'doc' => 'Treat parameters as installed packages from which to run tests', + ), + 'phpunit' => array( + 'shortopt' => 'u', + 'doc' => 'Search parameters for AllTests.php, and use that to run phpunit-based tests +If none is found, all .phpt tests will be tried instead.', + ), + 'tapoutput' => array( + 'shortopt' => 't', + 'doc' => 'Output run-tests.log in TAP-compliant format', + ), + 'cgi' => array( + 'shortopt' => 'c', + 'doc' => 'CGI php executable (needed for tests with POST/GET section)', + 'arg' => 'PHPCGI', + ), + 'coverage' => array( + 'shortopt' => 'x', + 'doc' => 'Generate a code coverage report (requires Xdebug 2.0.0+)', + ), + ), + 'doc' => '[testfile|dir ...] +Run regression tests with PHP\'s regression testing script (run-tests.php).', + ), + ); + + var $output; + + /** + * PEAR_Command_Test constructor. + * + * @access public + */ + function PEAR_Command_Test(&$ui, &$config) + { + parent::PEAR_Command_Common($ui, $config); + } + + function doRunTests($command, $options, $params) + { + if (isset($options['phpunit']) && isset($options['tapoutput'])) { + return $this->raiseError('ERROR: cannot use both --phpunit and --tapoutput at the same time'); + } + + require_once 'PEAR/Common.php'; + require_once 'System.php'; + $log = new PEAR_Common; + $log->ui = &$this->ui; // slightly hacky, but it will work + $tests = array(); + $depth = isset($options['recur']) ? 14 : 1; + + if (!count($params)) { + $params[] = '.'; + } + + if (isset($options['package'])) { + $oldparams = $params; + $params = array(); + $reg = &$this->config->getRegistry(); + foreach ($oldparams as $param) { + $pname = $reg->parsePackageName($param, $this->config->get('default_channel')); + if (PEAR::isError($pname)) { + return $this->raiseError($pname); + } + + $package = &$reg->getPackage($pname['package'], $pname['channel']); + if (!$package) { + return PEAR::raiseError('Unknown package "' . + $reg->parsedPackageNameToString($pname) . '"'); + } + + $filelist = $package->getFilelist(); + foreach ($filelist as $name => $atts) { + if (isset($atts['role']) && $atts['role'] != 'test') { + continue; + } + + if (isset($options['phpunit']) && preg_match('/AllTests\.php\\z/i', $name)) { + $params[] = $atts['installed_as']; + continue; + } elseif (!preg_match('/\.phpt\\z/', $name)) { + continue; + } + $params[] = $atts['installed_as']; + } + } + } + + foreach ($params as $p) { + if (is_dir($p)) { + if (isset($options['phpunit'])) { + $dir = System::find(array($p, '-type', 'f', + '-maxdepth', $depth, + '-name', 'AllTests.php')); + if (count($dir)) { + foreach ($dir as $p) { + $p = realpath($p); + if (!count($tests) || + (count($tests) && strlen($p) < strlen($tests[0]))) { + // this is in a higher-level directory, use this one instead. + $tests = array($p); + } + } + } + continue; + } + + $args = array($p, '-type', 'f', '-name', '*.phpt'); + } else { + if (isset($options['phpunit'])) { + if (preg_match('/AllTests\.php\\z/i', $p)) { + $p = realpath($p); + if (!count($tests) || + (count($tests) && strlen($p) < strlen($tests[0]))) { + // this is in a higher-level directory, use this one instead. + $tests = array($p); + } + } + continue; + } + + if (file_exists($p) && preg_match('/\.phpt$/', $p)) { + $tests[] = $p; + continue; + } + + if (!preg_match('/\.phpt\\z/', $p)) { + $p .= '.phpt'; + } + + $args = array(dirname($p), '-type', 'f', '-name', $p); + } + + if (!isset($options['recur'])) { + $args[] = '-maxdepth'; + $args[] = 1; + } + + $dir = System::find($args); + $tests = array_merge($tests, $dir); + } + + $ini_settings = ''; + if (isset($options['ini'])) { + $ini_settings .= $options['ini']; + } + + if (isset($_ENV['TEST_PHP_INCLUDE_PATH'])) { + $ini_settings .= " -d include_path={$_ENV['TEST_PHP_INCLUDE_PATH']}"; + } + + if ($ini_settings) { + $this->ui->outputData('Using INI settings: "' . $ini_settings . '"'); + } + + $skipped = $passed = $failed = array(); + $tests_count = count($tests); + $this->ui->outputData('Running ' . $tests_count . ' tests', $command); + $start = time(); + if (isset($options['realtimelog']) && file_exists('run-tests.log')) { + unlink('run-tests.log'); + } + + if (isset($options['tapoutput'])) { + $tap = '1..' . $tests_count . "\n"; + } + + require_once 'PEAR/RunTest.php'; + $run = new PEAR_RunTest($log, $options); + $run->tests_count = $tests_count; + + if (isset($options['coverage']) && extension_loaded('xdebug')){ + $run->xdebug_loaded = true; + } else { + $run->xdebug_loaded = false; + } + + $j = $i = 1; + foreach ($tests as $t) { + if (isset($options['realtimelog'])) { + $fp = @fopen('run-tests.log', 'a'); + if ($fp) { + fwrite($fp, "Running test [$i / $tests_count] $t..."); + fclose($fp); + } + } + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + if (isset($options['phpunit'])) { + $result = $run->runPHPUnit($t, $ini_settings); + } else { + $result = $run->run($t, $ini_settings, $j); + } + PEAR::staticPopErrorHandling(); + if (PEAR::isError($result)) { + $this->ui->log($result->getMessage()); + continue; + } + + if (isset($options['tapoutput'])) { + $tap .= $result[0] . ' ' . $i . $result[1] . "\n"; + continue; + } + + if (isset($options['realtimelog'])) { + $fp = @fopen('run-tests.log', 'a'); + if ($fp) { + fwrite($fp, "$result\n"); + fclose($fp); + } + } + + if ($result == 'FAILED') { + $failed[] = $t; + } + if ($result == 'PASSED') { + $passed[] = $t; + } + if ($result == 'SKIPPED') { + $skipped[] = $t; + } + + $j++; + } + + $total = date('i:s', time() - $start); + if (isset($options['tapoutput'])) { + $fp = @fopen('run-tests.log', 'w'); + if ($fp) { + fwrite($fp, $tap, strlen($tap)); + fclose($fp); + $this->ui->outputData('wrote TAP-format log to "' .realpath('run-tests.log') . + '"', $command); + } + } else { + if (count($failed)) { + $output = "TOTAL TIME: $total\n"; + $output .= count($passed) . " PASSED TESTS\n"; + $output .= count($skipped) . " SKIPPED TESTS\n"; + $output .= count($failed) . " FAILED TESTS:\n"; + foreach ($failed as $failure) { + $output .= $failure . "\n"; + } + + $mode = isset($options['realtimelog']) ? 'a' : 'w'; + $fp = @fopen('run-tests.log', $mode); + + if ($fp) { + fwrite($fp, $output, strlen($output)); + fclose($fp); + $this->ui->outputData('wrote log to "' . realpath('run-tests.log') . '"', $command); + } + } elseif (file_exists('run-tests.log') && !is_dir('run-tests.log')) { + @unlink('run-tests.log'); + } + } + $this->ui->outputData('TOTAL TIME: ' . $total); + $this->ui->outputData(count($passed) . ' PASSED TESTS', $command); + $this->ui->outputData(count($skipped) . ' SKIPPED TESTS', $command); + if (count($failed)) { + $this->ui->outputData(count($failed) . ' FAILED TESTS:', $command); + foreach ($failed as $failure) { + $this->ui->outputData($failure, $command); + } + } + + return true; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Command/Test.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Test.xml new file mode 100644 index 0000000000000000000000000000000000000000..bbe9fcccc51fad7569d664bc894a7b04076de5ca --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Command/Test.xml @@ -0,0 +1,54 @@ +<commands version="1.0"> + <run-tests> + <summary>Run Regression Tests</summary> + <function>doRunTests</function> + <shortcut>rt</shortcut> + <options> + <recur> + <shortopt>r</shortopt> + <doc>Run tests in child directories, recursively. 4 dirs deep maximum</doc> + </recur> + <ini> + <shortopt>i</shortopt> + <doc>actual string of settings to pass to php in format " -d setting=blah"</doc> + <arg>SETTINGS</arg> + </ini> + <realtimelog> + <shortopt>l</shortopt> + <doc>Log test runs/results as they are run</doc> + </realtimelog> + <quiet> + <shortopt>q</shortopt> + <doc>Only display detail for failed tests</doc> + </quiet> + <simple> + <shortopt>s</shortopt> + <doc>Display simple output for all tests</doc> + </simple> + <package> + <shortopt>p</shortopt> + <doc>Treat parameters as installed packages from which to run tests</doc> + </package> + <phpunit> + <shortopt>u</shortopt> + <doc>Search parameters for AllTests.php, and use that to run phpunit-based tests +If none is found, all .phpt tests will be tried instead.</doc> + </phpunit> + <tapoutput> + <shortopt>t</shortopt> + <doc>Output run-tests.log in TAP-compliant format</doc> + </tapoutput> + <cgi> + <shortopt>c</shortopt> + <doc>CGI php executable (needed for tests with POST/GET section)</doc> + <arg>PHPCGI</arg> + </cgi> + <coverage> + <shortopt>x</shortopt> + <doc>Generate a code coverage report (requires Xdebug 2.0.0+)</doc> + </coverage> + </options> + <doc>[testfile|dir ...] +Run regression tests with PHP's regression testing script (run-tests.php).</doc> + </run-tests> +</commands> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Common.php b/vendor/pear-pear.php.net/PEAR/PEAR/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..3a8c7e80d33f83aae44ff7a7ebed70a969312d5d --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Common.php @@ -0,0 +1,837 @@ +<?php +/** + * PEAR_Common, the base class for the PEAR Installer + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V. V. Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1.0 + * @deprecated File deprecated since Release 1.4.0a1 + */ + +/** + * Include error handling + */ +require_once 'PEAR.php'; + +/** + * PEAR_Common error when an invalid PHP file is passed to PEAR_Common::analyzeSourceCode() + */ +define('PEAR_COMMON_ERROR_INVALIDPHP', 1); +define('_PEAR_COMMON_PACKAGE_NAME_PREG', '[A-Za-z][a-zA-Z0-9_]+'); +define('PEAR_COMMON_PACKAGE_NAME_PREG', '/^' . _PEAR_COMMON_PACKAGE_NAME_PREG . '\\z/'); + +// this should allow: 1, 1.0, 1.0RC1, 1.0dev, 1.0dev123234234234, 1.0a1, 1.0b1, 1.0pl1 +define('_PEAR_COMMON_PACKAGE_VERSION_PREG', '\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?'); +define('PEAR_COMMON_PACKAGE_VERSION_PREG', '/^' . _PEAR_COMMON_PACKAGE_VERSION_PREG . '\\z/i'); + +// XXX far from perfect :-) +define('_PEAR_COMMON_PACKAGE_DOWNLOAD_PREG', '(' . _PEAR_COMMON_PACKAGE_NAME_PREG . + ')(-([.0-9a-zA-Z]+))?'); +define('PEAR_COMMON_PACKAGE_DOWNLOAD_PREG', '/^' . _PEAR_COMMON_PACKAGE_DOWNLOAD_PREG . + '\\z/'); + +define('_PEAR_CHANNELS_NAME_PREG', '[A-Za-z][a-zA-Z0-9\.]+'); +define('PEAR_CHANNELS_NAME_PREG', '/^' . _PEAR_CHANNELS_NAME_PREG . '\\z/'); + +// this should allow any dns or IP address, plus a path - NO UNDERSCORES ALLOWED +define('_PEAR_CHANNELS_SERVER_PREG', '[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*(\/[a-zA-Z0-9\-]+)*'); +define('PEAR_CHANNELS_SERVER_PREG', '/^' . _PEAR_CHANNELS_SERVER_PREG . '\\z/i'); + +define('_PEAR_CHANNELS_PACKAGE_PREG', '(' ._PEAR_CHANNELS_SERVER_PREG . ')\/(' + . _PEAR_COMMON_PACKAGE_NAME_PREG . ')'); +define('PEAR_CHANNELS_PACKAGE_PREG', '/^' . _PEAR_CHANNELS_PACKAGE_PREG . '\\z/i'); + +define('_PEAR_COMMON_CHANNEL_DOWNLOAD_PREG', '(' . _PEAR_CHANNELS_NAME_PREG . ')::(' + . _PEAR_COMMON_PACKAGE_NAME_PREG . ')(-([.0-9a-zA-Z]+))?'); +define('PEAR_COMMON_CHANNEL_DOWNLOAD_PREG', '/^' . _PEAR_COMMON_CHANNEL_DOWNLOAD_PREG . '\\z/'); + +/** + * List of temporary files and directories registered by + * PEAR_Common::addTempFile(). + * @var array + */ +$GLOBALS['_PEAR_Common_tempfiles'] = array(); + +/** + * Valid maintainer roles + * @var array + */ +$GLOBALS['_PEAR_Common_maintainer_roles'] = array('lead','developer','contributor','helper'); + +/** + * Valid release states + * @var array + */ +$GLOBALS['_PEAR_Common_release_states'] = array('alpha','beta','stable','snapshot','devel'); + +/** + * Valid dependency types + * @var array + */ +$GLOBALS['_PEAR_Common_dependency_types'] = array('pkg','ext','php','prog','ldlib','rtlib','os','websrv','sapi'); + +/** + * Valid dependency relations + * @var array + */ +$GLOBALS['_PEAR_Common_dependency_relations'] = array('has','eq','lt','le','gt','ge','not', 'ne'); + +/** + * Valid file roles + * @var array + */ +$GLOBALS['_PEAR_Common_file_roles'] = array('php','ext','test','doc','data','src','script'); + +/** + * Valid replacement types + * @var array + */ +$GLOBALS['_PEAR_Common_replacement_types'] = array('php-const', 'pear-config', 'package-info'); + +/** + * Valid "provide" types + * @var array + */ +$GLOBALS['_PEAR_Common_provide_types'] = array('ext', 'prog', 'class', 'function', 'feature', 'api'); + +/** + * Valid "provide" types + * @var array + */ +$GLOBALS['_PEAR_Common_script_phases'] = array('pre-install', 'post-install', 'pre-uninstall', 'post-uninstall', 'pre-build', 'post-build', 'pre-configure', 'post-configure', 'pre-setup', 'post-setup'); + +/** + * Class providing common functionality for PEAR administration classes. + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V. V. Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + * @deprecated This class will disappear, and its components will be spread + * into smaller classes, like the AT&T breakup, as of Release 1.4.0a1 + */ +class PEAR_Common extends PEAR +{ + /** + * User Interface object (PEAR_Frontend_* class). If null, + * the log() method uses print. + * @var object + */ + var $ui = null; + + /** + * Configuration object (PEAR_Config). + * @var PEAR_Config + */ + var $config = null; + + /** stack of elements, gives some sort of XML context */ + var $element_stack = array(); + + /** name of currently parsed XML element */ + var $current_element; + + /** array of attributes of the currently parsed XML element */ + var $current_attributes = array(); + + /** assoc with information about a package */ + var $pkginfo = array(); + + var $current_path = null; + + /** + * Flag variable used to mark a valid package file + * @var boolean + * @access private + */ + var $_validPackageFile; + + /** + * PEAR_Common constructor + * + * @access public + */ + function PEAR_Common() + { + parent::PEAR(); + $this->config = &PEAR_Config::singleton(); + $this->debug = $this->config->get('verbose'); + } + + /** + * PEAR_Common destructor + * + * @access private + */ + function _PEAR_Common() + { + // doesn't work due to bug #14744 + //$tempfiles = $this->_tempfiles; + $tempfiles =& $GLOBALS['_PEAR_Common_tempfiles']; + while ($file = array_shift($tempfiles)) { + if (@is_dir($file)) { + if (!class_exists('System')) { + require_once 'System.php'; + } + + System::rm(array('-rf', $file)); + } elseif (file_exists($file)) { + unlink($file); + } + } + } + + /** + * Register a temporary file or directory. When the destructor is + * executed, all registered temporary files and directories are + * removed. + * + * @param string $file name of file or directory + * + * @return void + * + * @access public + */ + function addTempFile($file) + { + if (!class_exists('PEAR_Frontend')) { + require_once 'PEAR/Frontend.php'; + } + PEAR_Frontend::addTempFile($file); + } + + /** + * Wrapper to System::mkDir(), creates a directory as well as + * any necessary parent directories. + * + * @param string $dir directory name + * + * @return bool TRUE on success, or a PEAR error + * + * @access public + */ + function mkDirHier($dir) + { + // Only used in Installer - move it there ? + $this->log(2, "+ create dir $dir"); + if (!class_exists('System')) { + require_once 'System.php'; + } + return System::mkDir(array('-p', $dir)); + } + + /** + * Logging method. + * + * @param int $level log level (0 is quiet, higher is noisier) + * @param string $msg message to write to the log + * + * @return void + * + * @access public + * @static + */ + function log($level, $msg, $append_crlf = true) + { + if ($this->debug >= $level) { + if (!class_exists('PEAR_Frontend')) { + require_once 'PEAR/Frontend.php'; + } + + $ui = &PEAR_Frontend::singleton(); + if (is_a($ui, 'PEAR_Frontend')) { + $ui->log($msg, $append_crlf); + } else { + print "$msg\n"; + } + } + } + + /** + * Create and register a temporary directory. + * + * @param string $tmpdir (optional) Directory to use as tmpdir. + * Will use system defaults (for example + * /tmp or c:\windows\temp) if not specified + * + * @return string name of created directory + * + * @access public + */ + function mkTempDir($tmpdir = '') + { + $topt = $tmpdir ? array('-t', $tmpdir) : array(); + $topt = array_merge($topt, array('-d', 'pear')); + if (!class_exists('System')) { + require_once 'System.php'; + } + + if (!$tmpdir = System::mktemp($topt)) { + return false; + } + + $this->addTempFile($tmpdir); + return $tmpdir; + } + + /** + * Set object that represents the frontend to be used. + * + * @param object Reference of the frontend object + * @return void + * @access public + */ + function setFrontendObject(&$ui) + { + $this->ui = &$ui; + } + + /** + * Return an array containing all of the states that are more stable than + * or equal to the passed in state + * + * @param string Release state + * @param boolean Determines whether to include $state in the list + * @return false|array False if $state is not a valid release state + */ + function betterStates($state, $include = false) + { + static $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable'); + $i = array_search($state, $states); + if ($i === false) { + return false; + } + if ($include) { + $i--; + } + return array_slice($states, $i + 1); + } + + /** + * Get the valid roles for a PEAR package maintainer + * + * @return array + * @static + */ + function getUserRoles() + { + return $GLOBALS['_PEAR_Common_maintainer_roles']; + } + + /** + * Get the valid package release states of packages + * + * @return array + * @static + */ + function getReleaseStates() + { + return $GLOBALS['_PEAR_Common_release_states']; + } + + /** + * Get the implemented dependency types (php, ext, pkg etc.) + * + * @return array + * @static + */ + function getDependencyTypes() + { + return $GLOBALS['_PEAR_Common_dependency_types']; + } + + /** + * Get the implemented dependency relations (has, lt, ge etc.) + * + * @return array + * @static + */ + function getDependencyRelations() + { + return $GLOBALS['_PEAR_Common_dependency_relations']; + } + + /** + * Get the implemented file roles + * + * @return array + * @static + */ + function getFileRoles() + { + return $GLOBALS['_PEAR_Common_file_roles']; + } + + /** + * Get the implemented file replacement types in + * + * @return array + * @static + */ + function getReplacementTypes() + { + return $GLOBALS['_PEAR_Common_replacement_types']; + } + + /** + * Get the implemented file replacement types in + * + * @return array + * @static + */ + function getProvideTypes() + { + return $GLOBALS['_PEAR_Common_provide_types']; + } + + /** + * Get the implemented file replacement types in + * + * @return array + * @static + */ + function getScriptPhases() + { + return $GLOBALS['_PEAR_Common_script_phases']; + } + + /** + * Test whether a string contains a valid package name. + * + * @param string $name the package name to test + * + * @return bool + * + * @access public + */ + function validPackageName($name) + { + return (bool)preg_match(PEAR_COMMON_PACKAGE_NAME_PREG, $name); + } + + /** + * Test whether a string contains a valid package version. + * + * @param string $ver the package version to test + * + * @return bool + * + * @access public + */ + function validPackageVersion($ver) + { + return (bool)preg_match(PEAR_COMMON_PACKAGE_VERSION_PREG, $ver); + } + + /** + * @param string $path relative or absolute include path + * @return boolean + * @static + */ + function isIncludeable($path) + { + if (file_exists($path) && is_readable($path)) { + return true; + } + + $ipath = explode(PATH_SEPARATOR, ini_get('include_path')); + foreach ($ipath as $include) { + $test = realpath($include . DIRECTORY_SEPARATOR . $path); + if (file_exists($test) && is_readable($test)) { + return true; + } + } + + return false; + } + + function _postProcessChecks($pf) + { + if (!PEAR::isError($pf)) { + return $this->_postProcessValidPackagexml($pf); + } + + $errs = $pf->getUserinfo(); + if (is_array($errs)) { + foreach ($errs as $error) { + $e = $this->raiseError($error['message'], $error['code'], null, null, $error); + } + } + + return $pf; + } + + /** + * Returns information about a package file. Expects the name of + * a gzipped tar file as input. + * + * @param string $file name of .tgz file + * + * @return array array with package information + * + * @access public + * @deprecated use PEAR_PackageFile->fromTgzFile() instead + * + */ + function infoFromTgzFile($file) + { + $packagefile = &new PEAR_PackageFile($this->config); + $pf = &$packagefile->fromTgzFile($file, PEAR_VALIDATE_NORMAL); + return $this->_postProcessChecks($pf); + } + + /** + * Returns information about a package file. Expects the name of + * a package xml file as input. + * + * @param string $descfile name of package xml file + * + * @return array array with package information + * + * @access public + * @deprecated use PEAR_PackageFile->fromPackageFile() instead + * + */ + function infoFromDescriptionFile($descfile) + { + $packagefile = &new PEAR_PackageFile($this->config); + $pf = &$packagefile->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL); + return $this->_postProcessChecks($pf); + } + + /** + * Returns information about a package file. Expects the contents + * of a package xml file as input. + * + * @param string $data contents of package.xml file + * + * @return array array with package information + * + * @access public + * @deprecated use PEAR_PackageFile->fromXmlstring() instead + * + */ + function infoFromString($data) + { + $packagefile = &new PEAR_PackageFile($this->config); + $pf = &$packagefile->fromXmlString($data, PEAR_VALIDATE_NORMAL, false); + return $this->_postProcessChecks($pf); + } + + /** + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @return array + */ + function _postProcessValidPackagexml(&$pf) + { + if (!is_a($pf, 'PEAR_PackageFile_v2')) { + $this->pkginfo = $pf->toArray(); + return $this->pkginfo; + } + + // sort of make this into a package.xml 1.0-style array + // changelog is not converted to old format. + $arr = $pf->toArray(true); + $arr = array_merge($arr, $arr['old']); + unset($arr['old'], $arr['xsdversion'], $arr['contents'], $arr['compatible'], + $arr['channel'], $arr['uri'], $arr['dependencies'], $arr['phprelease'], + $arr['extsrcrelease'], $arr['zendextsrcrelease'], $arr['extbinrelease'], + $arr['zendextbinrelease'], $arr['bundle'], $arr['lead'], $arr['developer'], + $arr['helper'], $arr['contributor']); + $arr['filelist'] = $pf->getFilelist(); + $this->pkginfo = $arr; + return $arr; + } + + /** + * Returns package information from different sources + * + * This method is able to extract information about a package + * from a .tgz archive or from a XML package definition file. + * + * @access public + * @param string Filename of the source ('package.xml', '<package>.tgz') + * @return string + * @deprecated use PEAR_PackageFile->fromAnyFile() instead + */ + function infoFromAny($info) + { + if (is_string($info) && file_exists($info)) { + $packagefile = &new PEAR_PackageFile($this->config); + $pf = &$packagefile->fromAnyFile($info, PEAR_VALIDATE_NORMAL); + if (PEAR::isError($pf)) { + $errs = $pf->getUserinfo(); + if (is_array($errs)) { + foreach ($errs as $error) { + $e = $this->raiseError($error['message'], $error['code'], null, null, $error); + } + } + + return $pf; + } + + return $this->_postProcessValidPackagexml($pf); + } + + return $info; + } + + /** + * Return an XML document based on the package info (as returned + * by the PEAR_Common::infoFrom* methods). + * + * @param array $pkginfo package info + * + * @return string XML data + * + * @access public + * @deprecated use a PEAR_PackageFile_v* object's generator instead + */ + function xmlFromInfo($pkginfo) + { + $config = &PEAR_Config::singleton(); + $packagefile = &new PEAR_PackageFile($config); + $pf = &$packagefile->fromArray($pkginfo); + $gen = &$pf->getDefaultGenerator(); + return $gen->toXml(PEAR_VALIDATE_PACKAGING); + } + + /** + * Validate XML package definition file. + * + * @param string $info Filename of the package archive or of the + * package definition file + * @param array $errors Array that will contain the errors + * @param array $warnings Array that will contain the warnings + * @param string $dir_prefix (optional) directory where source files + * may be found, or empty if they are not available + * @access public + * @return boolean + * @deprecated use the validation of PEAR_PackageFile objects + */ + function validatePackageInfo($info, &$errors, &$warnings, $dir_prefix = '') + { + $config = &PEAR_Config::singleton(); + $packagefile = &new PEAR_PackageFile($config); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + if (strpos($info, '<?xml') !== false) { + $pf = &$packagefile->fromXmlString($info, PEAR_VALIDATE_NORMAL, ''); + } else { + $pf = &$packagefile->fromAnyFile($info, PEAR_VALIDATE_NORMAL); + } + + PEAR::staticPopErrorHandling(); + if (PEAR::isError($pf)) { + $errs = $pf->getUserinfo(); + if (is_array($errs)) { + foreach ($errs as $error) { + if ($error['level'] == 'error') { + $errors[] = $error['message']; + } else { + $warnings[] = $error['message']; + } + } + } + + return false; + } + + return true; + } + + /** + * Build a "provides" array from data returned by + * analyzeSourceCode(). The format of the built array is like + * this: + * + * array( + * 'class;MyClass' => 'array('type' => 'class', 'name' => 'MyClass'), + * ... + * ) + * + * + * @param array $srcinfo array with information about a source file + * as returned by the analyzeSourceCode() method. + * + * @return void + * + * @access public + * + */ + function buildProvidesArray($srcinfo) + { + $file = basename($srcinfo['source_file']); + $pn = ''; + if (isset($this->_packageName)) { + $pn = $this->_packageName; + } + + $pnl = strlen($pn); + foreach ($srcinfo['declared_classes'] as $class) { + $key = "class;$class"; + if (isset($this->pkginfo['provides'][$key])) { + continue; + } + + $this->pkginfo['provides'][$key] = + array('file'=> $file, 'type' => 'class', 'name' => $class); + if (isset($srcinfo['inheritance'][$class])) { + $this->pkginfo['provides'][$key]['extends'] = + $srcinfo['inheritance'][$class]; + } + } + + foreach ($srcinfo['declared_methods'] as $class => $methods) { + foreach ($methods as $method) { + $function = "$class::$method"; + $key = "function;$function"; + if ($method{0} == '_' || !strcasecmp($method, $class) || + isset($this->pkginfo['provides'][$key])) { + continue; + } + + $this->pkginfo['provides'][$key] = + array('file'=> $file, 'type' => 'function', 'name' => $function); + } + } + + foreach ($srcinfo['declared_functions'] as $function) { + $key = "function;$function"; + if ($function{0} == '_' || isset($this->pkginfo['provides'][$key])) { + continue; + } + + if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) { + $warnings[] = "in1 " . $file . ": function \"$function\" not prefixed with package name \"$pn\""; + } + + $this->pkginfo['provides'][$key] = + array('file'=> $file, 'type' => 'function', 'name' => $function); + } + } + + /** + * Analyze the source code of the given PHP file + * + * @param string Filename of the PHP file + * @return mixed + * @access public + */ + function analyzeSourceCode($file) + { + if (!class_exists('PEAR_PackageFile_v2_Validator')) { + require_once 'PEAR/PackageFile/v2/Validator.php'; + } + + $a = new PEAR_PackageFile_v2_Validator; + return $a->analyzeSourceCode($file); + } + + function detectDependencies($any, $status_callback = null) + { + if (!function_exists("token_get_all")) { + return false; + } + + if (PEAR::isError($info = $this->infoFromAny($any))) { + return $this->raiseError($info); + } + + if (!is_array($info)) { + return false; + } + + $deps = array(); + $used_c = $decl_c = $decl_f = $decl_m = array(); + foreach ($info['filelist'] as $file => $fa) { + $tmp = $this->analyzeSourceCode($file); + $used_c = @array_merge($used_c, $tmp['used_classes']); + $decl_c = @array_merge($decl_c, $tmp['declared_classes']); + $decl_f = @array_merge($decl_f, $tmp['declared_functions']); + $decl_m = @array_merge($decl_m, $tmp['declared_methods']); + $inheri = @array_merge($inheri, $tmp['inheritance']); + } + + $used_c = array_unique($used_c); + $decl_c = array_unique($decl_c); + $undecl_c = array_diff($used_c, $decl_c); + + return array('used_classes' => $used_c, + 'declared_classes' => $decl_c, + 'declared_methods' => $decl_m, + 'declared_functions' => $decl_f, + 'undeclared_classes' => $undecl_c, + 'inheritance' => $inheri, + ); + } + + /** + * Download a file through HTTP. Considers suggested file name in + * Content-disposition: header and can run a callback function for + * different events. The callback will be called with two + * parameters: the callback type, and parameters. The implemented + * callback types are: + * + * 'setup' called at the very beginning, parameter is a UI object + * that should be used for all output + * 'message' the parameter is a string with an informational message + * 'saveas' may be used to save with a different file name, the + * parameter is the filename that is about to be used. + * If a 'saveas' callback returns a non-empty string, + * that file name will be used as the filename instead. + * Note that $save_dir will not be affected by this, only + * the basename of the file. + * 'start' download is starting, parameter is number of bytes + * that are expected, or -1 if unknown + * 'bytesread' parameter is the number of bytes read so far + * 'done' download is complete, parameter is the total number + * of bytes read + * 'connfailed' if the TCP connection fails, this callback is called + * with array(host,port,errno,errmsg) + * 'writefailed' if writing to disk fails, this callback is called + * with array(destfile,errmsg) + * + * If an HTTP proxy has been configured (http_proxy PEAR_Config + * setting), the proxy will be used. + * + * @param string $url the URL to download + * @param object $ui PEAR_Frontend_* instance + * @param object $config PEAR_Config instance + * @param string $save_dir (optional) directory to save file in + * @param mixed $callback (optional) function/method to call for status + * updates + * + * @return string Returns the full path of the downloaded file or a PEAR + * error on failure. If the error is caused by + * socket-related errors, the error object will + * have the fsockopen error code available through + * getCode(). + * + * @access public + * @deprecated in favor of PEAR_Downloader::downloadHttp() + */ + function downloadHttp($url, &$ui, $save_dir = '.', $callback = null) + { + if (!class_exists('PEAR_Downloader')) { + require_once 'PEAR/Downloader.php'; + } + return PEAR_Downloader::downloadHttp($url, $ui, $save_dir, $callback); + } +} + +require_once 'PEAR/Config.php'; +require_once 'PEAR/PackageFile.php'; \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Config.php b/vendor/pear-pear.php.net/PEAR/PEAR/Config.php new file mode 100644 index 0000000000000000000000000000000000000000..86a7db3f32f3a9768f4df111db4788fc61692dbb --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Config.php @@ -0,0 +1,2097 @@ +<?php +/** + * PEAR_Config, customized configuration handling for the PEAR Installer + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Config.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * Required for error handling + */ +require_once 'PEAR.php'; +require_once 'PEAR/Registry.php'; +require_once 'PEAR/Installer/Role.php'; +require_once 'System.php'; + +/** + * Last created PEAR_Config instance. + * @var object + */ +$GLOBALS['_PEAR_Config_instance'] = null; +if (!defined('PEAR_INSTALL_DIR') || !PEAR_INSTALL_DIR) { + $PEAR_INSTALL_DIR = PHP_LIBDIR . DIRECTORY_SEPARATOR . 'pear'; +} else { + $PEAR_INSTALL_DIR = PEAR_INSTALL_DIR; +} + +// Below we define constants with default values for all configuration +// parameters except username/password. All of them can have their +// defaults set through environment variables. The reason we use the +// PHP_ prefix is for some security, PHP protects environment +// variables starting with PHP_*. + +// default channel and preferred mirror is based on whether we are invoked through +// the "pear" or the "pecl" command +if (!defined('PEAR_RUNTYPE')) { + define('PEAR_RUNTYPE', 'pear'); +} + +if (PEAR_RUNTYPE == 'pear') { + define('PEAR_CONFIG_DEFAULT_CHANNEL', 'pear.php.net'); +} else { + define('PEAR_CONFIG_DEFAULT_CHANNEL', 'pecl.php.net'); +} + +if (getenv('PHP_PEAR_SYSCONF_DIR')) { + define('PEAR_CONFIG_SYSCONFDIR', getenv('PHP_PEAR_SYSCONF_DIR')); +} elseif (getenv('SystemRoot')) { + define('PEAR_CONFIG_SYSCONFDIR', getenv('SystemRoot')); +} else { + define('PEAR_CONFIG_SYSCONFDIR', PHP_SYSCONFDIR); +} + +// Default for master_server +if (getenv('PHP_PEAR_MASTER_SERVER')) { + define('PEAR_CONFIG_DEFAULT_MASTER_SERVER', getenv('PHP_PEAR_MASTER_SERVER')); +} else { + define('PEAR_CONFIG_DEFAULT_MASTER_SERVER', 'pear.php.net'); +} + +// Default for http_proxy +if (getenv('PHP_PEAR_HTTP_PROXY')) { + define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', getenv('PHP_PEAR_HTTP_PROXY')); +} elseif (getenv('http_proxy')) { + define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', getenv('http_proxy')); +} else { + define('PEAR_CONFIG_DEFAULT_HTTP_PROXY', ''); +} + +// Default for php_dir +if (getenv('PHP_PEAR_INSTALL_DIR')) { + define('PEAR_CONFIG_DEFAULT_PHP_DIR', getenv('PHP_PEAR_INSTALL_DIR')); +} else { + if (@file_exists($PEAR_INSTALL_DIR) && is_dir($PEAR_INSTALL_DIR)) { + define('PEAR_CONFIG_DEFAULT_PHP_DIR', $PEAR_INSTALL_DIR); + } else { + define('PEAR_CONFIG_DEFAULT_PHP_DIR', $PEAR_INSTALL_DIR); + } +} + +// Default for ext_dir +if (getenv('PHP_PEAR_EXTENSION_DIR')) { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', getenv('PHP_PEAR_EXTENSION_DIR')); +} else { + if (ini_get('extension_dir')) { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', ini_get('extension_dir')); + } elseif (defined('PEAR_EXTENSION_DIR') && + file_exists(PEAR_EXTENSION_DIR) && is_dir(PEAR_EXTENSION_DIR)) { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', PEAR_EXTENSION_DIR); + } elseif (defined('PHP_EXTENSION_DIR')) { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', PHP_EXTENSION_DIR); + } else { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', '.'); + } +} + +// Default for doc_dir +if (getenv('PHP_PEAR_DOC_DIR')) { + define('PEAR_CONFIG_DEFAULT_DOC_DIR', getenv('PHP_PEAR_DOC_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_DOC_DIR', + $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'docs'); +} + +// Default for bin_dir +if (getenv('PHP_PEAR_BIN_DIR')) { + define('PEAR_CONFIG_DEFAULT_BIN_DIR', getenv('PHP_PEAR_BIN_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_BIN_DIR', PHP_BINDIR); +} + +// Default for data_dir +if (getenv('PHP_PEAR_DATA_DIR')) { + define('PEAR_CONFIG_DEFAULT_DATA_DIR', getenv('PHP_PEAR_DATA_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_DATA_DIR', + $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'data'); +} + +// Default for cfg_dir +if (getenv('PHP_PEAR_CFG_DIR')) { + define('PEAR_CONFIG_DEFAULT_CFG_DIR', getenv('PHP_PEAR_CFG_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_CFG_DIR', + $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'cfg'); +} + +// Default for www_dir +if (getenv('PHP_PEAR_WWW_DIR')) { + define('PEAR_CONFIG_DEFAULT_WWW_DIR', getenv('PHP_PEAR_WWW_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_WWW_DIR', + $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'www'); +} + +// Default for test_dir +if (getenv('PHP_PEAR_TEST_DIR')) { + define('PEAR_CONFIG_DEFAULT_TEST_DIR', getenv('PHP_PEAR_TEST_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_TEST_DIR', + $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'tests'); +} + +// Default for temp_dir +if (getenv('PHP_PEAR_TEMP_DIR')) { + define('PEAR_CONFIG_DEFAULT_TEMP_DIR', getenv('PHP_PEAR_TEMP_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_TEMP_DIR', + System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' . + DIRECTORY_SEPARATOR . 'temp'); +} + +// Default for cache_dir +if (getenv('PHP_PEAR_CACHE_DIR')) { + define('PEAR_CONFIG_DEFAULT_CACHE_DIR', getenv('PHP_PEAR_CACHE_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_CACHE_DIR', + System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' . + DIRECTORY_SEPARATOR . 'cache'); +} + +// Default for download_dir +if (getenv('PHP_PEAR_DOWNLOAD_DIR')) { + define('PEAR_CONFIG_DEFAULT_DOWNLOAD_DIR', getenv('PHP_PEAR_DOWNLOAD_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_DOWNLOAD_DIR', + System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' . + DIRECTORY_SEPARATOR . 'download'); +} + +// Default for php_bin +if (getenv('PHP_PEAR_PHP_BIN')) { + define('PEAR_CONFIG_DEFAULT_PHP_BIN', getenv('PHP_PEAR_PHP_BIN')); +} else { + define('PEAR_CONFIG_DEFAULT_PHP_BIN', PEAR_CONFIG_DEFAULT_BIN_DIR. + DIRECTORY_SEPARATOR.'php'.(OS_WINDOWS ? '.exe' : '')); +} + +// Default for verbose +if (getenv('PHP_PEAR_VERBOSE')) { + define('PEAR_CONFIG_DEFAULT_VERBOSE', getenv('PHP_PEAR_VERBOSE')); +} else { + define('PEAR_CONFIG_DEFAULT_VERBOSE', 1); +} + +// Default for preferred_state +if (getenv('PHP_PEAR_PREFERRED_STATE')) { + define('PEAR_CONFIG_DEFAULT_PREFERRED_STATE', getenv('PHP_PEAR_PREFERRED_STATE')); +} else { + define('PEAR_CONFIG_DEFAULT_PREFERRED_STATE', 'stable'); +} + +// Default for umask +if (getenv('PHP_PEAR_UMASK')) { + define('PEAR_CONFIG_DEFAULT_UMASK', getenv('PHP_PEAR_UMASK')); +} else { + define('PEAR_CONFIG_DEFAULT_UMASK', decoct(umask())); +} + +// Default for cache_ttl +if (getenv('PHP_PEAR_CACHE_TTL')) { + define('PEAR_CONFIG_DEFAULT_CACHE_TTL', getenv('PHP_PEAR_CACHE_TTL')); +} else { + define('PEAR_CONFIG_DEFAULT_CACHE_TTL', 3600); +} + +// Default for sig_type +if (getenv('PHP_PEAR_SIG_TYPE')) { + define('PEAR_CONFIG_DEFAULT_SIG_TYPE', getenv('PHP_PEAR_SIG_TYPE')); +} else { + define('PEAR_CONFIG_DEFAULT_SIG_TYPE', 'gpg'); +} + +// Default for sig_bin +if (getenv('PHP_PEAR_SIG_BIN')) { + define('PEAR_CONFIG_DEFAULT_SIG_BIN', getenv('PHP_PEAR_SIG_BIN')); +} else { + define('PEAR_CONFIG_DEFAULT_SIG_BIN', + System::which( + 'gpg', OS_WINDOWS ? 'c:\gnupg\gpg.exe' : '/usr/local/bin/gpg')); +} + +// Default for sig_keydir +if (getenv('PHP_PEAR_SIG_KEYDIR')) { + define('PEAR_CONFIG_DEFAULT_SIG_KEYDIR', getenv('PHP_PEAR_SIG_KEYDIR')); +} else { + define('PEAR_CONFIG_DEFAULT_SIG_KEYDIR', + PEAR_CONFIG_SYSCONFDIR . DIRECTORY_SEPARATOR . 'pearkeys'); +} + +/** + * This is a class for storing configuration data, keeping track of + * which are system-defined, user-defined or defaulted. + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Config extends PEAR +{ + /** + * Array of config files used. + * + * @var array layer => config file + */ + var $files = array( + 'system' => '', + 'user' => '', + ); + + var $layers = array(); + + /** + * Configuration data, two-dimensional array where the first + * dimension is the config layer ('user', 'system' and 'default'), + * and the second dimension is keyname => value. + * + * The order in the first dimension is important! Earlier + * layers will shadow later ones when a config value is + * requested (if a 'user' value exists, it will be returned first, + * then 'system' and finally 'default'). + * + * @var array layer => array(keyname => value, ...) + */ + var $configuration = array( + 'user' => array(), + 'system' => array(), + 'default' => array(), + ); + + /** + * Configuration values that can be set for a channel + * + * All other configuration values can only have a global value + * @var array + * @access private + */ + var $_channelConfigInfo = array( + 'php_dir', 'ext_dir', 'doc_dir', 'bin_dir', 'data_dir', 'cfg_dir', + 'test_dir', 'www_dir', 'php_bin', 'php_prefix', 'php_suffix', 'username', + 'password', 'verbose', 'preferred_state', 'umask', 'preferred_mirror', 'php_ini' + ); + + /** + * Channels that can be accessed + * @see setChannels() + * @var array + * @access private + */ + var $_channels = array('pear.php.net', 'pecl.php.net', '__uri'); + + /** + * This variable is used to control the directory values returned + * @see setInstallRoot(); + * @var string|false + * @access private + */ + var $_installRoot = false; + + /** + * If requested, this will always refer to the registry + * contained in php_dir + * @var PEAR_Registry + */ + var $_registry = array(); + + /** + * @var array + * @access private + */ + var $_regInitialized = array(); + + /** + * @var bool + * @access private + */ + var $_noRegistry = false; + + /** + * amount of errors found while parsing config + * @var integer + * @access private + */ + var $_errorsFound = 0; + var $_lastError = null; + + /** + * Information about the configuration data. Stores the type, + * default value and a documentation string for each configuration + * value. + * + * @var array layer => array(infotype => value, ...) + */ + var $configuration_info = array( + // Channels/Internet Access + 'default_channel' => array( + 'type' => 'string', + 'default' => PEAR_CONFIG_DEFAULT_CHANNEL, + 'doc' => 'the default channel to use for all non explicit commands', + 'prompt' => 'Default Channel', + 'group' => 'Internet Access', + ), + 'preferred_mirror' => array( + 'type' => 'string', + 'default' => PEAR_CONFIG_DEFAULT_CHANNEL, + 'doc' => 'the default server or mirror to use for channel actions', + 'prompt' => 'Default Channel Mirror', + 'group' => 'Internet Access', + ), + 'remote_config' => array( + 'type' => 'password', + 'default' => '', + 'doc' => 'ftp url of remote configuration file to use for synchronized install', + 'prompt' => 'Remote Configuration File', + 'group' => 'Internet Access', + ), + 'auto_discover' => array( + 'type' => 'integer', + 'default' => 0, + 'doc' => 'whether to automatically discover new channels', + 'prompt' => 'Auto-discover new Channels', + 'group' => 'Internet Access', + ), + // Internet Access + 'master_server' => array( + 'type' => 'string', + 'default' => 'pear.php.net', + 'doc' => 'name of the main PEAR server [NOT USED IN THIS VERSION]', + 'prompt' => 'PEAR server [DEPRECATED]', + 'group' => 'Internet Access', + ), + 'http_proxy' => array( + 'type' => 'string', + 'default' => PEAR_CONFIG_DEFAULT_HTTP_PROXY, + 'doc' => 'HTTP proxy (host:port) to use when downloading packages', + 'prompt' => 'HTTP Proxy Server Address', + 'group' => 'Internet Access', + ), + // File Locations + 'php_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_PHP_DIR, + 'doc' => 'directory where .php files are installed', + 'prompt' => 'PEAR directory', + 'group' => 'File Locations', + ), + 'ext_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_EXT_DIR, + 'doc' => 'directory where loadable extensions are installed', + 'prompt' => 'PHP extension directory', + 'group' => 'File Locations', + ), + 'doc_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_DOC_DIR, + 'doc' => 'directory where documentation is installed', + 'prompt' => 'PEAR documentation directory', + 'group' => 'File Locations', + ), + 'bin_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_BIN_DIR, + 'doc' => 'directory where executables are installed', + 'prompt' => 'PEAR executables directory', + 'group' => 'File Locations', + ), + 'data_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_DATA_DIR, + 'doc' => 'directory where data files are installed', + 'prompt' => 'PEAR data directory', + 'group' => 'File Locations (Advanced)', + ), + 'cfg_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_CFG_DIR, + 'doc' => 'directory where modifiable configuration files are installed', + 'prompt' => 'PEAR configuration file directory', + 'group' => 'File Locations (Advanced)', + ), + 'www_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_WWW_DIR, + 'doc' => 'directory where www frontend files (html/js) are installed', + 'prompt' => 'PEAR www files directory', + 'group' => 'File Locations (Advanced)', + ), + 'test_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_TEST_DIR, + 'doc' => 'directory where regression tests are installed', + 'prompt' => 'PEAR test directory', + 'group' => 'File Locations (Advanced)', + ), + 'cache_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_CACHE_DIR, + 'doc' => 'directory which is used for web service cache', + 'prompt' => 'PEAR Installer cache directory', + 'group' => 'File Locations (Advanced)', + ), + 'temp_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_TEMP_DIR, + 'doc' => 'directory which is used for all temp files', + 'prompt' => 'PEAR Installer temp directory', + 'group' => 'File Locations (Advanced)', + ), + 'download_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_DOWNLOAD_DIR, + 'doc' => 'directory which is used for all downloaded files', + 'prompt' => 'PEAR Installer download directory', + 'group' => 'File Locations (Advanced)', + ), + 'php_bin' => array( + 'type' => 'file', + 'default' => PEAR_CONFIG_DEFAULT_PHP_BIN, + 'doc' => 'PHP CLI/CGI binary for executing scripts', + 'prompt' => 'PHP CLI/CGI binary', + 'group' => 'File Locations (Advanced)', + ), + 'php_prefix' => array( + 'type' => 'string', + 'default' => '', + 'doc' => '--program-prefix for php_bin\'s ./configure, used for pecl installs', + 'prompt' => '--program-prefix passed to PHP\'s ./configure', + 'group' => 'File Locations (Advanced)', + ), + 'php_suffix' => array( + 'type' => 'string', + 'default' => '', + 'doc' => '--program-suffix for php_bin\'s ./configure, used for pecl installs', + 'prompt' => '--program-suffix passed to PHP\'s ./configure', + 'group' => 'File Locations (Advanced)', + ), + 'php_ini' => array( + 'type' => 'file', + 'default' => '', + 'doc' => 'location of php.ini in which to enable PECL extensions on install', + 'prompt' => 'php.ini location', + 'group' => 'File Locations (Advanced)', + ), + // Maintainers + 'username' => array( + 'type' => 'string', + 'default' => '', + 'doc' => '(maintainers) your PEAR account name', + 'prompt' => 'PEAR username (for maintainers)', + 'group' => 'Maintainers', + ), + 'password' => array( + 'type' => 'password', + 'default' => '', + 'doc' => '(maintainers) your PEAR account password', + 'prompt' => 'PEAR password (for maintainers)', + 'group' => 'Maintainers', + ), + // Advanced + 'verbose' => array( + 'type' => 'integer', + 'default' => PEAR_CONFIG_DEFAULT_VERBOSE, + 'doc' => 'verbosity level +0: really quiet +1: somewhat quiet +2: verbose +3: debug', + 'prompt' => 'Debug Log Level', + 'group' => 'Advanced', + ), + 'preferred_state' => array( + 'type' => 'set', + 'default' => PEAR_CONFIG_DEFAULT_PREFERRED_STATE, + 'doc' => 'the installer will prefer releases with this state when installing packages without a version or state specified', + 'valid_set' => array( + 'stable', 'beta', 'alpha', 'devel', 'snapshot'), + 'prompt' => 'Preferred Package State', + 'group' => 'Advanced', + ), + 'umask' => array( + 'type' => 'mask', + 'default' => PEAR_CONFIG_DEFAULT_UMASK, + 'doc' => 'umask used when creating files (Unix-like systems only)', + 'prompt' => 'Unix file mask', + 'group' => 'Advanced', + ), + 'cache_ttl' => array( + 'type' => 'integer', + 'default' => PEAR_CONFIG_DEFAULT_CACHE_TTL, + 'doc' => 'amount of secs where the local cache is used and not updated', + 'prompt' => 'Cache TimeToLive', + 'group' => 'Advanced', + ), + 'sig_type' => array( + 'type' => 'set', + 'default' => PEAR_CONFIG_DEFAULT_SIG_TYPE, + 'doc' => 'which package signature mechanism to use', + 'valid_set' => array('gpg'), + 'prompt' => 'Package Signature Type', + 'group' => 'Maintainers', + ), + 'sig_bin' => array( + 'type' => 'string', + 'default' => PEAR_CONFIG_DEFAULT_SIG_BIN, + 'doc' => 'which package signature mechanism to use', + 'prompt' => 'Signature Handling Program', + 'group' => 'Maintainers', + ), + 'sig_keyid' => array( + 'type' => 'string', + 'default' => '', + 'doc' => 'which key to use for signing with', + 'prompt' => 'Signature Key Id', + 'group' => 'Maintainers', + ), + 'sig_keydir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_SIG_KEYDIR, + 'doc' => 'directory where signature keys are located', + 'prompt' => 'Signature Key Directory', + 'group' => 'Maintainers', + ), + // __channels is reserved - used for channel-specific configuration + ); + + /** + * Constructor. + * + * @param string file to read user-defined options from + * @param string file to read system-wide defaults from + * @param bool determines whether a registry object "follows" + * the value of php_dir (is automatically created + * and moved when php_dir is changed) + * @param bool if true, fails if configuration files cannot be loaded + * + * @access public + * + * @see PEAR_Config::singleton + */ + function PEAR_Config($user_file = '', $system_file = '', $ftp_file = false, + $strict = true) + { + $this->PEAR(); + PEAR_Installer_Role::initializeConfig($this); + $sl = DIRECTORY_SEPARATOR; + if (empty($user_file)) { + if (OS_WINDOWS) { + $user_file = PEAR_CONFIG_SYSCONFDIR . $sl . 'pear.ini'; + } else { + $user_file = getenv('HOME') . $sl . '.pearrc'; + } + } + + if (empty($system_file)) { + $system_file = PEAR_CONFIG_SYSCONFDIR . $sl; + if (OS_WINDOWS) { + $system_file .= 'pearsys.ini'; + } else { + $system_file .= 'pear.conf'; + } + } + + $this->layers = array_keys($this->configuration); + $this->files['user'] = $user_file; + $this->files['system'] = $system_file; + if ($user_file && file_exists($user_file)) { + $this->pushErrorHandling(PEAR_ERROR_RETURN); + $this->readConfigFile($user_file, 'user', $strict); + $this->popErrorHandling(); + if ($this->_errorsFound > 0) { + return; + } + } + + if ($system_file && @file_exists($system_file)) { + $this->mergeConfigFile($system_file, false, 'system', $strict); + if ($this->_errorsFound > 0) { + return; + } + + } + + if (!$ftp_file) { + $ftp_file = $this->get('remote_config'); + } + + if ($ftp_file && defined('PEAR_REMOTEINSTALL_OK')) { + $this->readFTPConfigFile($ftp_file); + } + + foreach ($this->configuration_info as $key => $info) { + $this->configuration['default'][$key] = $info['default']; + } + + $this->_registry['default'] = &new PEAR_Registry($this->configuration['default']['php_dir']); + $this->_registry['default']->setConfig($this, false); + $this->_regInitialized['default'] = false; + //$GLOBALS['_PEAR_Config_instance'] = &$this; + } + + /** + * Return the default locations of user and system configuration files + * @static + */ + function getDefaultConfigFiles() + { + $sl = DIRECTORY_SEPARATOR; + if (OS_WINDOWS) { + return array( + 'user' => PEAR_CONFIG_SYSCONFDIR . $sl . 'pear.ini', + 'system' => PEAR_CONFIG_SYSCONFDIR . $sl . 'pearsys.ini' + ); + } + + return array( + 'user' => getenv('HOME') . $sl . '.pearrc', + 'system' => PEAR_CONFIG_SYSCONFDIR . $sl . 'pear.conf' + ); + } + + /** + * Static singleton method. If you want to keep only one instance + * of this class in use, this method will give you a reference to + * the last created PEAR_Config object if one exists, or create a + * new object. + * + * @param string (optional) file to read user-defined options from + * @param string (optional) file to read system-wide defaults from + * + * @return object an existing or new PEAR_Config instance + * + * @access public + * + * @see PEAR_Config::PEAR_Config + */ + function &singleton($user_file = '', $system_file = '', $strict = true) + { + if (is_object($GLOBALS['_PEAR_Config_instance'])) { + return $GLOBALS['_PEAR_Config_instance']; + } + + $t_conf = &new PEAR_Config($user_file, $system_file, false, $strict); + if ($t_conf->_errorsFound > 0) { + return $t_conf->lastError; + } + + $GLOBALS['_PEAR_Config_instance'] = &$t_conf; + return $GLOBALS['_PEAR_Config_instance']; + } + + /** + * Determine whether any configuration files have been detected, and whether a + * registry object can be retrieved from this configuration. + * @return bool + * @since PEAR 1.4.0a1 + */ + function validConfiguration() + { + if ($this->isDefinedLayer('user') || $this->isDefinedLayer('system')) { + return true; + } + + return false; + } + + /** + * Reads configuration data from a file. All existing values in + * the config layer are discarded and replaced with data from the + * file. + * @param string file to read from, if NULL or not specified, the + * last-used file for the same layer (second param) is used + * @param string config layer to insert data into ('user' or 'system') + * @return bool TRUE on success or a PEAR error on failure + */ + function readConfigFile($file = null, $layer = 'user', $strict = true) + { + if (empty($this->files[$layer])) { + return $this->raiseError("unknown config layer `$layer'"); + } + + if ($file === null) { + $file = $this->files[$layer]; + } + + $data = $this->_readConfigDataFrom($file); + if (PEAR::isError($data)) { + if (!$strict) { + return true; + } + + $this->_errorsFound++; + $this->lastError = $data; + + return $data; + } + + $this->files[$layer] = $file; + $this->_decodeInput($data); + $this->configuration[$layer] = $data; + $this->_setupChannels(); + if (!$this->_noRegistry && ($phpdir = $this->get('php_dir', $layer, 'pear.php.net'))) { + $this->_registry[$layer] = &new PEAR_Registry($phpdir); + $this->_registry[$layer]->setConfig($this, false); + $this->_regInitialized[$layer] = false; + } else { + unset($this->_registry[$layer]); + } + return true; + } + + /** + * @param string url to the remote config file, like ftp://www.example.com/pear/config.ini + * @return true|PEAR_Error + */ + function readFTPConfigFile($path) + { + do { // poor man's try + if (!class_exists('PEAR_FTP')) { + if (!class_exists('PEAR_Common')) { + require_once 'PEAR/Common.php'; + } + if (PEAR_Common::isIncludeable('PEAR/FTP.php')) { + require_once 'PEAR/FTP.php'; + } + } + + if (!class_exists('PEAR_FTP')) { + return PEAR::raiseError('PEAR_RemoteInstaller must be installed to use remote config'); + } + + $this->_ftp = &new PEAR_FTP; + $this->_ftp->pushErrorHandling(PEAR_ERROR_RETURN); + $e = $this->_ftp->init($path); + if (PEAR::isError($e)) { + $this->_ftp->popErrorHandling(); + return $e; + } + + $tmp = System::mktemp('-d'); + PEAR_Common::addTempFile($tmp); + $e = $this->_ftp->get(basename($path), $tmp . DIRECTORY_SEPARATOR . + 'pear.ini', false, FTP_BINARY); + if (PEAR::isError($e)) { + $this->_ftp->popErrorHandling(); + return $e; + } + + PEAR_Common::addTempFile($tmp . DIRECTORY_SEPARATOR . 'pear.ini'); + $this->_ftp->disconnect(); + $this->_ftp->popErrorHandling(); + $this->files['ftp'] = $tmp . DIRECTORY_SEPARATOR . 'pear.ini'; + $e = $this->readConfigFile(null, 'ftp'); + if (PEAR::isError($e)) { + return $e; + } + + $fail = array(); + foreach ($this->configuration_info as $key => $val) { + if (in_array($this->getGroup($key), + array('File Locations', 'File Locations (Advanced)')) && + $this->getType($key) == 'directory') { + // any directory configs must be set for this to work + if (!isset($this->configuration['ftp'][$key])) { + $fail[] = $key; + } + } + } + + if (!count($fail)) { + return true; + } + + $fail = '"' . implode('", "', $fail) . '"'; + unset($this->files['ftp']); + unset($this->configuration['ftp']); + return PEAR::raiseError('ERROR: Ftp configuration file must set all ' . + 'directory configuration variables. These variables were not set: ' . + $fail); + } while (false); // poor man's catch + unset($this->files['ftp']); + return PEAR::raiseError('no remote host specified'); + } + + /** + * Reads the existing configurations and creates the _channels array from it + */ + function _setupChannels() + { + $set = array_flip(array_values($this->_channels)); + foreach ($this->configuration as $layer => $data) { + $i = 1000; + if (isset($data['__channels']) && is_array($data['__channels'])) { + foreach ($data['__channels'] as $channel => $info) { + $set[$channel] = $i++; + } + } + } + $this->_channels = array_values(array_flip($set)); + $this->setChannels($this->_channels); + } + + function deleteChannel($channel) + { + $ch = strtolower($channel); + foreach ($this->configuration as $layer => $data) { + if (isset($data['__channels']) && isset($data['__channels'][$ch])) { + unset($this->configuration[$layer]['__channels'][$ch]); + } + } + + $this->_channels = array_flip($this->_channels); + unset($this->_channels[$ch]); + $this->_channels = array_flip($this->_channels); + } + + /** + * Merges data into a config layer from a file. Does the same + * thing as readConfigFile, except it does not replace all + * existing values in the config layer. + * @param string file to read from + * @param bool whether to overwrite existing data (default TRUE) + * @param string config layer to insert data into ('user' or 'system') + * @param string if true, errors are returned if file opening fails + * @return bool TRUE on success or a PEAR error on failure + */ + function mergeConfigFile($file, $override = true, $layer = 'user', $strict = true) + { + if (empty($this->files[$layer])) { + return $this->raiseError("unknown config layer `$layer'"); + } + + if ($file === null) { + $file = $this->files[$layer]; + } + + $data = $this->_readConfigDataFrom($file); + if (PEAR::isError($data)) { + if (!$strict) { + return true; + } + + $this->_errorsFound++; + $this->lastError = $data; + + return $data; + } + + $this->_decodeInput($data); + if ($override) { + $this->configuration[$layer] = + PEAR_Config::arrayMergeRecursive($this->configuration[$layer], $data); + } else { + $this->configuration[$layer] = + PEAR_Config::arrayMergeRecursive($data, $this->configuration[$layer]); + } + + $this->_setupChannels(); + if (!$this->_noRegistry && ($phpdir = $this->get('php_dir', $layer, 'pear.php.net'))) { + $this->_registry[$layer] = &new PEAR_Registry($phpdir); + $this->_registry[$layer]->setConfig($this, false); + $this->_regInitialized[$layer] = false; + } else { + unset($this->_registry[$layer]); + } + return true; + } + + /** + * @param array + * @param array + * @return array + * @static + */ + function arrayMergeRecursive($arr2, $arr1) + { + $ret = array(); + foreach ($arr2 as $key => $data) { + if (!isset($arr1[$key])) { + $ret[$key] = $data; + unset($arr1[$key]); + continue; + } + if (is_array($data)) { + if (!is_array($arr1[$key])) { + $ret[$key] = $arr1[$key]; + unset($arr1[$key]); + continue; + } + $ret[$key] = PEAR_Config::arrayMergeRecursive($arr1[$key], $arr2[$key]); + unset($arr1[$key]); + } + } + + return array_merge($ret, $arr1); + } + + /** + * Writes data into a config layer from a file. + * + * @param string|null file to read from, or null for default + * @param string config layer to insert data into ('user' or + * 'system') + * @param string|null data to write to config file or null for internal data [DEPRECATED] + * @return bool TRUE on success or a PEAR error on failure + */ + function writeConfigFile($file = null, $layer = 'user', $data = null) + { + $this->_lazyChannelSetup($layer); + if ($layer == 'both' || $layer == 'all') { + foreach ($this->files as $type => $file) { + $err = $this->writeConfigFile($file, $type, $data); + if (PEAR::isError($err)) { + return $err; + } + } + return true; + } + + if (empty($this->files[$layer])) { + return $this->raiseError("unknown config file type `$layer'"); + } + + if ($file === null) { + $file = $this->files[$layer]; + } + + $data = ($data === null) ? $this->configuration[$layer] : $data; + $this->_encodeOutput($data); + $opt = array('-p', dirname($file)); + if (!@System::mkDir($opt)) { + return $this->raiseError("could not create directory: " . dirname($file)); + } + + if (file_exists($file) && is_file($file) && !is_writeable($file)) { + return $this->raiseError("no write access to $file!"); + } + + $fp = @fopen($file, "w"); + if (!$fp) { + return $this->raiseError("PEAR_Config::writeConfigFile fopen('$file','w') failed ($php_errormsg)"); + } + + $contents = "#PEAR_Config 0.9\n" . serialize($data); + if (!@fwrite($fp, $contents)) { + return $this->raiseError("PEAR_Config::writeConfigFile: fwrite failed ($php_errormsg)"); + } + return true; + } + + /** + * Reads configuration data from a file and returns the parsed data + * in an array. + * + * @param string file to read from + * @return array configuration data or a PEAR error on failure + * @access private + */ + function _readConfigDataFrom($file) + { + $fp = false; + if (file_exists($file)) { + $fp = @fopen($file, "r"); + } + + if (!$fp) { + return $this->raiseError("PEAR_Config::readConfigFile fopen('$file','r') failed"); + } + + $size = filesize($file); + $rt = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + fclose($fp); + $contents = file_get_contents($file); + if (empty($contents)) { + return $this->raiseError('Configuration file "' . $file . '" is empty'); + } + + set_magic_quotes_runtime($rt); + + $version = false; + if (preg_match('/^#PEAR_Config\s+(\S+)\s+/si', $contents, $matches)) { + $version = $matches[1]; + $contents = substr($contents, strlen($matches[0])); + } else { + // Museum config file + if (substr($contents,0,2) == 'a:') { + $version = '0.1'; + } + } + + if ($version && version_compare("$version", '1', '<')) { + // no '@', it is possible that unserialize + // raises a notice but it seems to block IO to + // STDOUT if a '@' is used and a notice is raise + $data = unserialize($contents); + + if (!is_array($data) && !$data) { + if ($contents == serialize(false)) { + $data = array(); + } else { + $err = $this->raiseError("PEAR_Config: bad data in $file"); + return $err; + } + } + if (!is_array($data)) { + if (strlen(trim($contents)) > 0) { + $error = "PEAR_Config: bad data in $file"; + $err = $this->raiseError($error); + return $err; + } + + $data = array(); + } + // add parsing of newer formats here... + } else { + $err = $this->raiseError("$file: unknown version `$version'"); + return $err; + } + + return $data; + } + + /** + * Gets the file used for storing the config for a layer + * + * @param string $layer 'user' or 'system' + */ + function getConfFile($layer) + { + return $this->files[$layer]; + } + + /** + * @param string Configuration class name, used for detecting duplicate calls + * @param array information on a role as parsed from its xml file + * @return true|PEAR_Error + * @access private + */ + function _addConfigVars($class, $vars) + { + static $called = array(); + if (isset($called[$class])) { + return; + } + + $called[$class] = 1; + if (count($vars) > 3) { + return $this->raiseError('Roles can only define 3 new config variables or less'); + } + + foreach ($vars as $name => $var) { + if (!is_array($var)) { + return $this->raiseError('Configuration information must be an array'); + } + + if (!isset($var['type'])) { + return $this->raiseError('Configuration information must contain a type'); + } elseif (!in_array($var['type'], + array('string', 'mask', 'password', 'directory', 'file', 'set'))) { + return $this->raiseError( + 'Configuration type must be one of directory, file, string, ' . + 'mask, set, or password'); + } + if (!isset($var['default'])) { + return $this->raiseError( + 'Configuration information must contain a default value ("default" index)'); + } + + if (is_array($var['default'])) { + $real_default = ''; + foreach ($var['default'] as $config_var => $val) { + if (strpos($config_var, 'text') === 0) { + $real_default .= $val; + } elseif (strpos($config_var, 'constant') === 0) { + if (!defined($val)) { + return $this->raiseError( + 'Unknown constant "' . $val . '" requested in ' . + 'default value for configuration variable "' . + $name . '"'); + } + + $real_default .= constant($val); + } elseif (isset($this->configuration_info[$config_var])) { + $real_default .= + $this->configuration_info[$config_var]['default']; + } else { + return $this->raiseError( + 'Unknown request for "' . $config_var . '" value in ' . + 'default value for configuration variable "' . + $name . '"'); + } + } + $var['default'] = $real_default; + } + + if ($var['type'] == 'integer') { + $var['default'] = (integer) $var['default']; + } + + if (!isset($var['doc'])) { + return $this->raiseError( + 'Configuration information must contain a summary ("doc" index)'); + } + + if (!isset($var['prompt'])) { + return $this->raiseError( + 'Configuration information must contain a simple prompt ("prompt" index)'); + } + + if (!isset($var['group'])) { + return $this->raiseError( + 'Configuration information must contain a simple group ("group" index)'); + } + + if (isset($this->configuration_info[$name])) { + return $this->raiseError('Configuration variable "' . $name . + '" already exists'); + } + + $this->configuration_info[$name] = $var; + // fix bug #7351: setting custom config variable in a channel fails + $this->_channelConfigInfo[] = $name; + } + + return true; + } + + /** + * Encodes/scrambles configuration data before writing to files. + * Currently, 'password' values will be base64-encoded as to avoid + * that people spot cleartext passwords by accident. + * + * @param array (reference) array to encode values in + * @return bool TRUE on success + * @access private + */ + function _encodeOutput(&$data) + { + foreach ($data as $key => $value) { + if ($key == '__channels') { + foreach ($data['__channels'] as $channel => $blah) { + $this->_encodeOutput($data['__channels'][$channel]); + } + } + + if (!isset($this->configuration_info[$key])) { + continue; + } + + $type = $this->configuration_info[$key]['type']; + switch ($type) { + // we base64-encode passwords so they are at least + // not shown in plain by accident + case 'password': { + $data[$key] = base64_encode($data[$key]); + break; + } + case 'mask': { + $data[$key] = octdec($data[$key]); + break; + } + } + } + + return true; + } + + /** + * Decodes/unscrambles configuration data after reading from files. + * + * @param array (reference) array to encode values in + * @return bool TRUE on success + * @access private + * + * @see PEAR_Config::_encodeOutput + */ + function _decodeInput(&$data) + { + if (!is_array($data)) { + return true; + } + + foreach ($data as $key => $value) { + if ($key == '__channels') { + foreach ($data['__channels'] as $channel => $blah) { + $this->_decodeInput($data['__channels'][$channel]); + } + } + + if (!isset($this->configuration_info[$key])) { + continue; + } + + $type = $this->configuration_info[$key]['type']; + switch ($type) { + case 'password': { + $data[$key] = base64_decode($data[$key]); + break; + } + case 'mask': { + $data[$key] = decoct($data[$key]); + break; + } + } + } + + return true; + } + + /** + * Retrieve the default channel. + * + * On startup, channels are not initialized, so if the default channel is not + * pear.php.net, then initialize the config. + * @param string registry layer + * @return string|false + */ + function getDefaultChannel($layer = null) + { + $ret = false; + if ($layer === null) { + foreach ($this->layers as $layer) { + if (isset($this->configuration[$layer]['default_channel'])) { + $ret = $this->configuration[$layer]['default_channel']; + break; + } + } + } elseif (isset($this->configuration[$layer]['default_channel'])) { + $ret = $this->configuration[$layer]['default_channel']; + } + + if ($ret == 'pear.php.net' && defined('PEAR_RUNTYPE') && PEAR_RUNTYPE == 'pecl') { + $ret = 'pecl.php.net'; + } + + if ($ret) { + if ($ret != 'pear.php.net') { + $this->_lazyChannelSetup(); + } + + return $ret; + } + + return PEAR_CONFIG_DEFAULT_CHANNEL; + } + + /** + * Returns a configuration value, prioritizing layers as per the + * layers property. + * + * @param string config key + * @return mixed the config value, or NULL if not found + * @access public + */ + function get($key, $layer = null, $channel = false) + { + if (!isset($this->configuration_info[$key])) { + return null; + } + + if ($key == '__channels') { + return null; + } + + if ($key == 'default_channel') { + return $this->getDefaultChannel($layer); + } + + if (!$channel) { + $channel = $this->getDefaultChannel(); + } elseif ($channel != 'pear.php.net') { + $this->_lazyChannelSetup(); + } + $channel = strtolower($channel); + + $test = (in_array($key, $this->_channelConfigInfo)) ? + $this->_getChannelValue($key, $layer, $channel) : + null; + if ($test !== null) { + if ($this->_installRoot) { + if (in_array($this->getGroup($key), + array('File Locations', 'File Locations (Advanced)')) && + $this->getType($key) == 'directory') { + return $this->_prependPath($test, $this->_installRoot); + } + } + return $test; + } + + if ($layer === null) { + foreach ($this->layers as $layer) { + if (isset($this->configuration[$layer][$key])) { + $test = $this->configuration[$layer][$key]; + if ($this->_installRoot) { + if (in_array($this->getGroup($key), + array('File Locations', 'File Locations (Advanced)')) && + $this->getType($key) == 'directory') { + return $this->_prependPath($test, $this->_installRoot); + } + } + + if ($key == 'preferred_mirror') { + $reg = &$this->getRegistry(); + if (is_object($reg)) { + $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } + + if (!$chan->getMirror($test) && $chan->getName() != $test) { + return $channel; // mirror does not exist + } + } + } + return $test; + } + } + } elseif (isset($this->configuration[$layer][$key])) { + $test = $this->configuration[$layer][$key]; + if ($this->_installRoot) { + if (in_array($this->getGroup($key), + array('File Locations', 'File Locations (Advanced)')) && + $this->getType($key) == 'directory') { + return $this->_prependPath($test, $this->_installRoot); + } + } + + if ($key == 'preferred_mirror') { + $reg = &$this->getRegistry(); + if (is_object($reg)) { + $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } + + if (!$chan->getMirror($test) && $chan->getName() != $test) { + return $channel; // mirror does not exist + } + } + } + + return $test; + } + + return null; + } + + /** + * Returns a channel-specific configuration value, prioritizing layers as per the + * layers property. + * + * @param string config key + * @return mixed the config value, or NULL if not found + * @access private + */ + function _getChannelValue($key, $layer, $channel) + { + if ($key == '__channels' || $channel == 'pear.php.net') { + return null; + } + + $ret = null; + if ($layer === null) { + foreach ($this->layers as $ilayer) { + if (isset($this->configuration[$ilayer]['__channels'][$channel][$key])) { + $ret = $this->configuration[$ilayer]['__channels'][$channel][$key]; + break; + } + } + } elseif (isset($this->configuration[$layer]['__channels'][$channel][$key])) { + $ret = $this->configuration[$layer]['__channels'][$channel][$key]; + } + + if ($key != 'preferred_mirror') { + return $ret; + } + + + if ($ret !== null) { + $reg = &$this->getRegistry($layer); + if (is_object($reg)) { + $chan = &$reg->getChannel($channel); + if (PEAR::isError($chan)) { + return $channel; + } + + if (!$chan->getMirror($ret) && $chan->getName() != $ret) { + return $channel; // mirror does not exist + } + } + + return $ret; + } + + if ($channel != $this->getDefaultChannel($layer)) { + return $channel; // we must use the channel name as the preferred mirror + // if the user has not chosen an alternate + } + + return $this->getDefaultChannel($layer); + } + + /** + * Set a config value in a specific layer (defaults to 'user'). + * Enforces the types defined in the configuration_info array. An + * integer config variable will be cast to int, and a set config + * variable will be validated against its legal values. + * + * @param string config key + * @param string config value + * @param string (optional) config layer + * @param string channel to set this value for, or null for global value + * @return bool TRUE on success, FALSE on failure + */ + function set($key, $value, $layer = 'user', $channel = false) + { + if ($key == '__channels') { + return false; + } + + if (!isset($this->configuration[$layer])) { + return false; + } + + if ($key == 'default_channel') { + // can only set this value globally + $channel = 'pear.php.net'; + if ($value != 'pear.php.net') { + $this->_lazyChannelSetup($layer); + } + } + + if ($key == 'preferred_mirror') { + if ($channel == '__uri') { + return false; // can't set the __uri pseudo-channel's mirror + } + + $reg = &$this->getRegistry($layer); + if (is_object($reg)) { + $chan = &$reg->getChannel($channel ? $channel : 'pear.php.net'); + if (PEAR::isError($chan)) { + return false; + } + + if (!$chan->getMirror($value) && $chan->getName() != $value) { + return false; // mirror does not exist + } + } + } + + if (!isset($this->configuration_info[$key])) { + return false; + } + + extract($this->configuration_info[$key]); + switch ($type) { + case 'integer': + $value = (int)$value; + break; + case 'set': { + // If a valid_set is specified, require the value to + // be in the set. If there is no valid_set, accept + // any value. + if ($valid_set) { + reset($valid_set); + if ((key($valid_set) === 0 && !in_array($value, $valid_set)) || + (key($valid_set) !== 0 && empty($valid_set[$value]))) + { + return false; + } + } + break; + } + } + + if (!$channel) { + $channel = $this->get('default_channel', null, 'pear.php.net'); + } + + if (!in_array($channel, $this->_channels)) { + $this->_lazyChannelSetup($layer); + $reg = &$this->getRegistry($layer); + if ($reg) { + $channel = $reg->channelName($channel); + } + + if (!in_array($channel, $this->_channels)) { + return false; + } + } + + if ($channel != 'pear.php.net') { + if (in_array($key, $this->_channelConfigInfo)) { + $this->configuration[$layer]['__channels'][$channel][$key] = $value; + return true; + } + + return false; + } + + if ($key == 'default_channel') { + if (!isset($reg)) { + $reg = &$this->getRegistry($layer); + if (!$reg) { + $reg = &$this->getRegistry(); + } + } + + if ($reg) { + $value = $reg->channelName($value); + } + + if (!$value) { + return false; + } + } + + $this->configuration[$layer][$key] = $value; + if ($key == 'php_dir' && !$this->_noRegistry) { + if (!isset($this->_registry[$layer]) || + $value != $this->_registry[$layer]->install_dir) { + $this->_registry[$layer] = &new PEAR_Registry($value); + $this->_regInitialized[$layer] = false; + $this->_registry[$layer]->setConfig($this, false); + } + } + + return true; + } + + function _lazyChannelSetup($uselayer = false) + { + if ($this->_noRegistry) { + return; + } + + $merge = false; + foreach ($this->_registry as $layer => $p) { + if ($uselayer && $uselayer != $layer) { + continue; + } + + if (!$this->_regInitialized[$layer]) { + if ($layer == 'default' && isset($this->_registry['user']) || + isset($this->_registry['system'])) { + // only use the default registry if there are no alternatives + continue; + } + + if (!is_object($this->_registry[$layer])) { + if ($phpdir = $this->get('php_dir', $layer, 'pear.php.net')) { + $this->_registry[$layer] = &new PEAR_Registry($phpdir); + $this->_registry[$layer]->setConfig($this, false); + $this->_regInitialized[$layer] = false; + } else { + unset($this->_registry[$layer]); + return; + } + } + + $this->setChannels($this->_registry[$layer]->listChannels(), $merge); + $this->_regInitialized[$layer] = true; + $merge = true; + } + } + } + + /** + * Set the list of channels. + * + * This should be set via a call to {@link PEAR_Registry::listChannels()} + * @param array + * @param bool + * @return bool success of operation + */ + function setChannels($channels, $merge = false) + { + if (!is_array($channels)) { + return false; + } + + if ($merge) { + $this->_channels = array_merge($this->_channels, $channels); + } else { + $this->_channels = $channels; + } + + foreach ($channels as $channel) { + $channel = strtolower($channel); + if ($channel == 'pear.php.net') { + continue; + } + + foreach ($this->layers as $layer) { + if (!isset($this->configuration[$layer]['__channels'])) { + $this->configuration[$layer]['__channels'] = array(); + } + if (!isset($this->configuration[$layer]['__channels'][$channel]) + || !is_array($this->configuration[$layer]['__channels'][$channel])) { + $this->configuration[$layer]['__channels'][$channel] = array(); + } + } + } + + return true; + } + + /** + * Get the type of a config value. + * + * @param string config key + * + * @return string type, one of "string", "integer", "file", + * "directory", "set" or "password". + * + * @access public + * + */ + function getType($key) + { + if (isset($this->configuration_info[$key])) { + return $this->configuration_info[$key]['type']; + } + return false; + } + + /** + * Get the documentation for a config value. + * + * @param string config key + * @return string documentation string + * + * @access public + * + */ + function getDocs($key) + { + if (isset($this->configuration_info[$key])) { + return $this->configuration_info[$key]['doc']; + } + + return false; + } + + /** + * Get the short documentation for a config value. + * + * @param string config key + * @return string short documentation string + * + * @access public + * + */ + function getPrompt($key) + { + if (isset($this->configuration_info[$key])) { + return $this->configuration_info[$key]['prompt']; + } + + return false; + } + + /** + * Get the parameter group for a config key. + * + * @param string config key + * @return string parameter group + * + * @access public + * + */ + function getGroup($key) + { + if (isset($this->configuration_info[$key])) { + return $this->configuration_info[$key]['group']; + } + + return false; + } + + /** + * Get the list of parameter groups. + * + * @return array list of parameter groups + * + * @access public + * + */ + function getGroups() + { + $tmp = array(); + foreach ($this->configuration_info as $key => $info) { + $tmp[$info['group']] = 1; + } + + return array_keys($tmp); + } + + /** + * Get the list of the parameters in a group. + * + * @param string $group parameter group + * @return array list of parameters in $group + * + * @access public + * + */ + function getGroupKeys($group) + { + $keys = array(); + foreach ($this->configuration_info as $key => $info) { + if ($info['group'] == $group) { + $keys[] = $key; + } + } + + return $keys; + } + + /** + * Get the list of allowed set values for a config value. Returns + * NULL for config values that are not sets. + * + * @param string config key + * @return array enumerated array of set values, or NULL if the + * config key is unknown or not a set + * + * @access public + * + */ + function getSetValues($key) + { + if (isset($this->configuration_info[$key]) && + isset($this->configuration_info[$key]['type']) && + $this->configuration_info[$key]['type'] == 'set') + { + $valid_set = $this->configuration_info[$key]['valid_set']; + reset($valid_set); + if (key($valid_set) === 0) { + return $valid_set; + } + + return array_keys($valid_set); + } + + return null; + } + + /** + * Get all the current config keys. + * + * @return array simple array of config keys + * + * @access public + */ + function getKeys() + { + $keys = array(); + foreach ($this->layers as $layer) { + $test = $this->configuration[$layer]; + if (isset($test['__channels'])) { + foreach ($test['__channels'] as $channel => $configs) { + $keys = array_merge($keys, $configs); + } + } + + unset($test['__channels']); + $keys = array_merge($keys, $test); + + } + return array_keys($keys); + } + + /** + * Remove the a config key from a specific config layer. + * + * @param string config key + * @param string (optional) config layer + * @param string (optional) channel (defaults to default channel) + * @return bool TRUE on success, FALSE on failure + * + * @access public + */ + function remove($key, $layer = 'user', $channel = null) + { + if ($channel === null) { + $channel = $this->getDefaultChannel(); + } + + if ($channel !== 'pear.php.net') { + if (isset($this->configuration[$layer]['__channels'][$channel][$key])) { + unset($this->configuration[$layer]['__channels'][$channel][$key]); + return true; + } + } + + if (isset($this->configuration[$layer][$key])) { + unset($this->configuration[$layer][$key]); + return true; + } + + return false; + } + + /** + * Temporarily remove an entire config layer. USE WITH CARE! + * + * @param string config key + * @param string (optional) config layer + * @return bool TRUE on success, FALSE on failure + * + * @access public + */ + function removeLayer($layer) + { + if (isset($this->configuration[$layer])) { + $this->configuration[$layer] = array(); + return true; + } + + return false; + } + + /** + * Stores configuration data in a layer. + * + * @param string config layer to store + * @return bool TRUE on success, or PEAR error on failure + * + * @access public + */ + function store($layer = 'user', $data = null) + { + return $this->writeConfigFile(null, $layer, $data); + } + + /** + * Tells what config layer that gets to define a key. + * + * @param string config key + * @param boolean return the defining channel + * + * @return string|array the config layer, or an empty string if not found. + * + * if $returnchannel, the return is an array array('layer' => layername, + * 'channel' => channelname), or an empty string if not found + * + * @access public + */ + function definedBy($key, $returnchannel = false) + { + foreach ($this->layers as $layer) { + $channel = $this->getDefaultChannel(); + if ($channel !== 'pear.php.net') { + if (isset($this->configuration[$layer]['__channels'][$channel][$key])) { + if ($returnchannel) { + return array('layer' => $layer, 'channel' => $channel); + } + return $layer; + } + } + + if (isset($this->configuration[$layer][$key])) { + if ($returnchannel) { + return array('layer' => $layer, 'channel' => 'pear.php.net'); + } + return $layer; + } + } + + return ''; + } + + /** + * Tells whether a given key exists as a config value. + * + * @param string config key + * @return bool whether <config key> exists in this object + * + * @access public + */ + function isDefined($key) + { + foreach ($this->layers as $layer) { + if (isset($this->configuration[$layer][$key])) { + return true; + } + } + + return false; + } + + /** + * Tells whether a given config layer exists. + * + * @param string config layer + * @return bool whether <config layer> exists in this object + * + * @access public + */ + function isDefinedLayer($layer) + { + return isset($this->configuration[$layer]); + } + + /** + * Returns the layers defined (except the 'default' one) + * + * @return array of the defined layers + */ + function getLayers() + { + $cf = $this->configuration; + unset($cf['default']); + return array_keys($cf); + } + + function apiVersion() + { + return '1.1'; + } + + /** + * @return PEAR_Registry + */ + function &getRegistry($use = null) + { + $layer = $use === null ? 'user' : $use; + if (isset($this->_registry[$layer])) { + return $this->_registry[$layer]; + } elseif ($use === null && isset($this->_registry['system'])) { + return $this->_registry['system']; + } elseif ($use === null && isset($this->_registry['default'])) { + return $this->_registry['default']; + } elseif ($use) { + $a = false; + return $a; + } + + // only go here if null was passed in + echo "CRITICAL ERROR: Registry could not be initialized from any value"; + exit(1); + } + + /** + * This is to allow customization like the use of installroot + * @param PEAR_Registry + * @return bool + */ + function setRegistry(&$reg, $layer = 'user') + { + if ($this->_noRegistry) { + return false; + } + + if (!in_array($layer, array('user', 'system'))) { + return false; + } + + $this->_registry[$layer] = &$reg; + if (is_object($reg)) { + $this->_registry[$layer]->setConfig($this, false); + } + + return true; + } + + function noRegistry() + { + $this->_noRegistry = true; + } + + /** + * @return PEAR_REST + */ + function &getREST($version, $options = array()) + { + $version = str_replace('.', '', $version); + if (!class_exists($class = 'PEAR_REST_' . $version)) { + require_once 'PEAR/REST/' . $version . '.php'; + } + + $remote = &new $class($this, $options); + return $remote; + } + + /** + * The ftp server is set in {@link readFTPConfigFile()}. It exists only if a + * remote configuration file has been specified + * @return PEAR_FTP|false + */ + function &getFTP() + { + if (isset($this->_ftp)) { + return $this->_ftp; + } + + $a = false; + return $a; + } + + function _prependPath($path, $prepend) + { + if (strlen($prepend) > 0) { + if (OS_WINDOWS && preg_match('/^[a-z]:/i', $path)) { + if (preg_match('/^[a-z]:/i', $prepend)) { + $prepend = substr($prepend, 2); + } elseif ($prepend{0} != '\\') { + $prepend = "\\$prepend"; + } + $path = substr($path, 0, 2) . $prepend . substr($path, 2); + } else { + $path = $prepend . $path; + } + } + return $path; + } + + /** + * @param string|false installation directory to prepend to all _dir variables, or false to + * disable + */ + function setInstallRoot($root) + { + if (substr($root, -1) == DIRECTORY_SEPARATOR) { + $root = substr($root, 0, -1); + } + $old = $this->_installRoot; + $this->_installRoot = $root; + if (($old != $root) && !$this->_noRegistry) { + foreach (array_keys($this->_registry) as $layer) { + if ($layer == 'ftp' || !isset($this->_registry[$layer])) { + continue; + } + $this->_registry[$layer] = + &new PEAR_Registry($this->get('php_dir', $layer, 'pear.php.net')); + $this->_registry[$layer]->setConfig($this, false); + $this->_regInitialized[$layer] = false; + } + } + } +} diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Dependency2.php b/vendor/pear-pear.php.net/PEAR/PEAR/Dependency2.php new file mode 100644 index 0000000000000000000000000000000000000000..f3ddeb1cf1b4b5d874b533099348b91d961547dc --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Dependency2.php @@ -0,0 +1,1358 @@ +<?php +/** + * PEAR_Dependency2, advanced dependency validation + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Dependency2.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * Required for the PEAR_VALIDATE_* constants + */ +require_once 'PEAR/Validate.php'; + +/** + * Dependency check for PEAR packages + * + * This class handles both version 1.0 and 2.0 dependencies + * WARNING: *any* changes to this class must be duplicated in the + * test_PEAR_Dependency2 class found in tests/PEAR_Dependency2/setup.php.inc, + * or unit tests will not actually validate the changes + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Dependency2 +{ + /** + * One of the PEAR_VALIDATE_* states + * @see PEAR_VALIDATE_NORMAL + * @var integer + */ + var $_state; + + /** + * Command-line options to install/upgrade/uninstall commands + * @param array + */ + var $_options; + + /** + * @var OS_Guess + */ + var $_os; + + /** + * @var PEAR_Registry + */ + var $_registry; + + /** + * @var PEAR_Config + */ + var $_config; + + /** + * @var PEAR_DependencyDB + */ + var $_dependencydb; + + /** + * Output of PEAR_Registry::parsedPackageName() + * @var array + */ + var $_currentPackage; + + /** + * @param PEAR_Config + * @param array installation options + * @param array format of PEAR_Registry::parsedPackageName() + * @param int installation state (one of PEAR_VALIDATE_*) + */ + function PEAR_Dependency2(&$config, $installoptions, $package, + $state = PEAR_VALIDATE_INSTALLING) + { + $this->_config = &$config; + if (!class_exists('PEAR_DependencyDB')) { + require_once 'PEAR/DependencyDB.php'; + } + + if (isset($installoptions['packagingroot'])) { + // make sure depdb is in the right location + $config->setInstallRoot($installoptions['packagingroot']); + } + + $this->_registry = &$config->getRegistry(); + $this->_dependencydb = &PEAR_DependencyDB::singleton($config); + if (isset($installoptions['packagingroot'])) { + $config->setInstallRoot(false); + } + + $this->_options = $installoptions; + $this->_state = $state; + if (!class_exists('OS_Guess')) { + require_once 'OS/Guess.php'; + } + + $this->_os = new OS_Guess; + $this->_currentPackage = $package; + } + + function _getExtraString($dep) + { + $extra = ' ('; + if (isset($dep['uri'])) { + return ''; + } + + if (isset($dep['recommended'])) { + $extra .= 'recommended version ' . $dep['recommended']; + } else { + if (isset($dep['min'])) { + $extra .= 'version >= ' . $dep['min']; + } + + if (isset($dep['max'])) { + if ($extra != ' (') { + $extra .= ', '; + } + $extra .= 'version <= ' . $dep['max']; + } + + if (isset($dep['exclude'])) { + if (!is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + + if ($extra != ' (') { + $extra .= ', '; + } + + $extra .= 'excluded versions: '; + foreach ($dep['exclude'] as $i => $exclude) { + if ($i) { + $extra .= ', '; + } + $extra .= $exclude; + } + } + } + + $extra .= ')'; + if ($extra == ' ()') { + $extra = ''; + } + + return $extra; + } + + /** + * This makes unit-testing a heck of a lot easier + */ + function getPHP_OS() + { + return PHP_OS; + } + + /** + * This makes unit-testing a heck of a lot easier + */ + function getsysname() + { + return $this->_os->getSysname(); + } + + /** + * Specify a dependency on an OS. Use arch for detailed os/processor information + * + * There are two generic OS dependencies that will be the most common, unix and windows. + * Other options are linux, freebsd, darwin (OS X), sunos, irix, hpux, aix + */ + function validateOsDependency($dep) + { + if ($this->_state != PEAR_VALIDATE_INSTALLING && $this->_state != PEAR_VALIDATE_DOWNLOADING) { + return true; + } + + if ($dep['name'] == '*') { + return true; + } + + $not = isset($dep['conflicts']) ? true : false; + switch (strtolower($dep['name'])) { + case 'windows' : + if ($not) { + if (strtolower(substr($this->getPHP_OS(), 0, 3)) == 'win') { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError("Cannot install %s on Windows"); + } + + return $this->warning("warning: Cannot install %s on Windows"); + } + } else { + if (strtolower(substr($this->getPHP_OS(), 0, 3)) != 'win') { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError("Can only install %s on Windows"); + } + + return $this->warning("warning: Can only install %s on Windows"); + } + } + break; + case 'unix' : + $unices = array('linux', 'freebsd', 'darwin', 'sunos', 'irix', 'hpux', 'aix'); + if ($not) { + if (in_array($this->getSysname(), $unices)) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError("Cannot install %s on any Unix system"); + } + + return $this->warning( "warning: Cannot install %s on any Unix system"); + } + } else { + if (!in_array($this->getSysname(), $unices)) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError("Can only install %s on a Unix system"); + } + + return $this->warning("warning: Can only install %s on a Unix system"); + } + } + break; + default : + if ($not) { + if (strtolower($dep['name']) == strtolower($this->getSysname())) { + if (!isset($this->_options['nodeps']) && + !isset($this->_options['force'])) { + return $this->raiseError('Cannot install %s on ' . $dep['name'] . + ' operating system'); + } + + return $this->warning('warning: Cannot install %s on ' . + $dep['name'] . ' operating system'); + } + } else { + if (strtolower($dep['name']) != strtolower($this->getSysname())) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('Cannot install %s on ' . + $this->getSysname() . + ' operating system, can only install on ' . $dep['name']); + } + + return $this->warning('warning: Cannot install %s on ' . + $this->getSysname() . + ' operating system, can only install on ' . $dep['name']); + } + } + } + return true; + } + + /** + * This makes unit-testing a heck of a lot easier + */ + function matchSignature($pattern) + { + return $this->_os->matchSignature($pattern); + } + + /** + * Specify a complex dependency on an OS/processor/kernel version, + * Use OS for simple operating system dependency. + * + * This is the only dependency that accepts an eregable pattern. The pattern + * will be matched against the php_uname() output parsed by OS_Guess + */ + function validateArchDependency($dep) + { + if ($this->_state != PEAR_VALIDATE_INSTALLING) { + return true; + } + + $not = isset($dep['conflicts']) ? true : false; + if (!$this->matchSignature($dep['pattern'])) { + if (!$not) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s Architecture dependency failed, does not ' . + 'match "' . $dep['pattern'] . '"'); + } + + return $this->warning('warning: %s Architecture dependency failed, does ' . + 'not match "' . $dep['pattern'] . '"'); + } + + return true; + } + + if ($not) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s Architecture dependency failed, required "' . + $dep['pattern'] . '"'); + } + + return $this->warning('warning: %s Architecture dependency failed, ' . + 'required "' . $dep['pattern'] . '"'); + } + + return true; + } + + /** + * This makes unit-testing a heck of a lot easier + */ + function extension_loaded($name) + { + return extension_loaded($name); + } + + /** + * This makes unit-testing a heck of a lot easier + */ + function phpversion($name = null) + { + if ($name !== null) { + return phpversion($name); + } + + return phpversion(); + } + + function validateExtensionDependency($dep, $required = true) + { + if ($this->_state != PEAR_VALIDATE_INSTALLING && + $this->_state != PEAR_VALIDATE_DOWNLOADING) { + return true; + } + + $loaded = $this->extension_loaded($dep['name']); + $extra = $this->_getExtraString($dep); + if (isset($dep['exclude'])) { + if (!is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + } + + if (!isset($dep['min']) && !isset($dep['max']) && + !isset($dep['recommended']) && !isset($dep['exclude']) + ) { + if ($loaded) { + if (isset($dep['conflicts'])) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s conflicts with PHP extension "' . + $dep['name'] . '"' . $extra); + } + + return $this->warning('warning: %s conflicts with PHP extension "' . + $dep['name'] . '"' . $extra); + } + + return true; + } + + if (isset($dep['conflicts'])) { + return true; + } + + if ($required) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires PHP extension "' . + $dep['name'] . '"' . $extra); + } + + return $this->warning('warning: %s requires PHP extension "' . + $dep['name'] . '"' . $extra); + } + + return $this->warning('%s can optionally use PHP extension "' . + $dep['name'] . '"' . $extra); + } + + if (!$loaded) { + if (isset($dep['conflicts'])) { + return true; + } + + if (!$required) { + return $this->warning('%s can optionally use PHP extension "' . + $dep['name'] . '"' . $extra); + } + + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires PHP extension "' . $dep['name'] . + '"' . $extra); + } + + return $this->warning('warning: %s requires PHP extension "' . $dep['name'] . + '"' . $extra); + } + + $version = (string) $this->phpversion($dep['name']); + if (empty($version)) { + $version = '0'; + } + + $fail = false; + if (isset($dep['min']) && !version_compare($version, $dep['min'], '>=')) { + $fail = true; + } + + if (isset($dep['max']) && !version_compare($version, $dep['max'], '<=')) { + $fail = true; + } + + if ($fail && !isset($dep['conflicts'])) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires PHP extension "' . $dep['name'] . + '"' . $extra . ', installed version is ' . $version); + } + + return $this->warning('warning: %s requires PHP extension "' . $dep['name'] . + '"' . $extra . ', installed version is ' . $version); + } elseif ((isset($dep['min']) || isset($dep['max'])) && !$fail && isset($dep['conflicts'])) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s conflicts with PHP extension "' . + $dep['name'] . '"' . $extra . ', installed version is ' . $version); + } + + return $this->warning('warning: %s conflicts with PHP extension "' . + $dep['name'] . '"' . $extra . ', installed version is ' . $version); + } + + if (isset($dep['exclude'])) { + foreach ($dep['exclude'] as $exclude) { + if (version_compare($version, $exclude, '==')) { + if (isset($dep['conflicts'])) { + continue; + } + + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s is not compatible with PHP extension "' . + $dep['name'] . '" version ' . + $exclude); + } + + return $this->warning('warning: %s is not compatible with PHP extension "' . + $dep['name'] . '" version ' . + $exclude); + } elseif (version_compare($version, $exclude, '!=') && isset($dep['conflicts'])) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s conflicts with PHP extension "' . + $dep['name'] . '"' . $extra . ', installed version is ' . $version); + } + + return $this->warning('warning: %s conflicts with PHP extension "' . + $dep['name'] . '"' . $extra . ', installed version is ' . $version); + } + } + } + + if (isset($dep['recommended'])) { + if (version_compare($version, $dep['recommended'], '==')) { + return true; + } + + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s dependency: PHP extension ' . $dep['name'] . + ' version "' . $version . '"' . + ' is not the recommended version "' . $dep['recommended'] . + '", but may be compatible, use --force to install'); + } + + return $this->warning('warning: %s dependency: PHP extension ' . + $dep['name'] . ' version "' . $version . '"' . + ' is not the recommended version "' . $dep['recommended'].'"'); + } + + return true; + } + + function validatePhpDependency($dep) + { + if ($this->_state != PEAR_VALIDATE_INSTALLING && + $this->_state != PEAR_VALIDATE_DOWNLOADING) { + return true; + } + + $version = $this->phpversion(); + $extra = $this->_getExtraString($dep); + if (isset($dep['exclude'])) { + if (!is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + } + + if (isset($dep['min'])) { + if (!version_compare($version, $dep['min'], '>=')) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires PHP' . + $extra . ', installed version is ' . $version); + } + + return $this->warning('warning: %s requires PHP' . + $extra . ', installed version is ' . $version); + } + } + + if (isset($dep['max'])) { + if (!version_compare($version, $dep['max'], '<=')) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires PHP' . + $extra . ', installed version is ' . $version); + } + + return $this->warning('warning: %s requires PHP' . + $extra . ', installed version is ' . $version); + } + } + + if (isset($dep['exclude'])) { + foreach ($dep['exclude'] as $exclude) { + if (version_compare($version, $exclude, '==')) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s is not compatible with PHP version ' . + $exclude); + } + + return $this->warning( + 'warning: %s is not compatible with PHP version ' . + $exclude); + } + } + } + + return true; + } + + /** + * This makes unit-testing a heck of a lot easier + */ + function getPEARVersion() + { + return '1.9.4'; + } + + function validatePearinstallerDependency($dep) + { + $pearversion = $this->getPEARVersion(); + $extra = $this->_getExtraString($dep); + if (isset($dep['exclude'])) { + if (!is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + } + + if (version_compare($pearversion, $dep['min'], '<')) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires PEAR Installer' . $extra . + ', installed version is ' . $pearversion); + } + + return $this->warning('warning: %s requires PEAR Installer' . $extra . + ', installed version is ' . $pearversion); + } + + if (isset($dep['max'])) { + if (version_compare($pearversion, $dep['max'], '>')) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires PEAR Installer' . $extra . + ', installed version is ' . $pearversion); + } + + return $this->warning('warning: %s requires PEAR Installer' . $extra . + ', installed version is ' . $pearversion); + } + } + + if (isset($dep['exclude'])) { + if (!isset($dep['exclude'][0])) { + $dep['exclude'] = array($dep['exclude']); + } + + foreach ($dep['exclude'] as $exclude) { + if (version_compare($exclude, $pearversion, '==')) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s is not compatible with PEAR Installer ' . + 'version ' . $exclude); + } + + return $this->warning('warning: %s is not compatible with PEAR ' . + 'Installer version ' . $exclude); + } + } + } + + return true; + } + + function validateSubpackageDependency($dep, $required, $params) + { + return $this->validatePackageDependency($dep, $required, $params); + } + + /** + * @param array dependency information (2.0 format) + * @param boolean whether this is a required dependency + * @param array a list of downloaded packages to be installed, if any + * @param boolean if true, then deps on pear.php.net that fail will also check + * against pecl.php.net packages to accomodate extensions that have + * moved to pecl.php.net from pear.php.net + */ + function validatePackageDependency($dep, $required, $params, $depv1 = false) + { + if ($this->_state != PEAR_VALIDATE_INSTALLING && + $this->_state != PEAR_VALIDATE_DOWNLOADING) { + return true; + } + + if (isset($dep['providesextension'])) { + if ($this->extension_loaded($dep['providesextension'])) { + $save = $dep; + $subdep = $dep; + $subdep['name'] = $subdep['providesextension']; + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $ret = $this->validateExtensionDependency($subdep, $required); + PEAR::popErrorHandling(); + if (!PEAR::isError($ret)) { + return true; + } + } + } + + if ($this->_state == PEAR_VALIDATE_INSTALLING) { + return $this->_validatePackageInstall($dep, $required, $depv1); + } + + if ($this->_state == PEAR_VALIDATE_DOWNLOADING) { + return $this->_validatePackageDownload($dep, $required, $params, $depv1); + } + } + + function _validatePackageDownload($dep, $required, $params, $depv1 = false) + { + $dep['package'] = $dep['name']; + if (isset($dep['uri'])) { + $dep['channel'] = '__uri'; + } + + $depname = $this->_registry->parsedPackageNameToString($dep, true); + $found = false; + foreach ($params as $param) { + if ($param->isEqual( + array('package' => $dep['name'], + 'channel' => $dep['channel']))) { + $found = true; + break; + } + + if ($depv1 && $dep['channel'] == 'pear.php.net') { + if ($param->isEqual( + array('package' => $dep['name'], + 'channel' => 'pecl.php.net'))) { + $found = true; + break; + } + } + } + + if (!$found && isset($dep['providesextension'])) { + foreach ($params as $param) { + if ($param->isExtension($dep['providesextension'])) { + $found = true; + break; + } + } + } + + if ($found) { + $version = $param->getVersion(); + $installed = false; + $downloaded = true; + } else { + if ($this->_registry->packageExists($dep['name'], $dep['channel'])) { + $installed = true; + $downloaded = false; + $version = $this->_registry->packageinfo($dep['name'], 'version', + $dep['channel']); + } else { + if ($dep['channel'] == 'pecl.php.net' && $this->_registry->packageExists($dep['name'], + 'pear.php.net')) { + $installed = true; + $downloaded = false; + $version = $this->_registry->packageinfo($dep['name'], 'version', + 'pear.php.net'); + } else { + $version = 'not installed or downloaded'; + $installed = false; + $downloaded = false; + } + } + } + + $extra = $this->_getExtraString($dep); + if (isset($dep['exclude']) && !is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + + if (!isset($dep['min']) && !isset($dep['max']) && + !isset($dep['recommended']) && !isset($dep['exclude']) + ) { + if ($installed || $downloaded) { + $installed = $installed ? 'installed' : 'downloaded'; + if (isset($dep['conflicts'])) { + $rest = ''; + if ($version) { + $rest = ", $installed version is " . $version; + } + + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s conflicts with package "' . $depname . '"' . $extra . $rest); + } + + return $this->warning('warning: %s conflicts with package "' . $depname . '"' . $extra . $rest); + } + + return true; + } + + if (isset($dep['conflicts'])) { + return true; + } + + if ($required) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires package "' . $depname . '"' . $extra); + } + + return $this->warning('warning: %s requires package "' . $depname . '"' . $extra); + } + + return $this->warning('%s can optionally use package "' . $depname . '"' . $extra); + } + + if (!$installed && !$downloaded) { + if (isset($dep['conflicts'])) { + return true; + } + + if ($required) { + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires package "' . $depname . '"' . $extra); + } + + return $this->warning('warning: %s requires package "' . $depname . '"' . $extra); + } + + return $this->warning('%s can optionally use package "' . $depname . '"' . $extra); + } + + $fail = false; + if (isset($dep['min']) && version_compare($version, $dep['min'], '<')) { + $fail = true; + } + + if (isset($dep['max']) && version_compare($version, $dep['max'], '>')) { + $fail = true; + } + + if ($fail && !isset($dep['conflicts'])) { + $installed = $installed ? 'installed' : 'downloaded'; + $dep['package'] = $dep['name']; + $dep = $this->_registry->parsedPackageNameToString($dep, true); + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s requires package "' . $depname . '"' . + $extra . ", $installed version is " . $version); + } + + return $this->warning('warning: %s requires package "' . $depname . '"' . + $extra . ", $installed version is " . $version); + } elseif ((isset($dep['min']) || isset($dep['max'])) && !$fail && + isset($dep['conflicts']) && !isset($dep['exclude'])) { + $installed = $installed ? 'installed' : 'downloaded'; + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s conflicts with package "' . $depname . '"' . $extra . + ", $installed version is " . $version); + } + + return $this->warning('warning: %s conflicts with package "' . $depname . '"' . + $extra . ", $installed version is " . $version); + } + + if (isset($dep['exclude'])) { + $installed = $installed ? 'installed' : 'downloaded'; + foreach ($dep['exclude'] as $exclude) { + if (version_compare($version, $exclude, '==') && !isset($dep['conflicts'])) { + if (!isset($this->_options['nodeps']) && + !isset($this->_options['force']) + ) { + return $this->raiseError('%s is not compatible with ' . + $installed . ' package "' . + $depname . '" version ' . + $exclude); + } + + return $this->warning('warning: %s is not compatible with ' . + $installed . ' package "' . + $depname . '" version ' . + $exclude); + } elseif (version_compare($version, $exclude, '!=') && isset($dep['conflicts'])) { + $installed = $installed ? 'installed' : 'downloaded'; + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('%s conflicts with package "' . $depname . '"' . + $extra . ", $installed version is " . $version); + } + + return $this->warning('warning: %s conflicts with package "' . $depname . '"' . + $extra . ", $installed version is " . $version); + } + } + } + + if (isset($dep['recommended'])) { + $installed = $installed ? 'installed' : 'downloaded'; + if (version_compare($version, $dep['recommended'], '==')) { + return true; + } + + if (!$found && $installed) { + $param = $this->_registry->getPackage($dep['name'], $dep['channel']); + } + + if ($param) { + $found = false; + foreach ($params as $parent) { + if ($parent->isEqual($this->_currentPackage)) { + $found = true; + break; + } + } + + if ($found) { + if ($param->isCompatible($parent)) { + return true; + } + } else { // this is for validPackage() calls + $parent = $this->_registry->getPackage($this->_currentPackage['package'], + $this->_currentPackage['channel']); + if ($parent !== null && $param->isCompatible($parent)) { + return true; + } + } + } + + if (!isset($this->_options['nodeps']) && !isset($this->_options['force']) && + !isset($this->_options['loose']) + ) { + return $this->raiseError('%s dependency package "' . $depname . + '" ' . $installed . ' version ' . $version . + ' is not the recommended version ' . $dep['recommended'] . + ', but may be compatible, use --force to install'); + } + + return $this->warning('warning: %s dependency package "' . $depname . + '" ' . $installed . ' version ' . $version . + ' is not the recommended version ' . $dep['recommended']); + } + + return true; + } + + function _validatePackageInstall($dep, $required, $depv1 = false) + { + return $this->_validatePackageDownload($dep, $required, array(), $depv1); + } + + /** + * Verify that uninstalling packages passed in to command line is OK. + * + * @param PEAR_Installer $dl + * @return PEAR_Error|true + */ + function validatePackageUninstall(&$dl) + { + if (PEAR::isError($this->_dependencydb)) { + return $this->_dependencydb; + } + + $params = array(); + // construct an array of "downloaded" packages to fool the package dependency checker + // into using these to validate uninstalls of circular dependencies + $downloaded = &$dl->getUninstallPackages(); + foreach ($downloaded as $i => $pf) { + if (!class_exists('PEAR_Downloader_Package')) { + require_once 'PEAR/Downloader/Package.php'; + } + $dp = &new PEAR_Downloader_Package($dl); + $dp->setPackageFile($downloaded[$i]); + $params[$i] = &$dp; + } + + // check cache + $memyselfandI = strtolower($this->_currentPackage['channel']) . '/' . + strtolower($this->_currentPackage['package']); + if (isset($dl->___uninstall_package_cache)) { + $badpackages = $dl->___uninstall_package_cache; + if (isset($badpackages[$memyselfandI]['warnings'])) { + foreach ($badpackages[$memyselfandI]['warnings'] as $warning) { + $dl->log(0, $warning[0]); + } + } + + if (isset($badpackages[$memyselfandI]['errors'])) { + foreach ($badpackages[$memyselfandI]['errors'] as $error) { + if (is_array($error)) { + $dl->log(0, $error[0]); + } else { + $dl->log(0, $error->getMessage()); + } + } + + if (isset($this->_options['nodeps']) || isset($this->_options['force'])) { + return $this->warning( + 'warning: %s should not be uninstalled, other installed packages depend ' . + 'on this package'); + } + + return $this->raiseError( + '%s cannot be uninstalled, other installed packages depend on this package'); + } + + return true; + } + + // first, list the immediate parents of each package to be uninstalled + $perpackagelist = array(); + $allparents = array(); + foreach ($params as $i => $param) { + $a = array( + 'channel' => strtolower($param->getChannel()), + 'package' => strtolower($param->getPackage()) + ); + + $deps = $this->_dependencydb->getDependentPackages($a); + if ($deps) { + foreach ($deps as $d) { + $pardeps = $this->_dependencydb->getDependencies($d); + foreach ($pardeps as $dep) { + if (strtolower($dep['dep']['channel']) == $a['channel'] && + strtolower($dep['dep']['name']) == $a['package']) { + if (!isset($perpackagelist[$a['channel'] . '/' . $a['package']])) { + $perpackagelist[$a['channel'] . '/' . $a['package']] = array(); + } + $perpackagelist[$a['channel'] . '/' . $a['package']][] + = array($d['channel'] . '/' . $d['package'], $dep); + if (!isset($allparents[$d['channel'] . '/' . $d['package']])) { + $allparents[$d['channel'] . '/' . $d['package']] = array(); + } + if (!isset($allparents[$d['channel'] . '/' . $d['package']][$a['channel'] . '/' . $a['package']])) { + $allparents[$d['channel'] . '/' . $d['package']][$a['channel'] . '/' . $a['package']] = array(); + } + $allparents[$d['channel'] . '/' . $d['package']] + [$a['channel'] . '/' . $a['package']][] + = array($d, $dep); + } + } + } + } + } + + // next, remove any packages from the parents list that are not installed + $remove = array(); + foreach ($allparents as $parent => $d1) { + foreach ($d1 as $d) { + if ($this->_registry->packageExists($d[0][0]['package'], $d[0][0]['channel'])) { + continue; + } + $remove[$parent] = true; + } + } + + // next remove any packages from the parents list that are not passed in for + // uninstallation + foreach ($allparents as $parent => $d1) { + foreach ($d1 as $d) { + foreach ($params as $param) { + if (strtolower($param->getChannel()) == $d[0][0]['channel'] && + strtolower($param->getPackage()) == $d[0][0]['package']) { + // found it + continue 3; + } + } + $remove[$parent] = true; + } + } + + // remove all packages whose dependencies fail + // save which ones failed for error reporting + $badchildren = array(); + do { + $fail = false; + foreach ($remove as $package => $unused) { + if (!isset($allparents[$package])) { + continue; + } + + foreach ($allparents[$package] as $kid => $d1) { + foreach ($d1 as $depinfo) { + if ($depinfo[1]['type'] != 'optional') { + if (isset($badchildren[$kid])) { + continue; + } + $badchildren[$kid] = true; + $remove[$kid] = true; + $fail = true; + continue 2; + } + } + } + if ($fail) { + // start over, we removed some children + continue 2; + } + } + } while ($fail); + + // next, construct the list of packages that can't be uninstalled + $badpackages = array(); + $save = $this->_currentPackage; + foreach ($perpackagelist as $package => $packagedeps) { + foreach ($packagedeps as $parent) { + if (!isset($remove[$parent[0]])) { + continue; + } + + $packagename = $this->_registry->parsePackageName($parent[0]); + $packagename['channel'] = $this->_registry->channelAlias($packagename['channel']); + $pa = $this->_registry->getPackage($packagename['package'], $packagename['channel']); + $packagename['package'] = $pa->getPackage(); + $this->_currentPackage = $packagename; + // parent is not present in uninstall list, make sure we can actually + // uninstall it (parent dep is optional) + $parentname['channel'] = $this->_registry->channelAlias($parent[1]['dep']['channel']); + $pa = $this->_registry->getPackage($parent[1]['dep']['name'], $parent[1]['dep']['channel']); + $parentname['package'] = $pa->getPackage(); + $parent[1]['dep']['package'] = $parentname['package']; + $parent[1]['dep']['channel'] = $parentname['channel']; + if ($parent[1]['type'] == 'optional') { + $test = $this->_validatePackageUninstall($parent[1]['dep'], false, $dl); + if ($test !== true) { + $badpackages[$package]['warnings'][] = $test; + } + } else { + $test = $this->_validatePackageUninstall($parent[1]['dep'], true, $dl); + if ($test !== true) { + $badpackages[$package]['errors'][] = $test; + } + } + } + } + + $this->_currentPackage = $save; + $dl->___uninstall_package_cache = $badpackages; + if (isset($badpackages[$memyselfandI])) { + if (isset($badpackages[$memyselfandI]['warnings'])) { + foreach ($badpackages[$memyselfandI]['warnings'] as $warning) { + $dl->log(0, $warning[0]); + } + } + + if (isset($badpackages[$memyselfandI]['errors'])) { + foreach ($badpackages[$memyselfandI]['errors'] as $error) { + if (is_array($error)) { + $dl->log(0, $error[0]); + } else { + $dl->log(0, $error->getMessage()); + } + } + + if (isset($this->_options['nodeps']) || isset($this->_options['force'])) { + return $this->warning( + 'warning: %s should not be uninstalled, other installed packages depend ' . + 'on this package'); + } + + return $this->raiseError( + '%s cannot be uninstalled, other installed packages depend on this package'); + } + } + + return true; + } + + function _validatePackageUninstall($dep, $required, $dl) + { + $depname = $this->_registry->parsedPackageNameToString($dep, true); + $version = $this->_registry->packageinfo($dep['package'], 'version', $dep['channel']); + if (!$version) { + return true; + } + + $extra = $this->_getExtraString($dep); + if (isset($dep['exclude']) && !is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + + if (isset($dep['conflicts'])) { + return true; // uninstall OK - these packages conflict (probably installed with --force) + } + + if (!isset($dep['min']) && !isset($dep['max'])) { + if (!$required) { + return $this->warning('"' . $depname . '" can be optionally used by ' . + 'installed package %s' . $extra); + } + + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError('"' . $depname . '" is required by ' . + 'installed package %s' . $extra); + } + + return $this->warning('warning: "' . $depname . '" is required by ' . + 'installed package %s' . $extra); + } + + $fail = false; + if (isset($dep['min']) && version_compare($version, $dep['min'], '>=')) { + $fail = true; + } + + if (isset($dep['max']) && version_compare($version, $dep['max'], '<=')) { + $fail = true; + } + + // we re-use this variable, preserve the original value + $saverequired = $required; + if (!$required) { + return $this->warning($depname . $extra . ' can be optionally used by installed package' . + ' "%s"'); + } + + if (!isset($this->_options['nodeps']) && !isset($this->_options['force'])) { + return $this->raiseError($depname . $extra . ' is required by installed package' . + ' "%s"'); + } + + return $this->raiseError('warning: ' . $depname . $extra . + ' is required by installed package "%s"'); + } + + /** + * validate a downloaded package against installed packages + * + * As of PEAR 1.4.3, this will only validate + * + * @param array|PEAR_Downloader_Package|PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * $pkg package identifier (either + * array('package' => blah, 'channel' => blah) or an array with + * index 'info' referencing an object) + * @param PEAR_Downloader $dl + * @param array $params full list of packages to install + * @return true|PEAR_Error + */ + function validatePackage($pkg, &$dl, $params = array()) + { + if (is_array($pkg) && isset($pkg['info'])) { + $deps = $this->_dependencydb->getDependentPackageDependencies($pkg['info']); + } else { + $deps = $this->_dependencydb->getDependentPackageDependencies($pkg); + } + + $fail = false; + if ($deps) { + if (!class_exists('PEAR_Downloader_Package')) { + require_once 'PEAR/Downloader/Package.php'; + } + + $dp = &new PEAR_Downloader_Package($dl); + if (is_object($pkg)) { + $dp->setPackageFile($pkg); + } else { + $dp->setDownloadURL($pkg); + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + foreach ($deps as $channel => $info) { + foreach ($info as $package => $ds) { + foreach ($params as $packd) { + if (strtolower($packd->getPackage()) == strtolower($package) && + $packd->getChannel() == $channel) { + $dl->log(3, 'skipping installed package check of "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $channel, 'package' => $package), + true) . + '", version "' . $packd->getVersion() . '" will be ' . + 'downloaded and installed'); + continue 2; // jump to next package + } + } + + foreach ($ds as $d) { + $checker = &new PEAR_Dependency2($this->_config, $this->_options, + array('channel' => $channel, 'package' => $package), $this->_state); + $dep = $d['dep']; + $required = $d['type'] == 'required'; + $ret = $checker->_validatePackageDownload($dep, $required, array(&$dp)); + if (is_array($ret)) { + $dl->log(0, $ret[0]); + } elseif (PEAR::isError($ret)) { + $dl->log(0, $ret->getMessage()); + $fail = true; + } + } + } + } + PEAR::popErrorHandling(); + } + + if ($fail) { + return $this->raiseError( + '%s cannot be installed, conflicts with installed packages'); + } + + return true; + } + + /** + * validate a package.xml 1.0 dependency + */ + function validateDependency1($dep, $params = array()) + { + if (!isset($dep['optional'])) { + $dep['optional'] = 'no'; + } + + list($newdep, $type) = $this->normalizeDep($dep); + if (!$newdep) { + return $this->raiseError("Invalid Dependency"); + } + + if (method_exists($this, "validate{$type}Dependency")) { + return $this->{"validate{$type}Dependency"}($newdep, $dep['optional'] == 'no', + $params, true); + } + } + + /** + * Convert a 1.0 dep into a 2.0 dep + */ + function normalizeDep($dep) + { + $types = array( + 'pkg' => 'Package', + 'ext' => 'Extension', + 'os' => 'Os', + 'php' => 'Php' + ); + + if (!isset($types[$dep['type']])) { + return array(false, false); + } + + $type = $types[$dep['type']]; + + $newdep = array(); + switch ($type) { + case 'Package' : + $newdep['channel'] = 'pear.php.net'; + case 'Extension' : + case 'Os' : + $newdep['name'] = $dep['name']; + break; + } + + $dep['rel'] = PEAR_Dependency2::signOperator($dep['rel']); + switch ($dep['rel']) { + case 'has' : + return array($newdep, $type); + break; + case 'not' : + $newdep['conflicts'] = true; + break; + case '>=' : + case '>' : + $newdep['min'] = $dep['version']; + if ($dep['rel'] == '>') { + $newdep['exclude'] = $dep['version']; + } + break; + case '<=' : + case '<' : + $newdep['max'] = $dep['version']; + if ($dep['rel'] == '<') { + $newdep['exclude'] = $dep['version']; + } + break; + case 'ne' : + case '!=' : + $newdep['min'] = '0'; + $newdep['max'] = '100000'; + $newdep['exclude'] = $dep['version']; + break; + case '==' : + $newdep['min'] = $dep['version']; + $newdep['max'] = $dep['version']; + break; + } + if ($type == 'Php') { + if (!isset($newdep['min'])) { + $newdep['min'] = '4.4.0'; + } + + if (!isset($newdep['max'])) { + $newdep['max'] = '6.0.0'; + } + } + return array($newdep, $type); + } + + /** + * Converts text comparing operators to them sign equivalents + * + * Example: 'ge' to '>=' + * + * @access public + * @param string Operator + * @return string Sign equivalent + */ + function signOperator($operator) + { + switch($operator) { + case 'lt': return '<'; + case 'le': return '<='; + case 'gt': return '>'; + case 'ge': return '>='; + case 'eq': return '=='; + case 'ne': return '!='; + default: + return $operator; + } + } + + function raiseError($msg) + { + if (isset($this->_options['ignore-errors'])) { + return $this->warning($msg); + } + + return PEAR::raiseError(sprintf($msg, $this->_registry->parsedPackageNameToString( + $this->_currentPackage, true))); + } + + function warning($msg) + { + return array(sprintf($msg, $this->_registry->parsedPackageNameToString( + $this->_currentPackage, true))); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/DependencyDB.php b/vendor/pear-pear.php.net/PEAR/PEAR/DependencyDB.php new file mode 100644 index 0000000000000000000000000000000000000000..948f0c9d7083e31f27aa22b6caa340486d603a50 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/DependencyDB.php @@ -0,0 +1,769 @@ +<?php +/** + * PEAR_DependencyDB, advanced installed packages dependency database + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Tomas V. V. Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: DependencyDB.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * Needed for error handling + */ +require_once 'PEAR.php'; +require_once 'PEAR/Config.php'; + +$GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'] = array(); +/** + * Track dependency relationships between installed packages + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @author Tomas V.V.Cox <cox@idec.net.com> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_DependencyDB +{ + // {{{ properties + + /** + * This is initialized by {@link setConfig()} + * @var PEAR_Config + * @access private + */ + var $_config; + /** + * This is initialized by {@link setConfig()} + * @var PEAR_Registry + * @access private + */ + var $_registry; + /** + * Filename of the dependency DB (usually .depdb) + * @var string + * @access private + */ + var $_depdb = false; + /** + * File name of the lockfile (usually .depdblock) + * @var string + * @access private + */ + var $_lockfile = false; + /** + * Open file resource for locking the lockfile + * @var resource|false + * @access private + */ + var $_lockFp = false; + /** + * API version of this class, used to validate a file on-disk + * @var string + * @access private + */ + var $_version = '1.0'; + /** + * Cached dependency database file + * @var array|null + * @access private + */ + var $_cache; + + // }}} + // {{{ & singleton() + + /** + * Get a raw dependency database. Calls setConfig() and assertDepsDB() + * @param PEAR_Config + * @param string|false full path to the dependency database, or false to use default + * @return PEAR_DependencyDB|PEAR_Error + * @static + */ + function &singleton(&$config, $depdb = false) + { + $phpdir = $config->get('php_dir', null, 'pear.php.net'); + if (!isset($GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'][$phpdir])) { + $a = new PEAR_DependencyDB; + $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'][$phpdir] = &$a; + $a->setConfig($config, $depdb); + $e = $a->assertDepsDB(); + if (PEAR::isError($e)) { + return $e; + } + } + + return $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'][$phpdir]; + } + + /** + * Set up the registry/location of dependency DB + * @param PEAR_Config|false + * @param string|false full path to the dependency database, or false to use default + */ + function setConfig(&$config, $depdb = false) + { + if (!$config) { + $this->_config = &PEAR_Config::singleton(); + } else { + $this->_config = &$config; + } + + $this->_registry = &$this->_config->getRegistry(); + if (!$depdb) { + $this->_depdb = $this->_config->get('php_dir', null, 'pear.php.net') . + DIRECTORY_SEPARATOR . '.depdb'; + } else { + $this->_depdb = $depdb; + } + + $this->_lockfile = dirname($this->_depdb) . DIRECTORY_SEPARATOR . '.depdblock'; + } + // }}} + + function hasWriteAccess() + { + if (!file_exists($this->_depdb)) { + $dir = $this->_depdb; + while ($dir && $dir != '.') { + $dir = dirname($dir); // cd .. + if ($dir != '.' && file_exists($dir)) { + if (is_writeable($dir)) { + return true; + } + + return false; + } + } + + return false; + } + + return is_writeable($this->_depdb); + } + + // {{{ assertDepsDB() + + /** + * Create the dependency database, if it doesn't exist. Error if the database is + * newer than the code reading it. + * @return void|PEAR_Error + */ + function assertDepsDB() + { + if (!is_file($this->_depdb)) { + $this->rebuildDB(); + return; + } + + $depdb = $this->_getDepDB(); + // Datatype format has been changed, rebuild the Deps DB + if ($depdb['_version'] < $this->_version) { + $this->rebuildDB(); + } + + if ($depdb['_version']{0} > $this->_version{0}) { + return PEAR::raiseError('Dependency database is version ' . + $depdb['_version'] . ', and we are version ' . + $this->_version . ', cannot continue'); + } + } + + /** + * Get a list of installed packages that depend on this package + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2|array + * @return array|false + */ + function getDependentPackages(&$pkg) + { + $data = $this->_getDepDB(); + if (is_object($pkg)) { + $channel = strtolower($pkg->getChannel()); + $package = strtolower($pkg->getPackage()); + } else { + $channel = strtolower($pkg['channel']); + $package = strtolower($pkg['package']); + } + + if (isset($data['packages'][$channel][$package])) { + return $data['packages'][$channel][$package]; + } + + return false; + } + + /** + * Get a list of the actual dependencies of installed packages that depend on + * a package. + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2|array + * @return array|false + */ + function getDependentPackageDependencies(&$pkg) + { + $data = $this->_getDepDB(); + if (is_object($pkg)) { + $channel = strtolower($pkg->getChannel()); + $package = strtolower($pkg->getPackage()); + } else { + $channel = strtolower($pkg['channel']); + $package = strtolower($pkg['package']); + } + + $depend = $this->getDependentPackages($pkg); + if (!$depend) { + return false; + } + + $dependencies = array(); + foreach ($depend as $info) { + $temp = $this->getDependencies($info); + foreach ($temp as $dep) { + if ( + isset($dep['dep'], $dep['dep']['channel'], $dep['dep']['name']) && + strtolower($dep['dep']['channel']) == $channel && + strtolower($dep['dep']['name']) == $package + ) { + if (!isset($dependencies[$info['channel']])) { + $dependencies[$info['channel']] = array(); + } + + if (!isset($dependencies[$info['channel']][$info['package']])) { + $dependencies[$info['channel']][$info['package']] = array(); + } + $dependencies[$info['channel']][$info['package']][] = $dep; + } + } + } + + return $dependencies; + } + + /** + * Get a list of dependencies of this installed package + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2|array + * @return array|false + */ + function getDependencies(&$pkg) + { + if (is_object($pkg)) { + $channel = strtolower($pkg->getChannel()); + $package = strtolower($pkg->getPackage()); + } else { + $channel = strtolower($pkg['channel']); + $package = strtolower($pkg['package']); + } + + $data = $this->_getDepDB(); + if (isset($data['dependencies'][$channel][$package])) { + return $data['dependencies'][$channel][$package]; + } + + return false; + } + + /** + * Determine whether $parent depends on $child, near or deep + * @param array|PEAR_PackageFile_v2|PEAR_PackageFile_v2 + * @param array|PEAR_PackageFile_v2|PEAR_PackageFile_v2 + */ + function dependsOn($parent, $child) + { + $c = array(); + $this->_getDepDB(); + return $this->_dependsOn($parent, $child, $c); + } + + function _dependsOn($parent, $child, &$checked) + { + if (is_object($parent)) { + $channel = strtolower($parent->getChannel()); + $package = strtolower($parent->getPackage()); + } else { + $channel = strtolower($parent['channel']); + $package = strtolower($parent['package']); + } + + if (is_object($child)) { + $depchannel = strtolower($child->getChannel()); + $deppackage = strtolower($child->getPackage()); + } else { + $depchannel = strtolower($child['channel']); + $deppackage = strtolower($child['package']); + } + + if (isset($checked[$channel][$package][$depchannel][$deppackage])) { + return false; // avoid endless recursion + } + + $checked[$channel][$package][$depchannel][$deppackage] = true; + if (!isset($this->_cache['dependencies'][$channel][$package])) { + return false; + } + + foreach ($this->_cache['dependencies'][$channel][$package] as $info) { + if (isset($info['dep']['uri'])) { + if (is_object($child)) { + if ($info['dep']['uri'] == $child->getURI()) { + return true; + } + } elseif (isset($child['uri'])) { + if ($info['dep']['uri'] == $child['uri']) { + return true; + } + } + return false; + } + + if (strtolower($info['dep']['channel']) == $depchannel && + strtolower($info['dep']['name']) == $deppackage) { + return true; + } + } + + foreach ($this->_cache['dependencies'][$channel][$package] as $info) { + if (isset($info['dep']['uri'])) { + if ($this->_dependsOn(array( + 'uri' => $info['dep']['uri'], + 'package' => $info['dep']['name']), $child, $checked)) { + return true; + } + } else { + if ($this->_dependsOn(array( + 'channel' => $info['dep']['channel'], + 'package' => $info['dep']['name']), $child, $checked)) { + return true; + } + } + } + + return false; + } + + /** + * Register dependencies of a package that is being installed or upgraded + * @param PEAR_PackageFile_v2|PEAR_PackageFile_v2 + */ + function installPackage(&$package) + { + $data = $this->_getDepDB(); + unset($this->_cache); + $this->_setPackageDeps($data, $package); + $this->_writeDepDB($data); + } + + /** + * Remove dependencies of a package that is being uninstalled, or upgraded. + * + * Upgraded packages first uninstall, then install + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2|array If an array, then it must have + * indices 'channel' and 'package' + */ + function uninstallPackage(&$pkg) + { + $data = $this->_getDepDB(); + unset($this->_cache); + if (is_object($pkg)) { + $channel = strtolower($pkg->getChannel()); + $package = strtolower($pkg->getPackage()); + } else { + $channel = strtolower($pkg['channel']); + $package = strtolower($pkg['package']); + } + + if (!isset($data['dependencies'][$channel][$package])) { + return true; + } + + foreach ($data['dependencies'][$channel][$package] as $dep) { + $found = false; + $depchannel = isset($dep['dep']['uri']) ? '__uri' : strtolower($dep['dep']['channel']); + $depname = strtolower($dep['dep']['name']); + if (isset($data['packages'][$depchannel][$depname])) { + foreach ($data['packages'][$depchannel][$depname] as $i => $info) { + if ($info['channel'] == $channel && $info['package'] == $package) { + $found = true; + break; + } + } + } + + if ($found) { + unset($data['packages'][$depchannel][$depname][$i]); + if (!count($data['packages'][$depchannel][$depname])) { + unset($data['packages'][$depchannel][$depname]); + if (!count($data['packages'][$depchannel])) { + unset($data['packages'][$depchannel]); + } + } else { + $data['packages'][$depchannel][$depname] = + array_values($data['packages'][$depchannel][$depname]); + } + } + } + + unset($data['dependencies'][$channel][$package]); + if (!count($data['dependencies'][$channel])) { + unset($data['dependencies'][$channel]); + } + + if (!count($data['dependencies'])) { + unset($data['dependencies']); + } + + if (!count($data['packages'])) { + unset($data['packages']); + } + + $this->_writeDepDB($data); + } + + /** + * Rebuild the dependency DB by reading registry entries. + * @return true|PEAR_Error + */ + function rebuildDB() + { + $depdb = array('_version' => $this->_version); + if (!$this->hasWriteAccess()) { + // allow startup for read-only with older Registry + return $depdb; + } + + $packages = $this->_registry->listAllPackages(); + if (PEAR::isError($packages)) { + return $packages; + } + + foreach ($packages as $channel => $ps) { + foreach ($ps as $package) { + $package = $this->_registry->getPackage($package, $channel); + if (PEAR::isError($package)) { + return $package; + } + $this->_setPackageDeps($depdb, $package); + } + } + + $error = $this->_writeDepDB($depdb); + if (PEAR::isError($error)) { + return $error; + } + + $this->_cache = $depdb; + return true; + } + + /** + * Register usage of the dependency DB to prevent race conditions + * @param int one of the LOCK_* constants + * @return true|PEAR_Error + * @access private + */ + function _lock($mode = LOCK_EX) + { + if (stristr(php_uname(), 'Windows 9')) { + return true; + } + + if ($mode != LOCK_UN && is_resource($this->_lockFp)) { + // XXX does not check type of lock (LOCK_SH/LOCK_EX) + return true; + } + + $open_mode = 'w'; + // XXX People reported problems with LOCK_SH and 'w' + if ($mode === LOCK_SH) { + if (!file_exists($this->_lockfile)) { + touch($this->_lockfile); + } elseif (!is_file($this->_lockfile)) { + return PEAR::raiseError('could not create Dependency lock file, ' . + 'it exists and is not a regular file'); + } + $open_mode = 'r'; + } + + if (!is_resource($this->_lockFp)) { + $this->_lockFp = @fopen($this->_lockfile, $open_mode); + } + + if (!is_resource($this->_lockFp)) { + return PEAR::raiseError("could not create Dependency lock file" . + (isset($php_errormsg) ? ": " . $php_errormsg : "")); + } + + if (!(int)flock($this->_lockFp, $mode)) { + switch ($mode) { + case LOCK_SH: $str = 'shared'; break; + case LOCK_EX: $str = 'exclusive'; break; + case LOCK_UN: $str = 'unlock'; break; + default: $str = 'unknown'; break; + } + + return PEAR::raiseError("could not acquire $str lock ($this->_lockfile)"); + } + + return true; + } + + /** + * Release usage of dependency DB + * @return true|PEAR_Error + * @access private + */ + function _unlock() + { + $ret = $this->_lock(LOCK_UN); + if (is_resource($this->_lockFp)) { + fclose($this->_lockFp); + } + $this->_lockFp = null; + return $ret; + } + + /** + * Load the dependency database from disk, or return the cache + * @return array|PEAR_Error + */ + function _getDepDB() + { + if (!$this->hasWriteAccess()) { + return array('_version' => $this->_version); + } + + if (isset($this->_cache)) { + return $this->_cache; + } + + if (!$fp = fopen($this->_depdb, 'r')) { + $err = PEAR::raiseError("Could not open dependencies file `".$this->_depdb."'"); + return $err; + } + + $rt = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + clearstatcache(); + fclose($fp); + $data = unserialize(file_get_contents($this->_depdb)); + set_magic_quotes_runtime($rt); + $this->_cache = $data; + return $data; + } + + /** + * Write out the dependency database to disk + * @param array the database + * @return true|PEAR_Error + * @access private + */ + function _writeDepDB(&$deps) + { + if (PEAR::isError($e = $this->_lock(LOCK_EX))) { + return $e; + } + + if (!$fp = fopen($this->_depdb, 'wb')) { + $this->_unlock(); + return PEAR::raiseError("Could not open dependencies file `".$this->_depdb."' for writing"); + } + + $rt = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + fwrite($fp, serialize($deps)); + set_magic_quotes_runtime($rt); + fclose($fp); + $this->_unlock(); + $this->_cache = $deps; + return true; + } + + /** + * Register all dependencies from a package in the dependencies database, in essence + * "installing" the package's dependency information + * @param array the database + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @access private + */ + function _setPackageDeps(&$data, &$pkg) + { + $pkg->setConfig($this->_config); + if ($pkg->getPackagexmlVersion() == '1.0') { + $gen = &$pkg->getDefaultGenerator(); + $deps = $gen->dependenciesToV2(); + } else { + $deps = $pkg->getDeps(true); + } + + if (!$deps) { + return; + } + + if (!is_array($data)) { + $data = array(); + } + + if (!isset($data['dependencies'])) { + $data['dependencies'] = array(); + } + + $channel = strtolower($pkg->getChannel()); + $package = strtolower($pkg->getPackage()); + + if (!isset($data['dependencies'][$channel])) { + $data['dependencies'][$channel] = array(); + } + + $data['dependencies'][$channel][$package] = array(); + if (isset($deps['required']['package'])) { + if (!isset($deps['required']['package'][0])) { + $deps['required']['package'] = array($deps['required']['package']); + } + + foreach ($deps['required']['package'] as $dep) { + $this->_registerDep($data, $pkg, $dep, 'required'); + } + } + + if (isset($deps['optional']['package'])) { + if (!isset($deps['optional']['package'][0])) { + $deps['optional']['package'] = array($deps['optional']['package']); + } + + foreach ($deps['optional']['package'] as $dep) { + $this->_registerDep($data, $pkg, $dep, 'optional'); + } + } + + if (isset($deps['required']['subpackage'])) { + if (!isset($deps['required']['subpackage'][0])) { + $deps['required']['subpackage'] = array($deps['required']['subpackage']); + } + + foreach ($deps['required']['subpackage'] as $dep) { + $this->_registerDep($data, $pkg, $dep, 'required'); + } + } + + if (isset($deps['optional']['subpackage'])) { + if (!isset($deps['optional']['subpackage'][0])) { + $deps['optional']['subpackage'] = array($deps['optional']['subpackage']); + } + + foreach ($deps['optional']['subpackage'] as $dep) { + $this->_registerDep($data, $pkg, $dep, 'optional'); + } + } + + if (isset($deps['group'])) { + if (!isset($deps['group'][0])) { + $deps['group'] = array($deps['group']); + } + + foreach ($deps['group'] as $group) { + if (isset($group['package'])) { + if (!isset($group['package'][0])) { + $group['package'] = array($group['package']); + } + + foreach ($group['package'] as $dep) { + $this->_registerDep($data, $pkg, $dep, 'optional', + $group['attribs']['name']); + } + } + + if (isset($group['subpackage'])) { + if (!isset($group['subpackage'][0])) { + $group['subpackage'] = array($group['subpackage']); + } + + foreach ($group['subpackage'] as $dep) { + $this->_registerDep($data, $pkg, $dep, 'optional', + $group['attribs']['name']); + } + } + } + } + + if ($data['dependencies'][$channel][$package] == array()) { + unset($data['dependencies'][$channel][$package]); + if (!count($data['dependencies'][$channel])) { + unset($data['dependencies'][$channel]); + } + } + } + + /** + * @param array the database + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param array the specific dependency + * @param required|optional whether this is a required or an optional dep + * @param string|false dependency group this dependency is from, or false for ordinary dep + */ + function _registerDep(&$data, &$pkg, $dep, $type, $group = false) + { + $info = array( + 'dep' => $dep, + 'type' => $type, + 'group' => $group + ); + + $dep = array_map('strtolower', $dep); + $depchannel = isset($dep['channel']) ? $dep['channel'] : '__uri'; + if (!isset($data['dependencies'])) { + $data['dependencies'] = array(); + } + + $channel = strtolower($pkg->getChannel()); + $package = strtolower($pkg->getPackage()); + + if (!isset($data['dependencies'][$channel])) { + $data['dependencies'][$channel] = array(); + } + + if (!isset($data['dependencies'][$channel][$package])) { + $data['dependencies'][$channel][$package] = array(); + } + + $data['dependencies'][$channel][$package][] = $info; + if (isset($data['packages'][$depchannel][$dep['name']])) { + $found = false; + foreach ($data['packages'][$depchannel][$dep['name']] as $i => $p) { + if ($p['channel'] == $channel && $p['package'] == $package) { + $found = true; + break; + } + } + } else { + if (!isset($data['packages'])) { + $data['packages'] = array(); + } + + if (!isset($data['packages'][$depchannel])) { + $data['packages'][$depchannel] = array(); + } + + if (!isset($data['packages'][$depchannel][$dep['name']])) { + $data['packages'][$depchannel][$dep['name']] = array(); + } + + $found = false; + } + + if (!$found) { + $data['packages'][$depchannel][$dep['name']][] = array( + 'channel' => $channel, + 'package' => $package + ); + } + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Downloader.php b/vendor/pear-pear.php.net/PEAR/PEAR/Downloader.php new file mode 100644 index 0000000000000000000000000000000000000000..730df0b73874bc2da179c692d14a3bf896ce6de7 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Downloader.php @@ -0,0 +1,1766 @@ +<?php +/** + * PEAR_Downloader, the PEAR Installer's download utility class + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @author Stig Bakken <ssb@php.net> + * @author Tomas V. V. Cox <cox@idecnet.com> + * @author Martin Jansen <mj@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Downloader.php 313024 2011-07-06 19:51:24Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.3.0 + */ + +/** + * Needed for constants, extending + */ +require_once 'PEAR/Common.php'; + +define('PEAR_INSTALLER_OK', 1); +define('PEAR_INSTALLER_FAILED', 0); +define('PEAR_INSTALLER_SKIPPED', -1); +define('PEAR_INSTALLER_ERROR_NO_PREF_STATE', 2); + +/** + * Administration class used to download anything from the internet (PEAR Packages, + * static URLs, xml files) + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @author Stig Bakken <ssb@php.net> + * @author Tomas V. V. Cox <cox@idecnet.com> + * @author Martin Jansen <mj@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.3.0 + */ +class PEAR_Downloader extends PEAR_Common +{ + /** + * @var PEAR_Registry + * @access private + */ + var $_registry; + + /** + * Preferred Installation State (snapshot, devel, alpha, beta, stable) + * @var string|null + * @access private + */ + var $_preferredState; + + /** + * Options from command-line passed to Install. + * + * Recognized options:<br /> + * - onlyreqdeps : install all required dependencies as well + * - alldeps : install all dependencies, including optional + * - installroot : base relative path to install files in + * - force : force a download even if warnings would prevent it + * - nocompress : download uncompressed tarballs + * @see PEAR_Command_Install + * @access private + * @var array + */ + var $_options; + + /** + * Downloaded Packages after a call to download(). + * + * Format of each entry: + * + * <code> + * array('pkg' => 'package_name', 'file' => '/path/to/local/file', + * 'info' => array() // parsed package.xml + * ); + * </code> + * @access private + * @var array + */ + var $_downloadedPackages = array(); + + /** + * Packages slated for download. + * + * This is used to prevent downloading a package more than once should it be a dependency + * for two packages to be installed. + * Format of each entry: + * + * <pre> + * array('package_name1' => parsed package.xml, 'package_name2' => parsed package.xml, + * ); + * </pre> + * @access private + * @var array + */ + var $_toDownload = array(); + + /** + * Array of every package installed, with names lower-cased. + * + * Format: + * <code> + * array('package1' => 0, 'package2' => 1, ); + * </code> + * @var array + */ + var $_installed = array(); + + /** + * @var array + * @access private + */ + var $_errorStack = array(); + + /** + * @var boolean + * @access private + */ + var $_internalDownload = false; + + /** + * Temporary variable used in sorting packages by dependency in {@link sortPkgDeps()} + * @var array + * @access private + */ + var $_packageSortTree; + + /** + * Temporary directory, or configuration value where downloads will occur + * @var string + */ + var $_downloadDir; + + /** + * @param PEAR_Frontend_* + * @param array + * @param PEAR_Config + */ + function PEAR_Downloader(&$ui, $options, &$config) + { + parent::PEAR_Common(); + $this->_options = $options; + $this->config = &$config; + $this->_preferredState = $this->config->get('preferred_state'); + $this->ui = &$ui; + if (!$this->_preferredState) { + // don't inadvertantly use a non-set preferred_state + $this->_preferredState = null; + } + + if (isset($this->_options['installroot'])) { + $this->config->setInstallRoot($this->_options['installroot']); + } + $this->_registry = &$config->getRegistry(); + + if (isset($this->_options['alldeps']) || isset($this->_options['onlyreqdeps'])) { + $this->_installed = $this->_registry->listAllPackages(); + foreach ($this->_installed as $key => $unused) { + if (!count($unused)) { + continue; + } + $strtolower = create_function('$a','return strtolower($a);'); + array_walk($this->_installed[$key], $strtolower); + } + } + } + + /** + * Attempt to discover a channel's remote capabilities from + * its server name + * @param string + * @return boolean + */ + function discover($channel) + { + $this->log(1, 'Attempting to discover channel "' . $channel . '"...'); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $callback = $this->ui ? array(&$this, '_downloadCallback') : null; + if (!class_exists('System')) { + require_once 'System.php'; + } + + $tmpdir = $this->config->get('temp_dir'); + $tmp = System::mktemp('-d -t "' . $tmpdir . '"'); + $a = $this->downloadHttp('http://' . $channel . '/channel.xml', $this->ui, $tmp, $callback, false); + PEAR::popErrorHandling(); + if (PEAR::isError($a)) { + // Attempt to fallback to https automatically. + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $this->log(1, 'Attempting fallback to https instead of http on channel "' . $channel . '"...'); + $a = $this->downloadHttp('https://' . $channel . '/channel.xml', $this->ui, $tmp, $callback, false); + PEAR::popErrorHandling(); + if (PEAR::isError($a)) { + return false; + } + } + + list($a, $lastmodified) = $a; + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $b = new PEAR_ChannelFile; + if ($b->fromXmlFile($a)) { + unlink($a); + if ($this->config->get('auto_discover')) { + $this->_registry->addChannel($b, $lastmodified); + $alias = $b->getName(); + if ($b->getName() == $this->_registry->channelName($b->getAlias())) { + $alias = $b->getAlias(); + } + + $this->log(1, 'Auto-discovered channel "' . $channel . + '", alias "' . $alias . '", adding to registry'); + } + + return true; + } + + unlink($a); + return false; + } + + /** + * For simpler unit-testing + * @param PEAR_Downloader + * @return PEAR_Downloader_Package + */ + function &newDownloaderPackage(&$t) + { + if (!class_exists('PEAR_Downloader_Package')) { + require_once 'PEAR/Downloader/Package.php'; + } + $a = &new PEAR_Downloader_Package($t); + return $a; + } + + /** + * For simpler unit-testing + * @param PEAR_Config + * @param array + * @param array + * @param int + */ + function &getDependency2Object(&$c, $i, $p, $s) + { + if (!class_exists('PEAR_Dependency2')) { + require_once 'PEAR/Dependency2.php'; + } + $z = &new PEAR_Dependency2($c, $i, $p, $s); + return $z; + } + + function &download($params) + { + if (!count($params)) { + $a = array(); + return $a; + } + + if (!isset($this->_registry)) { + $this->_registry = &$this->config->getRegistry(); + } + + $channelschecked = array(); + // convert all parameters into PEAR_Downloader_Package objects + foreach ($params as $i => $param) { + $params[$i] = &$this->newDownloaderPackage($this); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $err = $params[$i]->initialize($param); + PEAR::staticPopErrorHandling(); + if (!$err) { + // skip parameters that were missed by preferred_state + continue; + } + + if (PEAR::isError($err)) { + if (!isset($this->_options['soft']) && $err->getMessage() !== '') { + $this->log(0, $err->getMessage()); + } + + $params[$i] = false; + if (is_object($param)) { + $param = $param->getChannel() . '/' . $param->getPackage(); + } + + if (!isset($this->_options['soft'])) { + $this->log(2, 'Package "' . $param . '" is not valid'); + } + + // Message logged above in a specific verbose mode, passing null to not show up on CLI + $this->pushError(null, PEAR_INSTALLER_SKIPPED); + } else { + do { + if ($params[$i] && $params[$i]->getType() == 'local') { + // bug #7090 skip channel.xml check for local packages + break; + } + + if ($params[$i] && !isset($channelschecked[$params[$i]->getChannel()]) && + !isset($this->_options['offline']) + ) { + $channelschecked[$params[$i]->getChannel()] = true; + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + if (!class_exists('System')) { + require_once 'System.php'; + } + + $curchannel = &$this->_registry->getChannel($params[$i]->getChannel()); + if (PEAR::isError($curchannel)) { + PEAR::staticPopErrorHandling(); + return $this->raiseError($curchannel); + } + + if (PEAR::isError($dir = $this->getDownloadDir())) { + PEAR::staticPopErrorHandling(); + break; + } + + $mirror = $this->config->get('preferred_mirror', null, $params[$i]->getChannel()); + $url = 'http://' . $mirror . '/channel.xml'; + $a = $this->downloadHttp($url, $this->ui, $dir, null, $curchannel->lastModified()); + + PEAR::staticPopErrorHandling(); + if (PEAR::isError($a) || !$a) { + // Attempt fallback to https automatically + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $a = $this->downloadHttp('https://' . $mirror . + '/channel.xml', $this->ui, $dir, null, $curchannel->lastModified()); + + PEAR::staticPopErrorHandling(); + if (PEAR::isError($a) || !$a) { + break; + } + } + $this->log(0, 'WARNING: channel "' . $params[$i]->getChannel() . '" has ' . + 'updated its protocols, use "' . PEAR_RUNTYPE . ' channel-update ' . $params[$i]->getChannel() . + '" to update'); + } + } while (false); + + if ($params[$i] && !isset($this->_options['downloadonly'])) { + if (isset($this->_options['packagingroot'])) { + $checkdir = $this->_prependPath( + $this->config->get('php_dir', null, $params[$i]->getChannel()), + $this->_options['packagingroot']); + } else { + $checkdir = $this->config->get('php_dir', + null, $params[$i]->getChannel()); + } + + while ($checkdir && $checkdir != '/' && !file_exists($checkdir)) { + $checkdir = dirname($checkdir); + } + + if ($checkdir == '.') { + $checkdir = '/'; + } + + if (!is_writeable($checkdir)) { + return PEAR::raiseError('Cannot install, php_dir for channel "' . + $params[$i]->getChannel() . '" is not writeable by the current user'); + } + } + } + } + + unset($channelschecked); + PEAR_Downloader_Package::removeDuplicates($params); + if (!count($params)) { + $a = array(); + return $a; + } + + if (!isset($this->_options['nodeps']) && !isset($this->_options['offline'])) { + $reverify = true; + while ($reverify) { + $reverify = false; + foreach ($params as $i => $param) { + //PHP Bug 40768 / PEAR Bug #10944 + //Nested foreaches fail in PHP 5.2.1 + key($params); + $ret = $params[$i]->detectDependencies($params); + if (PEAR::isError($ret)) { + $reverify = true; + $params[$i] = false; + PEAR_Downloader_Package::removeDuplicates($params); + if (!isset($this->_options['soft'])) { + $this->log(0, $ret->getMessage()); + } + continue 2; + } + } + } + } + + if (isset($this->_options['offline'])) { + $this->log(3, 'Skipping dependency download check, --offline specified'); + } + + if (!count($params)) { + $a = array(); + return $a; + } + + while (PEAR_Downloader_Package::mergeDependencies($params)); + PEAR_Downloader_Package::removeDuplicates($params, true); + $errorparams = array(); + if (PEAR_Downloader_Package::detectStupidDuplicates($params, $errorparams)) { + if (count($errorparams)) { + foreach ($errorparams as $param) { + $name = $this->_registry->parsedPackageNameToString($param->getParsedPackage()); + $this->pushError('Duplicate package ' . $name . ' found', PEAR_INSTALLER_FAILED); + } + $a = array(); + return $a; + } + } + + PEAR_Downloader_Package::removeInstalled($params); + if (!count($params)) { + $this->pushError('No valid packages found', PEAR_INSTALLER_FAILED); + $a = array(); + return $a; + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $err = $this->analyzeDependencies($params); + PEAR::popErrorHandling(); + if (!count($params)) { + $this->pushError('No valid packages found', PEAR_INSTALLER_FAILED); + $a = array(); + return $a; + } + + $ret = array(); + $newparams = array(); + if (isset($this->_options['pretend'])) { + return $params; + } + + $somefailed = false; + foreach ($params as $i => $package) { + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $pf = &$params[$i]->download(); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($pf)) { + if (!isset($this->_options['soft'])) { + $this->log(1, $pf->getMessage()); + $this->log(0, 'Error: cannot download "' . + $this->_registry->parsedPackageNameToString($package->getParsedPackage(), + true) . + '"'); + } + $somefailed = true; + continue; + } + + $newparams[] = &$params[$i]; + $ret[] = array( + 'file' => $pf->getArchiveFile(), + 'info' => &$pf, + 'pkg' => $pf->getPackage() + ); + } + + if ($somefailed) { + // remove params that did not download successfully + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $err = $this->analyzeDependencies($newparams, true); + PEAR::popErrorHandling(); + if (!count($newparams)) { + $this->pushError('Download failed', PEAR_INSTALLER_FAILED); + $a = array(); + return $a; + } + } + + $this->_downloadedPackages = $ret; + return $newparams; + } + + /** + * @param array all packages to be installed + */ + function analyzeDependencies(&$params, $force = false) + { + if (isset($this->_options['downloadonly'])) { + return; + } + + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $redo = true; + $reset = $hasfailed = $failed = false; + while ($redo) { + $redo = false; + foreach ($params as $i => $param) { + $deps = $param->getDeps(); + if (!$deps) { + $depchecker = &$this->getDependency2Object($this->config, $this->getOptions(), + $param->getParsedPackage(), PEAR_VALIDATE_DOWNLOADING); + $send = $param->getPackageFile(); + + $installcheck = $depchecker->validatePackage($send, $this, $params); + if (PEAR::isError($installcheck)) { + if (!isset($this->_options['soft'])) { + $this->log(0, $installcheck->getMessage()); + } + $hasfailed = true; + $params[$i] = false; + $reset = true; + $redo = true; + $failed = false; + PEAR_Downloader_Package::removeDuplicates($params); + continue 2; + } + continue; + } + + if (!$reset && $param->alreadyValidated() && !$force) { + continue; + } + + if (count($deps)) { + $depchecker = &$this->getDependency2Object($this->config, $this->getOptions(), + $param->getParsedPackage(), PEAR_VALIDATE_DOWNLOADING); + $send = $param->getPackageFile(); + if ($send === null) { + $send = $param->getDownloadURL(); + } + + $installcheck = $depchecker->validatePackage($send, $this, $params); + if (PEAR::isError($installcheck)) { + if (!isset($this->_options['soft'])) { + $this->log(0, $installcheck->getMessage()); + } + $hasfailed = true; + $params[$i] = false; + $reset = true; + $redo = true; + $failed = false; + PEAR_Downloader_Package::removeDuplicates($params); + continue 2; + } + + $failed = false; + if (isset($deps['required']) && is_array($deps['required'])) { + foreach ($deps['required'] as $type => $dep) { + // note: Dependency2 will never return a PEAR_Error if ignore-errors + // is specified, so soft is needed to turn off logging + if (!isset($dep[0])) { + if (PEAR::isError($e = $depchecker->{"validate{$type}Dependency"}($dep, + true, $params))) { + $failed = true; + if (!isset($this->_options['soft'])) { + $this->log(0, $e->getMessage()); + } + } elseif (is_array($e) && !$param->alreadyValidated()) { + if (!isset($this->_options['soft'])) { + $this->log(0, $e[0]); + } + } + } else { + foreach ($dep as $d) { + if (PEAR::isError($e = + $depchecker->{"validate{$type}Dependency"}($d, + true, $params))) { + $failed = true; + if (!isset($this->_options['soft'])) { + $this->log(0, $e->getMessage()); + } + } elseif (is_array($e) && !$param->alreadyValidated()) { + if (!isset($this->_options['soft'])) { + $this->log(0, $e[0]); + } + } + } + } + } + + if (isset($deps['optional']) && is_array($deps['optional'])) { + foreach ($deps['optional'] as $type => $dep) { + if (!isset($dep[0])) { + if (PEAR::isError($e = + $depchecker->{"validate{$type}Dependency"}($dep, + false, $params))) { + $failed = true; + if (!isset($this->_options['soft'])) { + $this->log(0, $e->getMessage()); + } + } elseif (is_array($e) && !$param->alreadyValidated()) { + if (!isset($this->_options['soft'])) { + $this->log(0, $e[0]); + } + } + } else { + foreach ($dep as $d) { + if (PEAR::isError($e = + $depchecker->{"validate{$type}Dependency"}($d, + false, $params))) { + $failed = true; + if (!isset($this->_options['soft'])) { + $this->log(0, $e->getMessage()); + } + } elseif (is_array($e) && !$param->alreadyValidated()) { + if (!isset($this->_options['soft'])) { + $this->log(0, $e[0]); + } + } + } + } + } + } + + $groupname = $param->getGroup(); + if (isset($deps['group']) && $groupname) { + if (!isset($deps['group'][0])) { + $deps['group'] = array($deps['group']); + } + + $found = false; + foreach ($deps['group'] as $group) { + if ($group['attribs']['name'] == $groupname) { + $found = true; + break; + } + } + + if ($found) { + unset($group['attribs']); + foreach ($group as $type => $dep) { + if (!isset($dep[0])) { + if (PEAR::isError($e = + $depchecker->{"validate{$type}Dependency"}($dep, + false, $params))) { + $failed = true; + if (!isset($this->_options['soft'])) { + $this->log(0, $e->getMessage()); + } + } elseif (is_array($e) && !$param->alreadyValidated()) { + if (!isset($this->_options['soft'])) { + $this->log(0, $e[0]); + } + } + } else { + foreach ($dep as $d) { + if (PEAR::isError($e = + $depchecker->{"validate{$type}Dependency"}($d, + false, $params))) { + $failed = true; + if (!isset($this->_options['soft'])) { + $this->log(0, $e->getMessage()); + } + } elseif (is_array($e) && !$param->alreadyValidated()) { + if (!isset($this->_options['soft'])) { + $this->log(0, $e[0]); + } + } + } + } + } + } + } + } else { + foreach ($deps as $dep) { + if (PEAR::isError($e = $depchecker->validateDependency1($dep, $params))) { + $failed = true; + if (!isset($this->_options['soft'])) { + $this->log(0, $e->getMessage()); + } + } elseif (is_array($e) && !$param->alreadyValidated()) { + if (!isset($this->_options['soft'])) { + $this->log(0, $e[0]); + } + } + } + } + $params[$i]->setValidated(); + } + + if ($failed) { + $hasfailed = true; + $params[$i] = false; + $reset = true; + $redo = true; + $failed = false; + PEAR_Downloader_Package::removeDuplicates($params); + continue 2; + } + } + } + + PEAR::staticPopErrorHandling(); + if ($hasfailed && (isset($this->_options['ignore-errors']) || + isset($this->_options['nodeps']))) { + // this is probably not needed, but just in case + if (!isset($this->_options['soft'])) { + $this->log(0, 'WARNING: dependencies failed'); + } + } + } + + /** + * Retrieve the directory that downloads will happen in + * @access private + * @return string + */ + function getDownloadDir() + { + if (isset($this->_downloadDir)) { + return $this->_downloadDir; + } + + $downloaddir = $this->config->get('download_dir'); + if (empty($downloaddir) || (is_dir($downloaddir) && !is_writable($downloaddir))) { + if (is_dir($downloaddir) && !is_writable($downloaddir)) { + $this->log(0, 'WARNING: configuration download directory "' . $downloaddir . + '" is not writeable. Change download_dir config variable to ' . + 'a writeable dir to avoid this warning'); + } + + if (!class_exists('System')) { + require_once 'System.php'; + } + + if (PEAR::isError($downloaddir = System::mktemp('-d'))) { + return $downloaddir; + } + $this->log(3, '+ tmp dir created at ' . $downloaddir); + } + + if (!is_writable($downloaddir)) { + if (PEAR::isError(System::mkdir(array('-p', $downloaddir))) || + !is_writable($downloaddir)) { + return PEAR::raiseError('download directory "' . $downloaddir . + '" is not writeable. Change download_dir config variable to ' . + 'a writeable dir'); + } + } + + return $this->_downloadDir = $downloaddir; + } + + function setDownloadDir($dir) + { + if (!@is_writable($dir)) { + if (PEAR::isError(System::mkdir(array('-p', $dir)))) { + return PEAR::raiseError('download directory "' . $dir . + '" is not writeable. Change download_dir config variable to ' . + 'a writeable dir'); + } + } + $this->_downloadDir = $dir; + } + + function configSet($key, $value, $layer = 'user', $channel = false) + { + $this->config->set($key, $value, $layer, $channel); + $this->_preferredState = $this->config->get('preferred_state', null, $channel); + if (!$this->_preferredState) { + // don't inadvertantly use a non-set preferred_state + $this->_preferredState = null; + } + } + + function setOptions($options) + { + $this->_options = $options; + } + + function getOptions() + { + return $this->_options; + } + + + /** + * @param array output of {@link parsePackageName()} + * @access private + */ + function _getPackageDownloadUrl($parr) + { + $curchannel = $this->config->get('default_channel'); + $this->configSet('default_channel', $parr['channel']); + // getDownloadURL returns an array. On error, it only contains information + // on the latest release as array(version, info). On success it contains + // array(version, info, download url string) + $state = isset($parr['state']) ? $parr['state'] : $this->config->get('preferred_state'); + if (!$this->_registry->channelExists($parr['channel'])) { + do { + if ($this->config->get('auto_discover') && $this->discover($parr['channel'])) { + break; + } + + $this->configSet('default_channel', $curchannel); + return PEAR::raiseError('Unknown remote channel: ' . $parr['channel']); + } while (false); + } + + $chan = &$this->_registry->getChannel($parr['channel']); + if (PEAR::isError($chan)) { + return $chan; + } + + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $version = $this->_registry->packageInfo($parr['package'], 'version', $parr['channel']); + $stability = $this->_registry->packageInfo($parr['package'], 'stability', $parr['channel']); + // package is installed - use the installed release stability level + if (!isset($parr['state']) && $stability !== null) { + $state = $stability['release']; + } + PEAR::staticPopErrorHandling(); + $base2 = false; + + $preferred_mirror = $this->config->get('preferred_mirror'); + if (!$chan->supportsREST($preferred_mirror) || + ( + !($base2 = $chan->getBaseURL('REST1.3', $preferred_mirror)) + && + !($base = $chan->getBaseURL('REST1.0', $preferred_mirror)) + ) + ) { + return $this->raiseError($parr['channel'] . ' is using a unsupported protocol - This should never happen.'); + } + + if ($base2) { + $rest = &$this->config->getREST('1.3', $this->_options); + $base = $base2; + } else { + $rest = &$this->config->getREST('1.0', $this->_options); + } + + $downloadVersion = false; + if (!isset($parr['version']) && !isset($parr['state']) && $version + && !PEAR::isError($version) + && !isset($this->_options['downloadonly']) + ) { + $downloadVersion = $version; + } + + $url = $rest->getDownloadURL($base, $parr, $state, $downloadVersion, $chan->getName()); + if (PEAR::isError($url)) { + $this->configSet('default_channel', $curchannel); + return $url; + } + + if ($parr['channel'] != $curchannel) { + $this->configSet('default_channel', $curchannel); + } + + if (!is_array($url)) { + return $url; + } + + $url['raw'] = false; // no checking is necessary for REST + if (!is_array($url['info'])) { + return PEAR::raiseError('Invalid remote dependencies retrieved from REST - ' . + 'this should never happen'); + } + + if (!isset($this->_options['force']) && + !isset($this->_options['downloadonly']) && + $version && + !PEAR::isError($version) && + !isset($parr['group']) + ) { + if (version_compare($version, $url['version'], '=')) { + return PEAR::raiseError($this->_registry->parsedPackageNameToString( + $parr, true) . ' is already installed and is the same as the ' . + 'released version ' . $url['version'], -976); + } + + if (version_compare($version, $url['version'], '>')) { + return PEAR::raiseError($this->_registry->parsedPackageNameToString( + $parr, true) . ' is already installed and is newer than detected ' . + 'released version ' . $url['version'], -976); + } + } + + if (isset($url['info']['required']) || $url['compatible']) { + require_once 'PEAR/PackageFile/v2.php'; + $pf = new PEAR_PackageFile_v2; + $pf->setRawChannel($parr['channel']); + if ($url['compatible']) { + $pf->setRawCompatible($url['compatible']); + } + } else { + require_once 'PEAR/PackageFile/v1.php'; + $pf = new PEAR_PackageFile_v1; + } + + $pf->setRawPackage($url['package']); + $pf->setDeps($url['info']); + if ($url['compatible']) { + $pf->setCompatible($url['compatible']); + } + + $pf->setRawState($url['stability']); + $url['info'] = &$pf; + if (!extension_loaded("zlib") || isset($this->_options['nocompress'])) { + $ext = '.tar'; + } else { + $ext = '.tgz'; + } + + if (is_array($url) && isset($url['url'])) { + $url['url'] .= $ext; + } + + return $url; + } + + /** + * @param array dependency array + * @access private + */ + function _getDepPackageDownloadUrl($dep, $parr) + { + $xsdversion = isset($dep['rel']) ? '1.0' : '2.0'; + $curchannel = $this->config->get('default_channel'); + if (isset($dep['uri'])) { + $xsdversion = '2.0'; + $chan = &$this->_registry->getChannel('__uri'); + if (PEAR::isError($chan)) { + return $chan; + } + + $version = $this->_registry->packageInfo($dep['name'], 'version', '__uri'); + $this->configSet('default_channel', '__uri'); + } else { + if (isset($dep['channel'])) { + $remotechannel = $dep['channel']; + } else { + $remotechannel = 'pear.php.net'; + } + + if (!$this->_registry->channelExists($remotechannel)) { + do { + if ($this->config->get('auto_discover')) { + if ($this->discover($remotechannel)) { + break; + } + } + return PEAR::raiseError('Unknown remote channel: ' . $remotechannel); + } while (false); + } + + $chan = &$this->_registry->getChannel($remotechannel); + if (PEAR::isError($chan)) { + return $chan; + } + + $version = $this->_registry->packageInfo($dep['name'], 'version', $remotechannel); + $this->configSet('default_channel', $remotechannel); + } + + $state = isset($parr['state']) ? $parr['state'] : $this->config->get('preferred_state'); + if (isset($parr['state']) && isset($parr['version'])) { + unset($parr['state']); + } + + if (isset($dep['uri'])) { + $info = &$this->newDownloaderPackage($this); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $err = $info->initialize($dep); + PEAR::staticPopErrorHandling(); + if (!$err) { + // skip parameters that were missed by preferred_state + return PEAR::raiseError('Cannot initialize dependency'); + } + + if (PEAR::isError($err)) { + if (!isset($this->_options['soft'])) { + $this->log(0, $err->getMessage()); + } + + if (is_object($info)) { + $param = $info->getChannel() . '/' . $info->getPackage(); + } + return PEAR::raiseError('Package "' . $param . '" is not valid'); + } + return $info; + } elseif ($chan->supportsREST($this->config->get('preferred_mirror')) + && + ( + ($base2 = $chan->getBaseURL('REST1.3', $this->config->get('preferred_mirror'))) + || + ($base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) + ) + ) { + if ($base2) { + $base = $base2; + $rest = &$this->config->getREST('1.3', $this->_options); + } else { + $rest = &$this->config->getREST('1.0', $this->_options); + } + + $url = $rest->getDepDownloadURL($base, $xsdversion, $dep, $parr, + $state, $version, $chan->getName()); + if (PEAR::isError($url)) { + return $url; + } + + if ($parr['channel'] != $curchannel) { + $this->configSet('default_channel', $curchannel); + } + + if (!is_array($url)) { + return $url; + } + + $url['raw'] = false; // no checking is necessary for REST + if (!is_array($url['info'])) { + return PEAR::raiseError('Invalid remote dependencies retrieved from REST - ' . + 'this should never happen'); + } + + if (isset($url['info']['required'])) { + if (!class_exists('PEAR_PackageFile_v2')) { + require_once 'PEAR/PackageFile/v2.php'; + } + $pf = new PEAR_PackageFile_v2; + $pf->setRawChannel($remotechannel); + } else { + if (!class_exists('PEAR_PackageFile_v1')) { + require_once 'PEAR/PackageFile/v1.php'; + } + $pf = new PEAR_PackageFile_v1; + + } + $pf->setRawPackage($url['package']); + $pf->setDeps($url['info']); + if ($url['compatible']) { + $pf->setCompatible($url['compatible']); + } + + $pf->setRawState($url['stability']); + $url['info'] = &$pf; + if (!extension_loaded("zlib") || isset($this->_options['nocompress'])) { + $ext = '.tar'; + } else { + $ext = '.tgz'; + } + + if (is_array($url) && isset($url['url'])) { + $url['url'] .= $ext; + } + + return $url; + } + + return $this->raiseError($parr['channel'] . ' is using a unsupported protocol - This should never happen.'); + } + + /** + * @deprecated in favor of _getPackageDownloadUrl + */ + function getPackageDownloadUrl($package, $version = null, $channel = false) + { + if ($version) { + $package .= "-$version"; + } + if ($this === null || $this->_registry === null) { + $package = "http://pear.php.net/get/$package"; + } else { + $chan = $this->_registry->getChannel($channel); + if (PEAR::isError($chan)) { + return ''; + } + $package = "http://" . $chan->getServer() . "/get/$package"; + } + if (!extension_loaded("zlib")) { + $package .= '?uncompress=yes'; + } + return $package; + } + + /** + * Retrieve a list of downloaded packages after a call to {@link download()}. + * + * Also resets the list of downloaded packages. + * @return array + */ + function getDownloadedPackages() + { + $ret = $this->_downloadedPackages; + $this->_downloadedPackages = array(); + $this->_toDownload = array(); + return $ret; + } + + function _downloadCallback($msg, $params = null) + { + switch ($msg) { + case 'saveas': + $this->log(1, "downloading $params ..."); + break; + case 'done': + $this->log(1, '...done: ' . number_format($params, 0, '', ',') . ' bytes'); + break; + case 'bytesread': + static $bytes; + if (empty($bytes)) { + $bytes = 0; + } + if (!($bytes % 10240)) { + $this->log(1, '.', false); + } + $bytes += $params; + break; + case 'start': + if($params[1] == -1) { + $length = "Unknown size"; + } else { + $length = number_format($params[1], 0, '', ',')." bytes"; + } + $this->log(1, "Starting to download {$params[0]} ($length)"); + break; + } + if (method_exists($this->ui, '_downloadCallback')) + $this->ui->_downloadCallback($msg, $params); + } + + function _prependPath($path, $prepend) + { + if (strlen($prepend) > 0) { + if (OS_WINDOWS && preg_match('/^[a-z]:/i', $path)) { + if (preg_match('/^[a-z]:/i', $prepend)) { + $prepend = substr($prepend, 2); + } elseif ($prepend{0} != '\\') { + $prepend = "\\$prepend"; + } + $path = substr($path, 0, 2) . $prepend . substr($path, 2); + } else { + $path = $prepend . $path; + } + } + return $path; + } + + /** + * @param string + * @param integer + */ + function pushError($errmsg, $code = -1) + { + array_push($this->_errorStack, array($errmsg, $code)); + } + + function getErrorMsgs() + { + $msgs = array(); + $errs = $this->_errorStack; + foreach ($errs as $err) { + $msgs[] = $err[0]; + } + $this->_errorStack = array(); + return $msgs; + } + + /** + * for BC + * + * @deprecated + */ + function sortPkgDeps(&$packages, $uninstall = false) + { + $uninstall ? + $this->sortPackagesForUninstall($packages) : + $this->sortPackagesForInstall($packages); + } + + /** + * Sort a list of arrays of array(downloaded packagefilename) by dependency. + * + * This uses the topological sort method from graph theory, and the + * Structures_Graph package to properly sort dependencies for installation. + * @param array an array of downloaded PEAR_Downloader_Packages + * @return array array of array(packagefilename, package.xml contents) + */ + function sortPackagesForInstall(&$packages) + { + require_once 'Structures/Graph.php'; + require_once 'Structures/Graph/Node.php'; + require_once 'Structures/Graph/Manipulator/TopologicalSorter.php'; + $depgraph = new Structures_Graph(true); + $nodes = array(); + $reg = &$this->config->getRegistry(); + foreach ($packages as $i => $package) { + $pname = $reg->parsedPackageNameToString( + array( + 'channel' => $package->getChannel(), + 'package' => strtolower($package->getPackage()), + )); + $nodes[$pname] = new Structures_Graph_Node; + $nodes[$pname]->setData($packages[$i]); + $depgraph->addNode($nodes[$pname]); + } + + $deplinks = array(); + foreach ($nodes as $package => $node) { + $pf = &$node->getData(); + $pdeps = $pf->getDeps(true); + if (!$pdeps) { + continue; + } + + if ($pf->getPackagexmlVersion() == '1.0') { + foreach ($pdeps as $dep) { + if ($dep['type'] != 'pkg' || + (isset($dep['optional']) && $dep['optional'] == 'yes')) { + continue; + } + + $dname = $reg->parsedPackageNameToString( + array( + 'channel' => 'pear.php.net', + 'package' => strtolower($dep['name']), + )); + + if (isset($nodes[$dname])) { + if (!isset($deplinks[$dname])) { + $deplinks[$dname] = array(); + } + + $deplinks[$dname][$package] = 1; + // dependency is in installed packages + continue; + } + + $dname = $reg->parsedPackageNameToString( + array( + 'channel' => 'pecl.php.net', + 'package' => strtolower($dep['name']), + )); + + if (isset($nodes[$dname])) { + if (!isset($deplinks[$dname])) { + $deplinks[$dname] = array(); + } + + $deplinks[$dname][$package] = 1; + // dependency is in installed packages + continue; + } + } + } else { + // the only ordering we care about is: + // 1) subpackages must be installed before packages that depend on them + // 2) required deps must be installed before packages that depend on them + if (isset($pdeps['required']['subpackage'])) { + $t = $pdeps['required']['subpackage']; + if (!isset($t[0])) { + $t = array($t); + } + + $this->_setupGraph($t, $reg, $deplinks, $nodes, $package); + } + + if (isset($pdeps['group'])) { + if (!isset($pdeps['group'][0])) { + $pdeps['group'] = array($pdeps['group']); + } + + foreach ($pdeps['group'] as $group) { + if (isset($group['subpackage'])) { + $t = $group['subpackage']; + if (!isset($t[0])) { + $t = array($t); + } + + $this->_setupGraph($t, $reg, $deplinks, $nodes, $package); + } + } + } + + if (isset($pdeps['optional']['subpackage'])) { + $t = $pdeps['optional']['subpackage']; + if (!isset($t[0])) { + $t = array($t); + } + + $this->_setupGraph($t, $reg, $deplinks, $nodes, $package); + } + + if (isset($pdeps['required']['package'])) { + $t = $pdeps['required']['package']; + if (!isset($t[0])) { + $t = array($t); + } + + $this->_setupGraph($t, $reg, $deplinks, $nodes, $package); + } + + if (isset($pdeps['group'])) { + if (!isset($pdeps['group'][0])) { + $pdeps['group'] = array($pdeps['group']); + } + + foreach ($pdeps['group'] as $group) { + if (isset($group['package'])) { + $t = $group['package']; + if (!isset($t[0])) { + $t = array($t); + } + + $this->_setupGraph($t, $reg, $deplinks, $nodes, $package); + } + } + } + } + } + + $this->_detectDepCycle($deplinks); + foreach ($deplinks as $dependent => $parents) { + foreach ($parents as $parent => $unused) { + $nodes[$dependent]->connectTo($nodes[$parent]); + } + } + + $installOrder = Structures_Graph_Manipulator_TopologicalSorter::sort($depgraph); + $ret = array(); + for ($i = 0, $count = count($installOrder); $i < $count; $i++) { + foreach ($installOrder[$i] as $index => $sortedpackage) { + $data = &$installOrder[$i][$index]->getData(); + $ret[] = &$nodes[$reg->parsedPackageNameToString( + array( + 'channel' => $data->getChannel(), + 'package' => strtolower($data->getPackage()), + ))]->getData(); + } + } + + $packages = $ret; + return; + } + + /** + * Detect recursive links between dependencies and break the cycles + * + * @param array + * @access private + */ + function _detectDepCycle(&$deplinks) + { + do { + $keepgoing = false; + foreach ($deplinks as $dep => $parents) { + foreach ($parents as $parent => $unused) { + // reset the parent cycle detector + $this->_testCycle(null, null, null); + if ($this->_testCycle($dep, $deplinks, $parent)) { + $keepgoing = true; + unset($deplinks[$dep][$parent]); + if (count($deplinks[$dep]) == 0) { + unset($deplinks[$dep]); + } + + continue 3; + } + } + } + } while ($keepgoing); + } + + function _testCycle($test, $deplinks, $dep) + { + static $visited = array(); + if ($test === null) { + $visited = array(); + return; + } + + // this happens when a parent has a dep cycle on another dependency + // but the child is not part of the cycle + if (isset($visited[$dep])) { + return false; + } + + $visited[$dep] = 1; + if ($test == $dep) { + return true; + } + + if (isset($deplinks[$dep])) { + if (in_array($test, array_keys($deplinks[$dep]), true)) { + return true; + } + + foreach ($deplinks[$dep] as $parent => $unused) { + if ($this->_testCycle($test, $deplinks, $parent)) { + return true; + } + } + } + + return false; + } + + /** + * Set up the dependency for installation parsing + * + * @param array $t dependency information + * @param PEAR_Registry $reg + * @param array $deplinks list of dependency links already established + * @param array $nodes all existing package nodes + * @param string $package parent package name + * @access private + */ + function _setupGraph($t, $reg, &$deplinks, &$nodes, $package) + { + foreach ($t as $dep) { + $depchannel = !isset($dep['channel']) ? '__uri': $dep['channel']; + $dname = $reg->parsedPackageNameToString( + array( + 'channel' => $depchannel, + 'package' => strtolower($dep['name']), + )); + + if (isset($nodes[$dname])) { + if (!isset($deplinks[$dname])) { + $deplinks[$dname] = array(); + } + $deplinks[$dname][$package] = 1; + } + } + } + + function _dependsOn($a, $b) + { + return $this->_checkDepTree(strtolower($a->getChannel()), strtolower($a->getPackage()), $b); + } + + function _checkDepTree($channel, $package, $b, $checked = array()) + { + $checked[$channel][$package] = true; + if (!isset($this->_depTree[$channel][$package])) { + return false; + } + + if (isset($this->_depTree[$channel][$package][strtolower($b->getChannel())] + [strtolower($b->getPackage())])) { + return true; + } + + foreach ($this->_depTree[$channel][$package] as $ch => $packages) { + foreach ($packages as $pa => $true) { + if ($this->_checkDepTree($ch, $pa, $b, $checked)) { + return true; + } + } + } + + return false; + } + + function _sortInstall($a, $b) + { + if (!$a->getDeps() && !$b->getDeps()) { + return 0; // neither package has dependencies, order is insignificant + } + if ($a->getDeps() && !$b->getDeps()) { + return 1; // $a must be installed after $b because $a has dependencies + } + if (!$a->getDeps() && $b->getDeps()) { + return -1; // $b must be installed after $a because $b has dependencies + } + // both packages have dependencies + if ($this->_dependsOn($a, $b)) { + return 1; + } + if ($this->_dependsOn($b, $a)) { + return -1; + } + return 0; + } + + /** + * Download a file through HTTP. Considers suggested file name in + * Content-disposition: header and can run a callback function for + * different events. The callback will be called with two + * parameters: the callback type, and parameters. The implemented + * callback types are: + * + * 'setup' called at the very beginning, parameter is a UI object + * that should be used for all output + * 'message' the parameter is a string with an informational message + * 'saveas' may be used to save with a different file name, the + * parameter is the filename that is about to be used. + * If a 'saveas' callback returns a non-empty string, + * that file name will be used as the filename instead. + * Note that $save_dir will not be affected by this, only + * the basename of the file. + * 'start' download is starting, parameter is number of bytes + * that are expected, or -1 if unknown + * 'bytesread' parameter is the number of bytes read so far + * 'done' download is complete, parameter is the total number + * of bytes read + * 'connfailed' if the TCP/SSL connection fails, this callback is called + * with array(host,port,errno,errmsg) + * 'writefailed' if writing to disk fails, this callback is called + * with array(destfile,errmsg) + * + * If an HTTP proxy has been configured (http_proxy PEAR_Config + * setting), the proxy will be used. + * + * @param string $url the URL to download + * @param object $ui PEAR_Frontend_* instance + * @param object $config PEAR_Config instance + * @param string $save_dir directory to save file in + * @param mixed $callback function/method to call for status + * updates + * @param false|string|array $lastmodified header values to check against for caching + * use false to return the header values from this download + * @param false|array $accept Accept headers to send + * @param false|string $channel Channel to use for retrieving authentication + * @return string|array Returns the full path of the downloaded file or a PEAR + * error on failure. If the error is caused by + * socket-related errors, the error object will + * have the fsockopen error code available through + * getCode(). If caching is requested, then return the header + * values. + * + * @access public + */ + function downloadHttp($url, &$ui, $save_dir = '.', $callback = null, $lastmodified = null, + $accept = false, $channel = false) + { + static $redirect = 0; + // always reset , so we are clean case of error + $wasredirect = $redirect; + $redirect = 0; + if ($callback) { + call_user_func($callback, 'setup', array(&$ui)); + } + + $info = parse_url($url); + if (!isset($info['scheme']) || !in_array($info['scheme'], array('http', 'https'))) { + return PEAR::raiseError('Cannot download non-http URL "' . $url . '"'); + } + + if (!isset($info['host'])) { + return PEAR::raiseError('Cannot download from non-URL "' . $url . '"'); + } + + $host = isset($info['host']) ? $info['host'] : null; + $port = isset($info['port']) ? $info['port'] : null; + $path = isset($info['path']) ? $info['path'] : null; + + if (isset($this)) { + $config = &$this->config; + } else { + $config = &PEAR_Config::singleton(); + } + + $proxy_host = $proxy_port = $proxy_user = $proxy_pass = ''; + if ($config->get('http_proxy') && + $proxy = parse_url($config->get('http_proxy'))) { + $proxy_host = isset($proxy['host']) ? $proxy['host'] : null; + if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') { + $proxy_host = 'ssl://' . $proxy_host; + } + $proxy_port = isset($proxy['port']) ? $proxy['port'] : 8080; + $proxy_user = isset($proxy['user']) ? urldecode($proxy['user']) : null; + $proxy_pass = isset($proxy['pass']) ? urldecode($proxy['pass']) : null; + + if ($callback) { + call_user_func($callback, 'message', "Using HTTP proxy $host:$port"); + } + } + + if (empty($port)) { + $port = (isset($info['scheme']) && $info['scheme'] == 'https') ? 443 : 80; + } + + $scheme = (isset($info['scheme']) && $info['scheme'] == 'https') ? 'https' : 'http'; + + if ($proxy_host != '') { + $fp = @fsockopen($proxy_host, $proxy_port, $errno, $errstr); + if (!$fp) { + if ($callback) { + call_user_func($callback, 'connfailed', array($proxy_host, $proxy_port, + $errno, $errstr)); + } + return PEAR::raiseError("Connection to `$proxy_host:$proxy_port' failed: $errstr", $errno); + } + + if ($lastmodified === false || $lastmodified) { + $request = "GET $url HTTP/1.1\r\n"; + $request .= "Host: $host\r\n"; + } else { + $request = "GET $url HTTP/1.0\r\n"; + $request .= "Host: $host\r\n"; + } + } else { + $network_host = $host; + if (isset($info['scheme']) && $info['scheme'] == 'https') { + $network_host = 'ssl://' . $host; + } + + $fp = @fsockopen($network_host, $port, $errno, $errstr); + if (!$fp) { + if ($callback) { + call_user_func($callback, 'connfailed', array($host, $port, + $errno, $errstr)); + } + return PEAR::raiseError("Connection to `$host:$port' failed: $errstr", $errno); + } + + if ($lastmodified === false || $lastmodified) { + $request = "GET $path HTTP/1.1\r\n"; + $request .= "Host: $host\r\n"; + } else { + $request = "GET $path HTTP/1.0\r\n"; + $request .= "Host: $host\r\n"; + } + } + + $ifmodifiedsince = ''; + if (is_array($lastmodified)) { + if (isset($lastmodified['Last-Modified'])) { + $ifmodifiedsince = 'If-Modified-Since: ' . $lastmodified['Last-Modified'] . "\r\n"; + } + + if (isset($lastmodified['ETag'])) { + $ifmodifiedsince .= "If-None-Match: $lastmodified[ETag]\r\n"; + } + } else { + $ifmodifiedsince = ($lastmodified ? "If-Modified-Since: $lastmodified\r\n" : ''); + } + + $request .= $ifmodifiedsince . + "User-Agent: PEAR/1.9.4/PHP/" . PHP_VERSION . "\r\n"; + + if (isset($this)) { // only pass in authentication for non-static calls + $username = $config->get('username', null, $channel); + $password = $config->get('password', null, $channel); + if ($username && $password) { + $tmp = base64_encode("$username:$password"); + $request .= "Authorization: Basic $tmp\r\n"; + } + } + + if ($proxy_host != '' && $proxy_user != '') { + $request .= 'Proxy-Authorization: Basic ' . + base64_encode($proxy_user . ':' . $proxy_pass) . "\r\n"; + } + + if ($accept) { + $request .= 'Accept: ' . implode(', ', $accept) . "\r\n"; + } + + $request .= "Connection: close\r\n"; + $request .= "\r\n"; + fwrite($fp, $request); + $headers = array(); + $reply = 0; + while (trim($line = fgets($fp, 1024))) { + if (preg_match('/^([^:]+):\s+(.*)\s*\\z/', $line, $matches)) { + $headers[strtolower($matches[1])] = trim($matches[2]); + } elseif (preg_match('|^HTTP/1.[01] ([0-9]{3}) |', $line, $matches)) { + $reply = (int)$matches[1]; + if ($reply == 304 && ($lastmodified || ($lastmodified === false))) { + return false; + } + + if (!in_array($reply, array(200, 301, 302, 303, 305, 307))) { + return PEAR::raiseError("File $scheme://$host:$port$path not valid (received: $line)"); + } + } + } + + if ($reply != 200) { + if (!isset($headers['location'])) { + return PEAR::raiseError("File $scheme://$host:$port$path not valid (redirected but no location)"); + } + + if ($wasredirect > 4) { + return PEAR::raiseError("File $scheme://$host:$port$path not valid (redirection looped more than 5 times)"); + } + + $redirect = $wasredirect + 1; + return $this->downloadHttp($headers['location'], + $ui, $save_dir, $callback, $lastmodified, $accept); + } + + if (isset($headers['content-disposition']) && + preg_match('/\sfilename=\"([^;]*\S)\"\s*(;|\\z)/', $headers['content-disposition'], $matches)) { + $save_as = basename($matches[1]); + } else { + $save_as = basename($url); + } + + if ($callback) { + $tmp = call_user_func($callback, 'saveas', $save_as); + if ($tmp) { + $save_as = $tmp; + } + } + + $dest_file = $save_dir . DIRECTORY_SEPARATOR . $save_as; + if (is_link($dest_file)) { + return PEAR::raiseError('SECURITY ERROR: Will not write to ' . $dest_file . ' as it is symlinked to ' . readlink($dest_file) . ' - Possible symlink attack'); + } + + if (!$wp = @fopen($dest_file, 'wb')) { + fclose($fp); + if ($callback) { + call_user_func($callback, 'writefailed', array($dest_file, $php_errormsg)); + } + return PEAR::raiseError("could not open $dest_file for writing"); + } + + $length = isset($headers['content-length']) ? $headers['content-length'] : -1; + + $bytes = 0; + if ($callback) { + call_user_func($callback, 'start', array(basename($dest_file), $length)); + } + + while ($data = fread($fp, 1024)) { + $bytes += strlen($data); + if ($callback) { + call_user_func($callback, 'bytesread', $bytes); + } + if (!@fwrite($wp, $data)) { + fclose($fp); + if ($callback) { + call_user_func($callback, 'writefailed', array($dest_file, $php_errormsg)); + } + return PEAR::raiseError("$dest_file: write failed ($php_errormsg)"); + } + } + + fclose($fp); + fclose($wp); + if ($callback) { + call_user_func($callback, 'done', $bytes); + } + + if ($lastmodified === false || $lastmodified) { + if (isset($headers['etag'])) { + $lastmodified = array('ETag' => $headers['etag']); + } + + if (isset($headers['last-modified'])) { + if (is_array($lastmodified)) { + $lastmodified['Last-Modified'] = $headers['last-modified']; + } else { + $lastmodified = $headers['last-modified']; + } + } + return array($dest_file, $lastmodified, $headers); + } + return $dest_file; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Downloader/Package.php b/vendor/pear-pear.php.net/PEAR/PEAR/Downloader/Package.php new file mode 100644 index 0000000000000000000000000000000000000000..987c9656751fbe4d0e24cfcc332b7ba1dd5d24ad --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Downloader/Package.php @@ -0,0 +1,1988 @@ +<?php +/** + * PEAR_Downloader_Package + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Package.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * Error code when parameter initialization fails because no releases + * exist within preferred_state, but releases do exist + */ +define('PEAR_DOWNLOADER_PACKAGE_STATE', -1003); +/** + * Error code when parameter initialization fails because no releases + * exist that will work with the existing PHP version + */ +define('PEAR_DOWNLOADER_PACKAGE_PHPVERSION', -1004); + +/** + * Coordinates download parameters and manages their dependencies + * prior to downloading them. + * + * Input can come from three sources: + * + * - local files (archives or package.xml) + * - remote files (downloadable urls) + * - abstract package names + * + * The first two elements are handled cleanly by PEAR_PackageFile, but the third requires + * accessing pearweb's xml-rpc interface to determine necessary dependencies, and the + * format returned of dependencies is slightly different from that used in package.xml. + * + * This class hides the differences between these elements, and makes automatic + * dependency resolution a piece of cake. It also manages conflicts when + * two classes depend on incompatible dependencies, or differing versions of the same + * package dependency. In addition, download will not be attempted if the php version is + * not supported, PEAR installer version is not supported, or non-PECL extensions are not + * installed. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Downloader_Package +{ + /** + * @var PEAR_Downloader + */ + var $_downloader; + /** + * @var PEAR_Config + */ + var $_config; + /** + * @var PEAR_Registry + */ + var $_registry; + /** + * Used to implement packagingroot properly + * @var PEAR_Registry + */ + var $_installRegistry; + /** + * @var PEAR_PackageFile_v1|PEAR_PackageFile|v2 + */ + var $_packagefile; + /** + * @var array + */ + var $_parsedname; + /** + * @var array + */ + var $_downloadURL; + /** + * @var array + */ + var $_downloadDeps = array(); + /** + * @var boolean + */ + var $_valid = false; + /** + * @var boolean + */ + var $_analyzed = false; + /** + * if this or a parent package was invoked with Package-state, this is set to the + * state variable. + * + * This allows temporary reassignment of preferred_state for a parent package and all of + * its dependencies. + * @var string|false + */ + var $_explicitState = false; + /** + * If this package is invoked with Package#group, this variable will be true + */ + var $_explicitGroup = false; + /** + * Package type local|url + * @var string + */ + var $_type; + /** + * Contents of package.xml, if downloaded from a remote channel + * @var string|false + * @access private + */ + var $_rawpackagefile; + /** + * @var boolean + * @access private + */ + var $_validated = false; + + /** + * @param PEAR_Downloader + */ + function PEAR_Downloader_Package(&$downloader) + { + $this->_downloader = &$downloader; + $this->_config = &$this->_downloader->config; + $this->_registry = &$this->_config->getRegistry(); + $options = $downloader->getOptions(); + if (isset($options['packagingroot'])) { + $this->_config->setInstallRoot($options['packagingroot']); + $this->_installRegistry = &$this->_config->getRegistry(); + $this->_config->setInstallRoot(false); + } else { + $this->_installRegistry = &$this->_registry; + } + $this->_valid = $this->_analyzed = false; + } + + /** + * Parse the input and determine whether this is a local file, a remote uri, or an + * abstract package name. + * + * This is the heart of the PEAR_Downloader_Package(), and is used in + * {@link PEAR_Downloader::download()} + * @param string + * @return bool|PEAR_Error + */ + function initialize($param) + { + $origErr = $this->_fromFile($param); + if ($this->_valid) { + return true; + } + + $options = $this->_downloader->getOptions(); + if (isset($options['offline'])) { + if (PEAR::isError($origErr) && !isset($options['soft'])) { + foreach ($origErr->getUserInfo() as $userInfo) { + if (isset($userInfo['message'])) { + $this->_downloader->log(0, $userInfo['message']); + } + } + + $this->_downloader->log(0, $origErr->getMessage()); + } + + return PEAR::raiseError('Cannot download non-local package "' . $param . '"'); + } + + $err = $this->_fromUrl($param); + if (PEAR::isError($err) || !$this->_valid) { + if ($this->_type == 'url') { + if (PEAR::isError($err) && !isset($options['soft'])) { + $this->_downloader->log(0, $err->getMessage()); + } + + return PEAR::raiseError("Invalid or missing remote package file"); + } + + $err = $this->_fromString($param); + if (PEAR::isError($err) || !$this->_valid) { + if (PEAR::isError($err) && $err->getCode() == PEAR_DOWNLOADER_PACKAGE_STATE) { + return false; // instruct the downloader to silently skip + } + + if (isset($this->_type) && $this->_type == 'local' && PEAR::isError($origErr)) { + if (is_array($origErr->getUserInfo())) { + foreach ($origErr->getUserInfo() as $err) { + if (is_array($err)) { + $err = $err['message']; + } + + if (!isset($options['soft'])) { + $this->_downloader->log(0, $err); + } + } + } + + if (!isset($options['soft'])) { + $this->_downloader->log(0, $origErr->getMessage()); + } + + if (is_array($param)) { + $param = $this->_registry->parsedPackageNameToString($param, true); + } + + if (!isset($options['soft'])) { + $this->_downloader->log(2, "Cannot initialize '$param', invalid or missing package file"); + } + + // Passing no message back - already logged above + return PEAR::raiseError(); + } + + if (PEAR::isError($err) && !isset($options['soft'])) { + $this->_downloader->log(0, $err->getMessage()); + } + + if (is_array($param)) { + $param = $this->_registry->parsedPackageNameToString($param, true); + } + + if (!isset($options['soft'])) { + $this->_downloader->log(2, "Cannot initialize '$param', invalid or missing package file"); + } + + // Passing no message back - already logged above + return PEAR::raiseError(); + } + } + + return true; + } + + /** + * Retrieve any non-local packages + * @return PEAR_PackageFile_v1|PEAR_PackageFile_v2|PEAR_Error + */ + function &download() + { + if (isset($this->_packagefile)) { + return $this->_packagefile; + } + + if (isset($this->_downloadURL['url'])) { + $this->_isvalid = false; + $info = $this->getParsedPackage(); + foreach ($info as $i => $p) { + $info[$i] = strtolower($p); + } + + $err = $this->_fromUrl($this->_downloadURL['url'], + $this->_registry->parsedPackageNameToString($this->_parsedname, true)); + $newinfo = $this->getParsedPackage(); + foreach ($newinfo as $i => $p) { + $newinfo[$i] = strtolower($p); + } + + if ($info != $newinfo) { + do { + if ($info['channel'] == 'pecl.php.net' && $newinfo['channel'] == 'pear.php.net') { + $info['channel'] = 'pear.php.net'; + if ($info == $newinfo) { + // skip the channel check if a pecl package says it's a PEAR package + break; + } + } + if ($info['channel'] == 'pear.php.net' && $newinfo['channel'] == 'pecl.php.net') { + $info['channel'] = 'pecl.php.net'; + if ($info == $newinfo) { + // skip the channel check if a pecl package says it's a PEAR package + break; + } + } + + return PEAR::raiseError('CRITICAL ERROR: We are ' . + $this->_registry->parsedPackageNameToString($info) . ', but the file ' . + 'downloaded claims to be ' . + $this->_registry->parsedPackageNameToString($this->getParsedPackage())); + } while (false); + } + + if (PEAR::isError($err) || !$this->_valid) { + return $err; + } + } + + $this->_type = 'local'; + return $this->_packagefile; + } + + function &getPackageFile() + { + return $this->_packagefile; + } + + function &getDownloader() + { + return $this->_downloader; + } + + function getType() + { + return $this->_type; + } + + /** + * Like {@link initialize()}, but operates on a dependency + */ + function fromDepURL($dep) + { + $this->_downloadURL = $dep; + if (isset($dep['uri'])) { + $options = $this->_downloader->getOptions(); + if (!extension_loaded("zlib") || isset($options['nocompress'])) { + $ext = '.tar'; + } else { + $ext = '.tgz'; + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $err = $this->_fromUrl($dep['uri'] . $ext); + PEAR::popErrorHandling(); + if (PEAR::isError($err)) { + if (!isset($options['soft'])) { + $this->_downloader->log(0, $err->getMessage()); + } + + return PEAR::raiseError('Invalid uri dependency "' . $dep['uri'] . $ext . '", ' . + 'cannot download'); + } + } else { + $this->_parsedname = + array( + 'package' => $dep['info']->getPackage(), + 'channel' => $dep['info']->getChannel(), + 'version' => $dep['version'] + ); + if (!isset($dep['nodefault'])) { + $this->_parsedname['group'] = 'default'; // download the default dependency group + $this->_explicitGroup = false; + } + + $this->_rawpackagefile = $dep['raw']; + } + } + + function detectDependencies($params) + { + $options = $this->_downloader->getOptions(); + if (isset($options['downloadonly'])) { + return; + } + + if (isset($options['offline'])) { + $this->_downloader->log(3, 'Skipping dependency download check, --offline specified'); + return; + } + + $pname = $this->getParsedPackage(); + if (!$pname) { + return; + } + + $deps = $this->getDeps(); + if (!$deps) { + return; + } + + if (isset($deps['required'])) { // package.xml 2.0 + return $this->_detect2($deps, $pname, $options, $params); + } + + return $this->_detect1($deps, $pname, $options, $params); + } + + function setValidated() + { + $this->_validated = true; + } + + function alreadyValidated() + { + return $this->_validated; + } + + /** + * Remove packages to be downloaded that are already installed + * @param array of PEAR_Downloader_Package objects + * @static + */ + function removeInstalled(&$params) + { + if (!isset($params[0])) { + return; + } + + $options = $params[0]->_downloader->getOptions(); + if (!isset($options['downloadonly'])) { + foreach ($params as $i => $param) { + $package = $param->getPackage(); + $channel = $param->getChannel(); + // remove self if already installed with this version + // this does not need any pecl magic - we only remove exact matches + if ($param->_installRegistry->packageExists($package, $channel)) { + $packageVersion = $param->_installRegistry->packageInfo($package, 'version', $channel); + if (version_compare($packageVersion, $param->getVersion(), '==')) { + if (!isset($options['force'])) { + $info = $param->getParsedPackage(); + unset($info['version']); + unset($info['state']); + if (!isset($options['soft'])) { + $param->_downloader->log(1, 'Skipping package "' . + $param->getShortName() . + '", already installed as version ' . $packageVersion); + } + $params[$i] = false; + } + } elseif (!isset($options['force']) && !isset($options['upgrade']) && + !isset($options['soft'])) { + $info = $param->getParsedPackage(); + $param->_downloader->log(1, 'Skipping package "' . + $param->getShortName() . + '", already installed as version ' . $packageVersion); + $params[$i] = false; + } + } + } + } + + PEAR_Downloader_Package::removeDuplicates($params); + } + + function _detect2($deps, $pname, $options, $params) + { + $this->_downloadDeps = array(); + $groupnotfound = false; + foreach (array('package', 'subpackage') as $packagetype) { + // get required dependency group + if (isset($deps['required'][$packagetype])) { + if (isset($deps['required'][$packagetype][0])) { + foreach ($deps['required'][$packagetype] as $dep) { + if (isset($dep['conflicts'])) { + // skip any package that this package conflicts with + continue; + } + $ret = $this->_detect2Dep($dep, $pname, 'required', $params); + if (is_array($ret)) { + $this->_downloadDeps[] = $ret; + } elseif (PEAR::isError($ret) && !isset($options['soft'])) { + $this->_downloader->log(0, $ret->getMessage()); + } + } + } else { + $dep = $deps['required'][$packagetype]; + if (!isset($dep['conflicts'])) { + // skip any package that this package conflicts with + $ret = $this->_detect2Dep($dep, $pname, 'required', $params); + if (is_array($ret)) { + $this->_downloadDeps[] = $ret; + } elseif (PEAR::isError($ret) && !isset($options['soft'])) { + $this->_downloader->log(0, $ret->getMessage()); + } + } + } + } + + // get optional dependency group, if any + if (isset($deps['optional'][$packagetype])) { + $skipnames = array(); + if (!isset($deps['optional'][$packagetype][0])) { + $deps['optional'][$packagetype] = array($deps['optional'][$packagetype]); + } + + foreach ($deps['optional'][$packagetype] as $dep) { + $skip = false; + if (!isset($options['alldeps'])) { + $dep['package'] = $dep['name']; + if (!isset($options['soft'])) { + $this->_downloader->log(3, 'Notice: package "' . + $this->_registry->parsedPackageNameToString($this->getParsedPackage(), + true) . '" optional dependency "' . + $this->_registry->parsedPackageNameToString(array('package' => + $dep['name'], 'channel' => 'pear.php.net'), true) . + '" will not be automatically downloaded'); + } + $skipnames[] = $this->_registry->parsedPackageNameToString($dep, true); + $skip = true; + unset($dep['package']); + } + + $ret = $this->_detect2Dep($dep, $pname, 'optional', $params); + if (PEAR::isError($ret) && !isset($options['soft'])) { + $this->_downloader->log(0, $ret->getMessage()); + } + + if (!$ret) { + $dep['package'] = $dep['name']; + $skip = count($skipnames) ? + $skipnames[count($skipnames) - 1] : ''; + if ($skip == + $this->_registry->parsedPackageNameToString($dep, true)) { + array_pop($skipnames); + } + } + + if (!$skip && is_array($ret)) { + $this->_downloadDeps[] = $ret; + } + } + + if (count($skipnames)) { + if (!isset($options['soft'])) { + $this->_downloader->log(1, 'Did not download optional dependencies: ' . + implode(', ', $skipnames) . + ', use --alldeps to download automatically'); + } + } + } + + // get requested dependency group, if any + $groupname = $this->getGroup(); + $explicit = $this->_explicitGroup; + if (!$groupname) { + if (!$this->canDefault()) { + continue; + } + + $groupname = 'default'; // try the default dependency group + } + + if ($groupnotfound) { + continue; + } + + if (isset($deps['group'])) { + if (isset($deps['group']['attribs'])) { + if (strtolower($deps['group']['attribs']['name']) == strtolower($groupname)) { + $group = $deps['group']; + } elseif ($explicit) { + if (!isset($options['soft'])) { + $this->_downloader->log(0, 'Warning: package "' . + $this->_registry->parsedPackageNameToString($pname, true) . + '" has no dependency ' . 'group named "' . $groupname . '"'); + } + + $groupnotfound = true; + continue; + } + } else { + $found = false; + foreach ($deps['group'] as $group) { + if (strtolower($group['attribs']['name']) == strtolower($groupname)) { + $found = true; + break; + } + } + + if (!$found) { + if ($explicit) { + if (!isset($options['soft'])) { + $this->_downloader->log(0, 'Warning: package "' . + $this->_registry->parsedPackageNameToString($pname, true) . + '" has no dependency ' . 'group named "' . $groupname . '"'); + } + } + + $groupnotfound = true; + continue; + } + } + } + + if (isset($group) && isset($group[$packagetype])) { + if (isset($group[$packagetype][0])) { + foreach ($group[$packagetype] as $dep) { + $ret = $this->_detect2Dep($dep, $pname, 'dependency group "' . + $group['attribs']['name'] . '"', $params); + if (is_array($ret)) { + $this->_downloadDeps[] = $ret; + } elseif (PEAR::isError($ret) && !isset($options['soft'])) { + $this->_downloader->log(0, $ret->getMessage()); + } + } + } else { + $ret = $this->_detect2Dep($group[$packagetype], $pname, + 'dependency group "' . + $group['attribs']['name'] . '"', $params); + if (is_array($ret)) { + $this->_downloadDeps[] = $ret; + } elseif (PEAR::isError($ret) && !isset($options['soft'])) { + $this->_downloader->log(0, $ret->getMessage()); + } + } + } + } + } + + function _detect2Dep($dep, $pname, $group, $params) + { + if (isset($dep['conflicts'])) { + return true; + } + + $options = $this->_downloader->getOptions(); + if (isset($dep['uri'])) { + return array('uri' => $dep['uri'], 'dep' => $dep);; + } + + $testdep = $dep; + $testdep['package'] = $dep['name']; + if (PEAR_Downloader_Package::willDownload($testdep, $params)) { + $dep['package'] = $dep['name']; + if (!isset($options['soft'])) { + $this->_downloader->log(2, $this->getShortName() . ': Skipping ' . $group . + ' dependency "' . + $this->_registry->parsedPackageNameToString($dep, true) . + '", will be installed'); + } + return false; + } + + $options = $this->_downloader->getOptions(); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + if ($this->_explicitState) { + $pname['state'] = $this->_explicitState; + } + + $url = $this->_downloader->_getDepPackageDownloadUrl($dep, $pname); + if (PEAR::isError($url)) { + PEAR::popErrorHandling(); + return $url; + } + + $dep['package'] = $dep['name']; + $ret = $this->_analyzeDownloadURL($url, 'dependency', $dep, $params, $group == 'optional' && + !isset($options['alldeps']), true); + PEAR::popErrorHandling(); + if (PEAR::isError($ret)) { + if (!isset($options['soft'])) { + $this->_downloader->log(0, $ret->getMessage()); + } + + return false; + } + + // check to see if a dep is already installed and is the same or newer + if (!isset($dep['min']) && !isset($dep['max']) && !isset($dep['recommended'])) { + $oper = 'has'; + } else { + $oper = 'gt'; + } + + // do not try to move this before getDepPackageDownloadURL + // we can't determine whether upgrade is necessary until we know what + // version would be downloaded + if (!isset($options['force']) && $this->isInstalled($ret, $oper)) { + $version = $this->_installRegistry->packageInfo($dep['name'], 'version', $dep['channel']); + $dep['package'] = $dep['name']; + if (!isset($options['soft'])) { + $this->_downloader->log(3, $this->getShortName() . ': Skipping ' . $group . + ' dependency "' . + $this->_registry->parsedPackageNameToString($dep, true) . + '" version ' . $url['version'] . ', already installed as version ' . + $version); + } + + return false; + } + + if (isset($dep['nodefault'])) { + $ret['nodefault'] = true; + } + + return $ret; + } + + function _detect1($deps, $pname, $options, $params) + { + $this->_downloadDeps = array(); + $skipnames = array(); + foreach ($deps as $dep) { + $nodownload = false; + if (isset ($dep['type']) && $dep['type'] === 'pkg') { + $dep['channel'] = 'pear.php.net'; + $dep['package'] = $dep['name']; + switch ($dep['rel']) { + case 'not' : + continue 2; + case 'ge' : + case 'eq' : + case 'gt' : + case 'has' : + $group = (!isset($dep['optional']) || $dep['optional'] == 'no') ? + 'required' : + 'optional'; + if (PEAR_Downloader_Package::willDownload($dep, $params)) { + $this->_downloader->log(2, $this->getShortName() . ': Skipping ' . $group + . ' dependency "' . + $this->_registry->parsedPackageNameToString($dep, true) . + '", will be installed'); + continue 2; + } + $fakedp = new PEAR_PackageFile_v1; + $fakedp->setPackage($dep['name']); + // skip internet check if we are not upgrading (bug #5810) + if (!isset($options['upgrade']) && $this->isInstalled( + $fakedp, $dep['rel'])) { + $this->_downloader->log(2, $this->getShortName() . ': Skipping ' . $group + . ' dependency "' . + $this->_registry->parsedPackageNameToString($dep, true) . + '", is already installed'); + continue 2; + } + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + if ($this->_explicitState) { + $pname['state'] = $this->_explicitState; + } + + $url = $this->_downloader->_getDepPackageDownloadUrl($dep, $pname); + $chan = 'pear.php.net'; + if (PEAR::isError($url)) { + // check to see if this is a pecl package that has jumped + // from pear.php.net to pecl.php.net channel + if (!class_exists('PEAR_Dependency2')) { + require_once 'PEAR/Dependency2.php'; + } + + $newdep = PEAR_Dependency2::normalizeDep($dep); + $newdep = $newdep[0]; + $newdep['channel'] = 'pecl.php.net'; + $chan = 'pecl.php.net'; + $url = $this->_downloader->_getDepPackageDownloadUrl($newdep, $pname); + $obj = &$this->_installRegistry->getPackage($dep['name']); + if (PEAR::isError($url)) { + PEAR::popErrorHandling(); + if ($obj !== null && $this->isInstalled($obj, $dep['rel'])) { + $group = (!isset($dep['optional']) || $dep['optional'] == 'no') ? + 'required' : + 'optional'; + $dep['package'] = $dep['name']; + if (!isset($options['soft'])) { + $this->_downloader->log(3, $this->getShortName() . + ': Skipping ' . $group . ' dependency "' . + $this->_registry->parsedPackageNameToString($dep, true) . + '", already installed as version ' . $obj->getVersion()); + } + $skip = count($skipnames) ? + $skipnames[count($skipnames) - 1] : ''; + if ($skip == + $this->_registry->parsedPackageNameToString($dep, true)) { + array_pop($skipnames); + } + continue; + } else { + if (isset($dep['optional']) && $dep['optional'] == 'yes') { + $this->_downloader->log(2, $this->getShortName() . + ': Skipping optional dependency "' . + $this->_registry->parsedPackageNameToString($dep, true) . + '", no releases exist'); + continue; + } else { + return $url; + } + } + } + } + + PEAR::popErrorHandling(); + if (!isset($options['alldeps'])) { + if (isset($dep['optional']) && $dep['optional'] == 'yes') { + if (!isset($options['soft'])) { + $this->_downloader->log(3, 'Notice: package "' . + $this->getShortName() . + '" optional dependency "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $chan, 'package' => + $dep['name']), true) . + '" will not be automatically downloaded'); + } + $skipnames[] = $this->_registry->parsedPackageNameToString( + array('channel' => $chan, 'package' => + $dep['name']), true); + $nodownload = true; + } + } + + if (!isset($options['alldeps']) && !isset($options['onlyreqdeps'])) { + if (!isset($dep['optional']) || $dep['optional'] == 'no') { + if (!isset($options['soft'])) { + $this->_downloader->log(3, 'Notice: package "' . + $this->getShortName() . + '" required dependency "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $chan, 'package' => + $dep['name']), true) . + '" will not be automatically downloaded'); + } + $skipnames[] = $this->_registry->parsedPackageNameToString( + array('channel' => $chan, 'package' => + $dep['name']), true); + $nodownload = true; + } + } + + // check to see if a dep is already installed + // do not try to move this before getDepPackageDownloadURL + // we can't determine whether upgrade is necessary until we know what + // version would be downloaded + if (!isset($options['force']) && $this->isInstalled( + $url, $dep['rel'])) { + $group = (!isset($dep['optional']) || $dep['optional'] == 'no') ? + 'required' : + 'optional'; + $dep['package'] = $dep['name']; + if (isset($newdep)) { + $version = $this->_installRegistry->packageInfo($newdep['name'], 'version', $newdep['channel']); + } else { + $version = $this->_installRegistry->packageInfo($dep['name'], 'version'); + } + + $dep['version'] = $url['version']; + if (!isset($options['soft'])) { + $this->_downloader->log(3, $this->getShortName() . ': Skipping ' . $group . + ' dependency "' . + $this->_registry->parsedPackageNameToString($dep, true) . + '", already installed as version ' . $version); + } + + $skip = count($skipnames) ? + $skipnames[count($skipnames) - 1] : ''; + if ($skip == + $this->_registry->parsedPackageNameToString($dep, true)) { + array_pop($skipnames); + } + + continue; + } + + if ($nodownload) { + continue; + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + if (isset($newdep)) { + $dep = $newdep; + } + + $dep['package'] = $dep['name']; + $ret = $this->_analyzeDownloadURL($url, 'dependency', $dep, $params, + isset($dep['optional']) && $dep['optional'] == 'yes' && + !isset($options['alldeps']), true); + PEAR::popErrorHandling(); + if (PEAR::isError($ret)) { + if (!isset($options['soft'])) { + $this->_downloader->log(0, $ret->getMessage()); + } + continue; + } + + $this->_downloadDeps[] = $ret; + } + } + + if (count($skipnames)) { + if (!isset($options['soft'])) { + $this->_downloader->log(1, 'Did not download dependencies: ' . + implode(', ', $skipnames) . + ', use --alldeps or --onlyreqdeps to download automatically'); + } + } + } + + function setDownloadURL($pkg) + { + $this->_downloadURL = $pkg; + } + + /** + * Set the package.xml object for this downloaded package + * + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 $pkg + */ + function setPackageFile(&$pkg) + { + $this->_packagefile = &$pkg; + } + + function getShortName() + { + return $this->_registry->parsedPackageNameToString(array('channel' => $this->getChannel(), + 'package' => $this->getPackage()), true); + } + + function getParsedPackage() + { + if (isset($this->_packagefile) || isset($this->_parsedname)) { + return array('channel' => $this->getChannel(), + 'package' => $this->getPackage(), + 'version' => $this->getVersion()); + } + + return false; + } + + function getDownloadURL() + { + return $this->_downloadURL; + } + + function canDefault() + { + if (isset($this->_downloadURL) && isset($this->_downloadURL['nodefault'])) { + return false; + } + + return true; + } + + function getPackage() + { + if (isset($this->_packagefile)) { + return $this->_packagefile->getPackage(); + } elseif (isset($this->_downloadURL['info'])) { + return $this->_downloadURL['info']->getPackage(); + } + + return false; + } + + /** + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + */ + function isSubpackage(&$pf) + { + if (isset($this->_packagefile)) { + return $this->_packagefile->isSubpackage($pf); + } elseif (isset($this->_downloadURL['info'])) { + return $this->_downloadURL['info']->isSubpackage($pf); + } + + return false; + } + + function getPackageType() + { + if (isset($this->_packagefile)) { + return $this->_packagefile->getPackageType(); + } elseif (isset($this->_downloadURL['info'])) { + return $this->_downloadURL['info']->getPackageType(); + } + + return false; + } + + function isBundle() + { + if (isset($this->_packagefile)) { + return $this->_packagefile->getPackageType() == 'bundle'; + } + + return false; + } + + function getPackageXmlVersion() + { + if (isset($this->_packagefile)) { + return $this->_packagefile->getPackagexmlVersion(); + } elseif (isset($this->_downloadURL['info'])) { + return $this->_downloadURL['info']->getPackagexmlVersion(); + } + + return '1.0'; + } + + function getChannel() + { + if (isset($this->_packagefile)) { + return $this->_packagefile->getChannel(); + } elseif (isset($this->_downloadURL['info'])) { + return $this->_downloadURL['info']->getChannel(); + } + + return false; + } + + function getURI() + { + if (isset($this->_packagefile)) { + return $this->_packagefile->getURI(); + } elseif (isset($this->_downloadURL['info'])) { + return $this->_downloadURL['info']->getURI(); + } + + return false; + } + + function getVersion() + { + if (isset($this->_packagefile)) { + return $this->_packagefile->getVersion(); + } elseif (isset($this->_downloadURL['version'])) { + return $this->_downloadURL['version']; + } + + return false; + } + + function isCompatible($pf) + { + if (isset($this->_packagefile)) { + return $this->_packagefile->isCompatible($pf); + } elseif (isset($this->_downloadURL['info'])) { + return $this->_downloadURL['info']->isCompatible($pf); + } + + return true; + } + + function setGroup($group) + { + $this->_parsedname['group'] = $group; + } + + function getGroup() + { + if (isset($this->_parsedname['group'])) { + return $this->_parsedname['group']; + } + + return ''; + } + + function isExtension($name) + { + if (isset($this->_packagefile)) { + return $this->_packagefile->isExtension($name); + } elseif (isset($this->_downloadURL['info'])) { + if ($this->_downloadURL['info']->getPackagexmlVersion() == '2.0') { + return $this->_downloadURL['info']->getProvidesExtension() == $name; + } + + return false; + } + + return false; + } + + function getDeps() + { + if (isset($this->_packagefile)) { + $ver = $this->_packagefile->getPackagexmlVersion(); + if (version_compare($ver, '2.0', '>=')) { + return $this->_packagefile->getDeps(true); + } + + return $this->_packagefile->getDeps(); + } elseif (isset($this->_downloadURL['info'])) { + $ver = $this->_downloadURL['info']->getPackagexmlVersion(); + if (version_compare($ver, '2.0', '>=')) { + return $this->_downloadURL['info']->getDeps(true); + } + + return $this->_downloadURL['info']->getDeps(); + } + + return array(); + } + + /** + * @param array Parsed array from {@link PEAR_Registry::parsePackageName()} or a dependency + * returned from getDepDownloadURL() + */ + function isEqual($param) + { + if (is_object($param)) { + $channel = $param->getChannel(); + $package = $param->getPackage(); + if ($param->getURI()) { + $param = array( + 'channel' => $param->getChannel(), + 'package' => $param->getPackage(), + 'version' => $param->getVersion(), + 'uri' => $param->getURI(), + ); + } else { + $param = array( + 'channel' => $param->getChannel(), + 'package' => $param->getPackage(), + 'version' => $param->getVersion(), + ); + } + } else { + if (isset($param['uri'])) { + if ($this->getChannel() != '__uri') { + return false; + } + return $param['uri'] == $this->getURI(); + } + + $package = isset($param['package']) ? $param['package'] : $param['info']->getPackage(); + $channel = isset($param['channel']) ? $param['channel'] : $param['info']->getChannel(); + if (isset($param['rel'])) { + if (!class_exists('PEAR_Dependency2')) { + require_once 'PEAR/Dependency2.php'; + } + + $newdep = PEAR_Dependency2::normalizeDep($param); + $newdep = $newdep[0]; + } elseif (isset($param['min'])) { + $newdep = $param; + } + } + + if (isset($newdep)) { + if (!isset($newdep['min'])) { + $newdep['min'] = '0'; + } + + if (!isset($newdep['max'])) { + $newdep['max'] = '100000000000000000000'; + } + + // use magic to support pecl packages suddenly jumping to the pecl channel + // we need to support both dependency possibilities + if ($channel == 'pear.php.net' && $this->getChannel() == 'pecl.php.net') { + if ($package == $this->getPackage()) { + $channel = 'pecl.php.net'; + } + } + if ($channel == 'pecl.php.net' && $this->getChannel() == 'pear.php.net') { + if ($package == $this->getPackage()) { + $channel = 'pear.php.net'; + } + } + + return (strtolower($package) == strtolower($this->getPackage()) && + $channel == $this->getChannel() && + version_compare($newdep['min'], $this->getVersion(), '<=') && + version_compare($newdep['max'], $this->getVersion(), '>=')); + } + + // use magic to support pecl packages suddenly jumping to the pecl channel + if ($channel == 'pecl.php.net' && $this->getChannel() == 'pear.php.net') { + if (strtolower($package) == strtolower($this->getPackage())) { + $channel = 'pear.php.net'; + } + } + + if (isset($param['version'])) { + return (strtolower($package) == strtolower($this->getPackage()) && + $channel == $this->getChannel() && + $param['version'] == $this->getVersion()); + } + + return strtolower($package) == strtolower($this->getPackage()) && + $channel == $this->getChannel(); + } + + function isInstalled($dep, $oper = '==') + { + if (!$dep) { + return false; + } + + if ($oper != 'ge' && $oper != 'gt' && $oper != 'has' && $oper != '==') { + return false; + } + + if (is_object($dep)) { + $package = $dep->getPackage(); + $channel = $dep->getChannel(); + if ($dep->getURI()) { + $dep = array( + 'uri' => $dep->getURI(), + 'version' => $dep->getVersion(), + ); + } else { + $dep = array( + 'version' => $dep->getVersion(), + ); + } + } else { + if (isset($dep['uri'])) { + $channel = '__uri'; + $package = $dep['dep']['name']; + } else { + $channel = $dep['info']->getChannel(); + $package = $dep['info']->getPackage(); + } + } + + $options = $this->_downloader->getOptions(); + $test = $this->_installRegistry->packageExists($package, $channel); + if (!$test && $channel == 'pecl.php.net') { + // do magic to allow upgrading from old pecl packages to new ones + $test = $this->_installRegistry->packageExists($package, 'pear.php.net'); + $channel = 'pear.php.net'; + } + + if ($test) { + if (isset($dep['uri'])) { + if ($this->_installRegistry->packageInfo($package, 'uri', '__uri') == $dep['uri']) { + return true; + } + } + + if (isset($options['upgrade'])) { + $packageVersion = $this->_installRegistry->packageInfo($package, 'version', $channel); + if (version_compare($packageVersion, $dep['version'], '>=')) { + return true; + } + + return false; + } + + return true; + } + + return false; + } + + /** + * Detect duplicate package names with differing versions + * + * If a user requests to install Date 1.4.6 and Date 1.4.7, + * for instance, this is a logic error. This method + * detects this situation. + * + * @param array $params array of PEAR_Downloader_Package objects + * @param array $errorparams empty array + * @return array array of stupid duplicated packages in PEAR_Downloader_Package obejcts + */ + function detectStupidDuplicates($params, &$errorparams) + { + $existing = array(); + foreach ($params as $i => $param) { + $package = $param->getPackage(); + $channel = $param->getChannel(); + $group = $param->getGroup(); + if (!isset($existing[$channel . '/' . $package])) { + $existing[$channel . '/' . $package] = array(); + } + + if (!isset($existing[$channel . '/' . $package][$group])) { + $existing[$channel . '/' . $package][$group] = array(); + } + + $existing[$channel . '/' . $package][$group][] = $i; + } + + $indices = array(); + foreach ($existing as $package => $groups) { + foreach ($groups as $group => $dupes) { + if (count($dupes) > 1) { + $indices = $indices + $dupes; + } + } + } + + $indices = array_unique($indices); + foreach ($indices as $index) { + $errorparams[] = $params[$index]; + } + + return count($errorparams); + } + + /** + * @param array + * @param bool ignore install groups - for final removal of dupe packages + * @static + */ + function removeDuplicates(&$params, $ignoreGroups = false) + { + $pnames = array(); + foreach ($params as $i => $param) { + if (!$param) { + continue; + } + + if ($param->getPackage()) { + $group = $ignoreGroups ? '' : $param->getGroup(); + $pnames[$i] = $param->getChannel() . '/' . + $param->getPackage() . '-' . $param->getVersion() . '#' . $group; + } + } + + $pnames = array_unique($pnames); + $unset = array_diff(array_keys($params), array_keys($pnames)); + $testp = array_flip($pnames); + foreach ($params as $i => $param) { + if (!$param) { + $unset[] = $i; + continue; + } + + if (!is_a($param, 'PEAR_Downloader_Package')) { + $unset[] = $i; + continue; + } + + $group = $ignoreGroups ? '' : $param->getGroup(); + if (!isset($testp[$param->getChannel() . '/' . $param->getPackage() . '-' . + $param->getVersion() . '#' . $group])) { + $unset[] = $i; + } + } + + foreach ($unset as $i) { + unset($params[$i]); + } + + $ret = array(); + foreach ($params as $i => $param) { + $ret[] = &$params[$i]; + } + + $params = array(); + foreach ($ret as $i => $param) { + $params[] = &$ret[$i]; + } + } + + function explicitState() + { + return $this->_explicitState; + } + + function setExplicitState($s) + { + $this->_explicitState = $s; + } + + /** + * @static + */ + function mergeDependencies(&$params) + { + $bundles = $newparams = array(); + foreach ($params as $i => $param) { + if (!$param->isBundle()) { + continue; + } + + $bundles[] = $i; + $pf = &$param->getPackageFile(); + $newdeps = array(); + $contents = $pf->getBundledPackages(); + if (!is_array($contents)) { + $contents = array($contents); + } + + foreach ($contents as $file) { + $filecontents = $pf->getFileContents($file); + $dl = &$param->getDownloader(); + $options = $dl->getOptions(); + if (PEAR::isError($dir = $dl->getDownloadDir())) { + return $dir; + } + + $fp = @fopen($dir . DIRECTORY_SEPARATOR . $file, 'wb'); + if (!$fp) { + continue; + } + + // FIXME do symlink check + + fwrite($fp, $filecontents, strlen($filecontents)); + fclose($fp); + if ($s = $params[$i]->explicitState()) { + $obj->setExplicitState($s); + } + + $obj = &new PEAR_Downloader_Package($params[$i]->getDownloader()); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + if (PEAR::isError($dir = $dl->getDownloadDir())) { + PEAR::popErrorHandling(); + return $dir; + } + + $e = $obj->_fromFile($a = $dir . DIRECTORY_SEPARATOR . $file); + PEAR::popErrorHandling(); + if (PEAR::isError($e)) { + if (!isset($options['soft'])) { + $dl->log(0, $e->getMessage()); + } + continue; + } + + $j = &$obj; + if (!PEAR_Downloader_Package::willDownload($j, + array_merge($params, $newparams)) && !$param->isInstalled($j)) { + $newparams[] = &$j; + } + } + } + + foreach ($bundles as $i) { + unset($params[$i]); // remove bundles - only their contents matter for installation + } + + PEAR_Downloader_Package::removeDuplicates($params); // strip any unset indices + if (count($newparams)) { // add in bundled packages for install + foreach ($newparams as $i => $unused) { + $params[] = &$newparams[$i]; + } + $newparams = array(); + } + + foreach ($params as $i => $param) { + $newdeps = array(); + foreach ($param->_downloadDeps as $dep) { + $merge = array_merge($params, $newparams); + if (!PEAR_Downloader_Package::willDownload($dep, $merge) + && !$param->isInstalled($dep) + ) { + $newdeps[] = $dep; + } else { + //var_dump($dep); + // detect versioning conflicts here + } + } + + // convert the dependencies into PEAR_Downloader_Package objects for the next time around + $params[$i]->_downloadDeps = array(); + foreach ($newdeps as $dep) { + $obj = &new PEAR_Downloader_Package($params[$i]->getDownloader()); + if ($s = $params[$i]->explicitState()) { + $obj->setExplicitState($s); + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $e = $obj->fromDepURL($dep); + PEAR::popErrorHandling(); + if (PEAR::isError($e)) { + if (!isset($options['soft'])) { + $obj->_downloader->log(0, $e->getMessage()); + } + continue; + } + + $e = $obj->detectDependencies($params); + if (PEAR::isError($e)) { + if (!isset($options['soft'])) { + $obj->_downloader->log(0, $e->getMessage()); + } + } + + $j = &$obj; + $newparams[] = &$j; + } + } + + if (count($newparams)) { + foreach ($newparams as $i => $unused) { + $params[] = &$newparams[$i]; + } + return true; + } + + return false; + } + + + /** + * @static + */ + function willDownload($param, $params) + { + if (!is_array($params)) { + return false; + } + + foreach ($params as $obj) { + if ($obj->isEqual($param)) { + return true; + } + } + + return false; + } + + /** + * For simpler unit-testing + * @param PEAR_Config + * @param int + * @param string + */ + function &getPackagefileObject(&$c, $d) + { + $a = &new PEAR_PackageFile($c, $d); + return $a; + } + + /** + * This will retrieve from a local file if possible, and parse out + * a group name as well. The original parameter will be modified to reflect this. + * @param string|array can be a parsed package name as well + * @access private + */ + function _fromFile(&$param) + { + $saveparam = $param; + if (is_string($param)) { + if (!@file_exists($param)) { + $test = explode('#', $param); + $group = array_pop($test); + if (@file_exists(implode('#', $test))) { + $this->setGroup($group); + $param = implode('#', $test); + $this->_explicitGroup = true; + } + } + + if (@is_file($param)) { + $this->_type = 'local'; + $options = $this->_downloader->getOptions(); + $pkg = &$this->getPackagefileObject($this->_config, $this->_downloader->_debug); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $pf = &$pkg->fromAnyFile($param, PEAR_VALIDATE_INSTALLING); + PEAR::popErrorHandling(); + if (PEAR::isError($pf)) { + $this->_valid = false; + $param = $saveparam; + return $pf; + } + $this->_packagefile = &$pf; + if (!$this->getGroup()) { + $this->setGroup('default'); // install the default dependency group + } + return $this->_valid = true; + } + } + $param = $saveparam; + return $this->_valid = false; + } + + function _fromUrl($param, $saveparam = '') + { + if (!is_array($param) && (preg_match('#^(http|https|ftp)://#', $param))) { + $options = $this->_downloader->getOptions(); + $this->_type = 'url'; + $callback = $this->_downloader->ui ? + array(&$this->_downloader, '_downloadCallback') : null; + $this->_downloader->pushErrorHandling(PEAR_ERROR_RETURN); + if (PEAR::isError($dir = $this->_downloader->getDownloadDir())) { + $this->_downloader->popErrorHandling(); + return $dir; + } + + $this->_downloader->log(3, 'Downloading "' . $param . '"'); + $file = $this->_downloader->downloadHttp($param, $this->_downloader->ui, + $dir, $callback, null, false, $this->getChannel()); + $this->_downloader->popErrorHandling(); + if (PEAR::isError($file)) { + if (!empty($saveparam)) { + $saveparam = ", cannot download \"$saveparam\""; + } + $err = PEAR::raiseError('Could not download from "' . $param . + '"' . $saveparam . ' (' . $file->getMessage() . ')'); + return $err; + } + + if ($this->_rawpackagefile) { + require_once 'Archive/Tar.php'; + $tar = &new Archive_Tar($file); + $packagexml = $tar->extractInString('package2.xml'); + if (!$packagexml) { + $packagexml = $tar->extractInString('package.xml'); + } + + if (str_replace(array("\n", "\r"), array('',''), $packagexml) != + str_replace(array("\n", "\r"), array('',''), $this->_rawpackagefile)) { + if ($this->getChannel() != 'pear.php.net') { + return PEAR::raiseError('CRITICAL ERROR: package.xml downloaded does ' . + 'not match value returned from xml-rpc'); + } + + // be more lax for the existing PEAR packages that have not-ok + // characters in their package.xml + $this->_downloader->log(0, 'CRITICAL WARNING: The "' . + $this->getPackage() . '" package has invalid characters in its ' . + 'package.xml. The next version of PEAR may not be able to install ' . + 'this package for security reasons. Please open a bug report at ' . + 'http://pear.php.net/package/' . $this->getPackage() . '/bugs'); + } + } + + // whew, download worked! + $pkg = &$this->getPackagefileObject($this->_config, $this->_downloader->debug); + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $pf = &$pkg->fromAnyFile($file, PEAR_VALIDATE_INSTALLING); + PEAR::popErrorHandling(); + if (PEAR::isError($pf)) { + if (is_array($pf->getUserInfo())) { + foreach ($pf->getUserInfo() as $err) { + if (is_array($err)) { + $err = $err['message']; + } + + if (!isset($options['soft'])) { + $this->_downloader->log(0, "Validation Error: $err"); + } + } + } + + if (!isset($options['soft'])) { + $this->_downloader->log(0, $pf->getMessage()); + } + + ///FIXME need to pass back some error code that we can use to match with to cancel all further operations + /// At least stop all deps of this package from being installed + $out = $saveparam ? $saveparam : $param; + $err = PEAR::raiseError('Download of "' . $out . '" succeeded, but it is not a valid package archive'); + $this->_valid = false; + return $err; + } + + $this->_packagefile = &$pf; + $this->setGroup('default'); // install the default dependency group + return $this->_valid = true; + } + + return $this->_valid = false; + } + + /** + * + * @param string|array pass in an array of format + * array( + * 'package' => 'pname', + * ['channel' => 'channame',] + * ['version' => 'version',] + * ['state' => 'state',]) + * or a string of format [channame/]pname[-version|-state] + */ + function _fromString($param) + { + $options = $this->_downloader->getOptions(); + $channel = $this->_config->get('default_channel'); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $pname = $this->_registry->parsePackageName($param, $channel); + PEAR::popErrorHandling(); + if (PEAR::isError($pname)) { + if ($pname->getCode() == 'invalid') { + $this->_valid = false; + return false; + } + + if ($pname->getCode() == 'channel') { + $parsed = $pname->getUserInfo(); + if ($this->_downloader->discover($parsed['channel'])) { + if ($this->_config->get('auto_discover')) { + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $pname = $this->_registry->parsePackageName($param, $channel); + PEAR::popErrorHandling(); + } else { + if (!isset($options['soft'])) { + $this->_downloader->log(0, 'Channel "' . $parsed['channel'] . + '" is not initialized, use ' . + '"pear channel-discover ' . $parsed['channel'] . '" to initialize' . + 'or pear config-set auto_discover 1'); + } + } + } + + if (PEAR::isError($pname)) { + if (!isset($options['soft'])) { + $this->_downloader->log(0, $pname->getMessage()); + } + + if (is_array($param)) { + $param = $this->_registry->parsedPackageNameToString($param); + } + + $err = PEAR::raiseError('invalid package name/package file "' . $param . '"'); + $this->_valid = false; + return $err; + } + } else { + if (!isset($options['soft'])) { + $this->_downloader->log(0, $pname->getMessage()); + } + + $err = PEAR::raiseError('invalid package name/package file "' . $param . '"'); + $this->_valid = false; + return $err; + } + } + + if (!isset($this->_type)) { + $this->_type = 'rest'; + } + + $this->_parsedname = $pname; + $this->_explicitState = isset($pname['state']) ? $pname['state'] : false; + $this->_explicitGroup = isset($pname['group']) ? true : false; + + $info = $this->_downloader->_getPackageDownloadUrl($pname); + if (PEAR::isError($info)) { + if ($info->getCode() != -976 && $pname['channel'] == 'pear.php.net') { + // try pecl + $pname['channel'] = 'pecl.php.net'; + if ($test = $this->_downloader->_getPackageDownloadUrl($pname)) { + if (!PEAR::isError($test)) { + $info = PEAR::raiseError($info->getMessage() . ' - package ' . + $this->_registry->parsedPackageNameToString($pname, true) . + ' can be installed with "pecl install ' . $pname['package'] . + '"'); + } else { + $pname['channel'] = 'pear.php.net'; + } + } else { + $pname['channel'] = 'pear.php.net'; + } + } + + return $info; + } + + $this->_rawpackagefile = $info['raw']; + $ret = $this->_analyzeDownloadURL($info, $param, $pname); + if (PEAR::isError($ret)) { + return $ret; + } + + if ($ret) { + $this->_downloadURL = $ret; + return $this->_valid = (bool) $ret; + } + } + + /** + * @param array output of package.getDownloadURL + * @param string|array|object information for detecting packages to be downloaded, and + * for errors + * @param array name information of the package + * @param array|null packages to be downloaded + * @param bool is this an optional dependency? + * @param bool is this any kind of dependency? + * @access private + */ + function _analyzeDownloadURL($info, $param, $pname, $params = null, $optional = false, + $isdependency = false) + { + if (!is_string($param) && PEAR_Downloader_Package::willDownload($param, $params)) { + return false; + } + + if ($info === false) { + $saveparam = !is_string($param) ? ", cannot download \"$param\"" : ''; + + // no releases exist + return PEAR::raiseError('No releases for package "' . + $this->_registry->parsedPackageNameToString($pname, true) . '" exist' . $saveparam); + } + + if (strtolower($info['info']->getChannel()) != strtolower($pname['channel'])) { + $err = false; + if ($pname['channel'] == 'pecl.php.net') { + if ($info['info']->getChannel() != 'pear.php.net') { + $err = true; + } + } elseif ($info['info']->getChannel() == 'pecl.php.net') { + if ($pname['channel'] != 'pear.php.net') { + $err = true; + } + } else { + $err = true; + } + + if ($err) { + return PEAR::raiseError('SECURITY ERROR: package in channel "' . $pname['channel'] . + '" retrieved another channel\'s name for download! ("' . + $info['info']->getChannel() . '")'); + } + } + + $preferred_state = $this->_config->get('preferred_state'); + if (!isset($info['url'])) { + $package_version = $this->_registry->packageInfo($info['info']->getPackage(), + 'version', $info['info']->getChannel()); + if ($this->isInstalled($info)) { + if ($isdependency && version_compare($info['version'], $package_version, '<=')) { + // ignore bogus errors of "failed to download dependency" + // if it is already installed and the one that would be + // downloaded is older or the same version (Bug #7219) + return false; + } + } + + if ($info['version'] === $package_version) { + if (!isset($options['soft'])) { + $this->_downloader->log(1, 'WARNING: failed to download ' . $pname['channel'] . + '/' . $pname['package'] . '-' . $package_version. ', additionally the suggested version' . + ' (' . $package_version . ') is the same as the locally installed one.'); + } + + return false; + } + + if (version_compare($info['version'], $package_version, '<=')) { + if (!isset($options['soft'])) { + $this->_downloader->log(1, 'WARNING: failed to download ' . $pname['channel'] . + '/' . $pname['package'] . '-' . $package_version . ', additionally the suggested version' . + ' (' . $info['version'] . ') is a lower version than the locally installed one (' . $package_version . ').'); + } + + return false; + } + + $instead = ', will instead download version ' . $info['version'] . + ', stability "' . $info['info']->getState() . '"'; + // releases exist, but we failed to get any + if (isset($this->_downloader->_options['force'])) { + if (isset($pname['version'])) { + $vs = ', version "' . $pname['version'] . '"'; + } elseif (isset($pname['state'])) { + $vs = ', stability "' . $pname['state'] . '"'; + } elseif ($param == 'dependency') { + if (!class_exists('PEAR_Common')) { + require_once 'PEAR/Common.php'; + } + + if (!in_array($info['info']->getState(), + PEAR_Common::betterStates($preferred_state, true))) { + if ($optional) { + // don't spit out confusing error message + return $this->_downloader->_getPackageDownloadUrl( + array('package' => $pname['package'], + 'channel' => $pname['channel'], + 'version' => $info['version'])); + } + $vs = ' within preferred state "' . $preferred_state . + '"'; + } else { + if (!class_exists('PEAR_Dependency2')) { + require_once 'PEAR/Dependency2.php'; + } + + if ($optional) { + // don't spit out confusing error message + return $this->_downloader->_getPackageDownloadUrl( + array('package' => $pname['package'], + 'channel' => $pname['channel'], + 'version' => $info['version'])); + } + $vs = PEAR_Dependency2::_getExtraString($pname); + $instead = ''; + } + } else { + $vs = ' within preferred state "' . $preferred_state . '"'; + } + + if (!isset($options['soft'])) { + $this->_downloader->log(1, 'WARNING: failed to download ' . $pname['channel'] . + '/' . $pname['package'] . $vs . $instead); + } + + // download the latest release + return $this->_downloader->_getPackageDownloadUrl( + array('package' => $pname['package'], + 'channel' => $pname['channel'], + 'version' => $info['version'])); + } else { + if (isset($info['php']) && $info['php']) { + $err = PEAR::raiseError('Failed to download ' . + $this->_registry->parsedPackageNameToString( + array('channel' => $pname['channel'], + 'package' => $pname['package']), + true) . + ', latest release is version ' . $info['php']['v'] . + ', but it requires PHP version "' . + $info['php']['m'] . '", use "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $pname['channel'], 'package' => $pname['package'], + 'version' => $info['php']['v'])) . '" to install', + PEAR_DOWNLOADER_PACKAGE_PHPVERSION); + return $err; + } + + // construct helpful error message + if (isset($pname['version'])) { + $vs = ', version "' . $pname['version'] . '"'; + } elseif (isset($pname['state'])) { + $vs = ', stability "' . $pname['state'] . '"'; + } elseif ($param == 'dependency') { + if (!class_exists('PEAR_Common')) { + require_once 'PEAR/Common.php'; + } + + if (!in_array($info['info']->getState(), + PEAR_Common::betterStates($preferred_state, true))) { + if ($optional) { + // don't spit out confusing error message, and don't die on + // optional dep failure! + return $this->_downloader->_getPackageDownloadUrl( + array('package' => $pname['package'], + 'channel' => $pname['channel'], + 'version' => $info['version'])); + } + $vs = ' within preferred state "' . $preferred_state . '"'; + } else { + if (!class_exists('PEAR_Dependency2')) { + require_once 'PEAR/Dependency2.php'; + } + + if ($optional) { + // don't spit out confusing error message, and don't die on + // optional dep failure! + return $this->_downloader->_getPackageDownloadUrl( + array('package' => $pname['package'], + 'channel' => $pname['channel'], + 'version' => $info['version'])); + } + $vs = PEAR_Dependency2::_getExtraString($pname); + } + } else { + $vs = ' within preferred state "' . $this->_downloader->config->get('preferred_state') . '"'; + } + + $options = $this->_downloader->getOptions(); + // this is only set by the "download-all" command + if (isset($options['ignorepreferred_state'])) { + $err = PEAR::raiseError( + 'Failed to download ' . $this->_registry->parsedPackageNameToString( + array('channel' => $pname['channel'], 'package' => $pname['package']), + true) + . $vs . + ', latest release is version ' . $info['version'] . + ', stability "' . $info['info']->getState() . '", use "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $pname['channel'], 'package' => $pname['package'], + 'version' => $info['version'])) . '" to install', + PEAR_DOWNLOADER_PACKAGE_STATE); + return $err; + } + + // Checks if the user has a package installed already and checks the release against + // the state against the installed package, this allows upgrades for packages + // with lower stability than the preferred_state + $stability = $this->_registry->packageInfo($pname['package'], 'stability', $pname['channel']); + if (!$this->isInstalled($info) + || !in_array($info['info']->getState(), PEAR_Common::betterStates($stability['release'], true)) + ) { + $err = PEAR::raiseError( + 'Failed to download ' . $this->_registry->parsedPackageNameToString( + array('channel' => $pname['channel'], 'package' => $pname['package']), + true) + . $vs . + ', latest release is version ' . $info['version'] . + ', stability "' . $info['info']->getState() . '", use "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $pname['channel'], 'package' => $pname['package'], + 'version' => $info['version'])) . '" to install'); + return $err; + } + } + } + + if (isset($info['deprecated']) && $info['deprecated']) { + $this->_downloader->log(0, + 'WARNING: "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $info['info']->getChannel(), + 'package' => $info['info']->getPackage()), true) . + '" is deprecated in favor of "' . + $this->_registry->parsedPackageNameToString($info['deprecated'], true) . + '"'); + } + + return $info; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/ErrorStack.php b/vendor/pear-pear.php.net/PEAR/PEAR/ErrorStack.php new file mode 100644 index 0000000000000000000000000000000000000000..0303f5273adb45d68c77368ac99bd1910e1d4edd --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/ErrorStack.php @@ -0,0 +1,985 @@ +<?php +/** + * Error Stack Implementation + * + * This is an incredibly simple implementation of a very complex error handling + * facility. It contains the ability + * to track multiple errors from multiple packages simultaneously. In addition, + * it can track errors of many levels, save data along with the error, context + * information such as the exact file, line number, class and function that + * generated the error, and if necessary, it can raise a traditional PEAR_Error. + * It has built-in support for PEAR::Log, to log errors as they occur + * + * Since version 0.2alpha, it is also possible to selectively ignore errors, + * through the use of an error callback, see {@link pushCallback()} + * + * Since version 0.3alpha, it is possible to specify the exception class + * returned from {@link push()} + * + * Since version PEAR1.3.2, ErrorStack no longer instantiates an exception class. This can + * still be done quite handily in an error callback or by manipulating the returned array + * @category Debugging + * @package PEAR_ErrorStack + * @author Greg Beaver <cellog@php.net> + * @copyright 2004-2008 Greg Beaver + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: ErrorStack.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR_ErrorStack + */ + +/** + * Singleton storage + * + * Format: + * <pre> + * array( + * 'package1' => PEAR_ErrorStack object, + * 'package2' => PEAR_ErrorStack object, + * ... + * ) + * </pre> + * @access private + * @global array $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] + */ +$GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] = array(); + +/** + * Global error callback (default) + * + * This is only used if set to non-false. * is the default callback for + * all packages, whereas specific packages may set a default callback + * for all instances, regardless of whether they are a singleton or not. + * + * To exclude non-singletons, only set the local callback for the singleton + * @see PEAR_ErrorStack::setDefaultCallback() + * @access private + * @global array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] + */ +$GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] = array( + '*' => false, +); + +/** + * Global Log object (default) + * + * This is only used if set to non-false. Use to set a default log object for + * all stacks, regardless of instantiation order or location + * @see PEAR_ErrorStack::setDefaultLogger() + * @access private + * @global array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] + */ +$GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = false; + +/** + * Global Overriding Callback + * + * This callback will override any error callbacks that specific loggers have set. + * Use with EXTREME caution + * @see PEAR_ErrorStack::staticPushCallback() + * @access private + * @global array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] + */ +$GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array(); + +/**#@+ + * One of four possible return values from the error Callback + * @see PEAR_ErrorStack::_errorCallback() + */ +/** + * If this is returned, then the error will be both pushed onto the stack + * and logged. + */ +define('PEAR_ERRORSTACK_PUSHANDLOG', 1); +/** + * If this is returned, then the error will only be pushed onto the stack, + * and not logged. + */ +define('PEAR_ERRORSTACK_PUSH', 2); +/** + * If this is returned, then the error will only be logged, but not pushed + * onto the error stack. + */ +define('PEAR_ERRORSTACK_LOG', 3); +/** + * If this is returned, then the error is completely ignored. + */ +define('PEAR_ERRORSTACK_IGNORE', 4); +/** + * If this is returned, then the error is logged and die() is called. + */ +define('PEAR_ERRORSTACK_DIE', 5); +/**#@-*/ + +/** + * Error code for an attempt to instantiate a non-class as a PEAR_ErrorStack in + * the singleton method. + */ +define('PEAR_ERRORSTACK_ERR_NONCLASS', 1); + +/** + * Error code for an attempt to pass an object into {@link PEAR_ErrorStack::getMessage()} + * that has no __toString() method + */ +define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2); +/** + * Error Stack Implementation + * + * Usage: + * <code> + * // global error stack + * $global_stack = &PEAR_ErrorStack::singleton('MyPackage'); + * // local error stack + * $local_stack = new PEAR_ErrorStack('MyPackage'); + * </code> + * @author Greg Beaver <cellog@php.net> + * @version 1.9.4 + * @package PEAR_ErrorStack + * @category Debugging + * @copyright 2004-2008 Greg Beaver + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: ErrorStack.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR_ErrorStack + */ +class PEAR_ErrorStack { + /** + * Errors are stored in the order that they are pushed on the stack. + * @since 0.4alpha Errors are no longer organized by error level. + * This renders pop() nearly unusable, and levels could be more easily + * handled in a callback anyway + * @var array + * @access private + */ + var $_errors = array(); + + /** + * Storage of errors by level. + * + * Allows easy retrieval and deletion of only errors from a particular level + * @since PEAR 1.4.0dev + * @var array + * @access private + */ + var $_errorsByLevel = array(); + + /** + * Package name this error stack represents + * @var string + * @access protected + */ + var $_package; + + /** + * Determines whether a PEAR_Error is thrown upon every error addition + * @var boolean + * @access private + */ + var $_compat = false; + + /** + * If set to a valid callback, this will be used to generate the error + * message from the error code, otherwise the message passed in will be + * used + * @var false|string|array + * @access private + */ + var $_msgCallback = false; + + /** + * If set to a valid callback, this will be used to generate the error + * context for an error. For PHP-related errors, this will be a file + * and line number as retrieved from debug_backtrace(), but can be + * customized for other purposes. The error might actually be in a separate + * configuration file, or in a database query. + * @var false|string|array + * @access protected + */ + var $_contextCallback = false; + + /** + * If set to a valid callback, this will be called every time an error + * is pushed onto the stack. The return value will be used to determine + * whether to allow an error to be pushed or logged. + * + * The return value must be one an PEAR_ERRORSTACK_* constant + * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG + * @var false|string|array + * @access protected + */ + var $_errorCallback = array(); + + /** + * PEAR::Log object for logging errors + * @var false|Log + * @access protected + */ + var $_logger = false; + + /** + * Error messages - designed to be overridden + * @var array + * @abstract + */ + var $_errorMsgs = array(); + + /** + * Set up a new error stack + * + * @param string $package name of the package this error stack represents + * @param callback $msgCallback callback used for error message generation + * @param callback $contextCallback callback used for context generation, + * defaults to {@link getFileLine()} + * @param boolean $throwPEAR_Error + */ + function PEAR_ErrorStack($package, $msgCallback = false, $contextCallback = false, + $throwPEAR_Error = false) + { + $this->_package = $package; + $this->setMessageCallback($msgCallback); + $this->setContextCallback($contextCallback); + $this->_compat = $throwPEAR_Error; + } + + /** + * Return a single error stack for this package. + * + * Note that all parameters are ignored if the stack for package $package + * has already been instantiated + * @param string $package name of the package this error stack represents + * @param callback $msgCallback callback used for error message generation + * @param callback $contextCallback callback used for context generation, + * defaults to {@link getFileLine()} + * @param boolean $throwPEAR_Error + * @param string $stackClass class to instantiate + * @static + * @return PEAR_ErrorStack + */ + function &singleton($package, $msgCallback = false, $contextCallback = false, + $throwPEAR_Error = false, $stackClass = 'PEAR_ErrorStack') + { + if (isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { + return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]; + } + if (!class_exists($stackClass)) { + if (function_exists('debug_backtrace')) { + $trace = debug_backtrace(); + } + PEAR_ErrorStack::staticPush('PEAR_ErrorStack', PEAR_ERRORSTACK_ERR_NONCLASS, + 'exception', array('stackclass' => $stackClass), + 'stack class "%stackclass%" is not a valid class name (should be like PEAR_ErrorStack)', + false, $trace); + } + $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package] = + new $stackClass($package, $msgCallback, $contextCallback, $throwPEAR_Error); + + return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]; + } + + /** + * Internal error handler for PEAR_ErrorStack class + * + * Dies if the error is an exception (and would have died anyway) + * @access private + */ + function _handleError($err) + { + if ($err['level'] == 'exception') { + $message = $err['message']; + if (isset($_SERVER['REQUEST_URI'])) { + echo '<br />'; + } else { + echo "\n"; + } + var_dump($err['context']); + die($message); + } + } + + /** + * Set up a PEAR::Log object for all error stacks that don't have one + * @param Log $log + * @static + */ + function setDefaultLogger(&$log) + { + if (is_object($log) && method_exists($log, 'log') ) { + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; + } elseif (is_callable($log)) { + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; + } + } + + /** + * Set up a PEAR::Log object for this error stack + * @param Log $log + */ + function setLogger(&$log) + { + if (is_object($log) && method_exists($log, 'log') ) { + $this->_logger = &$log; + } elseif (is_callable($log)) { + $this->_logger = &$log; + } + } + + /** + * Set an error code => error message mapping callback + * + * This method sets the callback that can be used to generate error + * messages for any instance + * @param array|string Callback function/method + */ + function setMessageCallback($msgCallback) + { + if (!$msgCallback) { + $this->_msgCallback = array(&$this, 'getErrorMessage'); + } else { + if (is_callable($msgCallback)) { + $this->_msgCallback = $msgCallback; + } + } + } + + /** + * Get an error code => error message mapping callback + * + * This method returns the current callback that can be used to generate error + * messages + * @return array|string|false Callback function/method or false if none + */ + function getMessageCallback() + { + return $this->_msgCallback; + } + + /** + * Sets a default callback to be used by all error stacks + * + * This method sets the callback that can be used to generate error + * messages for a singleton + * @param array|string Callback function/method + * @param string Package name, or false for all packages + * @static + */ + function setDefaultCallback($callback = false, $package = false) + { + if (!is_callable($callback)) { + $callback = false; + } + $package = $package ? $package : '*'; + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'][$package] = $callback; + } + + /** + * Set a callback that generates context information (location of error) for an error stack + * + * This method sets the callback that can be used to generate context + * information for an error. Passing in NULL will disable context generation + * and remove the expensive call to debug_backtrace() + * @param array|string|null Callback function/method + */ + function setContextCallback($contextCallback) + { + if ($contextCallback === null) { + return $this->_contextCallback = false; + } + if (!$contextCallback) { + $this->_contextCallback = array(&$this, 'getFileLine'); + } else { + if (is_callable($contextCallback)) { + $this->_contextCallback = $contextCallback; + } + } + } + + /** + * Set an error Callback + * If set to a valid callback, this will be called every time an error + * is pushed onto the stack. The return value will be used to determine + * whether to allow an error to be pushed or logged. + * + * The return value must be one of the ERRORSTACK_* constants. + * + * This functionality can be used to emulate PEAR's pushErrorHandling, and + * the PEAR_ERROR_CALLBACK mode, without affecting the integrity of + * the error stack or logging + * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG + * @see popCallback() + * @param string|array $cb + */ + function pushCallback($cb) + { + array_push($this->_errorCallback, $cb); + } + + /** + * Remove a callback from the error callback stack + * @see pushCallback() + * @return array|string|false + */ + function popCallback() + { + if (!count($this->_errorCallback)) { + return false; + } + return array_pop($this->_errorCallback); + } + + /** + * Set a temporary overriding error callback for every package error stack + * + * Use this to temporarily disable all existing callbacks (can be used + * to emulate the @ operator, for instance) + * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG + * @see staticPopCallback(), pushCallback() + * @param string|array $cb + * @static + */ + function staticPushCallback($cb) + { + array_push($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'], $cb); + } + + /** + * Remove a temporary overriding error callback + * @see staticPushCallback() + * @return array|string|false + * @static + */ + function staticPopCallback() + { + $ret = array_pop($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK']); + if (!is_array($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'])) { + $GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array(); + } + return $ret; + } + + /** + * Add an error to the stack + * + * If the message generator exists, it is called with 2 parameters. + * - the current Error Stack object + * - an array that is in the same format as an error. Available indices + * are 'code', 'package', 'time', 'params', 'level', and 'context' + * + * Next, if the error should contain context information, this is + * handled by the context grabbing method. + * Finally, the error is pushed onto the proper error stack + * @param int $code Package-specific error code + * @param string $level Error level. This is NOT spell-checked + * @param array $params associative array of error parameters + * @param string $msg Error message, or a portion of it if the message + * is to be generated + * @param array $repackage If this error re-packages an error pushed by + * another package, place the array returned from + * {@link pop()} in this parameter + * @param array $backtrace Protected parameter: use this to pass in the + * {@link debug_backtrace()} that should be used + * to find error context + * @return PEAR_Error|array if compatibility mode is on, a PEAR_Error is also + * thrown. If a PEAR_Error is returned, the userinfo + * property is set to the following array: + * + * <code> + * array( + * 'code' => $code, + * 'params' => $params, + * 'package' => $this->_package, + * 'level' => $level, + * 'time' => time(), + * 'context' => $context, + * 'message' => $msg, + * //['repackage' => $err] repackaged error array/Exception class + * ); + * </code> + * + * Normally, the previous array is returned. + */ + function push($code, $level = 'error', $params = array(), $msg = false, + $repackage = false, $backtrace = false) + { + $context = false; + // grab error context + if ($this->_contextCallback) { + if (!$backtrace) { + $backtrace = debug_backtrace(); + } + $context = call_user_func($this->_contextCallback, $code, $params, $backtrace); + } + + // save error + $time = explode(' ', microtime()); + $time = $time[1] + $time[0]; + $err = array( + 'code' => $code, + 'params' => $params, + 'package' => $this->_package, + 'level' => $level, + 'time' => $time, + 'context' => $context, + 'message' => $msg, + ); + + if ($repackage) { + $err['repackage'] = $repackage; + } + + // set up the error message, if necessary + if ($this->_msgCallback) { + $msg = call_user_func_array($this->_msgCallback, + array(&$this, $err)); + $err['message'] = $msg; + } + $push = $log = true; + $die = false; + // try the overriding callback first + $callback = $this->staticPopCallback(); + if ($callback) { + $this->staticPushCallback($callback); + } + if (!is_callable($callback)) { + // try the local callback next + $callback = $this->popCallback(); + if (is_callable($callback)) { + $this->pushCallback($callback); + } else { + // try the default callback + $callback = isset($GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'][$this->_package]) ? + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'][$this->_package] : + $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK']['*']; + } + } + if (is_callable($callback)) { + switch(call_user_func($callback, $err)){ + case PEAR_ERRORSTACK_IGNORE: + return $err; + break; + case PEAR_ERRORSTACK_PUSH: + $log = false; + break; + case PEAR_ERRORSTACK_LOG: + $push = false; + break; + case PEAR_ERRORSTACK_DIE: + $die = true; + break; + // anything else returned has the same effect as pushandlog + } + } + if ($push) { + array_unshift($this->_errors, $err); + if (!isset($this->_errorsByLevel[$err['level']])) { + $this->_errorsByLevel[$err['level']] = array(); + } + $this->_errorsByLevel[$err['level']][] = &$this->_errors[0]; + } + if ($log) { + if ($this->_logger || $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER']) { + $this->_log($err); + } + } + if ($die) { + die(); + } + if ($this->_compat && $push) { + return $this->raiseError($msg, $code, null, null, $err); + } + return $err; + } + + /** + * Static version of {@link push()} + * + * @param string $package Package name this error belongs to + * @param int $code Package-specific error code + * @param string $level Error level. This is NOT spell-checked + * @param array $params associative array of error parameters + * @param string $msg Error message, or a portion of it if the message + * is to be generated + * @param array $repackage If this error re-packages an error pushed by + * another package, place the array returned from + * {@link pop()} in this parameter + * @param array $backtrace Protected parameter: use this to pass in the + * {@link debug_backtrace()} that should be used + * to find error context + * @return PEAR_Error|array if compatibility mode is on, a PEAR_Error is also + * thrown. see docs for {@link push()} + * @static + */ + function staticPush($package, $code, $level = 'error', $params = array(), + $msg = false, $repackage = false, $backtrace = false) + { + $s = &PEAR_ErrorStack::singleton($package); + if ($s->_contextCallback) { + if (!$backtrace) { + if (function_exists('debug_backtrace')) { + $backtrace = debug_backtrace(); + } + } + } + return $s->push($code, $level, $params, $msg, $repackage, $backtrace); + } + + /** + * Log an error using PEAR::Log + * @param array $err Error array + * @param array $levels Error level => Log constant map + * @access protected + */ + function _log($err) + { + if ($this->_logger) { + $logger = &$this->_logger; + } else { + $logger = &$GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER']; + } + if (is_a($logger, 'Log')) { + $levels = array( + 'exception' => PEAR_LOG_CRIT, + 'alert' => PEAR_LOG_ALERT, + 'critical' => PEAR_LOG_CRIT, + 'error' => PEAR_LOG_ERR, + 'warning' => PEAR_LOG_WARNING, + 'notice' => PEAR_LOG_NOTICE, + 'info' => PEAR_LOG_INFO, + 'debug' => PEAR_LOG_DEBUG); + if (isset($levels[$err['level']])) { + $level = $levels[$err['level']]; + } else { + $level = PEAR_LOG_INFO; + } + $logger->log($err['message'], $level, $err); + } else { // support non-standard logs + call_user_func($logger, $err); + } + } + + + /** + * Pop an error off of the error stack + * + * @return false|array + * @since 0.4alpha it is no longer possible to specify a specific error + * level to return - the last error pushed will be returned, instead + */ + function pop() + { + $err = @array_shift($this->_errors); + if (!is_null($err)) { + @array_pop($this->_errorsByLevel[$err['level']]); + if (!count($this->_errorsByLevel[$err['level']])) { + unset($this->_errorsByLevel[$err['level']]); + } + } + return $err; + } + + /** + * Pop an error off of the error stack, static method + * + * @param string package name + * @return boolean + * @since PEAR1.5.0a1 + */ + function staticPop($package) + { + if ($package) { + if (!isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { + return false; + } + return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->pop(); + } + } + + /** + * Determine whether there are any errors on the stack + * @param string|array Level name. Use to determine if any errors + * of level (string), or levels (array) have been pushed + * @return boolean + */ + function hasErrors($level = false) + { + if ($level) { + return isset($this->_errorsByLevel[$level]); + } + return count($this->_errors); + } + + /** + * Retrieve all errors since last purge + * + * @param boolean set in order to empty the error stack + * @param string level name, to return only errors of a particular severity + * @return array + */ + function getErrors($purge = false, $level = false) + { + if (!$purge) { + if ($level) { + if (!isset($this->_errorsByLevel[$level])) { + return array(); + } else { + return $this->_errorsByLevel[$level]; + } + } else { + return $this->_errors; + } + } + if ($level) { + $ret = $this->_errorsByLevel[$level]; + foreach ($this->_errorsByLevel[$level] as $i => $unused) { + // entries are references to the $_errors array + $this->_errorsByLevel[$level][$i] = false; + } + // array_filter removes all entries === false + $this->_errors = array_filter($this->_errors); + unset($this->_errorsByLevel[$level]); + return $ret; + } + $ret = $this->_errors; + $this->_errors = array(); + $this->_errorsByLevel = array(); + return $ret; + } + + /** + * Determine whether there are any errors on a single error stack, or on any error stack + * + * The optional parameter can be used to test the existence of any errors without the need of + * singleton instantiation + * @param string|false Package name to check for errors + * @param string Level name to check for a particular severity + * @return boolean + * @static + */ + function staticHasErrors($package = false, $level = false) + { + if ($package) { + if (!isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { + return false; + } + return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->hasErrors($level); + } + foreach ($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $obj) { + if ($obj->hasErrors($level)) { + return true; + } + } + return false; + } + + /** + * Get a list of all errors since last purge, organized by package + * @since PEAR 1.4.0dev BC break! $level is now in the place $merge used to be + * @param boolean $purge Set to purge the error stack of existing errors + * @param string $level Set to a level name in order to retrieve only errors of a particular level + * @param boolean $merge Set to return a flat array, not organized by package + * @param array $sortfunc Function used to sort a merged array - default + * sorts by time, and should be good for most cases + * @static + * @return array + */ + function staticGetErrors($purge = false, $level = false, $merge = false, + $sortfunc = array('PEAR_ErrorStack', '_sortErrors')) + { + $ret = array(); + if (!is_callable($sortfunc)) { + $sortfunc = array('PEAR_ErrorStack', '_sortErrors'); + } + foreach ($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $obj) { + $test = $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->getErrors($purge, $level); + if ($test) { + if ($merge) { + $ret = array_merge($ret, $test); + } else { + $ret[$package] = $test; + } + } + } + if ($merge) { + usort($ret, $sortfunc); + } + return $ret; + } + + /** + * Error sorting function, sorts by time + * @access private + */ + function _sortErrors($a, $b) + { + if ($a['time'] == $b['time']) { + return 0; + } + if ($a['time'] < $b['time']) { + return 1; + } + return -1; + } + + /** + * Standard file/line number/function/class context callback + * + * This function uses a backtrace generated from {@link debug_backtrace()} + * and so will not work at all in PHP < 4.3.0. The frame should + * reference the frame that contains the source of the error. + * @return array|false either array('file' => file, 'line' => line, + * 'function' => function name, 'class' => class name) or + * if this doesn't work, then false + * @param unused + * @param integer backtrace frame. + * @param array Results of debug_backtrace() + * @static + */ + function getFileLine($code, $params, $backtrace = null) + { + if ($backtrace === null) { + return false; + } + $frame = 0; + $functionframe = 1; + if (!isset($backtrace[1])) { + $functionframe = 0; + } else { + while (isset($backtrace[$functionframe]['function']) && + $backtrace[$functionframe]['function'] == 'eval' && + isset($backtrace[$functionframe + 1])) { + $functionframe++; + } + } + if (isset($backtrace[$frame])) { + if (!isset($backtrace[$frame]['file'])) { + $frame++; + } + $funcbacktrace = $backtrace[$functionframe]; + $filebacktrace = $backtrace[$frame]; + $ret = array('file' => $filebacktrace['file'], + 'line' => $filebacktrace['line']); + // rearrange for eval'd code or create function errors + if (strpos($filebacktrace['file'], '(') && + preg_match(';^(.*?)\((\d+)\) : (.*?)\\z;', $filebacktrace['file'], + $matches)) { + $ret['file'] = $matches[1]; + $ret['line'] = $matches[2] + 0; + } + if (isset($funcbacktrace['function']) && isset($backtrace[1])) { + if ($funcbacktrace['function'] != 'eval') { + if ($funcbacktrace['function'] == '__lambda_func') { + $ret['function'] = 'create_function() code'; + } else { + $ret['function'] = $funcbacktrace['function']; + } + } + } + if (isset($funcbacktrace['class']) && isset($backtrace[1])) { + $ret['class'] = $funcbacktrace['class']; + } + return $ret; + } + return false; + } + + /** + * Standard error message generation callback + * + * This method may also be called by a custom error message generator + * to fill in template values from the params array, simply + * set the third parameter to the error message template string to use + * + * The special variable %__msg% is reserved: use it only to specify + * where a message passed in by the user should be placed in the template, + * like so: + * + * Error message: %msg% - internal error + * + * If the message passed like so: + * + * <code> + * $stack->push(ERROR_CODE, 'error', array(), 'server error 500'); + * </code> + * + * The returned error message will be "Error message: server error 500 - + * internal error" + * @param PEAR_ErrorStack + * @param array + * @param string|false Pre-generated error message template + * @static + * @return string + */ + function getErrorMessage(&$stack, $err, $template = false) + { + if ($template) { + $mainmsg = $template; + } else { + $mainmsg = $stack->getErrorMessageTemplate($err['code']); + } + $mainmsg = str_replace('%__msg%', $err['message'], $mainmsg); + if (is_array($err['params']) && count($err['params'])) { + foreach ($err['params'] as $name => $val) { + if (is_array($val)) { + // @ is needed in case $val is a multi-dimensional array + $val = @implode(', ', $val); + } + if (is_object($val)) { + if (method_exists($val, '__toString')) { + $val = $val->__toString(); + } else { + PEAR_ErrorStack::staticPush('PEAR_ErrorStack', PEAR_ERRORSTACK_ERR_OBJTOSTRING, + 'warning', array('obj' => get_class($val)), + 'object %obj% passed into getErrorMessage, but has no __toString() method'); + $val = 'Object'; + } + } + $mainmsg = str_replace('%' . $name . '%', $val, $mainmsg); + } + } + return $mainmsg; + } + + /** + * Standard Error Message Template generator from code + * @return string + */ + function getErrorMessageTemplate($code) + { + if (!isset($this->_errorMsgs[$code])) { + return '%__msg%'; + } + return $this->_errorMsgs[$code]; + } + + /** + * Set the Error Message Template array + * + * The array format must be: + * <pre> + * array(error code => 'message template',...) + * </pre> + * + * Error message parameters passed into {@link push()} will be used as input + * for the error message. If the template is 'message %foo% was %bar%', and the + * parameters are array('foo' => 'one', 'bar' => 'six'), the error message returned will + * be 'message one was six' + * @return string + */ + function setErrorMessageTemplate($template) + { + $this->_errorMsgs = $template; + } + + + /** + * emulate PEAR::raiseError() + * + * @return PEAR_Error + */ + function raiseError() + { + require_once 'PEAR.php'; + $args = func_get_args(); + return call_user_func_array(array('PEAR', 'raiseError'), $args); + } +} +$stack = &PEAR_ErrorStack::singleton('PEAR_ErrorStack'); +$stack->pushCallback(array('PEAR_ErrorStack', '_handleError')); +?> diff --git a/vendor/PEAR/Exception.php b/vendor/pear-pear.php.net/PEAR/PEAR/Exception.php similarity index 99% rename from vendor/PEAR/Exception.php rename to vendor/pear-pear.php.net/PEAR/PEAR/Exception.php index 112bdd0f5ac69d191f776f47de23e5e0caaae5ff..4a0e7b86fac7a953773f2f3a841d36e2380b7664 100644 --- a/vendor/PEAR/Exception.php +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Exception.php @@ -13,7 +13,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Exception.php 299813 2010-05-26 19:50:00Z dufuz $ + * @version CVS: $Id: Exception.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.3 */ @@ -89,7 +89,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 1.9.3 + * @version Release: 1.9.4 * @link http://pear.php.net/package/PEAR * @since Class available since Release 1.3.3 * diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/FixPHP5PEARWarnings.php b/vendor/pear-pear.php.net/PEAR/PEAR/FixPHP5PEARWarnings.php new file mode 100644 index 0000000000000000000000000000000000000000..be5dc3ce707c3e06189b89395819ae49edbab19c --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/FixPHP5PEARWarnings.php @@ -0,0 +1,7 @@ +<?php +if ($skipmsg) { + $a = &new $ec($code, $mode, $options, $userinfo); +} else { + $a = &new $ec($message, $code, $mode, $options, $userinfo); +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Frontend.php b/vendor/pear-pear.php.net/PEAR/PEAR/Frontend.php new file mode 100644 index 0000000000000000000000000000000000000000..531e541f9eb3942da0aaccb332fc6a0223441620 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Frontend.php @@ -0,0 +1,228 @@ +<?php +/** + * PEAR_Frontend, the singleton-based frontend for user input/output + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Frontend.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * Include error handling + */ +//require_once 'PEAR.php'; + +/** + * Which user interface class is being used. + * @var string class name + */ +$GLOBALS['_PEAR_FRONTEND_CLASS'] = 'PEAR_Frontend_CLI'; + +/** + * Instance of $_PEAR_Command_uiclass. + * @var object + */ +$GLOBALS['_PEAR_FRONTEND_SINGLETON'] = null; + +/** + * Singleton-based frontend for PEAR user input/output + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Frontend extends PEAR +{ + /** + * Retrieve the frontend object + * @return PEAR_Frontend_CLI|PEAR_Frontend_Web|PEAR_Frontend_Gtk + * @static + */ + function &singleton($type = null) + { + if ($type === null) { + if (!isset($GLOBALS['_PEAR_FRONTEND_SINGLETON'])) { + $a = false; + return $a; + } + return $GLOBALS['_PEAR_FRONTEND_SINGLETON']; + } + + $a = PEAR_Frontend::setFrontendClass($type); + return $a; + } + + /** + * Set the frontend class that will be used by calls to {@link singleton()} + * + * Frontends are expected to conform to the PEAR naming standard of + * _ => DIRECTORY_SEPARATOR (PEAR_Frontend_CLI is in PEAR/Frontend/CLI.php) + * @param string $uiclass full class name + * @return PEAR_Frontend + * @static + */ + function &setFrontendClass($uiclass) + { + if (is_object($GLOBALS['_PEAR_FRONTEND_SINGLETON']) && + is_a($GLOBALS['_PEAR_FRONTEND_SINGLETON'], $uiclass)) { + return $GLOBALS['_PEAR_FRONTEND_SINGLETON']; + } + + if (!class_exists($uiclass)) { + $file = str_replace('_', '/', $uiclass) . '.php'; + if (PEAR_Frontend::isIncludeable($file)) { + include_once $file; + } + } + + if (class_exists($uiclass)) { + $obj = &new $uiclass; + // quick test to see if this class implements a few of the most + // important frontend methods + if (is_a($obj, 'PEAR_Frontend')) { + $GLOBALS['_PEAR_FRONTEND_SINGLETON'] = &$obj; + $GLOBALS['_PEAR_FRONTEND_CLASS'] = $uiclass; + return $obj; + } + + $err = PEAR::raiseError("not a frontend class: $uiclass"); + return $err; + } + + $err = PEAR::raiseError("no such class: $uiclass"); + return $err; + } + + /** + * Set the frontend class that will be used by calls to {@link singleton()} + * + * Frontends are expected to be a descendant of PEAR_Frontend + * @param PEAR_Frontend + * @return PEAR_Frontend + * @static + */ + function &setFrontendObject($uiobject) + { + if (is_object($GLOBALS['_PEAR_FRONTEND_SINGLETON']) && + is_a($GLOBALS['_PEAR_FRONTEND_SINGLETON'], get_class($uiobject))) { + return $GLOBALS['_PEAR_FRONTEND_SINGLETON']; + } + + if (!is_a($uiobject, 'PEAR_Frontend')) { + $err = PEAR::raiseError('not a valid frontend class: (' . + get_class($uiobject) . ')'); + return $err; + } + + $GLOBALS['_PEAR_FRONTEND_SINGLETON'] = &$uiobject; + $GLOBALS['_PEAR_FRONTEND_CLASS'] = get_class($uiobject); + return $uiobject; + } + + /** + * @param string $path relative or absolute include path + * @return boolean + * @static + */ + function isIncludeable($path) + { + if (file_exists($path) && is_readable($path)) { + return true; + } + + $fp = @fopen($path, 'r', true); + if ($fp) { + fclose($fp); + return true; + } + + return false; + } + + /** + * @param PEAR_Config + */ + function setConfig(&$config) + { + } + + /** + * This can be overridden to allow session-based temporary file management + * + * By default, all files are deleted at the end of a session. The web installer + * needs to be able to sustain a list over many sessions in order to support + * user interaction with install scripts + */ + function addTempFile($file) + { + $GLOBALS['_PEAR_Common_tempfiles'][] = $file; + } + + /** + * Log an action + * + * @param string $msg the message to log + * @param boolean $append_crlf + * @return boolean true + * @abstract + */ + function log($msg, $append_crlf = true) + { + } + + /** + * Run a post-installation script + * + * @param array $scripts array of post-install scripts + * @abstract + */ + function runPostinstallScripts(&$scripts) + { + } + + /** + * Display human-friendly output formatted depending on the + * $command parameter. + * + * This should be able to handle basic output data with no command + * @param mixed $data data structure containing the information to display + * @param string $command command from which this method was called + * @abstract + */ + function outputData($data, $command = '_default') + { + } + + /** + * Display a modal form dialog and return the given input + * + * A frontend that requires multiple requests to retrieve and process + * data must take these needs into account, and implement the request + * handling code. + * @param string $command command from which this method was called + * @param array $prompts associative array. keys are the input field names + * and values are the description + * @param array $types array of input field types (text, password, + * etc.) keys have to be the same like in $prompts + * @param array $defaults array of default values. again keys have + * to be the same like in $prompts. Do not depend + * on a default value being set. + * @return array input sent by the user + * @abstract + */ + function userDialog($command, $prompts, $types = array(), $defaults = array()) + { + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Frontend/CLI.php b/vendor/pear-pear.php.net/PEAR/PEAR/Frontend/CLI.php new file mode 100644 index 0000000000000000000000000000000000000000..340b99b79b7872404809a56175955e84a3da6c0a --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Frontend/CLI.php @@ -0,0 +1,751 @@ +<?php +/** + * PEAR_Frontend_CLI + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: CLI.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ +/** + * base class + */ +require_once 'PEAR/Frontend.php'; + +/** + * Command-line Frontend for the PEAR Installer + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Frontend_CLI extends PEAR_Frontend +{ + /** + * What type of user interface this frontend is for. + * @var string + * @access public + */ + var $type = 'CLI'; + var $lp = ''; // line prefix + + var $params = array(); + var $term = array( + 'bold' => '', + 'normal' => '', + ); + + function PEAR_Frontend_CLI() + { + parent::PEAR(); + $term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1 + if (function_exists('posix_isatty') && !posix_isatty(1)) { + // output is being redirected to a file or through a pipe + } elseif ($term) { + if (preg_match('/^(xterm|vt220|linux)/', $term)) { + $this->term['bold'] = sprintf("%c%c%c%c", 27, 91, 49, 109); + $this->term['normal'] = sprintf("%c%c%c", 27, 91, 109); + } elseif (preg_match('/^vt100/', $term)) { + $this->term['bold'] = sprintf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); + $this->term['normal'] = sprintf("%c%c%c%c%c", 27, 91, 109, 0, 0); + } + } elseif (OS_WINDOWS) { + // XXX add ANSI codes here + } + } + + /** + * @param object PEAR_Error object + */ + function displayError($e) + { + return $this->_displayLine($e->getMessage()); + } + + /** + * @param object PEAR_Error object + */ + function displayFatalError($eobj) + { + $this->displayError($eobj); + if (class_exists('PEAR_Config')) { + $config = &PEAR_Config::singleton(); + if ($config->get('verbose') > 5) { + if (function_exists('debug_print_backtrace')) { + debug_print_backtrace(); + exit(1); + } + + $raised = false; + foreach (debug_backtrace() as $i => $frame) { + if (!$raised) { + if (isset($frame['class']) + && strtolower($frame['class']) == 'pear' + && strtolower($frame['function']) == 'raiseerror' + ) { + $raised = true; + } else { + continue; + } + } + + $frame['class'] = !isset($frame['class']) ? '' : $frame['class']; + $frame['type'] = !isset($frame['type']) ? '' : $frame['type']; + $frame['function'] = !isset($frame['function']) ? '' : $frame['function']; + $frame['line'] = !isset($frame['line']) ? '' : $frame['line']; + $this->_displayLine("#$i: $frame[class]$frame[type]$frame[function] $frame[line]"); + } + } + } + + exit(1); + } + + /** + * Instruct the runInstallScript method to skip a paramgroup that matches the + * id value passed in. + * + * This method is useful for dynamically configuring which sections of a post-install script + * will be run based on the user's setup, which is very useful for making flexible + * post-install scripts without losing the cross-Frontend ability to retrieve user input + * @param string + */ + function skipParamgroup($id) + { + $this->_skipSections[$id] = true; + } + + function runPostinstallScripts(&$scripts) + { + foreach ($scripts as $i => $script) { + $this->runInstallScript($scripts[$i]->_params, $scripts[$i]->_obj); + } + } + + /** + * @param array $xml contents of postinstallscript tag + * @param object $script post-installation script + * @param string install|upgrade + */ + function runInstallScript($xml, &$script) + { + $this->_skipSections = array(); + if (!is_array($xml) || !isset($xml['paramgroup'])) { + $script->run(array(), '_default'); + return; + } + + $completedPhases = array(); + if (!isset($xml['paramgroup'][0])) { + $xml['paramgroup'] = array($xml['paramgroup']); + } + + foreach ($xml['paramgroup'] as $group) { + if (isset($this->_skipSections[$group['id']])) { + // the post-install script chose to skip this section dynamically + continue; + } + + if (isset($group['name'])) { + $paramname = explode('::', $group['name']); + if ($lastgroup['id'] != $paramname[0]) { + continue; + } + + $group['name'] = $paramname[1]; + if (!isset($answers)) { + return; + } + + if (isset($answers[$group['name']])) { + switch ($group['conditiontype']) { + case '=' : + if ($answers[$group['name']] != $group['value']) { + continue 2; + } + break; + case '!=' : + if ($answers[$group['name']] == $group['value']) { + continue 2; + } + break; + case 'preg_match' : + if (!@preg_match('/' . $group['value'] . '/', + $answers[$group['name']])) { + continue 2; + } + break; + default : + return; + } + } + } + + $lastgroup = $group; + if (isset($group['instructions'])) { + $this->_display($group['instructions']); + } + + if (!isset($group['param'][0])) { + $group['param'] = array($group['param']); + } + + if (isset($group['param'])) { + if (method_exists($script, 'postProcessPrompts')) { + $prompts = $script->postProcessPrompts($group['param'], $group['id']); + if (!is_array($prompts) || count($prompts) != count($group['param'])) { + $this->outputData('postinstall', 'Error: post-install script did not ' . + 'return proper post-processed prompts'); + $prompts = $group['param']; + } else { + foreach ($prompts as $i => $var) { + if (!is_array($var) || !isset($var['prompt']) || + !isset($var['name']) || + ($var['name'] != $group['param'][$i]['name']) || + ($var['type'] != $group['param'][$i]['type']) + ) { + $this->outputData('postinstall', 'Error: post-install script ' . + 'modified the variables or prompts, severe security risk. ' . + 'Will instead use the defaults from the package.xml'); + $prompts = $group['param']; + } + } + } + + $answers = $this->confirmDialog($prompts); + } else { + $answers = $this->confirmDialog($group['param']); + } + } + + if ((isset($answers) && $answers) || !isset($group['param'])) { + if (!isset($answers)) { + $answers = array(); + } + + array_unshift($completedPhases, $group['id']); + if (!$script->run($answers, $group['id'])) { + $script->run($completedPhases, '_undoOnError'); + return; + } + } else { + $script->run($completedPhases, '_undoOnError'); + return; + } + } + } + + /** + * Ask for user input, confirm the answers and continue until the user is satisfied + * @param array an array of arrays, format array('name' => 'paramname', 'prompt' => + * 'text to display', 'type' => 'string'[, default => 'default value']) + * @return array + */ + function confirmDialog($params) + { + $answers = $prompts = $types = array(); + foreach ($params as $param) { + $prompts[$param['name']] = $param['prompt']; + $types[$param['name']] = $param['type']; + $answers[$param['name']] = isset($param['default']) ? $param['default'] : ''; + } + + $tried = false; + do { + if ($tried) { + $i = 1; + foreach ($answers as $var => $value) { + if (!strlen($value)) { + echo $this->bold("* Enter an answer for #" . $i . ": ({$prompts[$var]})\n"); + } + $i++; + } + } + + $answers = $this->userDialog('', $prompts, $types, $answers); + $tried = true; + } while (is_array($answers) && count(array_filter($answers)) != count($prompts)); + + return $answers; + } + + function userDialog($command, $prompts, $types = array(), $defaults = array(), $screensize = 20) + { + if (!is_array($prompts)) { + return array(); + } + + $testprompts = array_keys($prompts); + $result = $defaults; + + reset($prompts); + if (count($prompts) === 1) { + foreach ($prompts as $key => $prompt) { + $type = $types[$key]; + $default = @$defaults[$key]; + print "$prompt "; + if ($default) { + print "[$default] "; + } + print ": "; + + $line = fgets(STDIN, 2048); + $result[$key] = ($default && trim($line) == '') ? $default : trim($line); + } + + return $result; + } + + $first_run = true; + while (true) { + $descLength = max(array_map('strlen', $prompts)); + $descFormat = "%-{$descLength}s"; + $last = count($prompts); + + $i = 0; + foreach ($prompts as $n => $var) { + $res = isset($result[$n]) ? $result[$n] : null; + printf("%2d. $descFormat : %s\n", ++$i, $prompts[$n], $res); + } + print "\n1-$last, 'all', 'abort', or Enter to continue: "; + + $tmp = trim(fgets(STDIN, 1024)); + if (empty($tmp)) { + break; + } + + if ($tmp == 'abort') { + return false; + } + + if (isset($testprompts[(int)$tmp - 1])) { + $var = $testprompts[(int)$tmp - 1]; + $desc = $prompts[$var]; + $current = @$result[$var]; + print "$desc [$current] : "; + $tmp = trim(fgets(STDIN, 1024)); + if ($tmp !== '') { + $result[$var] = $tmp; + } + } elseif ($tmp == 'all') { + foreach ($prompts as $var => $desc) { + $current = $result[$var]; + print "$desc [$current] : "; + $tmp = trim(fgets(STDIN, 1024)); + if (trim($tmp) !== '') { + $result[$var] = trim($tmp); + } + } + } + + $first_run = false; + } + + return $result; + } + + function userConfirm($prompt, $default = 'yes') + { + trigger_error("PEAR_Frontend_CLI::userConfirm not yet converted", E_USER_ERROR); + static $positives = array('y', 'yes', 'on', '1'); + static $negatives = array('n', 'no', 'off', '0'); + print "$this->lp$prompt [$default] : "; + $fp = fopen("php://stdin", "r"); + $line = fgets($fp, 2048); + fclose($fp); + $answer = strtolower(trim($line)); + if (empty($answer)) { + $answer = $default; + } + if (in_array($answer, $positives)) { + return true; + } + if (in_array($answer, $negatives)) { + return false; + } + if (in_array($default, $positives)) { + return true; + } + return false; + } + + function outputData($data, $command = '_default') + { + switch ($command) { + case 'channel-info': + foreach ($data as $type => $section) { + if ($type == 'main') { + $section['data'] = array_values($section['data']); + } + + $this->outputData($section); + } + break; + case 'install': + case 'upgrade': + case 'upgrade-all': + if (is_array($data) && isset($data['release_warnings'])) { + $this->_displayLine(''); + $this->_startTable(array( + 'border' => false, + 'caption' => 'Release Warnings' + )); + $this->_tableRow(array($data['release_warnings']), null, array(1 => array('wrap' => 55))); + $this->_endTable(); + $this->_displayLine(''); + } + + $this->_displayLine(is_array($data) ? $data['data'] : $data); + break; + case 'search': + $this->_startTable($data); + if (isset($data['headline']) && is_array($data['headline'])) { + $this->_tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55))); + } + + $packages = array(); + foreach($data['data'] as $category) { + foreach($category as $name => $pkg) { + $packages[$pkg[0]] = $pkg; + } + } + + $p = array_keys($packages); + natcasesort($p); + foreach ($p as $name) { + $this->_tableRow($packages[$name], null, array(1 => array('wrap' => 55))); + } + + $this->_endTable(); + break; + case 'list-all': + if (!isset($data['data'])) { + $this->_displayLine('No packages in channel'); + break; + } + + $this->_startTable($data); + if (isset($data['headline']) && is_array($data['headline'])) { + $this->_tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55))); + } + + $packages = array(); + foreach($data['data'] as $category) { + foreach($category as $name => $pkg) { + $packages[$pkg[0]] = $pkg; + } + } + + $p = array_keys($packages); + natcasesort($p); + foreach ($p as $name) { + $pkg = $packages[$name]; + unset($pkg[4], $pkg[5]); + $this->_tableRow($pkg, null, array(1 => array('wrap' => 55))); + } + + $this->_endTable(); + break; + case 'config-show': + $data['border'] = false; + $opts = array( + 0 => array('wrap' => 30), + 1 => array('wrap' => 20), + 2 => array('wrap' => 35) + ); + + $this->_startTable($data); + if (isset($data['headline']) && is_array($data['headline'])) { + $this->_tableRow($data['headline'], array('bold' => true), $opts); + } + + foreach ($data['data'] as $group) { + foreach ($group as $value) { + if ($value[2] == '') { + $value[2] = "<not set>"; + } + + $this->_tableRow($value, null, $opts); + } + } + + $this->_endTable(); + break; + case 'remote-info': + $d = $data; + $data = array( + 'caption' => 'Package details:', + 'border' => false, + 'data' => array( + array("Latest", $data['stable']), + array("Installed", $data['installed']), + array("Package", $data['name']), + array("License", $data['license']), + array("Category", $data['category']), + array("Summary", $data['summary']), + array("Description", $data['description']), + ), + ); + + if (isset($d['deprecated']) && $d['deprecated']) { + $conf = &PEAR_Config::singleton(); + $reg = $conf->getRegistry(); + $name = $reg->parsedPackageNameToString($d['deprecated'], true); + $data['data'][] = array('Deprecated! use', $name); + } + default: { + if (is_array($data)) { + $this->_startTable($data); + $count = count($data['data'][0]); + if ($count == 2) { + $opts = array(0 => array('wrap' => 25), + 1 => array('wrap' => 48) + ); + } elseif ($count == 3) { + $opts = array(0 => array('wrap' => 30), + 1 => array('wrap' => 20), + 2 => array('wrap' => 35) + ); + } else { + $opts = null; + } + if (isset($data['headline']) && is_array($data['headline'])) { + $this->_tableRow($data['headline'], + array('bold' => true), + $opts); + } + + if (is_array($data['data'])) { + foreach($data['data'] as $row) { + $this->_tableRow($row, null, $opts); + } + } else { + $this->_tableRow(array($data['data']), null, $opts); + } + $this->_endTable(); + } else { + $this->_displayLine($data); + } + } + } + } + + function log($text, $append_crlf = true) + { + if ($append_crlf) { + return $this->_displayLine($text); + } + + return $this->_display($text); + } + + function bold($text) + { + if (empty($this->term['bold'])) { + return strtoupper($text); + } + + return $this->term['bold'] . $text . $this->term['normal']; + } + + function _displayHeading($title) + { + print $this->lp.$this->bold($title)."\n"; + print $this->lp.str_repeat("=", strlen($title))."\n"; + } + + function _startTable($params = array()) + { + $params['table_data'] = array(); + $params['widest'] = array(); // indexed by column + $params['highest'] = array(); // indexed by row + $params['ncols'] = 0; + $this->params = $params; + } + + function _tableRow($columns, $rowparams = array(), $colparams = array()) + { + $highest = 1; + for ($i = 0; $i < count($columns); $i++) { + $col = &$columns[$i]; + if (isset($colparams[$i]) && !empty($colparams[$i]['wrap'])) { + $col = wordwrap($col, $colparams[$i]['wrap']); + } + + if (strpos($col, "\n") !== false) { + $multiline = explode("\n", $col); + $w = 0; + foreach ($multiline as $n => $line) { + $len = strlen($line); + if ($len > $w) { + $w = $len; + } + } + $lines = count($multiline); + } else { + $w = strlen($col); + } + + if (isset($this->params['widest'][$i])) { + if ($w > $this->params['widest'][$i]) { + $this->params['widest'][$i] = $w; + } + } else { + $this->params['widest'][$i] = $w; + } + + $tmp = count_chars($columns[$i], 1); + // handle unix, mac and windows formats + $lines = (isset($tmp[10]) ? $tmp[10] : (isset($tmp[13]) ? $tmp[13] : 0)) + 1; + if ($lines > $highest) { + $highest = $lines; + } + } + + if (count($columns) > $this->params['ncols']) { + $this->params['ncols'] = count($columns); + } + + $new_row = array( + 'data' => $columns, + 'height' => $highest, + 'rowparams' => $rowparams, + 'colparams' => $colparams, + ); + $this->params['table_data'][] = $new_row; + } + + function _endTable() + { + extract($this->params); + if (!empty($caption)) { + $this->_displayHeading($caption); + } + + if (count($table_data) === 0) { + return; + } + + if (!isset($width)) { + $width = $widest; + } else { + for ($i = 0; $i < $ncols; $i++) { + if (!isset($width[$i])) { + $width[$i] = $widest[$i]; + } + } + } + + $border = false; + if (empty($border)) { + $cellstart = ''; + $cellend = ' '; + $rowend = ''; + $padrowend = false; + $borderline = ''; + } else { + $cellstart = '| '; + $cellend = ' '; + $rowend = '|'; + $padrowend = true; + $borderline = '+'; + foreach ($width as $w) { + $borderline .= str_repeat('-', $w + strlen($cellstart) + strlen($cellend) - 1); + $borderline .= '+'; + } + } + + if ($borderline) { + $this->_displayLine($borderline); + } + + for ($i = 0; $i < count($table_data); $i++) { + extract($table_data[$i]); + if (!is_array($rowparams)) { + $rowparams = array(); + } + + if (!is_array($colparams)) { + $colparams = array(); + } + + $rowlines = array(); + if ($height > 1) { + for ($c = 0; $c < count($data); $c++) { + $rowlines[$c] = preg_split('/(\r?\n|\r)/', $data[$c]); + if (count($rowlines[$c]) < $height) { + $rowlines[$c] = array_pad($rowlines[$c], $height, ''); + } + } + } else { + for ($c = 0; $c < count($data); $c++) { + $rowlines[$c] = array($data[$c]); + } + } + + for ($r = 0; $r < $height; $r++) { + $rowtext = ''; + for ($c = 0; $c < count($data); $c++) { + if (isset($colparams[$c])) { + $attribs = array_merge($rowparams, $colparams); + } else { + $attribs = $rowparams; + } + + $w = isset($width[$c]) ? $width[$c] : 0; + //$cell = $data[$c]; + $cell = $rowlines[$c][$r]; + $l = strlen($cell); + if ($l > $w) { + $cell = substr($cell, 0, $w); + } + + if (isset($attribs['bold'])) { + $cell = $this->bold($cell); + } + + if ($l < $w) { + // not using str_pad here because we may + // add bold escape characters to $cell + $cell .= str_repeat(' ', $w - $l); + } + + $rowtext .= $cellstart . $cell . $cellend; + } + + if (!$border) { + $rowtext = rtrim($rowtext); + } + + $rowtext .= $rowend; + $this->_displayLine($rowtext); + } + } + + if ($borderline) { + $this->_displayLine($borderline); + } + } + + function _displayLine($text) + { + print "$this->lp$text\n"; + } + + function _display($text) + { + print $text; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer.php new file mode 100644 index 0000000000000000000000000000000000000000..eb17ca7914dc0a7a34588715cbf61e5d99cf1966 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer.php @@ -0,0 +1,1823 @@ +<?php +/** + * PEAR_Installer + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V. Cox <cox@idecnet.com> + * @author Martin Jansen <mj@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Installer.php 313024 2011-07-06 19:51:24Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * Used for installation groups in package.xml 2.0 and platform exceptions + */ +require_once 'OS/Guess.php'; +require_once 'PEAR/Downloader.php'; + +define('PEAR_INSTALLER_NOBINARY', -240); +/** + * Administration class used to install PEAR packages and maintain the + * installed package database. + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V. Cox <cox@idecnet.com> + * @author Martin Jansen <mj@php.net> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Installer extends PEAR_Downloader +{ + // {{{ properties + + /** name of the package directory, for example Foo-1.0 + * @var string + */ + var $pkgdir; + + /** directory where PHP code files go + * @var string + */ + var $phpdir; + + /** directory where PHP extension files go + * @var string + */ + var $extdir; + + /** directory where documentation goes + * @var string + */ + var $docdir; + + /** installation root directory (ala PHP's INSTALL_ROOT or + * automake's DESTDIR + * @var string + */ + var $installroot = ''; + + /** debug level + * @var int + */ + var $debug = 1; + + /** temporary directory + * @var string + */ + var $tmpdir; + + /** + * PEAR_Registry object used by the installer + * @var PEAR_Registry + */ + var $registry; + + /** + * array of PEAR_Downloader_Packages + * @var array + */ + var $_downloadedPackages; + + /** List of file transactions queued for an install/upgrade/uninstall. + * + * Format: + * array( + * 0 => array("rename => array("from-file", "to-file")), + * 1 => array("delete" => array("file-to-delete")), + * ... + * ) + * + * @var array + */ + var $file_operations = array(); + + // }}} + + // {{{ constructor + + /** + * PEAR_Installer constructor. + * + * @param object $ui user interface object (instance of PEAR_Frontend_*) + * + * @access public + */ + function PEAR_Installer(&$ui) + { + parent::PEAR_Common(); + $this->setFrontendObject($ui); + $this->debug = $this->config->get('verbose'); + } + + function setOptions($options) + { + $this->_options = $options; + } + + function setConfig(&$config) + { + $this->config = &$config; + $this->_registry = &$config->getRegistry(); + } + + // }}} + + function _removeBackups($files) + { + foreach ($files as $path) { + $this->addFileOperation('removebackup', array($path)); + } + } + + // {{{ _deletePackageFiles() + + /** + * Delete a package's installed files, does not remove empty directories. + * + * @param string package name + * @param string channel name + * @param bool if true, then files are backed up first + * @return bool TRUE on success, or a PEAR error on failure + * @access protected + */ + function _deletePackageFiles($package, $channel = false, $backup = false) + { + if (!$channel) { + $channel = 'pear.php.net'; + } + + if (!strlen($package)) { + return $this->raiseError("No package to uninstall given"); + } + + if (strtolower($package) == 'pear' && $channel == 'pear.php.net') { + // to avoid race conditions, include all possible needed files + require_once 'PEAR/Task/Common.php'; + require_once 'PEAR/Task/Replace.php'; + require_once 'PEAR/Task/Unixeol.php'; + require_once 'PEAR/Task/Windowseol.php'; + require_once 'PEAR/PackageFile/v1.php'; + require_once 'PEAR/PackageFile/v2.php'; + require_once 'PEAR/PackageFile/Generator/v1.php'; + require_once 'PEAR/PackageFile/Generator/v2.php'; + } + + $filelist = $this->_registry->packageInfo($package, 'filelist', $channel); + if ($filelist == null) { + return $this->raiseError("$channel/$package not installed"); + } + + $ret = array(); + foreach ($filelist as $file => $props) { + if (empty($props['installed_as'])) { + continue; + } + + $path = $props['installed_as']; + if ($backup) { + $this->addFileOperation('backup', array($path)); + $ret[] = $path; + } + + $this->addFileOperation('delete', array($path)); + } + + if ($backup) { + return $ret; + } + + return true; + } + + // }}} + // {{{ _installFile() + + /** + * @param string filename + * @param array attributes from <file> tag in package.xml + * @param string path to install the file in + * @param array options from command-line + * @access private + */ + function _installFile($file, $atts, $tmp_path, $options) + { + // {{{ return if this file is meant for another platform + static $os; + if (!isset($this->_registry)) { + $this->_registry = &$this->config->getRegistry(); + } + + if (isset($atts['platform'])) { + if (empty($os)) { + $os = new OS_Guess(); + } + + if (strlen($atts['platform']) && $atts['platform']{0} == '!') { + $negate = true; + $platform = substr($atts['platform'], 1); + } else { + $negate = false; + $platform = $atts['platform']; + } + + if ((bool) $os->matchSignature($platform) === $negate) { + $this->log(3, "skipped $file (meant for $atts[platform], we are ".$os->getSignature().")"); + return PEAR_INSTALLER_SKIPPED; + } + } + // }}} + + $channel = $this->pkginfo->getChannel(); + // {{{ assemble the destination paths + switch ($atts['role']) { + case 'src': + case 'extsrc': + $this->source_files++; + return; + case 'doc': + case 'data': + case 'test': + $dest_dir = $this->config->get($atts['role'] . '_dir', null, $channel) . + DIRECTORY_SEPARATOR . $this->pkginfo->getPackage(); + unset($atts['baseinstalldir']); + break; + case 'ext': + case 'php': + $dest_dir = $this->config->get($atts['role'] . '_dir', null, $channel); + break; + case 'script': + $dest_dir = $this->config->get('bin_dir', null, $channel); + break; + default: + return $this->raiseError("Invalid role `$atts[role]' for file $file"); + } + + $save_destdir = $dest_dir; + if (!empty($atts['baseinstalldir'])) { + $dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir']; + } + + if (dirname($file) != '.' && empty($atts['install-as'])) { + $dest_dir .= DIRECTORY_SEPARATOR . dirname($file); + } + + if (empty($atts['install-as'])) { + $dest_file = $dest_dir . DIRECTORY_SEPARATOR . basename($file); + } else { + $dest_file = $dest_dir . DIRECTORY_SEPARATOR . $atts['install-as']; + } + $orig_file = $tmp_path . DIRECTORY_SEPARATOR . $file; + + // Clean up the DIRECTORY_SEPARATOR mess + $ds2 = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; + list($dest_file, $orig_file) = preg_replace(array('!\\\\+!', '!/!', "!$ds2+!"), + array(DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR), + array($dest_file, $orig_file)); + $final_dest_file = $installed_as = $dest_file; + if (isset($this->_options['packagingroot'])) { + $installedas_dest_dir = dirname($final_dest_file); + $installedas_dest_file = $dest_dir . DIRECTORY_SEPARATOR . '.tmp' . basename($final_dest_file); + $final_dest_file = $this->_prependPath($final_dest_file, $this->_options['packagingroot']); + } else { + $installedas_dest_dir = dirname($final_dest_file); + $installedas_dest_file = $installedas_dest_dir . DIRECTORY_SEPARATOR . '.tmp' . basename($final_dest_file); + } + + $dest_dir = dirname($final_dest_file); + $dest_file = $dest_dir . DIRECTORY_SEPARATOR . '.tmp' . basename($final_dest_file); + if (preg_match('~/\.\.(/|\\z)|^\.\./~', str_replace('\\', '/', $dest_file))) { + return $this->raiseError("SECURITY ERROR: file $file (installed to $dest_file) contains parent directory reference ..", PEAR_INSTALLER_FAILED); + } + // }}} + + if (empty($this->_options['register-only']) && + (!file_exists($dest_dir) || !is_dir($dest_dir))) { + if (!$this->mkDirHier($dest_dir)) { + return $this->raiseError("failed to mkdir $dest_dir", + PEAR_INSTALLER_FAILED); + } + $this->log(3, "+ mkdir $dest_dir"); + } + + // pretty much nothing happens if we are only registering the install + if (empty($this->_options['register-only'])) { + if (empty($atts['replacements'])) { + if (!file_exists($orig_file)) { + return $this->raiseError("file $orig_file does not exist", + PEAR_INSTALLER_FAILED); + } + + if (!@copy($orig_file, $dest_file)) { + return $this->raiseError("failed to write $dest_file: $php_errormsg", + PEAR_INSTALLER_FAILED); + } + + $this->log(3, "+ cp $orig_file $dest_file"); + if (isset($atts['md5sum'])) { + $md5sum = md5_file($dest_file); + } + } else { + // {{{ file with replacements + if (!file_exists($orig_file)) { + return $this->raiseError("file does not exist", + PEAR_INSTALLER_FAILED); + } + + $contents = file_get_contents($orig_file); + if ($contents === false) { + $contents = ''; + } + + if (isset($atts['md5sum'])) { + $md5sum = md5($contents); + } + + $subst_from = $subst_to = array(); + foreach ($atts['replacements'] as $a) { + $to = ''; + if ($a['type'] == 'php-const') { + if (preg_match('/^[a-z0-9_]+\\z/i', $a['to'])) { + eval("\$to = $a[to];"); + } else { + if (!isset($options['soft'])) { + $this->log(0, "invalid php-const replacement: $a[to]"); + } + continue; + } + } elseif ($a['type'] == 'pear-config') { + if ($a['to'] == 'master_server') { + $chan = $this->_registry->getChannel($channel); + if (!PEAR::isError($chan)) { + $to = $chan->getServer(); + } else { + $to = $this->config->get($a['to'], null, $channel); + } + } else { + $to = $this->config->get($a['to'], null, $channel); + } + if (is_null($to)) { + if (!isset($options['soft'])) { + $this->log(0, "invalid pear-config replacement: $a[to]"); + } + continue; + } + } elseif ($a['type'] == 'package-info') { + if ($t = $this->pkginfo->packageInfo($a['to'])) { + $to = $t; + } else { + if (!isset($options['soft'])) { + $this->log(0, "invalid package-info replacement: $a[to]"); + } + continue; + } + } + if (!is_null($to)) { + $subst_from[] = $a['from']; + $subst_to[] = $to; + } + } + + $this->log(3, "doing ".sizeof($subst_from)." substitution(s) for $final_dest_file"); + if (sizeof($subst_from)) { + $contents = str_replace($subst_from, $subst_to, $contents); + } + + $wp = @fopen($dest_file, "wb"); + if (!is_resource($wp)) { + return $this->raiseError("failed to create $dest_file: $php_errormsg", + PEAR_INSTALLER_FAILED); + } + + if (@fwrite($wp, $contents) === false) { + return $this->raiseError("failed writing to $dest_file: $php_errormsg", + PEAR_INSTALLER_FAILED); + } + + fclose($wp); + // }}} + } + + // {{{ check the md5 + if (isset($md5sum)) { + if (strtolower($md5sum) === strtolower($atts['md5sum'])) { + $this->log(2, "md5sum ok: $final_dest_file"); + } else { + if (empty($options['force'])) { + // delete the file + if (file_exists($dest_file)) { + unlink($dest_file); + } + + if (!isset($options['ignore-errors'])) { + return $this->raiseError("bad md5sum for file $final_dest_file", + PEAR_INSTALLER_FAILED); + } + + if (!isset($options['soft'])) { + $this->log(0, "warning : bad md5sum for file $final_dest_file"); + } + } else { + if (!isset($options['soft'])) { + $this->log(0, "warning : bad md5sum for file $final_dest_file"); + } + } + } + } + // }}} + // {{{ set file permissions + if (!OS_WINDOWS) { + if ($atts['role'] == 'script') { + $mode = 0777 & ~(int)octdec($this->config->get('umask')); + $this->log(3, "+ chmod +x $dest_file"); + } else { + $mode = 0666 & ~(int)octdec($this->config->get('umask')); + } + + if ($atts['role'] != 'src') { + $this->addFileOperation("chmod", array($mode, $dest_file)); + if (!@chmod($dest_file, $mode)) { + if (!isset($options['soft'])) { + $this->log(0, "failed to change mode of $dest_file: $php_errormsg"); + } + } + } + } + // }}} + + if ($atts['role'] == 'src') { + rename($dest_file, $final_dest_file); + $this->log(2, "renamed source file $dest_file to $final_dest_file"); + } else { + $this->addFileOperation("rename", array($dest_file, $final_dest_file, + $atts['role'] == 'ext')); + } + } + + // Store the full path where the file was installed for easy unistall + if ($atts['role'] != 'script') { + $loc = $this->config->get($atts['role'] . '_dir'); + } else { + $loc = $this->config->get('bin_dir'); + } + + if ($atts['role'] != 'src') { + $this->addFileOperation("installed_as", array($file, $installed_as, + $loc, + dirname(substr($installedas_dest_file, strlen($loc))))); + } + + //$this->log(2, "installed: $dest_file"); + return PEAR_INSTALLER_OK; + } + + // }}} + // {{{ _installFile2() + + /** + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string filename + * @param array attributes from <file> tag in package.xml + * @param string path to install the file in + * @param array options from command-line + * @access private + */ + function _installFile2(&$pkg, $file, &$real_atts, $tmp_path, $options) + { + $atts = $real_atts; + if (!isset($this->_registry)) { + $this->_registry = &$this->config->getRegistry(); + } + + $channel = $pkg->getChannel(); + // {{{ assemble the destination paths + if (!in_array($atts['attribs']['role'], + PEAR_Installer_Role::getValidRoles($pkg->getPackageType()))) { + return $this->raiseError('Invalid role `' . $atts['attribs']['role'] . + "' for file $file"); + } + + $role = &PEAR_Installer_Role::factory($pkg, $atts['attribs']['role'], $this->config); + $err = $role->setup($this, $pkg, $atts['attribs'], $file); + if (PEAR::isError($err)) { + return $err; + } + + if (!$role->isInstallable()) { + return; + } + + $info = $role->processInstallation($pkg, $atts['attribs'], $file, $tmp_path); + if (PEAR::isError($info)) { + return $info; + } + + list($save_destdir, $dest_dir, $dest_file, $orig_file) = $info; + if (preg_match('~/\.\.(/|\\z)|^\.\./~', str_replace('\\', '/', $dest_file))) { + return $this->raiseError("SECURITY ERROR: file $file (installed to $dest_file) contains parent directory reference ..", PEAR_INSTALLER_FAILED); + } + + $final_dest_file = $installed_as = $dest_file; + if (isset($this->_options['packagingroot'])) { + $final_dest_file = $this->_prependPath($final_dest_file, + $this->_options['packagingroot']); + } + + $dest_dir = dirname($final_dest_file); + $dest_file = $dest_dir . DIRECTORY_SEPARATOR . '.tmp' . basename($final_dest_file); + // }}} + + if (empty($this->_options['register-only'])) { + if (!file_exists($dest_dir) || !is_dir($dest_dir)) { + if (!$this->mkDirHier($dest_dir)) { + return $this->raiseError("failed to mkdir $dest_dir", + PEAR_INSTALLER_FAILED); + } + $this->log(3, "+ mkdir $dest_dir"); + } + } + + $attribs = $atts['attribs']; + unset($atts['attribs']); + // pretty much nothing happens if we are only registering the install + if (empty($this->_options['register-only'])) { + if (!count($atts)) { // no tasks + if (!file_exists($orig_file)) { + return $this->raiseError("file $orig_file does not exist", + PEAR_INSTALLER_FAILED); + } + + if (!@copy($orig_file, $dest_file)) { + return $this->raiseError("failed to write $dest_file: $php_errormsg", + PEAR_INSTALLER_FAILED); + } + + $this->log(3, "+ cp $orig_file $dest_file"); + if (isset($attribs['md5sum'])) { + $md5sum = md5_file($dest_file); + } + } else { // file with tasks + if (!file_exists($orig_file)) { + return $this->raiseError("file $orig_file does not exist", + PEAR_INSTALLER_FAILED); + } + + $contents = file_get_contents($orig_file); + if ($contents === false) { + $contents = ''; + } + + if (isset($attribs['md5sum'])) { + $md5sum = md5($contents); + } + + foreach ($atts as $tag => $raw) { + $tag = str_replace(array($pkg->getTasksNs() . ':', '-'), array('', '_'), $tag); + $task = "PEAR_Task_$tag"; + $task = &new $task($this->config, $this, PEAR_TASK_INSTALL); + if (!$task->isScript()) { // scripts are only handled after installation + $task->init($raw, $attribs, $pkg->getLastInstalledVersion()); + $res = $task->startSession($pkg, $contents, $final_dest_file); + if ($res === false) { + continue; // skip this file + } + + if (PEAR::isError($res)) { + return $res; + } + + $contents = $res; // save changes + } + + $wp = @fopen($dest_file, "wb"); + if (!is_resource($wp)) { + return $this->raiseError("failed to create $dest_file: $php_errormsg", + PEAR_INSTALLER_FAILED); + } + + if (fwrite($wp, $contents) === false) { + return $this->raiseError("failed writing to $dest_file: $php_errormsg", + PEAR_INSTALLER_FAILED); + } + + fclose($wp); + } + } + + // {{{ check the md5 + if (isset($md5sum)) { + // Make sure the original md5 sum matches with expected + if (strtolower($md5sum) === strtolower($attribs['md5sum'])) { + $this->log(2, "md5sum ok: $final_dest_file"); + + if (isset($contents)) { + // set md5 sum based on $content in case any tasks were run. + $real_atts['attribs']['md5sum'] = md5($contents); + } + } else { + if (empty($options['force'])) { + // delete the file + if (file_exists($dest_file)) { + unlink($dest_file); + } + + if (!isset($options['ignore-errors'])) { + return $this->raiseError("bad md5sum for file $final_dest_file", + PEAR_INSTALLER_FAILED); + } + + if (!isset($options['soft'])) { + $this->log(0, "warning : bad md5sum for file $final_dest_file"); + } + } else { + if (!isset($options['soft'])) { + $this->log(0, "warning : bad md5sum for file $final_dest_file"); + } + } + } + } else { + $real_atts['attribs']['md5sum'] = md5_file($dest_file); + } + + // }}} + // {{{ set file permissions + if (!OS_WINDOWS) { + if ($role->isExecutable()) { + $mode = 0777 & ~(int)octdec($this->config->get('umask')); + $this->log(3, "+ chmod +x $dest_file"); + } else { + $mode = 0666 & ~(int)octdec($this->config->get('umask')); + } + + if ($attribs['role'] != 'src') { + $this->addFileOperation("chmod", array($mode, $dest_file)); + if (!@chmod($dest_file, $mode)) { + if (!isset($options['soft'])) { + $this->log(0, "failed to change mode of $dest_file: $php_errormsg"); + } + } + } + } + // }}} + + if ($attribs['role'] == 'src') { + rename($dest_file, $final_dest_file); + $this->log(2, "renamed source file $dest_file to $final_dest_file"); + } else { + $this->addFileOperation("rename", array($dest_file, $final_dest_file, $role->isExtension())); + } + } + + // Store the full path where the file was installed for easy uninstall + if ($attribs['role'] != 'src') { + $loc = $this->config->get($role->getLocationConfig(), null, $channel); + $this->addFileOperation('installed_as', array($file, $installed_as, + $loc, + dirname(substr($installed_as, strlen($loc))))); + } + + //$this->log(2, "installed: $dest_file"); + return PEAR_INSTALLER_OK; + } + + // }}} + // {{{ addFileOperation() + + /** + * Add a file operation to the current file transaction. + * + * @see startFileTransaction() + * @param string $type This can be one of: + * - rename: rename a file ($data has 3 values) + * - backup: backup an existing file ($data has 1 value) + * - removebackup: clean up backups created during install ($data has 1 value) + * - chmod: change permissions on a file ($data has 2 values) + * - delete: delete a file ($data has 1 value) + * - rmdir: delete a directory if empty ($data has 1 value) + * - installed_as: mark a file as installed ($data has 4 values). + * @param array $data For all file operations, this array must contain the + * full path to the file or directory that is being operated on. For + * the rename command, the first parameter must be the file to rename, + * the second its new name, the third whether this is a PHP extension. + * + * The installed_as operation contains 4 elements in this order: + * 1. Filename as listed in the filelist element from package.xml + * 2. Full path to the installed file + * 3. Full path from the php_dir configuration variable used in this + * installation + * 4. Relative path from the php_dir that this file is installed in + */ + function addFileOperation($type, $data) + { + if (!is_array($data)) { + return $this->raiseError('Internal Error: $data in addFileOperation' + . ' must be an array, was ' . gettype($data)); + } + + if ($type == 'chmod') { + $octmode = decoct($data[0]); + $this->log(3, "adding to transaction: $type $octmode $data[1]"); + } else { + $this->log(3, "adding to transaction: $type " . implode(" ", $data)); + } + $this->file_operations[] = array($type, $data); + } + + // }}} + // {{{ startFileTransaction() + + function startFileTransaction($rollback_in_case = false) + { + if (count($this->file_operations) && $rollback_in_case) { + $this->rollbackFileTransaction(); + } + $this->file_operations = array(); + } + + // }}} + // {{{ commitFileTransaction() + + function commitFileTransaction() + { + // {{{ first, check permissions and such manually + $errors = array(); + foreach ($this->file_operations as $key => $tr) { + list($type, $data) = $tr; + switch ($type) { + case 'rename': + if (!file_exists($data[0])) { + $errors[] = "cannot rename file $data[0], doesn't exist"; + } + + // check that dest dir. is writable + if (!is_writable(dirname($data[1]))) { + $errors[] = "permission denied ($type): $data[1]"; + } + break; + case 'chmod': + // check that file is writable + if (!is_writable($data[1])) { + $errors[] = "permission denied ($type): $data[1] " . decoct($data[0]); + } + break; + case 'delete': + if (!file_exists($data[0])) { + $this->log(2, "warning: file $data[0] doesn't exist, can't be deleted"); + } + // check that directory is writable + if (file_exists($data[0])) { + if (!is_writable(dirname($data[0]))) { + $errors[] = "permission denied ($type): $data[0]"; + } else { + // make sure the file to be deleted can be opened for writing + $fp = false; + if (!is_dir($data[0]) && + (!is_writable($data[0]) || !($fp = @fopen($data[0], 'a')))) { + $errors[] = "permission denied ($type): $data[0]"; + } elseif ($fp) { + fclose($fp); + } + } + + /* Verify we are not deleting a file owned by another package + * This can happen when a file moves from package A to B in + * an upgrade ala http://pear.php.net/17986 + */ + $info = array( + 'package' => strtolower($this->pkginfo->getName()), + 'channel' => strtolower($this->pkginfo->getChannel()), + ); + $result = $this->_registry->checkFileMap($data[0], $info, '1.1'); + if (is_array($result)) { + $res = array_diff($result, $info); + if (!empty($res)) { + $new = $this->_registry->getPackage($result[1], $result[0]); + $this->file_operations[$key] = false; + $this->log(3, "file $data[0] was scheduled for removal from {$this->pkginfo->getName()} but is owned by {$new->getChannel()}/{$new->getName()}, removal has been cancelled."); + } + } + } + break; + } + + } + // }}} + + $n = count($this->file_operations); + $this->log(2, "about to commit $n file operations for " . $this->pkginfo->getName()); + + $m = count($errors); + if ($m > 0) { + foreach ($errors as $error) { + if (!isset($this->_options['soft'])) { + $this->log(1, $error); + } + } + + if (!isset($this->_options['ignore-errors'])) { + return false; + } + } + + $this->_dirtree = array(); + // {{{ really commit the transaction + foreach ($this->file_operations as $i => $tr) { + if (!$tr) { + // support removal of non-existing backups + continue; + } + + list($type, $data) = $tr; + switch ($type) { + case 'backup': + if (!file_exists($data[0])) { + $this->file_operations[$i] = false; + break; + } + + if (!@copy($data[0], $data[0] . '.bak')) { + $this->log(1, 'Could not copy ' . $data[0] . ' to ' . $data[0] . + '.bak ' . $php_errormsg); + return false; + } + $this->log(3, "+ backup $data[0] to $data[0].bak"); + break; + case 'removebackup': + if (file_exists($data[0] . '.bak') && is_writable($data[0] . '.bak')) { + unlink($data[0] . '.bak'); + $this->log(3, "+ rm backup of $data[0] ($data[0].bak)"); + } + break; + case 'rename': + $test = file_exists($data[1]) ? @unlink($data[1]) : null; + if (!$test && file_exists($data[1])) { + if ($data[2]) { + $extra = ', this extension must be installed manually. Rename to "' . + basename($data[1]) . '"'; + } else { + $extra = ''; + } + + if (!isset($this->_options['soft'])) { + $this->log(1, 'Could not delete ' . $data[1] . ', cannot rename ' . + $data[0] . $extra); + } + + if (!isset($this->_options['ignore-errors'])) { + return false; + } + } + + // permissions issues with rename - copy() is far superior + $perms = @fileperms($data[0]); + if (!@copy($data[0], $data[1])) { + $this->log(1, 'Could not rename ' . $data[0] . ' to ' . $data[1] . + ' ' . $php_errormsg); + return false; + } + + // copy over permissions, otherwise they are lost + @chmod($data[1], $perms); + @unlink($data[0]); + $this->log(3, "+ mv $data[0] $data[1]"); + break; + case 'chmod': + if (!@chmod($data[1], $data[0])) { + $this->log(1, 'Could not chmod ' . $data[1] . ' to ' . + decoct($data[0]) . ' ' . $php_errormsg); + return false; + } + + $octmode = decoct($data[0]); + $this->log(3, "+ chmod $octmode $data[1]"); + break; + case 'delete': + if (file_exists($data[0])) { + if (!@unlink($data[0])) { + $this->log(1, 'Could not delete ' . $data[0] . ' ' . + $php_errormsg); + return false; + } + $this->log(3, "+ rm $data[0]"); + } + break; + case 'rmdir': + if (file_exists($data[0])) { + do { + $testme = opendir($data[0]); + while (false !== ($entry = readdir($testme))) { + if ($entry == '.' || $entry == '..') { + continue; + } + closedir($testme); + break 2; // this directory is not empty and can't be + // deleted + } + + closedir($testme); + if (!@rmdir($data[0])) { + $this->log(1, 'Could not rmdir ' . $data[0] . ' ' . + $php_errormsg); + return false; + } + $this->log(3, "+ rmdir $data[0]"); + } while (false); + } + break; + case 'installed_as': + $this->pkginfo->setInstalledAs($data[0], $data[1]); + if (!isset($this->_dirtree[dirname($data[1])])) { + $this->_dirtree[dirname($data[1])] = true; + $this->pkginfo->setDirtree(dirname($data[1])); + + while(!empty($data[3]) && dirname($data[3]) != $data[3] && + $data[3] != '/' && $data[3] != '\\') { + $this->pkginfo->setDirtree($pp = + $this->_prependPath($data[3], $data[2])); + $this->_dirtree[$pp] = true; + $data[3] = dirname($data[3]); + } + } + break; + } + } + // }}} + $this->log(2, "successfully committed $n file operations"); + $this->file_operations = array(); + return true; + } + + // }}} + // {{{ rollbackFileTransaction() + + function rollbackFileTransaction() + { + $n = count($this->file_operations); + $this->log(2, "rolling back $n file operations"); + foreach ($this->file_operations as $tr) { + list($type, $data) = $tr; + switch ($type) { + case 'backup': + if (file_exists($data[0] . '.bak')) { + if (file_exists($data[0] && is_writable($data[0]))) { + unlink($data[0]); + } + @copy($data[0] . '.bak', $data[0]); + $this->log(3, "+ restore $data[0] from $data[0].bak"); + } + break; + case 'removebackup': + if (file_exists($data[0] . '.bak') && is_writable($data[0] . '.bak')) { + unlink($data[0] . '.bak'); + $this->log(3, "+ rm backup of $data[0] ($data[0].bak)"); + } + break; + case 'rename': + @unlink($data[0]); + $this->log(3, "+ rm $data[0]"); + break; + case 'mkdir': + @rmdir($data[0]); + $this->log(3, "+ rmdir $data[0]"); + break; + case 'chmod': + break; + case 'delete': + break; + case 'installed_as': + $this->pkginfo->setInstalledAs($data[0], false); + break; + } + } + $this->pkginfo->resetDirtree(); + $this->file_operations = array(); + } + + // }}} + // {{{ mkDirHier($dir) + + function mkDirHier($dir) + { + $this->addFileOperation('mkdir', array($dir)); + return parent::mkDirHier($dir); + } + + // }}} + // {{{ download() + + /** + * Download any files and their dependencies, if necessary + * + * @param array a mixed list of package names, local files, or package.xml + * @param PEAR_Config + * @param array options from the command line + * @param array this is the array that will be populated with packages to + * install. Format of each entry: + * + * <code> + * array('pkg' => 'package_name', 'file' => '/path/to/local/file', + * 'info' => array() // parsed package.xml + * ); + * </code> + * @param array this will be populated with any error messages + * @param false private recursion variable + * @param false private recursion variable + * @param false private recursion variable + * @deprecated in favor of PEAR_Downloader + */ + function download($packages, $options, &$config, &$installpackages, + &$errors, $installed = false, $willinstall = false, $state = false) + { + // trickiness: initialize here + parent::PEAR_Downloader($this->ui, $options, $config); + $ret = parent::download($packages); + $errors = $this->getErrorMsgs(); + $installpackages = $this->getDownloadedPackages(); + trigger_error("PEAR Warning: PEAR_Installer::download() is deprecated " . + "in favor of PEAR_Downloader class", E_USER_WARNING); + return $ret; + } + + // }}} + // {{{ _parsePackageXml() + + function _parsePackageXml(&$descfile) + { + // Parse xml file ----------------------------------------------- + $pkg = new PEAR_PackageFile($this->config, $this->debug); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $p = &$pkg->fromAnyFile($descfile, PEAR_VALIDATE_INSTALLING); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($p)) { + if (is_array($p->getUserInfo())) { + foreach ($p->getUserInfo() as $err) { + $loglevel = $err['level'] == 'error' ? 0 : 1; + if (!isset($this->_options['soft'])) { + $this->log($loglevel, ucfirst($err['level']) . ': ' . $err['message']); + } + } + } + return $this->raiseError('Installation failed: invalid package file'); + } + + $descfile = $p->getPackageFile(); + return $p; + } + + // }}} + /** + * Set the list of PEAR_Downloader_Package objects to allow more sane + * dependency validation + * @param array + */ + function setDownloadedPackages(&$pkgs) + { + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $err = $this->analyzeDependencies($pkgs); + PEAR::popErrorHandling(); + if (PEAR::isError($err)) { + return $err; + } + $this->_downloadedPackages = &$pkgs; + } + + /** + * Set the list of PEAR_Downloader_Package objects to allow more sane + * dependency validation + * @param array + */ + function setUninstallPackages(&$pkgs) + { + $this->_downloadedPackages = &$pkgs; + } + + function getInstallPackages() + { + return $this->_downloadedPackages; + } + + // {{{ install() + + /** + * Installs the files within the package file specified. + * + * @param string|PEAR_Downloader_Package $pkgfile path to the package file, + * or a pre-initialized packagefile object + * @param array $options + * recognized options: + * - installroot : optional prefix directory for installation + * - force : force installation + * - register-only : update registry but don't install files + * - upgrade : upgrade existing install + * - soft : fail silently + * - nodeps : ignore dependency conflicts/missing dependencies + * - alldeps : install all dependencies + * - onlyreqdeps : install only required dependencies + * + * @return array|PEAR_Error package info if successful + */ + function install($pkgfile, $options = array()) + { + $this->_options = $options; + $this->_registry = &$this->config->getRegistry(); + if (is_object($pkgfile)) { + $dlpkg = &$pkgfile; + $pkg = $pkgfile->getPackageFile(); + $pkgfile = $pkg->getArchiveFile(); + $descfile = $pkg->getPackageFile(); + } else { + $descfile = $pkgfile; + $pkg = $this->_parsePackageXml($descfile); + if (PEAR::isError($pkg)) { + return $pkg; + } + } + + $tmpdir = dirname($descfile); + if (realpath($descfile) != realpath($pkgfile)) { + // Use the temp_dir since $descfile can contain the download dir path + $tmpdir = $this->config->get('temp_dir', null, 'pear.php.net'); + $tmpdir = System::mktemp('-d -t "' . $tmpdir . '"'); + + $tar = new Archive_Tar($pkgfile); + if (!$tar->extract($tmpdir)) { + return $this->raiseError("unable to unpack $pkgfile"); + } + } + + $pkgname = $pkg->getName(); + $channel = $pkg->getChannel(); + if (isset($this->_options['packagingroot'])) { + $regdir = $this->_prependPath( + $this->config->get('php_dir', null, 'pear.php.net'), + $this->_options['packagingroot']); + + $packrootphp_dir = $this->_prependPath( + $this->config->get('php_dir', null, $channel), + $this->_options['packagingroot']); + } + + if (isset($options['installroot'])) { + $this->config->setInstallRoot($options['installroot']); + $this->_registry = &$this->config->getRegistry(); + $installregistry = &$this->_registry; + $this->installroot = ''; // all done automagically now + $php_dir = $this->config->get('php_dir', null, $channel); + } else { + $this->config->setInstallRoot(false); + $this->_registry = &$this->config->getRegistry(); + if (isset($this->_options['packagingroot'])) { + $installregistry = &new PEAR_Registry($regdir); + if (!$installregistry->channelExists($channel, true)) { + // we need to fake a channel-discover of this channel + $chanobj = $this->_registry->getChannel($channel, true); + $installregistry->addChannel($chanobj); + } + $php_dir = $packrootphp_dir; + } else { + $installregistry = &$this->_registry; + $php_dir = $this->config->get('php_dir', null, $channel); + } + $this->installroot = ''; + } + + // {{{ checks to do when not in "force" mode + if (empty($options['force']) && + (file_exists($this->config->get('php_dir')) && + is_dir($this->config->get('php_dir')))) { + $testp = $channel == 'pear.php.net' ? $pkgname : array($channel, $pkgname); + $instfilelist = $pkg->getInstallationFileList(true); + if (PEAR::isError($instfilelist)) { + return $instfilelist; + } + + // ensure we have the most accurate registry + $installregistry->flushFileMap(); + $test = $installregistry->checkFileMap($instfilelist, $testp, '1.1'); + if (PEAR::isError($test)) { + return $test; + } + + if (sizeof($test)) { + $pkgs = $this->getInstallPackages(); + $found = false; + foreach ($pkgs as $param) { + if ($pkg->isSubpackageOf($param)) { + $found = true; + break; + } + } + + if ($found) { + // subpackages can conflict with earlier versions of parent packages + $parentreg = $installregistry->packageInfo($param->getPackage(), null, $param->getChannel()); + $tmp = $test; + foreach ($tmp as $file => $info) { + if (is_array($info)) { + if (strtolower($info[1]) == strtolower($param->getPackage()) && + strtolower($info[0]) == strtolower($param->getChannel()) + ) { + if (isset($parentreg['filelist'][$file])) { + unset($parentreg['filelist'][$file]); + } else{ + $pos = strpos($file, '/'); + $basedir = substr($file, 0, $pos); + $file2 = substr($file, $pos + 1); + if (isset($parentreg['filelist'][$file2]['baseinstalldir']) + && $parentreg['filelist'][$file2]['baseinstalldir'] === $basedir + ) { + unset($parentreg['filelist'][$file2]); + } + } + + unset($test[$file]); + } + } else { + if (strtolower($param->getChannel()) != 'pear.php.net') { + continue; + } + + if (strtolower($info) == strtolower($param->getPackage())) { + if (isset($parentreg['filelist'][$file])) { + unset($parentreg['filelist'][$file]); + } else{ + $pos = strpos($file, '/'); + $basedir = substr($file, 0, $pos); + $file2 = substr($file, $pos + 1); + if (isset($parentreg['filelist'][$file2]['baseinstalldir']) + && $parentreg['filelist'][$file2]['baseinstalldir'] === $basedir + ) { + unset($parentreg['filelist'][$file2]); + } + } + + unset($test[$file]); + } + } + } + + $pfk = &new PEAR_PackageFile($this->config); + $parentpkg = &$pfk->fromArray($parentreg); + $installregistry->updatePackage2($parentpkg); + } + + if ($param->getChannel() == 'pecl.php.net' && isset($options['upgrade'])) { + $tmp = $test; + foreach ($tmp as $file => $info) { + if (is_string($info)) { + // pear.php.net packages are always stored as strings + if (strtolower($info) == strtolower($param->getPackage())) { + // upgrading existing package + unset($test[$file]); + } + } + } + } + + if (count($test)) { + $msg = "$channel/$pkgname: conflicting files found:\n"; + $longest = max(array_map("strlen", array_keys($test))); + $fmt = "%${longest}s (%s)\n"; + foreach ($test as $file => $info) { + if (!is_array($info)) { + $info = array('pear.php.net', $info); + } + $info = $info[0] . '/' . $info[1]; + $msg .= sprintf($fmt, $file, $info); + } + + if (!isset($options['ignore-errors'])) { + return $this->raiseError($msg); + } + + if (!isset($options['soft'])) { + $this->log(0, "WARNING: $msg"); + } + } + } + } + // }}} + + $this->startFileTransaction(); + + $usechannel = $channel; + if ($channel == 'pecl.php.net') { + $test = $installregistry->packageExists($pkgname, $channel); + if (!$test) { + $test = $installregistry->packageExists($pkgname, 'pear.php.net'); + $usechannel = 'pear.php.net'; + } + } else { + $test = $installregistry->packageExists($pkgname, $channel); + } + + if (empty($options['upgrade']) && empty($options['soft'])) { + // checks to do only when installing new packages + if (empty($options['force']) && $test) { + return $this->raiseError("$channel/$pkgname is already installed"); + } + } else { + // Upgrade + if ($test) { + $v1 = $installregistry->packageInfo($pkgname, 'version', $usechannel); + $v2 = $pkg->getVersion(); + $cmp = version_compare("$v1", "$v2", 'gt'); + if (empty($options['force']) && !version_compare("$v2", "$v1", 'gt')) { + return $this->raiseError("upgrade to a newer version ($v2 is not newer than $v1)"); + } + } + } + + // Do cleanups for upgrade and install, remove old release's files first + if ($test && empty($options['register-only'])) { + // when upgrading, remove old release's files first: + if (PEAR::isError($err = $this->_deletePackageFiles($pkgname, $usechannel, + true))) { + if (!isset($options['ignore-errors'])) { + return $this->raiseError($err); + } + + if (!isset($options['soft'])) { + $this->log(0, 'WARNING: ' . $err->getMessage()); + } + } else { + $backedup = $err; + } + } + + // {{{ Copy files to dest dir --------------------------------------- + + // info from the package it self we want to access from _installFile + $this->pkginfo = &$pkg; + // used to determine whether we should build any C code + $this->source_files = 0; + + $savechannel = $this->config->get('default_channel'); + if (empty($options['register-only']) && !is_dir($php_dir)) { + if (PEAR::isError(System::mkdir(array('-p'), $php_dir))) { + return $this->raiseError("no installation destination directory '$php_dir'\n"); + } + } + + if (substr($pkgfile, -4) != '.xml') { + $tmpdir .= DIRECTORY_SEPARATOR . $pkgname . '-' . $pkg->getVersion(); + } + + $this->configSet('default_channel', $channel); + // {{{ install files + + $ver = $pkg->getPackagexmlVersion(); + if (version_compare($ver, '2.0', '>=')) { + $filelist = $pkg->getInstallationFilelist(); + } else { + $filelist = $pkg->getFileList(); + } + + if (PEAR::isError($filelist)) { + return $filelist; + } + + $p = &$installregistry->getPackage($pkgname, $channel); + $dirtree = (empty($options['register-only']) && $p) ? $p->getDirTree() : false; + + $pkg->resetFilelist(); + $pkg->setLastInstalledVersion($installregistry->packageInfo($pkg->getPackage(), + 'version', $pkg->getChannel())); + foreach ($filelist as $file => $atts) { + $this->expectError(PEAR_INSTALLER_FAILED); + if ($pkg->getPackagexmlVersion() == '1.0') { + $res = $this->_installFile($file, $atts, $tmpdir, $options); + } else { + $res = $this->_installFile2($pkg, $file, $atts, $tmpdir, $options); + } + $this->popExpect(); + + if (PEAR::isError($res)) { + if (empty($options['ignore-errors'])) { + $this->rollbackFileTransaction(); + if ($res->getMessage() == "file does not exist") { + $this->raiseError("file $file in package.xml does not exist"); + } + + return $this->raiseError($res); + } + + if (!isset($options['soft'])) { + $this->log(0, "Warning: " . $res->getMessage()); + } + } + + $real = isset($atts['attribs']) ? $atts['attribs'] : $atts; + if ($res == PEAR_INSTALLER_OK && $real['role'] != 'src') { + // Register files that were installed + $pkg->installedFile($file, $atts); + } + } + // }}} + + // {{{ compile and install source files + if ($this->source_files > 0 && empty($options['nobuild'])) { + if (PEAR::isError($err = + $this->_compileSourceFiles($savechannel, $pkg))) { + return $err; + } + } + // }}} + + if (isset($backedup)) { + $this->_removeBackups($backedup); + } + + if (!$this->commitFileTransaction()) { + $this->rollbackFileTransaction(); + $this->configSet('default_channel', $savechannel); + return $this->raiseError("commit failed", PEAR_INSTALLER_FAILED); + } + // }}} + + $ret = false; + $installphase = 'install'; + $oldversion = false; + // {{{ Register that the package is installed ----------------------- + if (empty($options['upgrade'])) { + // if 'force' is used, replace the info in registry + $usechannel = $channel; + if ($channel == 'pecl.php.net') { + $test = $installregistry->packageExists($pkgname, $channel); + if (!$test) { + $test = $installregistry->packageExists($pkgname, 'pear.php.net'); + $usechannel = 'pear.php.net'; + } + } else { + $test = $installregistry->packageExists($pkgname, $channel); + } + + if (!empty($options['force']) && $test) { + $oldversion = $installregistry->packageInfo($pkgname, 'version', $usechannel); + $installregistry->deletePackage($pkgname, $usechannel); + } + $ret = $installregistry->addPackage2($pkg); + } else { + if ($dirtree) { + $this->startFileTransaction(); + // attempt to delete empty directories + uksort($dirtree, array($this, '_sortDirs')); + foreach($dirtree as $dir => $notused) { + $this->addFileOperation('rmdir', array($dir)); + } + $this->commitFileTransaction(); + } + + $usechannel = $channel; + if ($channel == 'pecl.php.net') { + $test = $installregistry->packageExists($pkgname, $channel); + if (!$test) { + $test = $installregistry->packageExists($pkgname, 'pear.php.net'); + $usechannel = 'pear.php.net'; + } + } else { + $test = $installregistry->packageExists($pkgname, $channel); + } + + // new: upgrade installs a package if it isn't installed + if (!$test) { + $ret = $installregistry->addPackage2($pkg); + } else { + if ($usechannel != $channel) { + $installregistry->deletePackage($pkgname, $usechannel); + $ret = $installregistry->addPackage2($pkg); + } else { + $ret = $installregistry->updatePackage2($pkg); + } + $installphase = 'upgrade'; + } + } + + if (!$ret) { + $this->configSet('default_channel', $savechannel); + return $this->raiseError("Adding package $channel/$pkgname to registry failed"); + } + // }}} + + $this->configSet('default_channel', $savechannel); + if (class_exists('PEAR_Task_Common')) { // this is auto-included if any tasks exist + if (PEAR_Task_Common::hasPostinstallTasks()) { + PEAR_Task_Common::runPostinstallTasks($installphase); + } + } + + return $pkg->toArray(true); + } + + // }}} + + // {{{ _compileSourceFiles() + /** + * @param string + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + */ + function _compileSourceFiles($savechannel, &$filelist) + { + require_once 'PEAR/Builder.php'; + $this->log(1, "$this->source_files source files, building"); + $bob = &new PEAR_Builder($this->ui); + $bob->debug = $this->debug; + $built = $bob->build($filelist, array(&$this, '_buildCallback')); + if (PEAR::isError($built)) { + $this->rollbackFileTransaction(); + $this->configSet('default_channel', $savechannel); + return $built; + } + + $this->log(1, "\nBuild process completed successfully"); + foreach ($built as $ext) { + $bn = basename($ext['file']); + list($_ext_name, $_ext_suff) = explode('.', $bn); + if ($_ext_suff == '.so' || $_ext_suff == '.dll') { + if (extension_loaded($_ext_name)) { + $this->raiseError("Extension '$_ext_name' already loaded. " . + 'Please unload it in your php.ini file ' . + 'prior to install or upgrade'); + } + $role = 'ext'; + } else { + $role = 'src'; + } + + $dest = $ext['dest']; + $packagingroot = ''; + if (isset($this->_options['packagingroot'])) { + $packagingroot = $this->_options['packagingroot']; + } + + $copyto = $this->_prependPath($dest, $packagingroot); + $extra = $copyto != $dest ? " as '$copyto'" : ''; + $this->log(1, "Installing '$dest'$extra"); + + $copydir = dirname($copyto); + // pretty much nothing happens if we are only registering the install + if (empty($this->_options['register-only'])) { + if (!file_exists($copydir) || !is_dir($copydir)) { + if (!$this->mkDirHier($copydir)) { + return $this->raiseError("failed to mkdir $copydir", + PEAR_INSTALLER_FAILED); + } + + $this->log(3, "+ mkdir $copydir"); + } + + if (!@copy($ext['file'], $copyto)) { + return $this->raiseError("failed to write $copyto ($php_errormsg)", PEAR_INSTALLER_FAILED); + } + + $this->log(3, "+ cp $ext[file] $copyto"); + $this->addFileOperation('rename', array($ext['file'], $copyto)); + if (!OS_WINDOWS) { + $mode = 0666 & ~(int)octdec($this->config->get('umask')); + $this->addFileOperation('chmod', array($mode, $copyto)); + if (!@chmod($copyto, $mode)) { + $this->log(0, "failed to change mode of $copyto ($php_errormsg)"); + } + } + } + + + $data = array( + 'role' => $role, + 'name' => $bn, + 'installed_as' => $dest, + 'php_api' => $ext['php_api'], + 'zend_mod_api' => $ext['zend_mod_api'], + 'zend_ext_api' => $ext['zend_ext_api'], + ); + + if ($filelist->getPackageXmlVersion() == '1.0') { + $filelist->installedFile($bn, $data); + } else { + $filelist->installedFile($bn, array('attribs' => $data)); + } + } + } + + // }}} + function &getUninstallPackages() + { + return $this->_downloadedPackages; + } + // {{{ uninstall() + + /** + * Uninstall a package + * + * This method removes all files installed by the application, and then + * removes any empty directories. + * @param string package name + * @param array Command-line options. Possibilities include: + * + * - installroot: base installation dir, if not the default + * - register-only : update registry but don't remove files + * - nodeps: do not process dependencies of other packages to ensure + * uninstallation does not break things + */ + function uninstall($package, $options = array()) + { + $installRoot = isset($options['installroot']) ? $options['installroot'] : ''; + $this->config->setInstallRoot($installRoot); + + $this->installroot = ''; + $this->_registry = &$this->config->getRegistry(); + if (is_object($package)) { + $channel = $package->getChannel(); + $pkg = $package; + $package = $pkg->getPackage(); + } else { + $pkg = false; + $info = $this->_registry->parsePackageName($package, + $this->config->get('default_channel')); + $channel = $info['channel']; + $package = $info['package']; + } + + $savechannel = $this->config->get('default_channel'); + $this->configSet('default_channel', $channel); + if (!is_object($pkg)) { + $pkg = $this->_registry->getPackage($package, $channel); + } + + if (!$pkg) { + $this->configSet('default_channel', $savechannel); + return $this->raiseError($this->_registry->parsedPackageNameToString( + array( + 'channel' => $channel, + 'package' => $package + ), true) . ' not installed'); + } + + if ($pkg->getInstalledBinary()) { + // this is just an alias for a binary package + return $this->_registry->deletePackage($package, $channel); + } + + $filelist = $pkg->getFilelist(); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + if (!class_exists('PEAR_Dependency2')) { + require_once 'PEAR/Dependency2.php'; + } + + $depchecker = &new PEAR_Dependency2($this->config, $options, + array('channel' => $channel, 'package' => $package), + PEAR_VALIDATE_UNINSTALLING); + $e = $depchecker->validatePackageUninstall($this); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($e)) { + if (!isset($options['ignore-errors'])) { + return $this->raiseError($e); + } + + if (!isset($options['soft'])) { + $this->log(0, 'WARNING: ' . $e->getMessage()); + } + } elseif (is_array($e)) { + if (!isset($options['soft'])) { + $this->log(0, $e[0]); + } + } + + $this->pkginfo = &$pkg; + // pretty much nothing happens if we are only registering the uninstall + if (empty($options['register-only'])) { + // {{{ Delete the files + $this->startFileTransaction(); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + if (PEAR::isError($err = $this->_deletePackageFiles($package, $channel))) { + PEAR::popErrorHandling(); + $this->rollbackFileTransaction(); + $this->configSet('default_channel', $savechannel); + if (!isset($options['ignore-errors'])) { + return $this->raiseError($err); + } + + if (!isset($options['soft'])) { + $this->log(0, 'WARNING: ' . $err->getMessage()); + } + } else { + PEAR::popErrorHandling(); + } + + if (!$this->commitFileTransaction()) { + $this->rollbackFileTransaction(); + if (!isset($options['ignore-errors'])) { + return $this->raiseError("uninstall failed"); + } + + if (!isset($options['soft'])) { + $this->log(0, 'WARNING: uninstall failed'); + } + } else { + $this->startFileTransaction(); + $dirtree = $pkg->getDirTree(); + if ($dirtree === false) { + $this->configSet('default_channel', $savechannel); + return $this->_registry->deletePackage($package, $channel); + } + + // attempt to delete empty directories + uksort($dirtree, array($this, '_sortDirs')); + foreach($dirtree as $dir => $notused) { + $this->addFileOperation('rmdir', array($dir)); + } + + if (!$this->commitFileTransaction()) { + $this->rollbackFileTransaction(); + if (!isset($options['ignore-errors'])) { + return $this->raiseError("uninstall failed"); + } + + if (!isset($options['soft'])) { + $this->log(0, 'WARNING: uninstall failed'); + } + } + } + // }}} + } + + $this->configSet('default_channel', $savechannel); + // Register that the package is no longer installed + return $this->_registry->deletePackage($package, $channel); + } + + /** + * Sort a list of arrays of array(downloaded packagefilename) by dependency. + * + * It also removes duplicate dependencies + * @param array an array of PEAR_PackageFile_v[1/2] objects + * @return array|PEAR_Error array of array(packagefilename, package.xml contents) + */ + function sortPackagesForUninstall(&$packages) + { + $this->_dependencyDB = &PEAR_DependencyDB::singleton($this->config); + if (PEAR::isError($this->_dependencyDB)) { + return $this->_dependencyDB; + } + usort($packages, array(&$this, '_sortUninstall')); + } + + function _sortUninstall($a, $b) + { + if (!$a->getDeps() && !$b->getDeps()) { + return 0; // neither package has dependencies, order is insignificant + } + if ($a->getDeps() && !$b->getDeps()) { + return -1; // $a must be installed after $b because $a has dependencies + } + if (!$a->getDeps() && $b->getDeps()) { + return 1; // $b must be installed after $a because $b has dependencies + } + // both packages have dependencies + if ($this->_dependencyDB->dependsOn($a, $b)) { + return -1; + } + if ($this->_dependencyDB->dependsOn($b, $a)) { + return 1; + } + return 0; + } + + // }}} + // {{{ _sortDirs() + function _sortDirs($a, $b) + { + if (strnatcmp($a, $b) == -1) return 1; + if (strnatcmp($a, $b) == 1) return -1; + return 0; + } + + // }}} + + // {{{ _buildCallback() + + function _buildCallback($what, $data) + { + if (($what == 'cmdoutput' && $this->debug > 1) || + ($what == 'output' && $this->debug > 0)) { + $this->ui->outputData(rtrim($data), 'build'); + } + } + + // }}} +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role.php new file mode 100644 index 0000000000000000000000000000000000000000..0c50fa79c0c83dbe853ed3bb872bd15a2e0ace18 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role.php @@ -0,0 +1,276 @@ +<?php +/** + * PEAR_Installer_Role + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Role.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * base class for installer roles + */ +require_once 'PEAR/Installer/Role/Common.php'; +require_once 'PEAR/XMLParser.php'; +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role +{ + /** + * Set up any additional configuration variables that file roles require + * + * Never call this directly, it is called by the PEAR_Config constructor + * @param PEAR_Config + * @access private + * @static + */ + function initializeConfig(&$config) + { + if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { + PEAR_Installer_Role::registerRoles(); + } + + foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $class => $info) { + if (!$info['config_vars']) { + continue; + } + + $config->_addConfigVars($class, $info['config_vars']); + } + } + + /** + * @param PEAR_PackageFile_v2 + * @param string role name + * @param PEAR_Config + * @return PEAR_Installer_Role_Common + * @static + */ + function &factory($pkg, $role, &$config) + { + if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { + PEAR_Installer_Role::registerRoles(); + } + + if (!in_array($role, PEAR_Installer_Role::getValidRoles($pkg->getPackageType()))) { + $a = false; + return $a; + } + + $a = 'PEAR_Installer_Role_' . ucfirst($role); + if (!class_exists($a)) { + require_once str_replace('_', '/', $a) . '.php'; + } + + $b = new $a($config); + return $b; + } + + /** + * Get a list of file roles that are valid for the particular release type. + * + * For instance, src files serve no purpose in regular php releases. + * @param string + * @param bool clear cache + * @return array + * @static + */ + function getValidRoles($release, $clear = false) + { + if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { + PEAR_Installer_Role::registerRoles(); + } + + static $ret = array(); + if ($clear) { + $ret = array(); + } + + if (isset($ret[$release])) { + return $ret[$release]; + } + + $ret[$release] = array(); + foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $role => $okreleases) { + if (in_array($release, $okreleases['releasetypes'])) { + $ret[$release][] = strtolower(str_replace('PEAR_Installer_Role_', '', $role)); + } + } + + return $ret[$release]; + } + + /** + * Get a list of roles that require their files to be installed + * + * Most roles must be installed, but src and package roles, for instance + * are pseudo-roles. src files are compiled into a new extension. Package + * roles are actually fully bundled releases of a package + * @param bool clear cache + * @return array + * @static + */ + function getInstallableRoles($clear = false) + { + if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { + PEAR_Installer_Role::registerRoles(); + } + + static $ret; + if ($clear) { + unset($ret); + } + + if (isset($ret)) { + return $ret; + } + + $ret = array(); + foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $role => $okreleases) { + if ($okreleases['installable']) { + $ret[] = strtolower(str_replace('PEAR_Installer_Role_', '', $role)); + } + } + + return $ret; + } + + /** + * Return an array of roles that are affected by the baseinstalldir attribute + * + * Most roles ignore this attribute, and instead install directly into: + * PackageName/filepath + * so a tests file tests/file.phpt is installed into PackageName/tests/filepath.php + * @param bool clear cache + * @return array + * @static + */ + function getBaseinstallRoles($clear = false) + { + if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { + PEAR_Installer_Role::registerRoles(); + } + + static $ret; + if ($clear) { + unset($ret); + } + + if (isset($ret)) { + return $ret; + } + + $ret = array(); + foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $role => $okreleases) { + if ($okreleases['honorsbaseinstall']) { + $ret[] = strtolower(str_replace('PEAR_Installer_Role_', '', $role)); + } + } + + return $ret; + } + + /** + * Return an array of file roles that should be analyzed for PHP content at package time, + * like the "php" role. + * @param bool clear cache + * @return array + * @static + */ + function getPhpRoles($clear = false) + { + if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { + PEAR_Installer_Role::registerRoles(); + } + + static $ret; + if ($clear) { + unset($ret); + } + + if (isset($ret)) { + return $ret; + } + + $ret = array(); + foreach ($GLOBALS['_PEAR_INSTALLER_ROLES'] as $role => $okreleases) { + if ($okreleases['phpfile']) { + $ret[] = strtolower(str_replace('PEAR_Installer_Role_', '', $role)); + } + } + + return $ret; + } + + /** + * Scan through the Command directory looking for classes + * and see what commands they implement. + * @param string which directory to look for classes, defaults to + * the Installer/Roles subdirectory of + * the directory from where this file (__FILE__) is + * included. + * + * @return bool TRUE on success, a PEAR error on failure + * @access public + * @static + */ + function registerRoles($dir = null) + { + $GLOBALS['_PEAR_INSTALLER_ROLES'] = array(); + $parser = new PEAR_XMLParser; + if ($dir === null) { + $dir = dirname(__FILE__) . '/Role'; + } + + if (!file_exists($dir) || !is_dir($dir)) { + return PEAR::raiseError("registerRoles: opendir($dir) failed: does not exist/is not directory"); + } + + $dp = @opendir($dir); + if (empty($dp)) { + return PEAR::raiseError("registerRoles: opendir($dir) failed: $php_errmsg"); + } + + while ($entry = readdir($dp)) { + if ($entry{0} == '.' || substr($entry, -4) != '.xml') { + continue; + } + + $class = "PEAR_Installer_Role_".substr($entry, 0, -4); + // List of roles + if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'][$class])) { + $file = "$dir/$entry"; + $parser->parse(file_get_contents($file)); + $data = $parser->getData(); + if (!is_array($data['releasetypes'])) { + $data['releasetypes'] = array($data['releasetypes']); + } + + $GLOBALS['_PEAR_INSTALLER_ROLES'][$class] = $data; + } + } + + closedir($dp); + ksort($GLOBALS['_PEAR_INSTALLER_ROLES']); + PEAR_Installer_Role::getBaseinstallRoles(true); + PEAR_Installer_Role::getInstallableRoles(true); + PEAR_Installer_Role::getPhpRoles(true); + PEAR_Installer_Role::getValidRoles('****', true); + return true; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Cfg.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Cfg.php new file mode 100644 index 0000000000000000000000000000000000000000..762012248d23a5a4cd47eacd47449313d467d4f1 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Cfg.php @@ -0,0 +1,106 @@ +<?php +/** + * PEAR_Installer_Role_Cfg + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 2007-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Cfg.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.7.0 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 2007-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.7.0 + */ +class PEAR_Installer_Role_Cfg extends PEAR_Installer_Role_Common +{ + /** + * @var PEAR_Installer + */ + var $installer; + + /** + * the md5 of the original file + * + * @var unknown_type + */ + var $md5 = null; + + /** + * Do any unusual setup here + * @param PEAR_Installer + * @param PEAR_PackageFile_v2 + * @param array file attributes + * @param string file name + */ + function setup(&$installer, $pkg, $atts, $file) + { + $this->installer = &$installer; + $reg = &$this->installer->config->getRegistry(); + $package = $reg->getPackage($pkg->getPackage(), $pkg->getChannel()); + if ($package) { + $filelist = $package->getFilelist(); + if (isset($filelist[$file]) && isset($filelist[$file]['md5sum'])) { + $this->md5 = $filelist[$file]['md5sum']; + } + } + } + + function processInstallation($pkg, $atts, $file, $tmp_path, $layer = null) + { + $test = parent::processInstallation($pkg, $atts, $file, $tmp_path, $layer); + if (@file_exists($test[2]) && @file_exists($test[3])) { + $md5 = md5_file($test[2]); + // configuration has already been installed, check for mods + if ($md5 !== $this->md5 && $md5 !== md5_file($test[3])) { + // configuration has been modified, so save our version as + // configfile-version + $old = $test[2]; + $test[2] .= '.new-' . $pkg->getVersion(); + // backup original and re-install it + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $tmpcfg = $this->config->get('temp_dir'); + $newloc = System::mkdir(array('-p', $tmpcfg)); + if (!$newloc) { + // try temp_dir + $newloc = System::mktemp(array('-d')); + if (!$newloc || PEAR::isError($newloc)) { + PEAR::popErrorHandling(); + return PEAR::raiseError('Could not save existing configuration file '. + $old . ', unable to install. Please set temp_dir ' . + 'configuration variable to a writeable location and try again'); + } + } else { + $newloc = $tmpcfg; + } + + $temp_file = $newloc . DIRECTORY_SEPARATOR . uniqid('savefile'); + if (!@copy($old, $temp_file)) { + PEAR::popErrorHandling(); + return PEAR::raiseError('Could not save existing configuration file '. + $old . ', unable to install. Please set temp_dir ' . + 'configuration variable to a writeable location and try again'); + } + + PEAR::popErrorHandling(); + $this->installer->log(0, "WARNING: configuration file $old is being installed as $test[2], you should manually merge in changes to the existing configuration file"); + $this->installer->addFileOperation('rename', array($temp_file, $old, false)); + $this->installer->addFileOperation('delete', array($temp_file)); + } + } + + return $test; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Cfg.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Cfg.xml new file mode 100644 index 0000000000000000000000000000000000000000..7a415dc466ab9a58607c4bed3dc2900f7414e76d --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Cfg.xml @@ -0,0 +1,15 @@ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>cfg_dir</locationconfig> + <honorsbaseinstall /> + <unusualbaseinstall>1</unusualbaseinstall> + <phpfile /> + <executable /> + <phpextension /> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Common.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..23e7348d70cf2332689f8968f66bfdb13a8531e4 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Common.php @@ -0,0 +1,174 @@ +<?php +/** + * Base class for all installation roles. + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2006 The PHP Group + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * Base class for all installation roles. + * + * This class allows extensibility of file roles. Packages with complex + * customization can now provide custom file roles along with the possibility of + * adding configuration values to match. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2006 The PHP Group + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role_Common +{ + /** + * @var PEAR_Config + * @access protected + */ + var $config; + + /** + * @param PEAR_Config + */ + function PEAR_Installer_Role_Common(&$config) + { + $this->config = $config; + } + + /** + * Retrieve configuration information about a file role from its XML info + * + * @param string $role Role Classname, as in "PEAR_Installer_Role_Data" + * @return array + */ + function getInfo($role) + { + if (empty($GLOBALS['_PEAR_INSTALLER_ROLES'][$role])) { + return PEAR::raiseError('Unknown Role class: "' . $role . '"'); + } + return $GLOBALS['_PEAR_INSTALLER_ROLES'][$role]; + } + + /** + * This is called for each file to set up the directories and files + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param array attributes from the <file> tag + * @param string file name + * @return array an array consisting of: + * + * 1 the original, pre-baseinstalldir installation directory + * 2 the final installation directory + * 3 the full path to the final location of the file + * 4 the location of the pre-installation file + */ + function processInstallation($pkg, $atts, $file, $tmp_path, $layer = null) + { + $roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' . + ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this))))); + if (PEAR::isError($roleInfo)) { + return $roleInfo; + } + if (!$roleInfo['locationconfig']) { + return false; + } + if ($roleInfo['honorsbaseinstall']) { + $dest_dir = $save_destdir = $this->config->get($roleInfo['locationconfig'], $layer, + $pkg->getChannel()); + if (!empty($atts['baseinstalldir'])) { + $dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir']; + } + } elseif ($roleInfo['unusualbaseinstall']) { + $dest_dir = $save_destdir = $this->config->get($roleInfo['locationconfig'], + $layer, $pkg->getChannel()) . DIRECTORY_SEPARATOR . $pkg->getPackage(); + if (!empty($atts['baseinstalldir'])) { + $dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir']; + } + } else { + $dest_dir = $save_destdir = $this->config->get($roleInfo['locationconfig'], + $layer, $pkg->getChannel()) . DIRECTORY_SEPARATOR . $pkg->getPackage(); + } + if (dirname($file) != '.' && empty($atts['install-as'])) { + $dest_dir .= DIRECTORY_SEPARATOR . dirname($file); + } + if (empty($atts['install-as'])) { + $dest_file = $dest_dir . DIRECTORY_SEPARATOR . basename($file); + } else { + $dest_file = $dest_dir . DIRECTORY_SEPARATOR . $atts['install-as']; + } + $orig_file = $tmp_path . DIRECTORY_SEPARATOR . $file; + + // Clean up the DIRECTORY_SEPARATOR mess + $ds2 = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; + + list($dest_dir, $dest_file, $orig_file) = preg_replace(array('!\\\\+!', '!/!', "!$ds2+!"), + array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, + DIRECTORY_SEPARATOR), + array($dest_dir, $dest_file, $orig_file)); + return array($save_destdir, $dest_dir, $dest_file, $orig_file); + } + + /** + * Get the name of the configuration variable that specifies the location of this file + * @return string|false + */ + function getLocationConfig() + { + $roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' . + ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this))))); + if (PEAR::isError($roleInfo)) { + return $roleInfo; + } + return $roleInfo['locationconfig']; + } + + /** + * Do any unusual setup here + * @param PEAR_Installer + * @param PEAR_PackageFile_v2 + * @param array file attributes + * @param string file name + */ + function setup(&$installer, $pkg, $atts, $file) + { + } + + function isExecutable() + { + $roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' . + ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this))))); + if (PEAR::isError($roleInfo)) { + return $roleInfo; + } + return $roleInfo['executable']; + } + + function isInstallable() + { + $roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' . + ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this))))); + if (PEAR::isError($roleInfo)) { + return $roleInfo; + } + return $roleInfo['installable']; + } + + function isExtension() + { + $roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' . + ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this))))); + if (PEAR::isError($roleInfo)) { + return $roleInfo; + } + return $roleInfo['phpextension']; + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Data.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Data.php new file mode 100644 index 0000000000000000000000000000000000000000..e3b7fa2fff2da698a1924a627356c1c8f4fcc9ad --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Data.php @@ -0,0 +1,28 @@ +<?php +/** + * PEAR_Installer_Role_Data + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Data.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Data.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Data.xml new file mode 100644 index 0000000000000000000000000000000000000000..eae63720d3ba4022846e7ed36880cd71af734139 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Data.xml @@ -0,0 +1,15 @@ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>data_dir</locationconfig> + <honorsbaseinstall /> + <unusualbaseinstall /> + <phpfile /> + <executable /> + <phpextension /> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Doc.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Doc.php new file mode 100644 index 0000000000000000000000000000000000000000..d592ffff01481f4af2eb856ad1f734d53701b0f3 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Doc.php @@ -0,0 +1,28 @@ +<?php +/** + * PEAR_Installer_Role_Doc + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Doc.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Doc.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Doc.xml new file mode 100644 index 0000000000000000000000000000000000000000..173afba011a0f45e88da18659bd47c3cb47471a1 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Doc.xml @@ -0,0 +1,15 @@ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>doc_dir</locationconfig> + <honorsbaseinstall /> + <unusualbaseinstall /> + <phpfile /> + <executable /> + <phpextension /> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Ext.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Ext.php new file mode 100644 index 0000000000000000000000000000000000000000..eceb0279ff957267539233858fe1d1fcbb0c4c6a --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Ext.php @@ -0,0 +1,28 @@ +<?php +/** + * PEAR_Installer_Role_Ext + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Ext.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Ext.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Ext.xml new file mode 100644 index 0000000000000000000000000000000000000000..e2940fe1f22cbe7dc1c7a1b02e97e0c6ab9ca7ef --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Ext.xml @@ -0,0 +1,12 @@ +<role version="1.0"> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>ext_dir</locationconfig> + <honorsbaseinstall>1</honorsbaseinstall> + <unusualbaseinstall /> + <phpfile /> + <executable /> + <phpextension>1</phpextension> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Php.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Php.php new file mode 100644 index 0000000000000000000000000000000000000000..e2abf44eed1ea222432a47e5bf14d425f3e61e5b --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Php.php @@ -0,0 +1,28 @@ +<?php +/** + * PEAR_Installer_Role_Php + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Php.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Php.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Php.xml new file mode 100644 index 0000000000000000000000000000000000000000..6b9a0e67af9ac8d90543de9575988a7da3427da8 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Php.xml @@ -0,0 +1,15 @@ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>php_dir</locationconfig> + <honorsbaseinstall>1</honorsbaseinstall> + <unusualbaseinstall /> + <phpfile>1</phpfile> + <executable /> + <phpextension /> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Script.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Script.php new file mode 100644 index 0000000000000000000000000000000000000000..b31469e4b10721f8e02619ca194a2e03c80a5506 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Script.php @@ -0,0 +1,28 @@ +<?php +/** + * PEAR_Installer_Role_Script + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Script.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role_Script extends PEAR_Installer_Role_Common {} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Script.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Script.xml new file mode 100644 index 0000000000000000000000000000000000000000..e732cf2af6f8e3731d0f91068053787eb23ad4eb --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Script.xml @@ -0,0 +1,15 @@ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>bin_dir</locationconfig> + <honorsbaseinstall>1</honorsbaseinstall> + <unusualbaseinstall /> + <phpfile /> + <executable>1</executable> + <phpextension /> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Src.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Src.php new file mode 100644 index 0000000000000000000000000000000000000000..503705313d821bff26e0457c805e40c612e3eed0 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Src.php @@ -0,0 +1,34 @@ +<?php +/** + * PEAR_Installer_Role_Src + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Src.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role_Src extends PEAR_Installer_Role_Common +{ + function setup(&$installer, $pkg, $atts, $file) + { + $installer->source_files++; + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Src.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Src.xml new file mode 100644 index 0000000000000000000000000000000000000000..103483402f04d40d2630ffa2e46d866c039d806a --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Src.xml @@ -0,0 +1,12 @@ +<role version="1.0"> + <releasetypes>extsrc</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <installable>1</installable> + <locationconfig>temp_dir</locationconfig> + <honorsbaseinstall /> + <unusualbaseinstall /> + <phpfile /> + <executable /> + <phpextension /> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Test.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Test.php new file mode 100644 index 0000000000000000000000000000000000000000..14c0e60919239fa8d2716fd114d7e31dc4b140cf --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Test.php @@ -0,0 +1,28 @@ +<?php +/** + * PEAR_Installer_Role_Test + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Test.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Installer_Role_Test extends PEAR_Installer_Role_Common {} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Test.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Test.xml new file mode 100644 index 0000000000000000000000000000000000000000..51d5b894e07b695f5766bf10a7c70a8630eefa61 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Test.xml @@ -0,0 +1,15 @@ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>test_dir</locationconfig> + <honorsbaseinstall /> + <unusualbaseinstall /> + <phpfile /> + <executable /> + <phpextension /> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Www.php b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Www.php new file mode 100644 index 0000000000000000000000000000000000000000..11adeff8295c4a0b7c843e0b163f7f66159d1d2f --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Www.php @@ -0,0 +1,28 @@ +<?php +/** + * PEAR_Installer_Role_Www + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 2007-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Www.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.7.0 + */ + +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 2007-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.7.0 + */ +class PEAR_Installer_Role_Www extends PEAR_Installer_Role_Common {} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Www.xml b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Www.xml new file mode 100644 index 0000000000000000000000000000000000000000..7598be38892571d3eca2d32d24b5413377ad6099 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Installer/Role/Www.xml @@ -0,0 +1,15 @@ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>www_dir</locationconfig> + <honorsbaseinstall>1</honorsbaseinstall> + <unusualbaseinstall /> + <phpfile /> + <executable /> + <phpextension /> + <config_vars /> +</role> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile.php new file mode 100644 index 0000000000000000000000000000000000000000..7ae3362844158c8650cb54d12f02b13d94d7db93 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile.php @@ -0,0 +1,492 @@ +<?php +/** + * PEAR_PackageFile, package.xml parsing utility class + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: PackageFile.php 313024 2011-07-06 19:51:24Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * needed for PEAR_VALIDATE_* constants + */ +require_once 'PEAR/Validate.php'; +/** + * Error code if the package.xml <package> tag does not contain a valid version + */ +define('PEAR_PACKAGEFILE_ERROR_NO_PACKAGEVERSION', 1); +/** + * Error code if the package.xml <package> tag version is not supported (version 1.0 and 1.1 are the only supported versions, + * currently + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_PACKAGEVERSION', 2); +/** + * Abstraction for the package.xml package description file + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_PackageFile +{ + /** + * @var PEAR_Config + */ + var $_config; + var $_debug; + + var $_logger = false; + /** + * @var boolean + */ + var $_rawReturn = false; + + /** + * helper for extracting Archive_Tar errors + * @var array + * @access private + */ + var $_extractErrors = array(); + + /** + * + * @param PEAR_Config $config + * @param ? $debug + * @param string @tmpdir Optional temporary directory for uncompressing + * files + */ + function PEAR_PackageFile(&$config, $debug = false) + { + $this->_config = $config; + $this->_debug = $debug; + } + + /** + * Turn off validation - return a parsed package.xml without checking it + * + * This is used by the package-validate command + */ + function rawReturn() + { + $this->_rawReturn = true; + } + + function setLogger(&$l) + { + $this->_logger = &$l; + } + + /** + * Create a PEAR_PackageFile_Parser_v* of a given version. + * @param int $version + * @return PEAR_PackageFile_Parser_v1|PEAR_PackageFile_Parser_v1 + */ + function &parserFactory($version) + { + if (!in_array($version{0}, array('1', '2'))) { + $a = false; + return $a; + } + + include_once 'PEAR/PackageFile/Parser/v' . $version{0} . '.php'; + $version = $version{0}; + $class = "PEAR_PackageFile_Parser_v$version"; + $a = new $class; + return $a; + } + + /** + * For simpler unit-testing + * @return string + */ + function getClassPrefix() + { + return 'PEAR_PackageFile_v'; + } + + /** + * Create a PEAR_PackageFile_v* of a given version. + * @param int $version + * @return PEAR_PackageFile_v1|PEAR_PackageFile_v1 + */ + function &factory($version) + { + if (!in_array($version{0}, array('1', '2'))) { + $a = false; + return $a; + } + + include_once 'PEAR/PackageFile/v' . $version{0} . '.php'; + $version = $version{0}; + $class = $this->getClassPrefix() . $version; + $a = new $class; + return $a; + } + + /** + * Create a PEAR_PackageFile_v* from its toArray() method + * + * WARNING: no validation is performed, the array is assumed to be valid, + * always parse from xml if you want validation. + * @param array $arr + * @return PEAR_PackageFileManager_v1|PEAR_PackageFileManager_v2 + * @uses factory() to construct the returned object. + */ + function &fromArray($arr) + { + if (isset($arr['xsdversion'])) { + $obj = &$this->factory($arr['xsdversion']); + if ($this->_logger) { + $obj->setLogger($this->_logger); + } + + $obj->setConfig($this->_config); + $obj->fromArray($arr); + return $obj; + } + + if (isset($arr['package']['attribs']['version'])) { + $obj = &$this->factory($arr['package']['attribs']['version']); + } else { + $obj = &$this->factory('1.0'); + } + + if ($this->_logger) { + $obj->setLogger($this->_logger); + } + + $obj->setConfig($this->_config); + $obj->fromArray($arr); + return $obj; + } + + /** + * Create a PEAR_PackageFile_v* from an XML string. + * @access public + * @param string $data contents of package.xml file + * @param int $state package state (one of PEAR_VALIDATE_* constants) + * @param string $file full path to the package.xml file (and the files + * it references) + * @param string $archive optional name of the archive that the XML was + * extracted from, if any + * @return PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @uses parserFactory() to construct a parser to load the package. + */ + function &fromXmlString($data, $state, $file, $archive = false) + { + if (preg_match('/<package[^>]+version=[\'"]([0-9]+\.[0-9]+)[\'"]/', $data, $packageversion)) { + if (!in_array($packageversion[1], array('1.0', '2.0', '2.1'))) { + return PEAR::raiseError('package.xml version "' . $packageversion[1] . + '" is not supported, only 1.0, 2.0, and 2.1 are supported.'); + } + + $object = &$this->parserFactory($packageversion[1]); + if ($this->_logger) { + $object->setLogger($this->_logger); + } + + $object->setConfig($this->_config); + $pf = $object->parse($data, $file, $archive); + if (PEAR::isError($pf)) { + return $pf; + } + + if ($this->_rawReturn) { + return $pf; + } + + if (!$pf->validate($state)) {; + if ($this->_config->get('verbose') > 0 + && $this->_logger && $pf->getValidationWarnings(false) + ) { + foreach ($pf->getValidationWarnings(false) as $warning) { + $this->_logger->log(0, 'ERROR: ' . $warning['message']); + } + } + + $a = PEAR::raiseError('Parsing of package.xml from file "' . $file . '" failed', + 2, null, null, $pf->getValidationWarnings()); + return $a; + } + + if ($this->_logger && $pf->getValidationWarnings(false)) { + foreach ($pf->getValidationWarnings() as $warning) { + $this->_logger->log(0, 'WARNING: ' . $warning['message']); + } + } + + if (method_exists($pf, 'flattenFilelist')) { + $pf->flattenFilelist(); // for v2 + } + + return $pf; + } elseif (preg_match('/<package[^>]+version=[\'"]([^"\']+)[\'"]/', $data, $packageversion)) { + $a = PEAR::raiseError('package.xml file "' . $file . + '" has unsupported package.xml <package> version "' . $packageversion[1] . '"'); + return $a; + } else { + if (!class_exists('PEAR_ErrorStack')) { + require_once 'PEAR/ErrorStack.php'; + } + + PEAR_ErrorStack::staticPush('PEAR_PackageFile', + PEAR_PACKAGEFILE_ERROR_NO_PACKAGEVERSION, + 'warning', array('xml' => $data), 'package.xml "' . $file . + '" has no package.xml <package> version'); + $object = &$this->parserFactory('1.0'); + $object->setConfig($this->_config); + $pf = $object->parse($data, $file, $archive); + if (PEAR::isError($pf)) { + return $pf; + } + + if ($this->_rawReturn) { + return $pf; + } + + if (!$pf->validate($state)) { + $a = PEAR::raiseError('Parsing of package.xml from file "' . $file . '" failed', + 2, null, null, $pf->getValidationWarnings()); + return $a; + } + + if ($this->_logger && $pf->getValidationWarnings(false)) { + foreach ($pf->getValidationWarnings() as $warning) { + $this->_logger->log(0, 'WARNING: ' . $warning['message']); + } + } + + if (method_exists($pf, 'flattenFilelist')) { + $pf->flattenFilelist(); // for v2 + } + + return $pf; + } + } + + /** + * Register a temporary file or directory. When the destructor is + * executed, all registered temporary files and directories are + * removed. + * + * @param string $file name of file or directory + * @return void + */ + function addTempFile($file) + { + $GLOBALS['_PEAR_Common_tempfiles'][] = $file; + } + + /** + * Create a PEAR_PackageFile_v* from a compresed Tar or Tgz file. + * @access public + * @param string contents of package.xml file + * @param int package state (one of PEAR_VALIDATE_* constants) + * @return PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @using Archive_Tar to extract the files + * @using fromPackageFile() to load the package after the package.xml + * file is extracted. + */ + function &fromTgzFile($file, $state) + { + if (!class_exists('Archive_Tar')) { + require_once 'Archive/Tar.php'; + } + + $tar = new Archive_Tar($file); + if ($this->_debug <= 1) { + $tar->pushErrorHandling(PEAR_ERROR_RETURN); + } + + $content = $tar->listContent(); + if ($this->_debug <= 1) { + $tar->popErrorHandling(); + } + + if (!is_array($content)) { + if (is_string($file) && strlen($file < 255) && + (!file_exists($file) || !@is_file($file))) { + $ret = PEAR::raiseError("could not open file \"$file\""); + return $ret; + } + + $file = realpath($file); + $ret = PEAR::raiseError("Could not get contents of package \"$file\"". + '. Invalid tgz file.'); + return $ret; + } + + if (!count($content) && !@is_file($file)) { + $ret = PEAR::raiseError("could not open file \"$file\""); + return $ret; + } + + $xml = null; + $origfile = $file; + foreach ($content as $file) { + $name = $file['filename']; + if ($name == 'package2.xml') { // allow a .tgz to distribute both versions + $xml = $name; + break; + } + + if ($name == 'package.xml') { + $xml = $name; + break; + } elseif (preg_match('/package.xml$/', $name, $match)) { + $xml = $name; + break; + } + } + + $tmpdir = System::mktemp('-t "' . $this->_config->get('temp_dir') . '" -d pear'); + if ($tmpdir === false) { + $ret = PEAR::raiseError("there was a problem with getting the configured temp directory"); + return $ret; + } + + PEAR_PackageFile::addTempFile($tmpdir); + + $this->_extractErrors(); + PEAR::staticPushErrorHandling(PEAR_ERROR_CALLBACK, array($this, '_extractErrors')); + + if (!$xml || !$tar->extractList(array($xml), $tmpdir)) { + $extra = implode("\n", $this->_extractErrors()); + if ($extra) { + $extra = ' ' . $extra; + } + + PEAR::staticPopErrorHandling(); + $ret = PEAR::raiseError('could not extract the package.xml file from "' . + $origfile . '"' . $extra); + return $ret; + } + + PEAR::staticPopErrorHandling(); + $ret = &PEAR_PackageFile::fromPackageFile("$tmpdir/$xml", $state, $origfile); + return $ret; + } + + /** + * helper callback for extracting Archive_Tar errors + * + * @param PEAR_Error|null $err + * @return array + * @access private + */ + function _extractErrors($err = null) + { + static $errors = array(); + if ($err === null) { + $e = $errors; + $errors = array(); + return $e; + } + $errors[] = $err->getMessage(); + } + + /** + * Create a PEAR_PackageFile_v* from a package.xml file. + * + * @access public + * @param string $descfile name of package xml file + * @param int $state package state (one of PEAR_VALIDATE_* constants) + * @param string|false $archive name of the archive this package.xml came + * from, if any + * @return PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @uses PEAR_PackageFile::fromXmlString to create the oject after the + * XML is loaded from the package.xml file. + */ + function &fromPackageFile($descfile, $state, $archive = false) + { + $fp = false; + if (is_string($descfile) && strlen($descfile) < 255 && + ( + !file_exists($descfile) || !is_file($descfile) || !is_readable($descfile) + || (!$fp = @fopen($descfile, 'r')) + ) + ) { + $a = PEAR::raiseError("Unable to open $descfile"); + return $a; + } + + // read the whole thing so we only get one cdata callback + // for each block of cdata + fclose($fp); + $data = file_get_contents($descfile); + $ret = &PEAR_PackageFile::fromXmlString($data, $state, $descfile, $archive); + return $ret; + } + + /** + * Create a PEAR_PackageFile_v* from a .tgz archive or package.xml file. + * + * This method is able to extract information about a package from a .tgz + * archive or from a XML package definition file. + * + * @access public + * @param string $info file name + * @param int $state package state (one of PEAR_VALIDATE_* constants) + * @return PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @uses fromPackageFile() if the file appears to be XML + * @uses fromTgzFile() to load all non-XML files + */ + function &fromAnyFile($info, $state) + { + if (is_dir($info)) { + $dir_name = realpath($info); + if (file_exists($dir_name . '/package.xml')) { + $info = PEAR_PackageFile::fromPackageFile($dir_name . '/package.xml', $state); + } elseif (file_exists($dir_name . '/package2.xml')) { + $info = PEAR_PackageFile::fromPackageFile($dir_name . '/package2.xml', $state); + } else { + $info = PEAR::raiseError("No package definition found in '$info' directory"); + } + + return $info; + } + + $fp = false; + if (is_string($info) && strlen($info) < 255 && + (file_exists($info) || ($fp = @fopen($info, 'r'))) + ) { + + if ($fp) { + fclose($fp); + } + + $tmp = substr($info, -4); + if ($tmp == '.xml') { + $info = &PEAR_PackageFile::fromPackageFile($info, $state); + } elseif ($tmp == '.tar' || $tmp == '.tgz') { + $info = &PEAR_PackageFile::fromTgzFile($info, $state); + } else { + $fp = fopen($info, 'r'); + $test = fread($fp, 5); + fclose($fp); + if ($test == '<?xml') { + $info = &PEAR_PackageFile::fromPackageFile($info, $state); + } else { + $info = &PEAR_PackageFile::fromTgzFile($info, $state); + } + } + + return $info; + } + + $info = PEAR::raiseError("Cannot open '$info' for parsing"); + return $info; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Generator/v1.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Generator/v1.php new file mode 100644 index 0000000000000000000000000000000000000000..2f42f178d595c8b57f7d7ac9838e2008af8c3109 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Generator/v1.php @@ -0,0 +1,1284 @@ +<?php +/** + * package.xml generation class, package.xml version 1.0 + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: v1.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * needed for PEAR_VALIDATE_* constants + */ +require_once 'PEAR/Validate.php'; +require_once 'System.php'; +require_once 'PEAR/PackageFile/v2.php'; +/** + * This class converts a PEAR_PackageFile_v1 object into any output format. + * + * Supported output formats include array, XML string, and a PEAR_PackageFile_v2 + * object, for converting package.xml 1.0 into package.xml 2.0 with no sweat. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_PackageFile_Generator_v1 +{ + /** + * @var PEAR_PackageFile_v1 + */ + var $_packagefile; + function PEAR_PackageFile_Generator_v1(&$packagefile) + { + $this->_packagefile = &$packagefile; + } + + function getPackagerVersion() + { + return '1.9.4'; + } + + /** + * @param PEAR_Packager + * @param bool if true, a .tgz is written, otherwise a .tar is written + * @param string|null directory in which to save the .tgz + * @return string|PEAR_Error location of package or error object + */ + function toTgz(&$packager, $compress = true, $where = null) + { + require_once 'Archive/Tar.php'; + if ($where === null) { + if (!($where = System::mktemp(array('-d')))) { + return PEAR::raiseError('PEAR_Packagefile_v1::toTgz: mktemp failed'); + } + } elseif (!@System::mkDir(array('-p', $where))) { + return PEAR::raiseError('PEAR_Packagefile_v1::toTgz: "' . $where . '" could' . + ' not be created'); + } + if (file_exists($where . DIRECTORY_SEPARATOR . 'package.xml') && + !is_file($where . DIRECTORY_SEPARATOR . 'package.xml')) { + return PEAR::raiseError('PEAR_Packagefile_v1::toTgz: unable to save package.xml as' . + ' "' . $where . DIRECTORY_SEPARATOR . 'package.xml"'); + } + if (!$this->_packagefile->validate(PEAR_VALIDATE_PACKAGING)) { + return PEAR::raiseError('PEAR_Packagefile_v1::toTgz: invalid package file'); + } + $pkginfo = $this->_packagefile->getArray(); + $ext = $compress ? '.tgz' : '.tar'; + $pkgver = $pkginfo['package'] . '-' . $pkginfo['version']; + $dest_package = getcwd() . DIRECTORY_SEPARATOR . $pkgver . $ext; + if (file_exists(getcwd() . DIRECTORY_SEPARATOR . $pkgver . $ext) && + !is_file(getcwd() . DIRECTORY_SEPARATOR . $pkgver . $ext)) { + return PEAR::raiseError('PEAR_Packagefile_v1::toTgz: cannot create tgz file "' . + getcwd() . DIRECTORY_SEPARATOR . $pkgver . $ext . '"'); + } + if ($pkgfile = $this->_packagefile->getPackageFile()) { + $pkgdir = dirname(realpath($pkgfile)); + $pkgfile = basename($pkgfile); + } else { + return PEAR::raiseError('PEAR_Packagefile_v1::toTgz: package file object must ' . + 'be created from a real file'); + } + // {{{ Create the package file list + $filelist = array(); + $i = 0; + + foreach ($this->_packagefile->getFilelist() as $fname => $atts) { + $file = $pkgdir . DIRECTORY_SEPARATOR . $fname; + if (!file_exists($file)) { + return PEAR::raiseError("File does not exist: $fname"); + } else { + $filelist[$i++] = $file; + if (!isset($atts['md5sum'])) { + $this->_packagefile->setFileAttribute($fname, 'md5sum', md5_file($file)); + } + $packager->log(2, "Adding file $fname"); + } + } + // }}} + $packagexml = $this->toPackageFile($where, PEAR_VALIDATE_PACKAGING, 'package.xml', true); + if ($packagexml) { + $tar =& new Archive_Tar($dest_package, $compress); + $tar->setErrorHandling(PEAR_ERROR_RETURN); // XXX Don't print errors + // ----- Creates with the package.xml file + $ok = $tar->createModify(array($packagexml), '', $where); + if (PEAR::isError($ok)) { + return $ok; + } elseif (!$ok) { + return PEAR::raiseError('PEAR_Packagefile_v1::toTgz: tarball creation failed'); + } + // ----- Add the content of the package + if (!$tar->addModify($filelist, $pkgver, $pkgdir)) { + return PEAR::raiseError('PEAR_Packagefile_v1::toTgz: tarball creation failed'); + } + return $dest_package; + } + } + + /** + * @param string|null directory to place the package.xml in, or null for a temporary dir + * @param int one of the PEAR_VALIDATE_* constants + * @param string name of the generated file + * @param bool if true, then no analysis will be performed on role="php" files + * @return string|PEAR_Error path to the created file on success + */ + function toPackageFile($where = null, $state = PEAR_VALIDATE_NORMAL, $name = 'package.xml', + $nofilechecking = false) + { + if (!$this->_packagefile->validate($state, $nofilechecking)) { + return PEAR::raiseError('PEAR_Packagefile_v1::toPackageFile: invalid package.xml', + null, null, null, $this->_packagefile->getValidationWarnings()); + } + if ($where === null) { + if (!($where = System::mktemp(array('-d')))) { + return PEAR::raiseError('PEAR_Packagefile_v1::toPackageFile: mktemp failed'); + } + } elseif (!@System::mkDir(array('-p', $where))) { + return PEAR::raiseError('PEAR_Packagefile_v1::toPackageFile: "' . $where . '" could' . + ' not be created'); + } + $newpkgfile = $where . DIRECTORY_SEPARATOR . $name; + $np = @fopen($newpkgfile, 'wb'); + if (!$np) { + return PEAR::raiseError('PEAR_Packagefile_v1::toPackageFile: unable to save ' . + "$name as $newpkgfile"); + } + fwrite($np, $this->toXml($state, true)); + fclose($np); + return $newpkgfile; + } + + /** + * fix both XML encoding to be UTF8, and replace standard XML entities < > " & ' + * + * @param string $string + * @return string + * @access private + */ + function _fixXmlEncoding($string) + { + if (version_compare(phpversion(), '5.0.0', 'lt')) { + $string = utf8_encode($string); + } + return strtr($string, array( + '&' => '&', + '>' => '>', + '<' => '<', + '"' => '"', + '\'' => ''' )); + } + + /** + * Return an XML document based on the package info (as returned + * by the PEAR_Common::infoFrom* methods). + * + * @return string XML data + */ + function toXml($state = PEAR_VALIDATE_NORMAL, $nofilevalidation = false) + { + $this->_packagefile->setDate(date('Y-m-d')); + if (!$this->_packagefile->validate($state, $nofilevalidation)) { + return false; + } + $pkginfo = $this->_packagefile->getArray(); + static $maint_map = array( + "handle" => "user", + "name" => "name", + "email" => "email", + "role" => "role", + ); + $ret = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; + $ret .= "<!DOCTYPE package SYSTEM \"http://pear.php.net/dtd/package-1.0\">\n"; + $ret .= "<package version=\"1.0\" packagerversion=\"1.9.4\">\n" . +" <name>$pkginfo[package]</name>"; + if (isset($pkginfo['extends'])) { + $ret .= "\n<extends>$pkginfo[extends]</extends>"; + } + $ret .= + "\n <summary>".$this->_fixXmlEncoding($pkginfo['summary'])."</summary>\n" . +" <description>".trim($this->_fixXmlEncoding($pkginfo['description']))."\n </description>\n" . +" <maintainers>\n"; + foreach ($pkginfo['maintainers'] as $maint) { + $ret .= " <maintainer>\n"; + foreach ($maint_map as $idx => $elm) { + $ret .= " <$elm>"; + $ret .= $this->_fixXmlEncoding($maint[$idx]); + $ret .= "</$elm>\n"; + } + $ret .= " </maintainer>\n"; + } + $ret .= " </maintainers>\n"; + $ret .= $this->_makeReleaseXml($pkginfo, false, $state); + if (isset($pkginfo['changelog']) && count($pkginfo['changelog']) > 0) { + $ret .= " <changelog>\n"; + foreach ($pkginfo['changelog'] as $oldrelease) { + $ret .= $this->_makeReleaseXml($oldrelease, true); + } + $ret .= " </changelog>\n"; + } + $ret .= "</package>\n"; + return $ret; + } + + // }}} + // {{{ _makeReleaseXml() + + /** + * Generate part of an XML description with release information. + * + * @param array $pkginfo array with release information + * @param bool $changelog whether the result will be in a changelog element + * + * @return string XML data + * + * @access private + */ + function _makeReleaseXml($pkginfo, $changelog = false, $state = PEAR_VALIDATE_NORMAL) + { + // XXX QUOTE ENTITIES IN PCDATA, OR EMBED IN CDATA BLOCKS!! + $indent = $changelog ? " " : ""; + $ret = "$indent <release>\n"; + if (!empty($pkginfo['version'])) { + $ret .= "$indent <version>$pkginfo[version]</version>\n"; + } + if (!empty($pkginfo['release_date'])) { + $ret .= "$indent <date>$pkginfo[release_date]</date>\n"; + } + if (!empty($pkginfo['release_license'])) { + $ret .= "$indent <license>$pkginfo[release_license]</license>\n"; + } + if (!empty($pkginfo['release_state'])) { + $ret .= "$indent <state>$pkginfo[release_state]</state>\n"; + } + if (!empty($pkginfo['release_notes'])) { + $ret .= "$indent <notes>".trim($this->_fixXmlEncoding($pkginfo['release_notes'])) + ."\n$indent </notes>\n"; + } + if (!empty($pkginfo['release_warnings'])) { + $ret .= "$indent <warnings>".$this->_fixXmlEncoding($pkginfo['release_warnings'])."</warnings>\n"; + } + if (isset($pkginfo['release_deps']) && sizeof($pkginfo['release_deps']) > 0) { + $ret .= "$indent <deps>\n"; + foreach ($pkginfo['release_deps'] as $dep) { + $ret .= "$indent <dep type=\"$dep[type]\" rel=\"$dep[rel]\""; + if (isset($dep['version'])) { + $ret .= " version=\"$dep[version]\""; + } + if (isset($dep['optional'])) { + $ret .= " optional=\"$dep[optional]\""; + } + if (isset($dep['name'])) { + $ret .= ">$dep[name]</dep>\n"; + } else { + $ret .= "/>\n"; + } + } + $ret .= "$indent </deps>\n"; + } + if (isset($pkginfo['configure_options'])) { + $ret .= "$indent <configureoptions>\n"; + foreach ($pkginfo['configure_options'] as $c) { + $ret .= "$indent <configureoption name=\"". + $this->_fixXmlEncoding($c['name']) . "\""; + if (isset($c['default'])) { + $ret .= " default=\"" . $this->_fixXmlEncoding($c['default']) . "\""; + } + $ret .= " prompt=\"" . $this->_fixXmlEncoding($c['prompt']) . "\""; + $ret .= "/>\n"; + } + $ret .= "$indent </configureoptions>\n"; + } + if (isset($pkginfo['provides'])) { + foreach ($pkginfo['provides'] as $key => $what) { + $ret .= "$indent <provides type=\"$what[type]\" "; + $ret .= "name=\"$what[name]\" "; + if (isset($what['extends'])) { + $ret .= "extends=\"$what[extends]\" "; + } + $ret .= "/>\n"; + } + } + if (isset($pkginfo['filelist'])) { + $ret .= "$indent <filelist>\n"; + if ($state ^ PEAR_VALIDATE_PACKAGING) { + $ret .= $this->recursiveXmlFilelist($pkginfo['filelist']); + } else { + foreach ($pkginfo['filelist'] as $file => $fa) { + if (!isset($fa['role'])) { + $fa['role'] = ''; + } + $ret .= "$indent <file role=\"$fa[role]\""; + if (isset($fa['baseinstalldir'])) { + $ret .= ' baseinstalldir="' . + $this->_fixXmlEncoding($fa['baseinstalldir']) . '"'; + } + if (isset($fa['md5sum'])) { + $ret .= " md5sum=\"$fa[md5sum]\""; + } + if (isset($fa['platform'])) { + $ret .= " platform=\"$fa[platform]\""; + } + if (!empty($fa['install-as'])) { + $ret .= ' install-as="' . + $this->_fixXmlEncoding($fa['install-as']) . '"'; + } + $ret .= ' name="' . $this->_fixXmlEncoding($file) . '"'; + if (empty($fa['replacements'])) { + $ret .= "/>\n"; + } else { + $ret .= ">\n"; + foreach ($fa['replacements'] as $r) { + $ret .= "$indent <replace"; + foreach ($r as $k => $v) { + $ret .= " $k=\"" . $this->_fixXmlEncoding($v) .'"'; + } + $ret .= "/>\n"; + } + $ret .= "$indent </file>\n"; + } + } + } + $ret .= "$indent </filelist>\n"; + } + $ret .= "$indent </release>\n"; + return $ret; + } + + /** + * @param array + * @access protected + */ + function recursiveXmlFilelist($list) + { + $this->_dirs = array(); + foreach ($list as $file => $attributes) { + $this->_addDir($this->_dirs, explode('/', dirname($file)), $file, $attributes); + } + return $this->_formatDir($this->_dirs); + } + + /** + * @param array + * @param array + * @param string|null + * @param array|null + * @access private + */ + function _addDir(&$dirs, $dir, $file = null, $attributes = null) + { + if ($dir == array() || $dir == array('.')) { + $dirs['files'][basename($file)] = $attributes; + return; + } + $curdir = array_shift($dir); + if (!isset($dirs['dirs'][$curdir])) { + $dirs['dirs'][$curdir] = array(); + } + $this->_addDir($dirs['dirs'][$curdir], $dir, $file, $attributes); + } + + /** + * @param array + * @param string + * @param string + * @access private + */ + function _formatDir($dirs, $indent = '', $curdir = '') + { + $ret = ''; + if (!count($dirs)) { + return ''; + } + if (isset($dirs['dirs'])) { + uksort($dirs['dirs'], 'strnatcasecmp'); + foreach ($dirs['dirs'] as $dir => $contents) { + $usedir = "$curdir/$dir"; + $ret .= "$indent <dir name=\"$dir\">\n"; + $ret .= $this->_formatDir($contents, "$indent ", $usedir); + $ret .= "$indent </dir> <!-- $usedir -->\n"; + } + } + if (isset($dirs['files'])) { + uksort($dirs['files'], 'strnatcasecmp'); + foreach ($dirs['files'] as $file => $attribs) { + $ret .= $this->_formatFile($file, $attribs, $indent); + } + } + return $ret; + } + + /** + * @param string + * @param array + * @param string + * @access private + */ + function _formatFile($file, $attributes, $indent) + { + $ret = "$indent <file role=\"$attributes[role]\""; + if (isset($attributes['baseinstalldir'])) { + $ret .= ' baseinstalldir="' . + $this->_fixXmlEncoding($attributes['baseinstalldir']) . '"'; + } + if (isset($attributes['md5sum'])) { + $ret .= " md5sum=\"$attributes[md5sum]\""; + } + if (isset($attributes['platform'])) { + $ret .= " platform=\"$attributes[platform]\""; + } + if (!empty($attributes['install-as'])) { + $ret .= ' install-as="' . + $this->_fixXmlEncoding($attributes['install-as']) . '"'; + } + $ret .= ' name="' . $this->_fixXmlEncoding($file) . '"'; + if (empty($attributes['replacements'])) { + $ret .= "/>\n"; + } else { + $ret .= ">\n"; + foreach ($attributes['replacements'] as $r) { + $ret .= "$indent <replace"; + foreach ($r as $k => $v) { + $ret .= " $k=\"" . $this->_fixXmlEncoding($v) .'"'; + } + $ret .= "/>\n"; + } + $ret .= "$indent </file>\n"; + } + return $ret; + } + + // {{{ _unIndent() + + /** + * Unindent given string (?) + * + * @param string $str The string that has to be unindented. + * @return string + * @access private + */ + function _unIndent($str) + { + // remove leading newlines + $str = preg_replace('/^[\r\n]+/', '', $str); + // find whitespace at the beginning of the first line + $indent_len = strspn($str, " \t"); + $indent = substr($str, 0, $indent_len); + $data = ''; + // remove the same amount of whitespace from following lines + foreach (explode("\n", $str) as $line) { + if (substr($line, 0, $indent_len) == $indent) { + $data .= substr($line, $indent_len) . "\n"; + } + } + return $data; + } + + /** + * @return array + */ + function dependenciesToV2() + { + $arr = array(); + $this->_convertDependencies2_0($arr); + return $arr['dependencies']; + } + + /** + * Convert a package.xml version 1.0 into version 2.0 + * + * Note that this does a basic conversion, to allow more advanced + * features like bundles and multiple releases + * @param string the classname to instantiate and return. This must be + * PEAR_PackageFile_v2 or a descendant + * @param boolean if true, only valid, deterministic package.xml 1.0 as defined by the + * strictest parameters will be converted + * @return PEAR_PackageFile_v2|PEAR_Error + */ + function &toV2($class = 'PEAR_PackageFile_v2', $strict = false) + { + if ($strict) { + if (!$this->_packagefile->validate()) { + $a = PEAR::raiseError('invalid package.xml version 1.0 cannot be converted' . + ' to version 2.0', null, null, null, + $this->_packagefile->getValidationWarnings(true)); + return $a; + } + } + + $arr = array( + 'attribs' => array( + 'version' => '2.0', + 'xmlns' => 'http://pear.php.net/dtd/package-2.0', + 'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0', + 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + 'xsi:schemaLocation' => "http://pear.php.net/dtd/tasks-1.0\n" . +"http://pear.php.net/dtd/tasks-1.0.xsd\n" . +"http://pear.php.net/dtd/package-2.0\n" . +'http://pear.php.net/dtd/package-2.0.xsd', + ), + 'name' => $this->_packagefile->getPackage(), + 'channel' => 'pear.php.net', + ); + $arr['summary'] = $this->_packagefile->getSummary(); + $arr['description'] = $this->_packagefile->getDescription(); + $maintainers = $this->_packagefile->getMaintainers(); + foreach ($maintainers as $maintainer) { + if ($maintainer['role'] != 'lead') { + continue; + } + $new = array( + 'name' => $maintainer['name'], + 'user' => $maintainer['handle'], + 'email' => $maintainer['email'], + 'active' => 'yes', + ); + $arr['lead'][] = $new; + } + + if (!isset($arr['lead'])) { // some people... you know? + $arr['lead'] = array( + 'name' => 'unknown', + 'user' => 'unknown', + 'email' => 'noleadmaintainer@example.com', + 'active' => 'no', + ); + } + + if (count($arr['lead']) == 1) { + $arr['lead'] = $arr['lead'][0]; + } + + foreach ($maintainers as $maintainer) { + if ($maintainer['role'] == 'lead') { + continue; + } + $new = array( + 'name' => $maintainer['name'], + 'user' => $maintainer['handle'], + 'email' => $maintainer['email'], + 'active' => 'yes', + ); + $arr[$maintainer['role']][] = $new; + } + + if (isset($arr['developer']) && count($arr['developer']) == 1) { + $arr['developer'] = $arr['developer'][0]; + } + + if (isset($arr['contributor']) && count($arr['contributor']) == 1) { + $arr['contributor'] = $arr['contributor'][0]; + } + + if (isset($arr['helper']) && count($arr['helper']) == 1) { + $arr['helper'] = $arr['helper'][0]; + } + + $arr['date'] = $this->_packagefile->getDate(); + $arr['version'] = + array( + 'release' => $this->_packagefile->getVersion(), + 'api' => $this->_packagefile->getVersion(), + ); + $arr['stability'] = + array( + 'release' => $this->_packagefile->getState(), + 'api' => $this->_packagefile->getState(), + ); + $licensemap = + array( + 'php' => 'http://www.php.net/license', + 'php license' => 'http://www.php.net/license', + 'lgpl' => 'http://www.gnu.org/copyleft/lesser.html', + 'bsd' => 'http://www.opensource.org/licenses/bsd-license.php', + 'bsd style' => 'http://www.opensource.org/licenses/bsd-license.php', + 'bsd-style' => 'http://www.opensource.org/licenses/bsd-license.php', + 'mit' => 'http://www.opensource.org/licenses/mit-license.php', + 'gpl' => 'http://www.gnu.org/copyleft/gpl.html', + 'apache' => 'http://www.opensource.org/licenses/apache2.0.php' + ); + + if (isset($licensemap[strtolower($this->_packagefile->getLicense())])) { + $arr['license'] = array( + 'attribs' => array('uri' => + $licensemap[strtolower($this->_packagefile->getLicense())]), + '_content' => $this->_packagefile->getLicense() + ); + } else { + // don't use bogus uri + $arr['license'] = $this->_packagefile->getLicense(); + } + + $arr['notes'] = $this->_packagefile->getNotes(); + $temp = array(); + $arr['contents'] = $this->_convertFilelist2_0($temp); + $this->_convertDependencies2_0($arr); + $release = ($this->_packagefile->getConfigureOptions() || $this->_isExtension) ? + 'extsrcrelease' : 'phprelease'; + if ($release == 'extsrcrelease') { + $arr['channel'] = 'pecl.php.net'; + $arr['providesextension'] = $arr['name']; // assumption + } + + $arr[$release] = array(); + if ($this->_packagefile->getConfigureOptions()) { + $arr[$release]['configureoption'] = $this->_packagefile->getConfigureOptions(); + foreach ($arr[$release]['configureoption'] as $i => $opt) { + $arr[$release]['configureoption'][$i] = array('attribs' => $opt); + } + if (count($arr[$release]['configureoption']) == 1) { + $arr[$release]['configureoption'] = $arr[$release]['configureoption'][0]; + } + } + + $this->_convertRelease2_0($arr[$release], $temp); + if ($release == 'extsrcrelease' && count($arr[$release]) > 1) { + // multiple extsrcrelease tags added in PEAR 1.4.1 + $arr['dependencies']['required']['pearinstaller']['min'] = '1.4.1'; + } + + if ($cl = $this->_packagefile->getChangelog()) { + foreach ($cl as $release) { + $rel = array(); + $rel['version'] = + array( + 'release' => $release['version'], + 'api' => $release['version'], + ); + if (!isset($release['release_state'])) { + $release['release_state'] = 'stable'; + } + + $rel['stability'] = + array( + 'release' => $release['release_state'], + 'api' => $release['release_state'], + ); + if (isset($release['release_date'])) { + $rel['date'] = $release['release_date']; + } else { + $rel['date'] = date('Y-m-d'); + } + + if (isset($release['release_license'])) { + if (isset($licensemap[strtolower($release['release_license'])])) { + $uri = $licensemap[strtolower($release['release_license'])]; + } else { + $uri = 'http://www.example.com'; + } + $rel['license'] = array( + 'attribs' => array('uri' => $uri), + '_content' => $release['release_license'] + ); + } else { + $rel['license'] = $arr['license']; + } + + if (!isset($release['release_notes'])) { + $release['release_notes'] = 'no release notes'; + } + + $rel['notes'] = $release['release_notes']; + $arr['changelog']['release'][] = $rel; + } + } + + $ret = new $class; + $ret->setConfig($this->_packagefile->_config); + if (isset($this->_packagefile->_logger) && is_object($this->_packagefile->_logger)) { + $ret->setLogger($this->_packagefile->_logger); + } + + $ret->fromArray($arr); + return $ret; + } + + /** + * @param array + * @param bool + * @access private + */ + function _convertDependencies2_0(&$release, $internal = false) + { + $peardep = array('pearinstaller' => + array('min' => '1.4.0b1')); // this is a lot safer + $required = $optional = array(); + $release['dependencies'] = array('required' => array()); + if ($this->_packagefile->hasDeps()) { + foreach ($this->_packagefile->getDeps() as $dep) { + if (!isset($dep['optional']) || $dep['optional'] == 'no') { + $required[] = $dep; + } else { + $optional[] = $dep; + } + } + foreach (array('required', 'optional') as $arr) { + $deps = array(); + foreach ($$arr as $dep) { + // organize deps by dependency type and name + if (!isset($deps[$dep['type']])) { + $deps[$dep['type']] = array(); + } + if (isset($dep['name'])) { + $deps[$dep['type']][$dep['name']][] = $dep; + } else { + $deps[$dep['type']][] = $dep; + } + } + do { + if (isset($deps['php'])) { + $php = array(); + if (count($deps['php']) > 1) { + $php = $this->_processPhpDeps($deps['php']); + } else { + if (!isset($deps['php'][0])) { + list($key, $blah) = each ($deps['php']); // stupid buggy versions + $deps['php'] = array($blah[0]); + } + $php = $this->_processDep($deps['php'][0]); + if (!$php) { + break; // poor mans throw + } + } + $release['dependencies'][$arr]['php'] = $php; + } + } while (false); + do { + if (isset($deps['pkg'])) { + $pkg = array(); + $pkg = $this->_processMultipleDepsName($deps['pkg']); + if (!$pkg) { + break; // poor mans throw + } + $release['dependencies'][$arr]['package'] = $pkg; + } + } while (false); + do { + if (isset($deps['ext'])) { + $pkg = array(); + $pkg = $this->_processMultipleDepsName($deps['ext']); + $release['dependencies'][$arr]['extension'] = $pkg; + } + } while (false); + // skip sapi - it's not supported so nobody will have used it + // skip os - it's not supported in 1.0 + } + } + if (isset($release['dependencies']['required'])) { + $release['dependencies']['required'] = + array_merge($peardep, $release['dependencies']['required']); + } else { + $release['dependencies']['required'] = $peardep; + } + if (!isset($release['dependencies']['required']['php'])) { + $release['dependencies']['required']['php'] = + array('min' => '4.0.0'); + } + $order = array(); + $bewm = $release['dependencies']['required']; + $order['php'] = $bewm['php']; + $order['pearinstaller'] = $bewm['pearinstaller']; + isset($bewm['package']) ? $order['package'] = $bewm['package'] :0; + isset($bewm['extension']) ? $order['extension'] = $bewm['extension'] :0; + $release['dependencies']['required'] = $order; + } + + /** + * @param array + * @access private + */ + function _convertFilelist2_0(&$package) + { + $ret = array('dir' => + array( + 'attribs' => array('name' => '/'), + 'file' => array() + ) + ); + $package['platform'] = + $package['install-as'] = array(); + $this->_isExtension = false; + foreach ($this->_packagefile->getFilelist() as $name => $file) { + $file['name'] = $name; + if (isset($file['role']) && $file['role'] == 'src') { + $this->_isExtension = true; + } + if (isset($file['replacements'])) { + $repl = $file['replacements']; + unset($file['replacements']); + } else { + unset($repl); + } + if (isset($file['install-as'])) { + $package['install-as'][$name] = $file['install-as']; + unset($file['install-as']); + } + if (isset($file['platform'])) { + $package['platform'][$name] = $file['platform']; + unset($file['platform']); + } + $file = array('attribs' => $file); + if (isset($repl)) { + foreach ($repl as $replace ) { + $file['tasks:replace'][] = array('attribs' => $replace); + } + if (count($repl) == 1) { + $file['tasks:replace'] = $file['tasks:replace'][0]; + } + } + $ret['dir']['file'][] = $file; + } + return $ret; + } + + /** + * Post-process special files with install-as/platform attributes and + * make the release tag. + * + * This complex method follows this work-flow to create the release tags: + * + * <pre> + * - if any install-as/platform exist, create a generic release and fill it with + * o <install as=..> tags for <file name=... install-as=...> + * o <install as=..> tags for <file name=... platform=!... install-as=..> + * o <ignore> tags for <file name=... platform=...> + * o <ignore> tags for <file name=... platform=... install-as=..> + * - create a release for each platform encountered and fill with + * o <install as..> tags for <file name=... install-as=...> + * o <install as..> tags for <file name=... platform=this platform install-as=..> + * o <install as..> tags for <file name=... platform=!other platform install-as=..> + * o <ignore> tags for <file name=... platform=!this platform> + * o <ignore> tags for <file name=... platform=other platform> + * o <ignore> tags for <file name=... platform=other platform install-as=..> + * o <ignore> tags for <file name=... platform=!this platform install-as=..> + * </pre> + * + * It does this by accessing the $package parameter, which contains an array with + * indices: + * + * - platform: mapping of file => OS the file should be installed on + * - install-as: mapping of file => installed name + * - osmap: mapping of OS => list of files that should be installed + * on that OS + * - notosmap: mapping of OS => list of files that should not be + * installed on that OS + * + * @param array + * @param array + * @access private + */ + function _convertRelease2_0(&$release, $package) + { + //- if any install-as/platform exist, create a generic release and fill it with + if (count($package['platform']) || count($package['install-as'])) { + $generic = array(); + $genericIgnore = array(); + foreach ($package['install-as'] as $file => $as) { + //o <install as=..> tags for <file name=... install-as=...> + if (!isset($package['platform'][$file])) { + $generic[] = $file; + continue; + } + //o <install as=..> tags for <file name=... platform=!... install-as=..> + if (isset($package['platform'][$file]) && + $package['platform'][$file]{0} == '!') { + $generic[] = $file; + continue; + } + //o <ignore> tags for <file name=... platform=... install-as=..> + if (isset($package['platform'][$file]) && + $package['platform'][$file]{0} != '!') { + $genericIgnore[] = $file; + continue; + } + } + foreach ($package['platform'] as $file => $platform) { + if (isset($package['install-as'][$file])) { + continue; + } + if ($platform{0} != '!') { + //o <ignore> tags for <file name=... platform=...> + $genericIgnore[] = $file; + } + } + if (count($package['platform'])) { + $oses = $notplatform = $platform = array(); + foreach ($package['platform'] as $file => $os) { + // get a list of oses + if ($os{0} == '!') { + if (isset($oses[substr($os, 1)])) { + continue; + } + $oses[substr($os, 1)] = count($oses); + } else { + if (isset($oses[$os])) { + continue; + } + $oses[$os] = count($oses); + } + } + //- create a release for each platform encountered and fill with + foreach ($oses as $os => $releaseNum) { + $release[$releaseNum]['installconditions']['os']['name'] = $os; + $release[$releaseNum]['filelist'] = array('install' => array(), + 'ignore' => array()); + foreach ($package['install-as'] as $file => $as) { + //o <install as=..> tags for <file name=... install-as=...> + if (!isset($package['platform'][$file])) { + $release[$releaseNum]['filelist']['install'][] = + array( + 'attribs' => array( + 'name' => $file, + 'as' => $as, + ), + ); + continue; + } + //o <install as..> tags for + // <file name=... platform=this platform install-as=..> + if (isset($package['platform'][$file]) && + $package['platform'][$file] == $os) { + $release[$releaseNum]['filelist']['install'][] = + array( + 'attribs' => array( + 'name' => $file, + 'as' => $as, + ), + ); + continue; + } + //o <install as..> tags for + // <file name=... platform=!other platform install-as=..> + if (isset($package['platform'][$file]) && + $package['platform'][$file] != "!$os" && + $package['platform'][$file]{0} == '!') { + $release[$releaseNum]['filelist']['install'][] = + array( + 'attribs' => array( + 'name' => $file, + 'as' => $as, + ), + ); + continue; + } + //o <ignore> tags for + // <file name=... platform=!this platform install-as=..> + if (isset($package['platform'][$file]) && + $package['platform'][$file] == "!$os") { + $release[$releaseNum]['filelist']['ignore'][] = + array( + 'attribs' => array( + 'name' => $file, + ), + ); + continue; + } + //o <ignore> tags for + // <file name=... platform=other platform install-as=..> + if (isset($package['platform'][$file]) && + $package['platform'][$file]{0} != '!' && + $package['platform'][$file] != $os) { + $release[$releaseNum]['filelist']['ignore'][] = + array( + 'attribs' => array( + 'name' => $file, + ), + ); + continue; + } + } + foreach ($package['platform'] as $file => $platform) { + if (isset($package['install-as'][$file])) { + continue; + } + //o <ignore> tags for <file name=... platform=!this platform> + if ($platform == "!$os") { + $release[$releaseNum]['filelist']['ignore'][] = + array( + 'attribs' => array( + 'name' => $file, + ), + ); + continue; + } + //o <ignore> tags for <file name=... platform=other platform> + if ($platform{0} != '!' && $platform != $os) { + $release[$releaseNum]['filelist']['ignore'][] = + array( + 'attribs' => array( + 'name' => $file, + ), + ); + } + } + if (!count($release[$releaseNum]['filelist']['install'])) { + unset($release[$releaseNum]['filelist']['install']); + } + if (!count($release[$releaseNum]['filelist']['ignore'])) { + unset($release[$releaseNum]['filelist']['ignore']); + } + } + if (count($generic) || count($genericIgnore)) { + $release[count($oses)] = array(); + if (count($generic)) { + foreach ($generic as $file) { + if (isset($package['install-as'][$file])) { + $installas = $package['install-as'][$file]; + } else { + $installas = $file; + } + $release[count($oses)]['filelist']['install'][] = + array( + 'attribs' => array( + 'name' => $file, + 'as' => $installas, + ) + ); + } + } + if (count($genericIgnore)) { + foreach ($genericIgnore as $file) { + $release[count($oses)]['filelist']['ignore'][] = + array( + 'attribs' => array( + 'name' => $file, + ) + ); + } + } + } + // cleanup + foreach ($release as $i => $rel) { + if (isset($rel['filelist']['install']) && + count($rel['filelist']['install']) == 1) { + $release[$i]['filelist']['install'] = + $release[$i]['filelist']['install'][0]; + } + if (isset($rel['filelist']['ignore']) && + count($rel['filelist']['ignore']) == 1) { + $release[$i]['filelist']['ignore'] = + $release[$i]['filelist']['ignore'][0]; + } + } + if (count($release) == 1) { + $release = $release[0]; + } + } else { + // no platform atts, but some install-as atts + foreach ($package['install-as'] as $file => $value) { + $release['filelist']['install'][] = + array( + 'attribs' => array( + 'name' => $file, + 'as' => $value + ) + ); + } + if (count($release['filelist']['install']) == 1) { + $release['filelist']['install'] = $release['filelist']['install'][0]; + } + } + } + } + + /** + * @param array + * @return array + * @access private + */ + function _processDep($dep) + { + if ($dep['type'] == 'php') { + if ($dep['rel'] == 'has') { + // come on - everyone has php! + return false; + } + } + $php = array(); + if ($dep['type'] != 'php') { + $php['name'] = $dep['name']; + if ($dep['type'] == 'pkg') { + $php['channel'] = 'pear.php.net'; + } + } + switch ($dep['rel']) { + case 'gt' : + $php['min'] = $dep['version']; + $php['exclude'] = $dep['version']; + break; + case 'ge' : + if (!isset($dep['version'])) { + if ($dep['type'] == 'php') { + if (isset($dep['name'])) { + $dep['version'] = $dep['name']; + } + } + } + $php['min'] = $dep['version']; + break; + case 'lt' : + $php['max'] = $dep['version']; + $php['exclude'] = $dep['version']; + break; + case 'le' : + $php['max'] = $dep['version']; + break; + case 'eq' : + $php['min'] = $dep['version']; + $php['max'] = $dep['version']; + break; + case 'ne' : + $php['exclude'] = $dep['version']; + break; + case 'not' : + $php['conflicts'] = 'yes'; + break; + } + return $php; + } + + /** + * @param array + * @return array + */ + function _processPhpDeps($deps) + { + $test = array(); + foreach ($deps as $dep) { + $test[] = $this->_processDep($dep); + } + $min = array(); + $max = array(); + foreach ($test as $dep) { + if (!$dep) { + continue; + } + if (isset($dep['min'])) { + $min[$dep['min']] = count($min); + } + if (isset($dep['max'])) { + $max[$dep['max']] = count($max); + } + } + if (count($min) > 0) { + uksort($min, 'version_compare'); + } + if (count($max) > 0) { + uksort($max, 'version_compare'); + } + if (count($min)) { + // get the highest minimum + $min = array_pop($a = array_flip($min)); + } else { + $min = false; + } + if (count($max)) { + // get the lowest maximum + $max = array_shift($a = array_flip($max)); + } else { + $max = false; + } + if ($min) { + $php['min'] = $min; + } + if ($max) { + $php['max'] = $max; + } + $exclude = array(); + foreach ($test as $dep) { + if (!isset($dep['exclude'])) { + continue; + } + $exclude[] = $dep['exclude']; + } + if (count($exclude)) { + $php['exclude'] = $exclude; + } + return $php; + } + + /** + * process multiple dependencies that have a name, like package deps + * @param array + * @return array + * @access private + */ + function _processMultipleDepsName($deps) + { + $ret = $tests = array(); + foreach ($deps as $name => $dep) { + foreach ($dep as $d) { + $tests[$name][] = $this->_processDep($d); + } + } + + foreach ($tests as $name => $test) { + $max = $min = $php = array(); + $php['name'] = $name; + foreach ($test as $dep) { + if (!$dep) { + continue; + } + if (isset($dep['channel'])) { + $php['channel'] = 'pear.php.net'; + } + if (isset($dep['conflicts']) && $dep['conflicts'] == 'yes') { + $php['conflicts'] = 'yes'; + } + if (isset($dep['min'])) { + $min[$dep['min']] = count($min); + } + if (isset($dep['max'])) { + $max[$dep['max']] = count($max); + } + } + if (count($min) > 0) { + uksort($min, 'version_compare'); + } + if (count($max) > 0) { + uksort($max, 'version_compare'); + } + if (count($min)) { + // get the highest minimum + $min = array_pop($a = array_flip($min)); + } else { + $min = false; + } + if (count($max)) { + // get the lowest maximum + $max = array_shift($a = array_flip($max)); + } else { + $max = false; + } + if ($min) { + $php['min'] = $min; + } + if ($max) { + $php['max'] = $max; + } + $exclude = array(); + foreach ($test as $dep) { + if (!isset($dep['exclude'])) { + continue; + } + $exclude[] = $dep['exclude']; + } + if (count($exclude)) { + $php['exclude'] = $exclude; + } + $ret[] = $php; + } + return $ret; + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Generator/v2.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Generator/v2.php new file mode 100644 index 0000000000000000000000000000000000000000..4d202df27d30602c0f9acb46ad2d3c59fd61faca --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Generator/v2.php @@ -0,0 +1,893 @@ +<?php +/** + * package.xml generation class, package.xml version 2.0 + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @author Stephan Schmidt (original XML_Serializer code) + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: v2.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * file/dir manipulation routines + */ +require_once 'System.php'; +require_once 'XML/Util.php'; + +/** + * This class converts a PEAR_PackageFile_v2 object into any output format. + * + * Supported output formats include array, XML string (using S. Schmidt's + * XML_Serializer, slightly customized) + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @author Stephan Schmidt (original XML_Serializer code) + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_PackageFile_Generator_v2 +{ + /** + * default options for the serialization + * @access private + * @var array $_defaultOptions + */ + var $_defaultOptions = array( + 'indent' => ' ', // string used for indentation + 'linebreak' => "\n", // string used for newlines + 'typeHints' => false, // automatically add type hin attributes + 'addDecl' => true, // add an XML declaration + 'defaultTagName' => 'XML_Serializer_Tag', // tag used for indexed arrays or invalid names + 'classAsTagName' => false, // use classname for objects in indexed arrays + 'keyAttribute' => '_originalKey', // attribute where original key is stored + 'typeAttribute' => '_type', // attribute for type (only if typeHints => true) + 'classAttribute' => '_class', // attribute for class of objects (only if typeHints => true) + 'scalarAsAttributes' => false, // scalar values (strings, ints,..) will be serialized as attribute + 'prependAttributes' => '', // prepend string for attributes + 'indentAttributes' => false, // indent the attributes, if set to '_auto', it will indent attributes so they all start at the same column + 'mode' => 'simplexml', // use 'simplexml' to use parent name as tagname if transforming an indexed array + 'addDoctype' => false, // add a doctype declaration + 'doctype' => null, // supply a string or an array with id and uri ({@see XML_Util::getDoctypeDeclaration()} + 'rootName' => 'package', // name of the root tag + 'rootAttributes' => array( + 'version' => '2.0', + 'xmlns' => 'http://pear.php.net/dtd/package-2.0', + 'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0', + 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + 'xsi:schemaLocation' => 'http://pear.php.net/dtd/tasks-1.0 +http://pear.php.net/dtd/tasks-1.0.xsd +http://pear.php.net/dtd/package-2.0 +http://pear.php.net/dtd/package-2.0.xsd', + ), // attributes of the root tag + 'attributesArray' => 'attribs', // all values in this key will be treated as attributes + 'contentName' => '_content', // this value will be used directly as content, instead of creating a new tag, may only be used in conjuction with attributesArray + 'beautifyFilelist' => false, + 'encoding' => 'UTF-8', + ); + + /** + * options for the serialization + * @access private + * @var array $options + */ + var $options = array(); + + /** + * current tag depth + * @var integer $_tagDepth + */ + var $_tagDepth = 0; + + /** + * serilialized representation of the data + * @var string $_serializedData + */ + var $_serializedData = null; + /** + * @var PEAR_PackageFile_v2 + */ + var $_packagefile; + /** + * @param PEAR_PackageFile_v2 + */ + function PEAR_PackageFile_Generator_v2(&$packagefile) + { + $this->_packagefile = &$packagefile; + if (isset($this->_packagefile->encoding)) { + $this->_defaultOptions['encoding'] = $this->_packagefile->encoding; + } + } + + /** + * @return string + */ + function getPackagerVersion() + { + return '1.9.4'; + } + + /** + * @param PEAR_Packager + * @param bool generate a .tgz or a .tar + * @param string|null temporary directory to package in + */ + function toTgz(&$packager, $compress = true, $where = null) + { + $a = null; + return $this->toTgz2($packager, $a, $compress, $where); + } + + /** + * Package up both a package.xml and package2.xml for the same release + * @param PEAR_Packager + * @param PEAR_PackageFile_v1 + * @param bool generate a .tgz or a .tar + * @param string|null temporary directory to package in + */ + function toTgz2(&$packager, &$pf1, $compress = true, $where = null) + { + require_once 'Archive/Tar.php'; + if (!$this->_packagefile->isEquivalent($pf1)) { + return PEAR::raiseError('PEAR_Packagefile_v2::toTgz: "' . + basename($pf1->getPackageFile()) . + '" is not equivalent to "' . basename($this->_packagefile->getPackageFile()) + . '"'); + } + + if ($where === null) { + if (!($where = System::mktemp(array('-d')))) { + return PEAR::raiseError('PEAR_Packagefile_v2::toTgz: mktemp failed'); + } + } elseif (!@System::mkDir(array('-p', $where))) { + return PEAR::raiseError('PEAR_Packagefile_v2::toTgz: "' . $where . '" could' . + ' not be created'); + } + + $file = $where . DIRECTORY_SEPARATOR . 'package.xml'; + if (file_exists($file) && !is_file($file)) { + return PEAR::raiseError('PEAR_Packagefile_v2::toTgz: unable to save package.xml as' . + ' "' . $file .'"'); + } + + if (!$this->_packagefile->validate(PEAR_VALIDATE_PACKAGING)) { + return PEAR::raiseError('PEAR_Packagefile_v2::toTgz: invalid package.xml'); + } + + $ext = $compress ? '.tgz' : '.tar'; + $pkgver = $this->_packagefile->getPackage() . '-' . $this->_packagefile->getVersion(); + $dest_package = getcwd() . DIRECTORY_SEPARATOR . $pkgver . $ext; + if (file_exists($dest_package) && !is_file($dest_package)) { + return PEAR::raiseError('PEAR_Packagefile_v2::toTgz: cannot create tgz file "' . + $dest_package . '"'); + } + + $pkgfile = $this->_packagefile->getPackageFile(); + if (!$pkgfile) { + return PEAR::raiseError('PEAR_Packagefile_v2::toTgz: package file object must ' . + 'be created from a real file'); + } + + $pkgdir = dirname(realpath($pkgfile)); + $pkgfile = basename($pkgfile); + + // {{{ Create the package file list + $filelist = array(); + $i = 0; + $this->_packagefile->flattenFilelist(); + $contents = $this->_packagefile->getContents(); + if (isset($contents['bundledpackage'])) { // bundles of packages + $contents = $contents['bundledpackage']; + if (!isset($contents[0])) { + $contents = array($contents); + } + + $packageDir = $where; + foreach ($contents as $i => $package) { + $fname = $package; + $file = $pkgdir . DIRECTORY_SEPARATOR . $fname; + if (!file_exists($file)) { + return $packager->raiseError("File does not exist: $fname"); + } + + $tfile = $packageDir . DIRECTORY_SEPARATOR . $fname; + System::mkdir(array('-p', dirname($tfile))); + copy($file, $tfile); + $filelist[$i++] = $tfile; + $packager->log(2, "Adding package $fname"); + } + } else { // normal packages + $contents = $contents['dir']['file']; + if (!isset($contents[0])) { + $contents = array($contents); + } + + $packageDir = $where; + foreach ($contents as $i => $file) { + $fname = $file['attribs']['name']; + $atts = $file['attribs']; + $orig = $file; + $file = $pkgdir . DIRECTORY_SEPARATOR . $fname; + if (!file_exists($file)) { + return $packager->raiseError("File does not exist: $fname"); + } + + $origperms = fileperms($file); + $tfile = $packageDir . DIRECTORY_SEPARATOR . $fname; + unset($orig['attribs']); + if (count($orig)) { // file with tasks + // run any package-time tasks + $contents = file_get_contents($file); + foreach ($orig as $tag => $raw) { + $tag = str_replace( + array($this->_packagefile->getTasksNs() . ':', '-'), + array('', '_'), $tag); + $task = "PEAR_Task_$tag"; + $task = &new $task($this->_packagefile->_config, + $this->_packagefile->_logger, + PEAR_TASK_PACKAGE); + $task->init($raw, $atts, null); + $res = $task->startSession($this->_packagefile, $contents, $tfile); + if (!$res) { + continue; // skip this task + } + + if (PEAR::isError($res)) { + return $res; + } + + $contents = $res; // save changes + System::mkdir(array('-p', dirname($tfile))); + $wp = fopen($tfile, "wb"); + fwrite($wp, $contents); + fclose($wp); + } + } + + if (!file_exists($tfile)) { + System::mkdir(array('-p', dirname($tfile))); + copy($file, $tfile); + } + + chmod($tfile, $origperms); + $filelist[$i++] = $tfile; + $this->_packagefile->setFileAttribute($fname, 'md5sum', md5_file($tfile), $i - 1); + $packager->log(2, "Adding file $fname"); + } + } + // }}} + + $name = $pf1 !== null ? 'package2.xml' : 'package.xml'; + $packagexml = $this->toPackageFile($where, PEAR_VALIDATE_PACKAGING, $name); + if ($packagexml) { + $tar =& new Archive_Tar($dest_package, $compress); + $tar->setErrorHandling(PEAR_ERROR_RETURN); // XXX Don't print errors + // ----- Creates with the package.xml file + $ok = $tar->createModify(array($packagexml), '', $where); + if (PEAR::isError($ok)) { + return $packager->raiseError($ok); + } elseif (!$ok) { + return $packager->raiseError('PEAR_Packagefile_v2::toTgz(): adding ' . $name . + ' failed'); + } + + // ----- Add the content of the package + if (!$tar->addModify($filelist, $pkgver, $where)) { + return $packager->raiseError( + 'PEAR_Packagefile_v2::toTgz(): tarball creation failed'); + } + + // add the package.xml version 1.0 + if ($pf1 !== null) { + $pfgen = &$pf1->getDefaultGenerator(); + $packagexml1 = $pfgen->toPackageFile($where, PEAR_VALIDATE_PACKAGING, 'package.xml', true); + if (!$tar->addModify(array($packagexml1), '', $where)) { + return $packager->raiseError( + 'PEAR_Packagefile_v2::toTgz(): adding package.xml failed'); + } + } + + return $dest_package; + } + } + + function toPackageFile($where = null, $state = PEAR_VALIDATE_NORMAL, $name = 'package.xml') + { + if (!$this->_packagefile->validate($state)) { + return PEAR::raiseError('PEAR_Packagefile_v2::toPackageFile: invalid package.xml', + null, null, null, $this->_packagefile->getValidationWarnings()); + } + + if ($where === null) { + if (!($where = System::mktemp(array('-d')))) { + return PEAR::raiseError('PEAR_Packagefile_v2::toPackageFile: mktemp failed'); + } + } elseif (!@System::mkDir(array('-p', $where))) { + return PEAR::raiseError('PEAR_Packagefile_v2::toPackageFile: "' . $where . '" could' . + ' not be created'); + } + + $newpkgfile = $where . DIRECTORY_SEPARATOR . $name; + $np = @fopen($newpkgfile, 'wb'); + if (!$np) { + return PEAR::raiseError('PEAR_Packagefile_v2::toPackageFile: unable to save ' . + "$name as $newpkgfile"); + } + fwrite($np, $this->toXml($state)); + fclose($np); + return $newpkgfile; + } + + function &toV2() + { + return $this->_packagefile; + } + + /** + * Return an XML document based on the package info (as returned + * by the PEAR_Common::infoFrom* methods). + * + * @return string XML data + */ + function toXml($state = PEAR_VALIDATE_NORMAL, $options = array()) + { + $this->_packagefile->setDate(date('Y-m-d')); + $this->_packagefile->setTime(date('H:i:s')); + if (!$this->_packagefile->validate($state)) { + return false; + } + + if (is_array($options)) { + $this->options = array_merge($this->_defaultOptions, $options); + } else { + $this->options = $this->_defaultOptions; + } + + $arr = $this->_packagefile->getArray(); + if (isset($arr['filelist'])) { + unset($arr['filelist']); + } + + if (isset($arr['_lastversion'])) { + unset($arr['_lastversion']); + } + + // Fix the notes a little bit + if (isset($arr['notes'])) { + // This trims out the indenting, needs fixing + $arr['notes'] = "\n" . trim($arr['notes']) . "\n"; + } + + if (isset($arr['changelog']) && !empty($arr['changelog'])) { + // Fix for inconsistency how the array is filled depending on the changelog release amount + if (!isset($arr['changelog']['release'][0])) { + $release = $arr['changelog']['release']; + unset($arr['changelog']['release']); + + $arr['changelog']['release'] = array(); + $arr['changelog']['release'][0] = $release; + } + + foreach (array_keys($arr['changelog']['release']) as $key) { + $c =& $arr['changelog']['release'][$key]; + if (isset($c['notes'])) { + // This trims out the indenting, needs fixing + $c['notes'] = "\n" . trim($c['notes']) . "\n"; + } + } + } + + if ($state ^ PEAR_VALIDATE_PACKAGING && !isset($arr['bundle'])) { + $use = $this->_recursiveXmlFilelist($arr['contents']['dir']['file']); + unset($arr['contents']['dir']['file']); + if (isset($use['dir'])) { + $arr['contents']['dir']['dir'] = $use['dir']; + } + if (isset($use['file'])) { + $arr['contents']['dir']['file'] = $use['file']; + } + $this->options['beautifyFilelist'] = true; + } + + $arr['attribs']['packagerversion'] = '1.9.4'; + if ($this->serialize($arr, $options)) { + return $this->_serializedData . "\n"; + } + + return false; + } + + + function _recursiveXmlFilelist($list) + { + $dirs = array(); + if (isset($list['attribs'])) { + $file = $list['attribs']['name']; + unset($list['attribs']['name']); + $attributes = $list['attribs']; + $this->_addDir($dirs, explode('/', dirname($file)), $file, $attributes); + } else { + foreach ($list as $a) { + $file = $a['attribs']['name']; + $attributes = $a['attribs']; + unset($a['attribs']); + $this->_addDir($dirs, explode('/', dirname($file)), $file, $attributes, $a); + } + } + $this->_formatDir($dirs); + $this->_deFormat($dirs); + return $dirs; + } + + function _addDir(&$dirs, $dir, $file = null, $attributes = null, $tasks = null) + { + if (!$tasks) { + $tasks = array(); + } + if ($dir == array() || $dir == array('.')) { + $dirs['file'][basename($file)] = $tasks; + $attributes['name'] = basename($file); + $dirs['file'][basename($file)]['attribs'] = $attributes; + return; + } + $curdir = array_shift($dir); + if (!isset($dirs['dir'][$curdir])) { + $dirs['dir'][$curdir] = array(); + } + $this->_addDir($dirs['dir'][$curdir], $dir, $file, $attributes, $tasks); + } + + function _formatDir(&$dirs) + { + if (!count($dirs)) { + return array(); + } + $newdirs = array(); + if (isset($dirs['dir'])) { + $newdirs['dir'] = $dirs['dir']; + } + if (isset($dirs['file'])) { + $newdirs['file'] = $dirs['file']; + } + $dirs = $newdirs; + if (isset($dirs['dir'])) { + uksort($dirs['dir'], 'strnatcasecmp'); + foreach ($dirs['dir'] as $dir => $contents) { + $this->_formatDir($dirs['dir'][$dir]); + } + } + if (isset($dirs['file'])) { + uksort($dirs['file'], 'strnatcasecmp'); + }; + } + + function _deFormat(&$dirs) + { + if (!count($dirs)) { + return array(); + } + $newdirs = array(); + if (isset($dirs['dir'])) { + foreach ($dirs['dir'] as $dir => $contents) { + $newdir = array(); + $newdir['attribs']['name'] = $dir; + $this->_deFormat($contents); + foreach ($contents as $tag => $val) { + $newdir[$tag] = $val; + } + $newdirs['dir'][] = $newdir; + } + if (count($newdirs['dir']) == 1) { + $newdirs['dir'] = $newdirs['dir'][0]; + } + } + if (isset($dirs['file'])) { + foreach ($dirs['file'] as $name => $file) { + $newdirs['file'][] = $file; + } + if (count($newdirs['file']) == 1) { + $newdirs['file'] = $newdirs['file'][0]; + } + } + $dirs = $newdirs; + } + + /** + * reset all options to default options + * + * @access public + * @see setOption(), XML_Unserializer() + */ + function resetOptions() + { + $this->options = $this->_defaultOptions; + } + + /** + * set an option + * + * You can use this method if you do not want to set all options in the constructor + * + * @access public + * @see resetOption(), XML_Serializer() + */ + function setOption($name, $value) + { + $this->options[$name] = $value; + } + + /** + * sets several options at once + * + * You can use this method if you do not want to set all options in the constructor + * + * @access public + * @see resetOption(), XML_Unserializer(), setOption() + */ + function setOptions($options) + { + $this->options = array_merge($this->options, $options); + } + + /** + * serialize data + * + * @access public + * @param mixed $data data to serialize + * @return boolean true on success, pear error on failure + */ + function serialize($data, $options = null) + { + // if options have been specified, use them instead + // of the previously defined ones + if (is_array($options)) { + $optionsBak = $this->options; + if (isset($options['overrideOptions']) && $options['overrideOptions'] == true) { + $this->options = array_merge($this->_defaultOptions, $options); + } else { + $this->options = array_merge($this->options, $options); + } + } else { + $optionsBak = null; + } + + // start depth is zero + $this->_tagDepth = 0; + $this->_serializedData = ''; + // serialize an array + if (is_array($data)) { + $tagName = isset($this->options['rootName']) ? $this->options['rootName'] : 'array'; + $this->_serializedData .= $this->_serializeArray($data, $tagName, $this->options['rootAttributes']); + } + + // add doctype declaration + if ($this->options['addDoctype'] === true) { + $this->_serializedData = XML_Util::getDoctypeDeclaration($tagName, $this->options['doctype']) + . $this->options['linebreak'] + . $this->_serializedData; + } + + // build xml declaration + if ($this->options['addDecl']) { + $atts = array(); + $encoding = isset($this->options['encoding']) ? $this->options['encoding'] : null; + $this->_serializedData = XML_Util::getXMLDeclaration('1.0', $encoding) + . $this->options['linebreak'] + . $this->_serializedData; + } + + + if ($optionsBak !== null) { + $this->options = $optionsBak; + } + + return true; + } + + /** + * get the result of the serialization + * + * @access public + * @return string serialized XML + */ + function getSerializedData() + { + if ($this->_serializedData === null) { + return $this->raiseError('No serialized data available. Use XML_Serializer::serialize() first.', XML_SERIALIZER_ERROR_NO_SERIALIZATION); + } + return $this->_serializedData; + } + + /** + * serialize any value + * + * This method checks for the type of the value and calls the appropriate method + * + * @access private + * @param mixed $value + * @param string $tagName + * @param array $attributes + * @return string + */ + function _serializeValue($value, $tagName = null, $attributes = array()) + { + if (is_array($value)) { + $xml = $this->_serializeArray($value, $tagName, $attributes); + } elseif (is_object($value)) { + $xml = $this->_serializeObject($value, $tagName); + } else { + $tag = array( + 'qname' => $tagName, + 'attributes' => $attributes, + 'content' => $value + ); + $xml = $this->_createXMLTag($tag); + } + return $xml; + } + + /** + * serialize an array + * + * @access private + * @param array $array array to serialize + * @param string $tagName name of the root tag + * @param array $attributes attributes for the root tag + * @return string $string serialized data + * @uses XML_Util::isValidName() to check, whether key has to be substituted + */ + function _serializeArray(&$array, $tagName = null, $attributes = array()) + { + $_content = null; + + /** + * check for special attributes + */ + if ($this->options['attributesArray'] !== null) { + if (isset($array[$this->options['attributesArray']])) { + $attributes = $array[$this->options['attributesArray']]; + unset($array[$this->options['attributesArray']]); + } + /** + * check for special content + */ + if ($this->options['contentName'] !== null) { + if (isset($array[$this->options['contentName']])) { + $_content = $array[$this->options['contentName']]; + unset($array[$this->options['contentName']]); + } + } + } + + /* + * if mode is set to simpleXML, check whether + * the array is associative or indexed + */ + if (is_array($array) && $this->options['mode'] == 'simplexml') { + $indexed = true; + if (!count($array)) { + $indexed = false; + } + foreach ($array as $key => $val) { + if (!is_int($key)) { + $indexed = false; + break; + } + } + + if ($indexed && $this->options['mode'] == 'simplexml') { + $string = ''; + foreach ($array as $key => $val) { + if ($this->options['beautifyFilelist'] && $tagName == 'dir') { + if (!isset($this->_curdir)) { + $this->_curdir = ''; + } + $savedir = $this->_curdir; + if (isset($val['attribs'])) { + if ($val['attribs']['name'] == '/') { + $this->_curdir = '/'; + } else { + if ($this->_curdir == '/') { + $this->_curdir = ''; + } + $this->_curdir .= '/' . $val['attribs']['name']; + } + } + } + $string .= $this->_serializeValue( $val, $tagName, $attributes); + if ($this->options['beautifyFilelist'] && $tagName == 'dir') { + $string .= ' <!-- ' . $this->_curdir . ' -->'; + if (empty($savedir)) { + unset($this->_curdir); + } else { + $this->_curdir = $savedir; + } + } + + $string .= $this->options['linebreak']; + // do indentation + if ($this->options['indent'] !== null && $this->_tagDepth > 0) { + $string .= str_repeat($this->options['indent'], $this->_tagDepth); + } + } + return rtrim($string); + } + } + + if ($this->options['scalarAsAttributes'] === true) { + foreach ($array as $key => $value) { + if (is_scalar($value) && (XML_Util::isValidName($key) === true)) { + unset($array[$key]); + $attributes[$this->options['prependAttributes'].$key] = $value; + } + } + } + + // check for empty array => create empty tag + if (empty($array)) { + $tag = array( + 'qname' => $tagName, + 'content' => $_content, + 'attributes' => $attributes + ); + + } else { + $this->_tagDepth++; + $tmp = $this->options['linebreak']; + foreach ($array as $key => $value) { + // do indentation + if ($this->options['indent'] !== null && $this->_tagDepth > 0) { + $tmp .= str_repeat($this->options['indent'], $this->_tagDepth); + } + + // copy key + $origKey = $key; + // key cannot be used as tagname => use default tag + $valid = XML_Util::isValidName($key); + if (PEAR::isError($valid)) { + if ($this->options['classAsTagName'] && is_object($value)) { + $key = get_class($value); + } else { + $key = $this->options['defaultTagName']; + } + } + $atts = array(); + if ($this->options['typeHints'] === true) { + $atts[$this->options['typeAttribute']] = gettype($value); + if ($key !== $origKey) { + $atts[$this->options['keyAttribute']] = (string)$origKey; + } + + } + if ($this->options['beautifyFilelist'] && $key == 'dir') { + if (!isset($this->_curdir)) { + $this->_curdir = ''; + } + $savedir = $this->_curdir; + if (isset($value['attribs'])) { + if ($value['attribs']['name'] == '/') { + $this->_curdir = '/'; + } else { + $this->_curdir .= '/' . $value['attribs']['name']; + } + } + } + + if (is_string($value) && $value && ($value{strlen($value) - 1} == "\n")) { + $value .= str_repeat($this->options['indent'], $this->_tagDepth); + } + $tmp .= $this->_createXMLTag(array( + 'qname' => $key, + 'attributes' => $atts, + 'content' => $value ) + ); + if ($this->options['beautifyFilelist'] && $key == 'dir') { + if (isset($value['attribs'])) { + $tmp .= ' <!-- ' . $this->_curdir . ' -->'; + if (empty($savedir)) { + unset($this->_curdir); + } else { + $this->_curdir = $savedir; + } + } + } + $tmp .= $this->options['linebreak']; + } + + $this->_tagDepth--; + if ($this->options['indent']!==null && $this->_tagDepth>0) { + $tmp .= str_repeat($this->options['indent'], $this->_tagDepth); + } + + if (trim($tmp) === '') { + $tmp = null; + } + + $tag = array( + 'qname' => $tagName, + 'content' => $tmp, + 'attributes' => $attributes + ); + } + if ($this->options['typeHints'] === true) { + if (!isset($tag['attributes'][$this->options['typeAttribute']])) { + $tag['attributes'][$this->options['typeAttribute']] = 'array'; + } + } + + $string = $this->_createXMLTag($tag, false); + return $string; + } + + /** + * create a tag from an array + * this method awaits an array in the following format + * array( + * 'qname' => $tagName, + * 'attributes' => array(), + * 'content' => $content, // optional + * 'namespace' => $namespace // optional + * 'namespaceUri' => $namespaceUri // optional + * ) + * + * @access private + * @param array $tag tag definition + * @param boolean $replaceEntities whether to replace XML entities in content or not + * @return string $string XML tag + */ + function _createXMLTag($tag, $replaceEntities = true) + { + if ($this->options['indentAttributes'] !== false) { + $multiline = true; + $indent = str_repeat($this->options['indent'], $this->_tagDepth); + + if ($this->options['indentAttributes'] == '_auto') { + $indent .= str_repeat(' ', (strlen($tag['qname'])+2)); + + } else { + $indent .= $this->options['indentAttributes']; + } + } else { + $indent = $multiline = false; + } + + if (is_array($tag['content'])) { + if (empty($tag['content'])) { + $tag['content'] = ''; + } + } elseif(is_scalar($tag['content']) && (string)$tag['content'] == '') { + $tag['content'] = ''; + } + + if (is_scalar($tag['content']) || is_null($tag['content'])) { + if ($this->options['encoding'] == 'UTF-8' && + version_compare(phpversion(), '5.0.0', 'lt') + ) { + $tag['content'] = utf8_encode($tag['content']); + } + + if ($replaceEntities === true) { + $replaceEntities = XML_UTIL_ENTITIES_XML; + } + + $tag = XML_Util::createTagFromArray($tag, $replaceEntities, $multiline, $indent, $this->options['linebreak']); + } elseif (is_array($tag['content'])) { + $tag = $this->_serializeArray($tag['content'], $tag['qname'], $tag['attributes']); + } elseif (is_object($tag['content'])) { + $tag = $this->_serializeObject($tag['content'], $tag['qname'], $tag['attributes']); + } elseif (is_resource($tag['content'])) { + settype($tag['content'], 'string'); + $tag = XML_Util::createTagFromArray($tag, $replaceEntities); + } + return $tag; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Parser/v1.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Parser/v1.php new file mode 100644 index 0000000000000000000000000000000000000000..23395dc757a230e68b7273adc376fa444a82738e --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Parser/v1.php @@ -0,0 +1,459 @@ +<?php +/** + * package.xml parsing class, package.xml version 1.0 + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: v1.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * package.xml abstraction class + */ +require_once 'PEAR/PackageFile/v1.php'; +/** + * Parser for package.xml version 1.0 + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @PEAR-VER@ + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_PackageFile_Parser_v1 +{ + var $_registry; + var $_config; + var $_logger; + /** + * BC hack to allow PEAR_Common::infoFromString() to sort of + * work with the version 2.0 format - there's no filelist though + * @param PEAR_PackageFile_v2 + */ + function fromV2($packagefile) + { + $info = $packagefile->getArray(true); + $ret = new PEAR_PackageFile_v1; + $ret->fromArray($info['old']); + } + + function setConfig(&$c) + { + $this->_config = &$c; + $this->_registry = &$c->getRegistry(); + } + + function setLogger(&$l) + { + $this->_logger = &$l; + } + + /** + * @param string contents of package.xml file, version 1.0 + * @return bool success of parsing + */ + function &parse($data, $file, $archive = false) + { + if (!extension_loaded('xml')) { + return PEAR::raiseError('Cannot create xml parser for parsing package.xml, no xml extension'); + } + $xp = xml_parser_create(); + if (!$xp) { + $a = &PEAR::raiseError('Cannot create xml parser for parsing package.xml'); + return $a; + } + xml_set_object($xp, $this); + xml_set_element_handler($xp, '_element_start_1_0', '_element_end_1_0'); + xml_set_character_data_handler($xp, '_pkginfo_cdata_1_0'); + xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, false); + + $this->element_stack = array(); + $this->_packageInfo = array('provides' => array()); + $this->current_element = false; + unset($this->dir_install); + $this->_packageInfo['filelist'] = array(); + $this->filelist =& $this->_packageInfo['filelist']; + $this->dir_names = array(); + $this->in_changelog = false; + $this->d_i = 0; + $this->cdata = ''; + $this->_isValid = true; + + if (!xml_parse($xp, $data, 1)) { + $code = xml_get_error_code($xp); + $line = xml_get_current_line_number($xp); + xml_parser_free($xp); + $a = &PEAR::raiseError(sprintf("XML error: %s at line %d", + $str = xml_error_string($code), $line), 2); + return $a; + } + + xml_parser_free($xp); + + $pf = new PEAR_PackageFile_v1; + $pf->setConfig($this->_config); + if (isset($this->_logger)) { + $pf->setLogger($this->_logger); + } + $pf->setPackagefile($file, $archive); + $pf->fromArray($this->_packageInfo); + return $pf; + } + // {{{ _unIndent() + + /** + * Unindent given string + * + * @param string $str The string that has to be unindented. + * @return string + * @access private + */ + function _unIndent($str) + { + // remove leading newlines + $str = preg_replace('/^[\r\n]+/', '', $str); + // find whitespace at the beginning of the first line + $indent_len = strspn($str, " \t"); + $indent = substr($str, 0, $indent_len); + $data = ''; + // remove the same amount of whitespace from following lines + foreach (explode("\n", $str) as $line) { + if (substr($line, 0, $indent_len) == $indent) { + $data .= substr($line, $indent_len) . "\n"; + } elseif (trim(substr($line, 0, $indent_len))) { + $data .= ltrim($line); + } + } + return $data; + } + + // Support for package DTD v1.0: + // {{{ _element_start_1_0() + + /** + * XML parser callback for ending elements. Used for version 1.0 + * packages. + * + * @param resource $xp XML parser resource + * @param string $name name of ending element + * + * @return void + * + * @access private + */ + function _element_start_1_0($xp, $name, $attribs) + { + array_push($this->element_stack, $name); + $this->current_element = $name; + $spos = sizeof($this->element_stack) - 2; + $this->prev_element = ($spos >= 0) ? $this->element_stack[$spos] : ''; + $this->current_attributes = $attribs; + $this->cdata = ''; + switch ($name) { + case 'dir': + if ($this->in_changelog) { + break; + } + if (array_key_exists('name', $attribs) && $attribs['name'] != '/') { + $attribs['name'] = preg_replace(array('!\\\\+!', '!/+!'), array('/', '/'), + $attribs['name']); + if (strrpos($attribs['name'], '/') === strlen($attribs['name']) - 1) { + $attribs['name'] = substr($attribs['name'], 0, + strlen($attribs['name']) - 1); + } + if (strpos($attribs['name'], '/') === 0) { + $attribs['name'] = substr($attribs['name'], 1); + } + $this->dir_names[] = $attribs['name']; + } + if (isset($attribs['baseinstalldir'])) { + $this->dir_install = $attribs['baseinstalldir']; + } + if (isset($attribs['role'])) { + $this->dir_role = $attribs['role']; + } + break; + case 'file': + if ($this->in_changelog) { + break; + } + if (isset($attribs['name'])) { + $path = ''; + if (count($this->dir_names)) { + foreach ($this->dir_names as $dir) { + $path .= $dir . '/'; + } + } + $path .= preg_replace(array('!\\\\+!', '!/+!'), array('/', '/'), + $attribs['name']); + unset($attribs['name']); + $this->current_path = $path; + $this->filelist[$path] = $attribs; + // Set the baseinstalldir only if the file don't have this attrib + if (!isset($this->filelist[$path]['baseinstalldir']) && + isset($this->dir_install)) + { + $this->filelist[$path]['baseinstalldir'] = $this->dir_install; + } + // Set the Role + if (!isset($this->filelist[$path]['role']) && isset($this->dir_role)) { + $this->filelist[$path]['role'] = $this->dir_role; + } + } + break; + case 'replace': + if (!$this->in_changelog) { + $this->filelist[$this->current_path]['replacements'][] = $attribs; + } + break; + case 'maintainers': + $this->_packageInfo['maintainers'] = array(); + $this->m_i = 0; // maintainers array index + break; + case 'maintainer': + // compatibility check + if (!isset($this->_packageInfo['maintainers'])) { + $this->_packageInfo['maintainers'] = array(); + $this->m_i = 0; + } + $this->_packageInfo['maintainers'][$this->m_i] = array(); + $this->current_maintainer =& $this->_packageInfo['maintainers'][$this->m_i]; + break; + case 'changelog': + $this->_packageInfo['changelog'] = array(); + $this->c_i = 0; // changelog array index + $this->in_changelog = true; + break; + case 'release': + if ($this->in_changelog) { + $this->_packageInfo['changelog'][$this->c_i] = array(); + $this->current_release = &$this->_packageInfo['changelog'][$this->c_i]; + } else { + $this->current_release = &$this->_packageInfo; + } + break; + case 'deps': + if (!$this->in_changelog) { + $this->_packageInfo['release_deps'] = array(); + } + break; + case 'dep': + // dependencies array index + if (!$this->in_changelog) { + $this->d_i++; + isset($attribs['type']) ? ($attribs['type'] = strtolower($attribs['type'])) : false; + $this->_packageInfo['release_deps'][$this->d_i] = $attribs; + } + break; + case 'configureoptions': + if (!$this->in_changelog) { + $this->_packageInfo['configure_options'] = array(); + } + break; + case 'configureoption': + if (!$this->in_changelog) { + $this->_packageInfo['configure_options'][] = $attribs; + } + break; + case 'provides': + if (empty($attribs['type']) || empty($attribs['name'])) { + break; + } + $attribs['explicit'] = true; + $this->_packageInfo['provides']["$attribs[type];$attribs[name]"] = $attribs; + break; + case 'package' : + if (isset($attribs['version'])) { + $this->_packageInfo['xsdversion'] = trim($attribs['version']); + } else { + $this->_packageInfo['xsdversion'] = '1.0'; + } + if (isset($attribs['packagerversion'])) { + $this->_packageInfo['packagerversion'] = $attribs['packagerversion']; + } + break; + } + } + + // }}} + // {{{ _element_end_1_0() + + /** + * XML parser callback for ending elements. Used for version 1.0 + * packages. + * + * @param resource $xp XML parser resource + * @param string $name name of ending element + * + * @return void + * + * @access private + */ + function _element_end_1_0($xp, $name) + { + $data = trim($this->cdata); + switch ($name) { + case 'name': + switch ($this->prev_element) { + case 'package': + $this->_packageInfo['package'] = $data; + break; + case 'maintainer': + $this->current_maintainer['name'] = $data; + break; + } + break; + case 'extends' : + $this->_packageInfo['extends'] = $data; + break; + case 'summary': + $this->_packageInfo['summary'] = $data; + break; + case 'description': + $data = $this->_unIndent($this->cdata); + $this->_packageInfo['description'] = $data; + break; + case 'user': + $this->current_maintainer['handle'] = $data; + break; + case 'email': + $this->current_maintainer['email'] = $data; + break; + case 'role': + $this->current_maintainer['role'] = $data; + break; + case 'version': + if ($this->in_changelog) { + $this->current_release['version'] = $data; + } else { + $this->_packageInfo['version'] = $data; + } + break; + case 'date': + if ($this->in_changelog) { + $this->current_release['release_date'] = $data; + } else { + $this->_packageInfo['release_date'] = $data; + } + break; + case 'notes': + // try to "de-indent" release notes in case someone + // has been over-indenting their xml ;-) + // Trim only on the right side + $data = rtrim($this->_unIndent($this->cdata)); + if ($this->in_changelog) { + $this->current_release['release_notes'] = $data; + } else { + $this->_packageInfo['release_notes'] = $data; + } + break; + case 'warnings': + if ($this->in_changelog) { + $this->current_release['release_warnings'] = $data; + } else { + $this->_packageInfo['release_warnings'] = $data; + } + break; + case 'state': + if ($this->in_changelog) { + $this->current_release['release_state'] = $data; + } else { + $this->_packageInfo['release_state'] = $data; + } + break; + case 'license': + if ($this->in_changelog) { + $this->current_release['release_license'] = $data; + } else { + $this->_packageInfo['release_license'] = $data; + } + break; + case 'dep': + if ($data && !$this->in_changelog) { + $this->_packageInfo['release_deps'][$this->d_i]['name'] = $data; + } + break; + case 'dir': + if ($this->in_changelog) { + break; + } + array_pop($this->dir_names); + break; + case 'file': + if ($this->in_changelog) { + break; + } + if ($data) { + $path = ''; + if (count($this->dir_names)) { + foreach ($this->dir_names as $dir) { + $path .= $dir . '/'; + } + } + $path .= $data; + $this->filelist[$path] = $this->current_attributes; + // Set the baseinstalldir only if the file don't have this attrib + if (!isset($this->filelist[$path]['baseinstalldir']) && + isset($this->dir_install)) + { + $this->filelist[$path]['baseinstalldir'] = $this->dir_install; + } + // Set the Role + if (!isset($this->filelist[$path]['role']) && isset($this->dir_role)) { + $this->filelist[$path]['role'] = $this->dir_role; + } + } + break; + case 'maintainer': + if (empty($this->_packageInfo['maintainers'][$this->m_i]['role'])) { + $this->_packageInfo['maintainers'][$this->m_i]['role'] = 'lead'; + } + $this->m_i++; + break; + case 'release': + if ($this->in_changelog) { + $this->c_i++; + } + break; + case 'changelog': + $this->in_changelog = false; + break; + } + array_pop($this->element_stack); + $spos = sizeof($this->element_stack) - 1; + $this->current_element = ($spos > 0) ? $this->element_stack[$spos] : ''; + $this->cdata = ''; + } + + // }}} + // {{{ _pkginfo_cdata_1_0() + + /** + * XML parser callback for character data. Used for version 1.0 + * packages. + * + * @param resource $xp XML parser resource + * @param string $name character data + * + * @return void + * + * @access private + */ + function _pkginfo_cdata_1_0($xp, $data) + { + if (isset($this->cdata)) { + $this->cdata .= $data; + } + } + + // }}} +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Parser/v2.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Parser/v2.php new file mode 100644 index 0000000000000000000000000000000000000000..a3ba7063f2b481549a2e7a66a3fd0f078e9affaa --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/Parser/v2.php @@ -0,0 +1,113 @@ +<?php +/** + * package.xml parsing class, package.xml version 2.0 + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: v2.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * base xml parser class + */ +require_once 'PEAR/XMLParser.php'; +require_once 'PEAR/PackageFile/v2.php'; +/** + * Parser for package.xml version 2.0 + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @PEAR-VER@ + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_PackageFile_Parser_v2 extends PEAR_XMLParser +{ + var $_config; + var $_logger; + var $_registry; + + function setConfig(&$c) + { + $this->_config = &$c; + $this->_registry = &$c->getRegistry(); + } + + function setLogger(&$l) + { + $this->_logger = &$l; + } + /** + * Unindent given string + * + * @param string $str The string that has to be unindented. + * @return string + * @access private + */ + function _unIndent($str) + { + // remove leading newlines + $str = preg_replace('/^[\r\n]+/', '', $str); + // find whitespace at the beginning of the first line + $indent_len = strspn($str, " \t"); + $indent = substr($str, 0, $indent_len); + $data = ''; + // remove the same amount of whitespace from following lines + foreach (explode("\n", $str) as $line) { + if (substr($line, 0, $indent_len) == $indent) { + $data .= substr($line, $indent_len) . "\n"; + } else { + $data .= $line . "\n"; + } + } + return $data; + } + + /** + * post-process data + * + * @param string $data + * @param string $element element name + */ + function postProcess($data, $element) + { + if ($element == 'notes') { + return trim($this->_unIndent($data)); + } + return trim($data); + } + + /** + * @param string + * @param string file name of the package.xml + * @param string|false name of the archive this package.xml came from, if any + * @param string class name to instantiate and return. This must be PEAR_PackageFile_v2 or + * a subclass + * @return PEAR_PackageFile_v2 + */ + function &parse($data, $file, $archive = false, $class = 'PEAR_PackageFile_v2') + { + if (PEAR::isError($err = parent::parse($data, $file))) { + return $err; + } + + $ret = new $class; + $ret->encoding = $this->encoding; + $ret->setConfig($this->_config); + if (isset($this->_logger)) { + $ret->setLogger($this->_logger); + } + + $ret->fromArray($this->_unserializedData); + $ret->setPackagefile($file, $archive); + return $ret; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v1.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v1.php new file mode 100644 index 0000000000000000000000000000000000000000..43e346bcdac9adabe0d17e39953a06150d376341 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v1.php @@ -0,0 +1,1612 @@ +<?php +/** + * PEAR_PackageFile_v1, package.xml version 1.0 + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: v1.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * For error handling + */ +require_once 'PEAR/ErrorStack.php'; + +/** + * Error code if parsing is attempted with no xml extension + */ +define('PEAR_PACKAGEFILE_ERROR_NO_XML_EXT', 3); + +/** + * Error code if creating the xml parser resource fails + */ +define('PEAR_PACKAGEFILE_ERROR_CANT_MAKE_PARSER', 4); + +/** + * Error code used for all sax xml parsing errors + */ +define('PEAR_PACKAGEFILE_ERROR_PARSER_ERROR', 5); + +/** + * Error code used when there is no name + */ +define('PEAR_PACKAGEFILE_ERROR_NO_NAME', 6); + +/** + * Error code when a package name is not valid + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_NAME', 7); + +/** + * Error code used when no summary is parsed + */ +define('PEAR_PACKAGEFILE_ERROR_NO_SUMMARY', 8); + +/** + * Error code for summaries that are more than 1 line + */ +define('PEAR_PACKAGEFILE_ERROR_MULTILINE_SUMMARY', 9); + +/** + * Error code used when no description is present + */ +define('PEAR_PACKAGEFILE_ERROR_NO_DESCRIPTION', 10); + +/** + * Error code used when no license is present + */ +define('PEAR_PACKAGEFILE_ERROR_NO_LICENSE', 11); + +/** + * Error code used when a <version> version number is not present + */ +define('PEAR_PACKAGEFILE_ERROR_NO_VERSION', 12); + +/** + * Error code used when a <version> version number is invalid + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_VERSION', 13); + +/** + * Error code when release state is missing + */ +define('PEAR_PACKAGEFILE_ERROR_NO_STATE', 14); + +/** + * Error code when release state is invalid + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_STATE', 15); + +/** + * Error code when release state is missing + */ +define('PEAR_PACKAGEFILE_ERROR_NO_DATE', 16); + +/** + * Error code when release state is invalid + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_DATE', 17); + +/** + * Error code when no release notes are found + */ +define('PEAR_PACKAGEFILE_ERROR_NO_NOTES', 18); + +/** + * Error code when no maintainers are found + */ +define('PEAR_PACKAGEFILE_ERROR_NO_MAINTAINERS', 19); + +/** + * Error code when a maintainer has no handle + */ +define('PEAR_PACKAGEFILE_ERROR_NO_MAINTHANDLE', 20); + +/** + * Error code when a maintainer has no handle + */ +define('PEAR_PACKAGEFILE_ERROR_NO_MAINTROLE', 21); + +/** + * Error code when a maintainer has no name + */ +define('PEAR_PACKAGEFILE_ERROR_NO_MAINTNAME', 22); + +/** + * Error code when a maintainer has no email + */ +define('PEAR_PACKAGEFILE_ERROR_NO_MAINTEMAIL', 23); + +/** + * Error code when a maintainer has no handle + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_MAINTROLE', 24); + +/** + * Error code when a dependency is not a PHP dependency, but has no name + */ +define('PEAR_PACKAGEFILE_ERROR_NO_DEPNAME', 25); + +/** + * Error code when a dependency has no type (pkg, php, etc.) + */ +define('PEAR_PACKAGEFILE_ERROR_NO_DEPTYPE', 26); + +/** + * Error code when a dependency has no relation (lt, ge, has, etc.) + */ +define('PEAR_PACKAGEFILE_ERROR_NO_DEPREL', 27); + +/** + * Error code when a dependency is not a 'has' relation, but has no version + */ +define('PEAR_PACKAGEFILE_ERROR_NO_DEPVERSION', 28); + +/** + * Error code when a dependency has an invalid relation + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_DEPREL', 29); + +/** + * Error code when a dependency has an invalid type + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_DEPTYPE', 30); + +/** + * Error code when a dependency has an invalid optional option + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_DEPOPTIONAL', 31); + +/** + * Error code when a dependency is a pkg dependency, and has an invalid package name + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_DEPNAME', 32); + +/** + * Error code when a dependency has a channel="foo" attribute, and foo is not a registered channel + */ +define('PEAR_PACKAGEFILE_ERROR_UNKNOWN_DEPCHANNEL', 33); + +/** + * Error code when rel="has" and version attribute is present. + */ +define('PEAR_PACKAGEFILE_ERROR_DEPVERSION_IGNORED', 34); + +/** + * Error code when type="php" and dependency name is present + */ +define('PEAR_PACKAGEFILE_ERROR_DEPNAME_IGNORED', 35); + +/** + * Error code when a configure option has no name + */ +define('PEAR_PACKAGEFILE_ERROR_NO_CONFNAME', 36); + +/** + * Error code when a configure option has no name + */ +define('PEAR_PACKAGEFILE_ERROR_NO_CONFPROMPT', 37); + +/** + * Error code when a file in the filelist has an invalid role + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_FILEROLE', 38); + +/** + * Error code when a file in the filelist has no role + */ +define('PEAR_PACKAGEFILE_ERROR_NO_FILEROLE', 39); + +/** + * Error code when analyzing a php source file that has parse errors + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_PHPFILE', 40); + +/** + * Error code when analyzing a php source file reveals a source element + * without a package name prefix + */ +define('PEAR_PACKAGEFILE_ERROR_NO_PNAME_PREFIX', 41); + +/** + * Error code when an unknown channel is specified + */ +define('PEAR_PACKAGEFILE_ERROR_UNKNOWN_CHANNEL', 42); + +/** + * Error code when no files are found in the filelist + */ +define('PEAR_PACKAGEFILE_ERROR_NO_FILES', 43); + +/** + * Error code when a file is not valid php according to _analyzeSourceCode() + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_FILE', 44); + +/** + * Error code when the channel validator returns an error or warning + */ +define('PEAR_PACKAGEFILE_ERROR_CHANNELVAL', 45); + +/** + * Error code when a php5 package is packaged in php4 (analysis doesn't work) + */ +define('PEAR_PACKAGEFILE_ERROR_PHP5', 46); + +/** + * Error code when a file is listed in package.xml but does not exist + */ +define('PEAR_PACKAGEFILE_ERROR_FILE_NOTFOUND', 47); + +/** + * Error code when a <dep type="php" rel="not"... is encountered (use rel="ne") + */ +define('PEAR_PACKAGEFILE_PHP_NO_NOT', 48); + +/** + * Error code when a package.xml contains non-ISO-8859-1 characters + */ +define('PEAR_PACKAGEFILE_ERROR_NON_ISO_CHARS', 49); + +/** + * Error code when a dependency is not a 'has' relation, but has no version + */ +define('PEAR_PACKAGEFILE_ERROR_NO_DEPPHPVERSION', 50); + +/** + * Error code when a package has no lead developer + */ +define('PEAR_PACKAGEFILE_ERROR_NO_LEAD', 51); + +/** + * Error code when a filename begins with "." + */ +define('PEAR_PACKAGEFILE_ERROR_INVALID_FILENAME', 52); +/** + * package.xml encapsulator + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_PackageFile_v1 +{ + /** + * @access private + * @var PEAR_ErrorStack + * @access private + */ + var $_stack; + + /** + * A registry object, used to access the package name validation regex for non-standard channels + * @var PEAR_Registry + * @access private + */ + var $_registry; + + /** + * An object that contains a log method that matches PEAR_Common::log's signature + * @var object + * @access private + */ + var $_logger; + + /** + * Parsed package information + * @var array + * @access private + */ + var $_packageInfo; + + /** + * path to package.xml + * @var string + * @access private + */ + var $_packageFile; + + /** + * path to package .tgz or false if this is a local/extracted package.xml + * @var string + * @access private + */ + var $_archiveFile; + + /** + * @var int + * @access private + */ + var $_isValid = 0; + + /** + * Determines whether this packagefile was initialized only with partial package info + * + * If this package file was constructed via parsing REST, it will only contain + * + * - package name + * - channel name + * - dependencies + * @var boolean + * @access private + */ + var $_incomplete = true; + + /** + * @param bool determines whether to return a PEAR_Error object, or use the PEAR_ErrorStack + * @param string Name of Error Stack class to use. + */ + function PEAR_PackageFile_v1() + { + $this->_stack = &new PEAR_ErrorStack('PEAR_PackageFile_v1'); + $this->_stack->setErrorMessageTemplate($this->_getErrorMessage()); + $this->_isValid = 0; + } + + function installBinary($installer) + { + return false; + } + + function isExtension($name) + { + return false; + } + + function setConfig(&$config) + { + $this->_config = &$config; + $this->_registry = &$config->getRegistry(); + } + + function setRequestedGroup() + { + // placeholder + } + + /** + * For saving in the registry. + * + * Set the last version that was installed + * @param string + */ + function setLastInstalledVersion($version) + { + $this->_packageInfo['_lastversion'] = $version; + } + + /** + * @return string|false + */ + function getLastInstalledVersion() + { + if (isset($this->_packageInfo['_lastversion'])) { + return $this->_packageInfo['_lastversion']; + } + return false; + } + + function getInstalledBinary() + { + return false; + } + + function listPostinstallScripts() + { + return false; + } + + function initPostinstallScripts() + { + return false; + } + + function setLogger(&$logger) + { + if ($logger && (!is_object($logger) || !method_exists($logger, 'log'))) { + return PEAR::raiseError('Logger must be compatible with PEAR_Common::log'); + } + $this->_logger = &$logger; + } + + function setPackagefile($file, $archive = false) + { + $this->_packageFile = $file; + $this->_archiveFile = $archive ? $archive : $file; + } + + function getPackageFile() + { + return isset($this->_packageFile) ? $this->_packageFile : false; + } + + function getPackageType() + { + return 'php'; + } + + function getArchiveFile() + { + return $this->_archiveFile; + } + + function packageInfo($field) + { + if (!is_string($field) || empty($field) || + !isset($this->_packageInfo[$field])) { + return false; + } + return $this->_packageInfo[$field]; + } + + function setDirtree($path) + { + if (!isset($this->_packageInfo['dirtree'])) { + $this->_packageInfo['dirtree'] = array(); + } + $this->_packageInfo['dirtree'][$path] = true; + } + + function getDirtree() + { + if (isset($this->_packageInfo['dirtree']) && count($this->_packageInfo['dirtree'])) { + return $this->_packageInfo['dirtree']; + } + return false; + } + + function resetDirtree() + { + unset($this->_packageInfo['dirtree']); + } + + function fromArray($pinfo) + { + $this->_incomplete = false; + $this->_packageInfo = $pinfo; + } + + function isIncomplete() + { + return $this->_incomplete; + } + + function getChannel() + { + return 'pear.php.net'; + } + + function getUri() + { + return false; + } + + function getTime() + { + return false; + } + + function getExtends() + { + if (isset($this->_packageInfo['extends'])) { + return $this->_packageInfo['extends']; + } + return false; + } + + /** + * @return array + */ + function toArray() + { + if (!$this->validate(PEAR_VALIDATE_NORMAL)) { + return false; + } + return $this->getArray(); + } + + function getArray() + { + return $this->_packageInfo; + } + + function getName() + { + return $this->getPackage(); + } + + function getPackage() + { + if (isset($this->_packageInfo['package'])) { + return $this->_packageInfo['package']; + } + return false; + } + + /** + * WARNING - don't use this unless you know what you are doing + */ + function setRawPackage($package) + { + $this->_packageInfo['package'] = $package; + } + + function setPackage($package) + { + $this->_packageInfo['package'] = $package; + $this->_isValid = false; + } + + function getVersion() + { + if (isset($this->_packageInfo['version'])) { + return $this->_packageInfo['version']; + } + return false; + } + + function setVersion($version) + { + $this->_packageInfo['version'] = $version; + $this->_isValid = false; + } + + function clearMaintainers() + { + unset($this->_packageInfo['maintainers']); + } + + function getMaintainers() + { + if (isset($this->_packageInfo['maintainers'])) { + return $this->_packageInfo['maintainers']; + } + return false; + } + + /** + * Adds a new maintainer - no checking of duplicates is performed, use + * updatemaintainer for that purpose. + */ + function addMaintainer($role, $handle, $name, $email) + { + $this->_packageInfo['maintainers'][] = + array('handle' => $handle, 'role' => $role, 'email' => $email, 'name' => $name); + $this->_isValid = false; + } + + function updateMaintainer($role, $handle, $name, $email) + { + $found = false; + if (!isset($this->_packageInfo['maintainers']) || + !is_array($this->_packageInfo['maintainers'])) { + return $this->addMaintainer($role, $handle, $name, $email); + } + foreach ($this->_packageInfo['maintainers'] as $i => $maintainer) { + if ($maintainer['handle'] == $handle) { + $found = $i; + break; + } + } + if ($found !== false) { + unset($this->_packageInfo['maintainers'][$found]); + $this->_packageInfo['maintainers'] = + array_values($this->_packageInfo['maintainers']); + } + $this->addMaintainer($role, $handle, $name, $email); + } + + function deleteMaintainer($handle) + { + $found = false; + foreach ($this->_packageInfo['maintainers'] as $i => $maintainer) { + if ($maintainer['handle'] == $handle) { + $found = $i; + break; + } + } + if ($found !== false) { + unset($this->_packageInfo['maintainers'][$found]); + $this->_packageInfo['maintainers'] = + array_values($this->_packageInfo['maintainers']); + return true; + } + return false; + } + + function getState() + { + if (isset($this->_packageInfo['release_state'])) { + return $this->_packageInfo['release_state']; + } + return false; + } + + function setRawState($state) + { + $this->_packageInfo['release_state'] = $state; + } + + function setState($state) + { + $this->_packageInfo['release_state'] = $state; + $this->_isValid = false; + } + + function getDate() + { + if (isset($this->_packageInfo['release_date'])) { + return $this->_packageInfo['release_date']; + } + return false; + } + + function setDate($date) + { + $this->_packageInfo['release_date'] = $date; + $this->_isValid = false; + } + + function getLicense() + { + if (isset($this->_packageInfo['release_license'])) { + return $this->_packageInfo['release_license']; + } + return false; + } + + function setLicense($date) + { + $this->_packageInfo['release_license'] = $date; + $this->_isValid = false; + } + + function getSummary() + { + if (isset($this->_packageInfo['summary'])) { + return $this->_packageInfo['summary']; + } + return false; + } + + function setSummary($summary) + { + $this->_packageInfo['summary'] = $summary; + $this->_isValid = false; + } + + function getDescription() + { + if (isset($this->_packageInfo['description'])) { + return $this->_packageInfo['description']; + } + return false; + } + + function setDescription($desc) + { + $this->_packageInfo['description'] = $desc; + $this->_isValid = false; + } + + function getNotes() + { + if (isset($this->_packageInfo['release_notes'])) { + return $this->_packageInfo['release_notes']; + } + return false; + } + + function setNotes($notes) + { + $this->_packageInfo['release_notes'] = $notes; + $this->_isValid = false; + } + + function getDeps() + { + if (isset($this->_packageInfo['release_deps'])) { + return $this->_packageInfo['release_deps']; + } + return false; + } + + /** + * Reset dependencies prior to adding new ones + */ + function clearDeps() + { + unset($this->_packageInfo['release_deps']); + } + + function addPhpDep($version, $rel) + { + $this->_isValid = false; + $this->_packageInfo['release_deps'][] = + array('type' => 'php', + 'rel' => $rel, + 'version' => $version); + } + + function addPackageDep($name, $version, $rel, $optional = 'no') + { + $this->_isValid = false; + $dep = + array('type' => 'pkg', + 'name' => $name, + 'rel' => $rel, + 'optional' => $optional); + if ($rel != 'has' && $rel != 'not') { + $dep['version'] = $version; + } + $this->_packageInfo['release_deps'][] = $dep; + } + + function addExtensionDep($name, $version, $rel, $optional = 'no') + { + $this->_isValid = false; + $this->_packageInfo['release_deps'][] = + array('type' => 'ext', + 'name' => $name, + 'rel' => $rel, + 'version' => $version, + 'optional' => $optional); + } + + /** + * WARNING - do not use this function directly unless you know what you're doing + */ + function setDeps($deps) + { + $this->_packageInfo['release_deps'] = $deps; + } + + function hasDeps() + { + return isset($this->_packageInfo['release_deps']) && + count($this->_packageInfo['release_deps']); + } + + function getDependencyGroup($group) + { + return false; + } + + function isCompatible($pf) + { + return false; + } + + function isSubpackageOf($p) + { + return $p->isSubpackage($this); + } + + function isSubpackage($p) + { + return false; + } + + function dependsOn($package, $channel) + { + if (strtolower($channel) != 'pear.php.net') { + return false; + } + if (!($deps = $this->getDeps())) { + return false; + } + foreach ($deps as $dep) { + if ($dep['type'] != 'pkg') { + continue; + } + if (strtolower($dep['name']) == strtolower($package)) { + return true; + } + } + return false; + } + + function getConfigureOptions() + { + if (isset($this->_packageInfo['configure_options'])) { + return $this->_packageInfo['configure_options']; + } + return false; + } + + function hasConfigureOptions() + { + return isset($this->_packageInfo['configure_options']) && + count($this->_packageInfo['configure_options']); + } + + function addConfigureOption($name, $prompt, $default = false) + { + $o = array('name' => $name, 'prompt' => $prompt); + if ($default !== false) { + $o['default'] = $default; + } + if (!isset($this->_packageInfo['configure_options'])) { + $this->_packageInfo['configure_options'] = array(); + } + $this->_packageInfo['configure_options'][] = $o; + } + + function clearConfigureOptions() + { + unset($this->_packageInfo['configure_options']); + } + + function getProvides() + { + if (isset($this->_packageInfo['provides'])) { + return $this->_packageInfo['provides']; + } + return false; + } + + function getProvidesExtension() + { + return false; + } + + function addFile($dir, $file, $attrs) + { + $dir = preg_replace(array('!\\\\+!', '!/+!'), array('/', '/'), $dir); + if ($dir == '/' || $dir == '') { + $dir = ''; + } else { + $dir .= '/'; + } + $file = $dir . $file; + $file = preg_replace('![\\/]+!', '/', $file); + $this->_packageInfo['filelist'][$file] = $attrs; + } + + function getInstallationFilelist() + { + return $this->getFilelist(); + } + + function getFilelist() + { + if (isset($this->_packageInfo['filelist'])) { + return $this->_packageInfo['filelist']; + } + return false; + } + + function setFileAttribute($file, $attr, $value) + { + $this->_packageInfo['filelist'][$file][$attr] = $value; + } + + function resetFilelist() + { + $this->_packageInfo['filelist'] = array(); + } + + function setInstalledAs($file, $path) + { + if ($path) { + return $this->_packageInfo['filelist'][$file]['installed_as'] = $path; + } + unset($this->_packageInfo['filelist'][$file]['installed_as']); + } + + function installedFile($file, $atts) + { + if (isset($this->_packageInfo['filelist'][$file])) { + $this->_packageInfo['filelist'][$file] = + array_merge($this->_packageInfo['filelist'][$file], $atts); + } else { + $this->_packageInfo['filelist'][$file] = $atts; + } + } + + function getChangelog() + { + if (isset($this->_packageInfo['changelog'])) { + return $this->_packageInfo['changelog']; + } + return false; + } + + function getPackagexmlVersion() + { + return '1.0'; + } + + /** + * Wrapper to {@link PEAR_ErrorStack::getErrors()} + * @param boolean determines whether to purge the error stack after retrieving + * @return array + */ + function getValidationWarnings($purge = true) + { + return $this->_stack->getErrors($purge); + } + + // }}} + /** + * Validation error. Also marks the object contents as invalid + * @param error code + * @param array error information + * @access private + */ + function _validateError($code, $params = array()) + { + $this->_stack->push($code, 'error', $params, false, false, debug_backtrace()); + $this->_isValid = false; + } + + /** + * Validation warning. Does not mark the object contents invalid. + * @param error code + * @param array error information + * @access private + */ + function _validateWarning($code, $params = array()) + { + $this->_stack->push($code, 'warning', $params, false, false, debug_backtrace()); + } + + /** + * @param integer error code + * @access protected + */ + function _getErrorMessage() + { + return array( + PEAR_PACKAGEFILE_ERROR_NO_NAME => + 'Missing Package Name', + PEAR_PACKAGEFILE_ERROR_NO_SUMMARY => + 'No summary found', + PEAR_PACKAGEFILE_ERROR_MULTILINE_SUMMARY => + 'Summary should be on one line', + PEAR_PACKAGEFILE_ERROR_NO_DESCRIPTION => + 'Missing description', + PEAR_PACKAGEFILE_ERROR_NO_LICENSE => + 'Missing license', + PEAR_PACKAGEFILE_ERROR_NO_VERSION => + 'No release version found', + PEAR_PACKAGEFILE_ERROR_NO_STATE => + 'No release state found', + PEAR_PACKAGEFILE_ERROR_NO_DATE => + 'No release date found', + PEAR_PACKAGEFILE_ERROR_NO_NOTES => + 'No release notes found', + PEAR_PACKAGEFILE_ERROR_NO_LEAD => + 'Package must have at least one lead maintainer', + PEAR_PACKAGEFILE_ERROR_NO_MAINTAINERS => + 'No maintainers found, at least one must be defined', + PEAR_PACKAGEFILE_ERROR_NO_MAINTHANDLE => + 'Maintainer %index% has no handle (user ID at channel server)', + PEAR_PACKAGEFILE_ERROR_NO_MAINTROLE => + 'Maintainer %index% has no role', + PEAR_PACKAGEFILE_ERROR_NO_MAINTNAME => + 'Maintainer %index% has no name', + PEAR_PACKAGEFILE_ERROR_NO_MAINTEMAIL => + 'Maintainer %index% has no email', + PEAR_PACKAGEFILE_ERROR_NO_DEPNAME => + 'Dependency %index% is not a php dependency, and has no name', + PEAR_PACKAGEFILE_ERROR_NO_DEPREL => + 'Dependency %index% has no relation (rel)', + PEAR_PACKAGEFILE_ERROR_NO_DEPTYPE => + 'Dependency %index% has no type', + PEAR_PACKAGEFILE_ERROR_DEPNAME_IGNORED => + 'PHP Dependency %index% has a name attribute of "%name%" which will be' . + ' ignored!', + PEAR_PACKAGEFILE_ERROR_NO_DEPVERSION => + 'Dependency %index% is not a rel="has" or rel="not" dependency, ' . + 'and has no version', + PEAR_PACKAGEFILE_ERROR_NO_DEPPHPVERSION => + 'Dependency %index% is a type="php" dependency, ' . + 'and has no version', + PEAR_PACKAGEFILE_ERROR_DEPVERSION_IGNORED => + 'Dependency %index% is a rel="%rel%" dependency, versioning is ignored', + PEAR_PACKAGEFILE_ERROR_INVALID_DEPOPTIONAL => + 'Dependency %index% has invalid optional value "%opt%", should be yes or no', + PEAR_PACKAGEFILE_PHP_NO_NOT => + 'Dependency %index%: php dependencies cannot use "not" rel, use "ne"' . + ' to exclude specific versions', + PEAR_PACKAGEFILE_ERROR_NO_CONFNAME => + 'Configure Option %index% has no name', + PEAR_PACKAGEFILE_ERROR_NO_CONFPROMPT => + 'Configure Option %index% has no prompt', + PEAR_PACKAGEFILE_ERROR_NO_FILES => + 'No files in <filelist> section of package.xml', + PEAR_PACKAGEFILE_ERROR_NO_FILEROLE => + 'File "%file%" has no role, expecting one of "%roles%"', + PEAR_PACKAGEFILE_ERROR_INVALID_FILEROLE => + 'File "%file%" has invalid role "%role%", expecting one of "%roles%"', + PEAR_PACKAGEFILE_ERROR_INVALID_FILENAME => + 'File "%file%" cannot start with ".", cannot package or install', + PEAR_PACKAGEFILE_ERROR_INVALID_PHPFILE => + 'Parser error: invalid PHP found in file "%file%"', + PEAR_PACKAGEFILE_ERROR_NO_PNAME_PREFIX => + 'in %file%: %type% "%name%" not prefixed with package name "%package%"', + PEAR_PACKAGEFILE_ERROR_INVALID_FILE => + 'Parser error: invalid PHP file "%file%"', + PEAR_PACKAGEFILE_ERROR_CHANNELVAL => + 'Channel validator error: field "%field%" - %reason%', + PEAR_PACKAGEFILE_ERROR_PHP5 => + 'Error, PHP5 token encountered in %file%, analysis should be in PHP5', + PEAR_PACKAGEFILE_ERROR_FILE_NOTFOUND => + 'File "%file%" in package.xml does not exist', + PEAR_PACKAGEFILE_ERROR_NON_ISO_CHARS => + 'Package.xml contains non-ISO-8859-1 characters, and may not validate', + ); + } + + /** + * Validate XML package definition file. + * + * @access public + * @return boolean + */ + function validate($state = PEAR_VALIDATE_NORMAL, $nofilechecking = false) + { + if (($this->_isValid & $state) == $state) { + return true; + } + $this->_isValid = true; + $info = $this->_packageInfo; + if (empty($info['package'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_NAME); + $this->_packageName = $pn = 'unknown'; + } else { + $this->_packageName = $pn = $info['package']; + } + + if (empty($info['summary'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_SUMMARY); + } elseif (strpos(trim($info['summary']), "\n") !== false) { + $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_MULTILINE_SUMMARY, + array('summary' => $info['summary'])); + } + if (empty($info['description'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_DESCRIPTION); + } + if (empty($info['release_license'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_LICENSE); + } + if (empty($info['version'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_VERSION); + } + if (empty($info['release_state'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_STATE); + } + if (empty($info['release_date'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_DATE); + } + if (empty($info['release_notes'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_NOTES); + } + if (empty($info['maintainers'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_MAINTAINERS); + } else { + $haslead = false; + $i = 1; + foreach ($info['maintainers'] as $m) { + if (empty($m['handle'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_MAINTHANDLE, + array('index' => $i)); + } + if (empty($m['role'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_MAINTROLE, + array('index' => $i, 'roles' => PEAR_Common::getUserRoles())); + } elseif ($m['role'] == 'lead') { + $haslead = true; + } + if (empty($m['name'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_MAINTNAME, + array('index' => $i)); + } + if (empty($m['email'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_MAINTEMAIL, + array('index' => $i)); + } + $i++; + } + if (!$haslead) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_LEAD); + } + } + if (!empty($info['release_deps'])) { + $i = 1; + foreach ($info['release_deps'] as $d) { + if (!isset($d['type']) || empty($d['type'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_DEPTYPE, + array('index' => $i, 'types' => PEAR_Common::getDependencyTypes())); + continue; + } + if (!isset($d['rel']) || empty($d['rel'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_DEPREL, + array('index' => $i, 'rels' => PEAR_Common::getDependencyRelations())); + continue; + } + if (!empty($d['optional'])) { + if (!in_array($d['optional'], array('yes', 'no'))) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_DEPOPTIONAL, + array('index' => $i, 'opt' => $d['optional'])); + } + } + if ($d['rel'] != 'has' && $d['rel'] != 'not' && empty($d['version'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_DEPVERSION, + array('index' => $i)); + } elseif (($d['rel'] == 'has' || $d['rel'] == 'not') && !empty($d['version'])) { + $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_DEPVERSION_IGNORED, + array('index' => $i, 'rel' => $d['rel'])); + } + if ($d['type'] == 'php' && !empty($d['name'])) { + $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_DEPNAME_IGNORED, + array('index' => $i, 'name' => $d['name'])); + } elseif ($d['type'] != 'php' && empty($d['name'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_DEPNAME, + array('index' => $i)); + } + if ($d['type'] == 'php' && empty($d['version'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_DEPPHPVERSION, + array('index' => $i)); + } + if (($d['rel'] == 'not') && ($d['type'] == 'php')) { + $this->_validateError(PEAR_PACKAGEFILE_PHP_NO_NOT, + array('index' => $i)); + } + $i++; + } + } + if (!empty($info['configure_options'])) { + $i = 1; + foreach ($info['configure_options'] as $c) { + if (empty($c['name'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_CONFNAME, + array('index' => $i)); + } + if (empty($c['prompt'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_CONFPROMPT, + array('index' => $i)); + } + $i++; + } + } + if (empty($info['filelist'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_FILES); + $errors[] = 'no files'; + } else { + foreach ($info['filelist'] as $file => $fa) { + if (empty($fa['role'])) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_NO_FILEROLE, + array('file' => $file, 'roles' => PEAR_Common::getFileRoles())); + continue; + } elseif (!in_array($fa['role'], PEAR_Common::getFileRoles())) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_FILEROLE, + array('file' => $file, 'role' => $fa['role'], 'roles' => PEAR_Common::getFileRoles())); + } + if (preg_match('~/\.\.?(/|\\z)|^\.\.?/~', str_replace('\\', '/', $file))) { + // file contains .. parent directory or . cur directory references + $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_FILENAME, + array('file' => $file)); + } + if (isset($fa['install-as']) && + preg_match('~/\.\.?(/|\\z)|^\.\.?/~', + str_replace('\\', '/', $fa['install-as']))) { + // install-as contains .. parent directory or . cur directory references + $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_FILENAME, + array('file' => $file . ' [installed as ' . $fa['install-as'] . ']')); + } + if (isset($fa['baseinstalldir']) && + preg_match('~/\.\.?(/|\\z)|^\.\.?/~', + str_replace('\\', '/', $fa['baseinstalldir']))) { + // install-as contains .. parent directory or . cur directory references + $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_FILENAME, + array('file' => $file . ' [baseinstalldir ' . $fa['baseinstalldir'] . ']')); + } + } + } + if (isset($this->_registry) && $this->_isValid) { + $chan = $this->_registry->getChannel('pear.php.net'); + if (PEAR::isError($chan)) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_CHANNELVAL, $chan->getMessage()); + return $this->_isValid = 0; + } + $validator = $chan->getValidationObject(); + $validator->setPackageFile($this); + $validator->validate($state); + $failures = $validator->getFailures(); + foreach ($failures['errors'] as $error) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_CHANNELVAL, $error); + } + foreach ($failures['warnings'] as $warning) { + $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_CHANNELVAL, $warning); + } + } + if ($this->_isValid && $state == PEAR_VALIDATE_PACKAGING && !$nofilechecking) { + if ($this->_analyzePhpFiles()) { + $this->_isValid = true; + } + } + if ($this->_isValid) { + return $this->_isValid = $state; + } + return $this->_isValid = 0; + } + + function _analyzePhpFiles() + { + if (!$this->_isValid) { + return false; + } + if (!isset($this->_packageFile)) { + return false; + } + $dir_prefix = dirname($this->_packageFile); + $common = new PEAR_Common; + $log = isset($this->_logger) ? array(&$this->_logger, 'log') : + array($common, 'log'); + $info = $this->getFilelist(); + foreach ($info as $file => $fa) { + if (!file_exists($dir_prefix . DIRECTORY_SEPARATOR . $file)) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_FILE_NOTFOUND, + array('file' => realpath($dir_prefix) . DIRECTORY_SEPARATOR . $file)); + continue; + } + if ($fa['role'] == 'php' && $dir_prefix) { + call_user_func_array($log, array(1, "Analyzing $file")); + $srcinfo = $this->_analyzeSourceCode($dir_prefix . DIRECTORY_SEPARATOR . $file); + if ($srcinfo) { + $this->_buildProvidesArray($srcinfo); + } + } + } + $this->_packageName = $pn = $this->getPackage(); + $pnl = strlen($pn); + if (isset($this->_packageInfo['provides'])) { + foreach ((array) $this->_packageInfo['provides'] as $key => $what) { + if (isset($what['explicit'])) { + // skip conformance checks if the provides entry is + // specified in the package.xml file + continue; + } + extract($what); + if ($type == 'class') { + if (!strncasecmp($name, $pn, $pnl)) { + continue; + } + $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_NO_PNAME_PREFIX, + array('file' => $file, 'type' => $type, 'name' => $name, 'package' => $pn)); + } elseif ($type == 'function') { + if (strstr($name, '::') || !strncasecmp($name, $pn, $pnl)) { + continue; + } + $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_NO_PNAME_PREFIX, + array('file' => $file, 'type' => $type, 'name' => $name, 'package' => $pn)); + } + } + } + return $this->_isValid; + } + + /** + * Get the default xml generator object + * + * @return PEAR_PackageFile_Generator_v1 + */ + function &getDefaultGenerator() + { + if (!class_exists('PEAR_PackageFile_Generator_v1')) { + require_once 'PEAR/PackageFile/Generator/v1.php'; + } + $a = &new PEAR_PackageFile_Generator_v1($this); + return $a; + } + + /** + * Get the contents of a file listed within the package.xml + * @param string + * @return string + */ + function getFileContents($file) + { + if ($this->_archiveFile == $this->_packageFile) { // unpacked + $dir = dirname($this->_packageFile); + $file = $dir . DIRECTORY_SEPARATOR . $file; + $file = str_replace(array('/', '\\'), + array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR), $file); + if (file_exists($file) && is_readable($file)) { + return implode('', file($file)); + } + } else { // tgz + if (!class_exists('Archive_Tar')) { + require_once 'Archive/Tar.php'; + } + $tar = &new Archive_Tar($this->_archiveFile); + $tar->pushErrorHandling(PEAR_ERROR_RETURN); + if ($file != 'package.xml' && $file != 'package2.xml') { + $file = $this->getPackage() . '-' . $this->getVersion() . '/' . $file; + } + $file = $tar->extractInString($file); + $tar->popErrorHandling(); + if (PEAR::isError($file)) { + return PEAR::raiseError("Cannot locate file '$file' in archive"); + } + return $file; + } + } + + // {{{ analyzeSourceCode() + /** + * Analyze the source code of the given PHP file + * + * @param string Filename of the PHP file + * @return mixed + * @access private + */ + function _analyzeSourceCode($file) + { + if (!function_exists("token_get_all")) { + return false; + } + if (!defined('T_DOC_COMMENT')) { + define('T_DOC_COMMENT', T_COMMENT); + } + if (!defined('T_INTERFACE')) { + define('T_INTERFACE', -1); + } + if (!defined('T_IMPLEMENTS')) { + define('T_IMPLEMENTS', -1); + } + if (!$fp = @fopen($file, "r")) { + return false; + } + fclose($fp); + $contents = file_get_contents($file); + $tokens = token_get_all($contents); +/* + for ($i = 0; $i < sizeof($tokens); $i++) { + @list($token, $data) = $tokens[$i]; + if (is_string($token)) { + var_dump($token); + } else { + print token_name($token) . ' '; + var_dump(rtrim($data)); + } + } +*/ + $look_for = 0; + $paren_level = 0; + $bracket_level = 0; + $brace_level = 0; + $lastphpdoc = ''; + $current_class = ''; + $current_interface = ''; + $current_class_level = -1; + $current_function = ''; + $current_function_level = -1; + $declared_classes = array(); + $declared_interfaces = array(); + $declared_functions = array(); + $declared_methods = array(); + $used_classes = array(); + $used_functions = array(); + $extends = array(); + $implements = array(); + $nodeps = array(); + $inquote = false; + $interface = false; + for ($i = 0; $i < sizeof($tokens); $i++) { + if (is_array($tokens[$i])) { + list($token, $data) = $tokens[$i]; + } else { + $token = $tokens[$i]; + $data = ''; + } + if ($inquote) { + if ($token != '"' && $token != T_END_HEREDOC) { + continue; + } else { + $inquote = false; + continue; + } + } + switch ($token) { + case T_WHITESPACE : + continue; + case ';': + if ($interface) { + $current_function = ''; + $current_function_level = -1; + } + break; + case '"': + case T_START_HEREDOC: + $inquote = true; + break; + case T_CURLY_OPEN: + case T_DOLLAR_OPEN_CURLY_BRACES: + case '{': $brace_level++; continue 2; + case '}': + $brace_level--; + if ($current_class_level == $brace_level) { + $current_class = ''; + $current_class_level = -1; + } + if ($current_function_level == $brace_level) { + $current_function = ''; + $current_function_level = -1; + } + continue 2; + case '[': $bracket_level++; continue 2; + case ']': $bracket_level--; continue 2; + case '(': $paren_level++; continue 2; + case ')': $paren_level--; continue 2; + case T_INTERFACE: + $interface = true; + case T_CLASS: + if (($current_class_level != -1) || ($current_function_level != -1)) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_PHPFILE, + array('file' => $file)); + return false; + } + case T_FUNCTION: + case T_NEW: + case T_EXTENDS: + case T_IMPLEMENTS: + $look_for = $token; + continue 2; + case T_STRING: + if (version_compare(zend_version(), '2.0', '<')) { + if (in_array(strtolower($data), + array('public', 'private', 'protected', 'abstract', + 'interface', 'implements', 'throw') + )) { + $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_PHP5, + array($file)); + } + } + if ($look_for == T_CLASS) { + $current_class = $data; + $current_class_level = $brace_level; + $declared_classes[] = $current_class; + } elseif ($look_for == T_INTERFACE) { + $current_interface = $data; + $current_class_level = $brace_level; + $declared_interfaces[] = $current_interface; + } elseif ($look_for == T_IMPLEMENTS) { + $implements[$current_class] = $data; + } elseif ($look_for == T_EXTENDS) { + $extends[$current_class] = $data; + } elseif ($look_for == T_FUNCTION) { + if ($current_class) { + $current_function = "$current_class::$data"; + $declared_methods[$current_class][] = $data; + } elseif ($current_interface) { + $current_function = "$current_interface::$data"; + $declared_methods[$current_interface][] = $data; + } else { + $current_function = $data; + $declared_functions[] = $current_function; + } + $current_function_level = $brace_level; + $m = array(); + } elseif ($look_for == T_NEW) { + $used_classes[$data] = true; + } + $look_for = 0; + continue 2; + case T_VARIABLE: + $look_for = 0; + continue 2; + case T_DOC_COMMENT: + case T_COMMENT: + if (preg_match('!^/\*\*\s!', $data)) { + $lastphpdoc = $data; + if (preg_match_all('/@nodep\s+(\S+)/', $lastphpdoc, $m)) { + $nodeps = array_merge($nodeps, $m[1]); + } + } + continue 2; + case T_DOUBLE_COLON: + if (!($tokens[$i - 1][0] == T_WHITESPACE || $tokens[$i - 1][0] == T_STRING)) { + $this->_validateError(PEAR_PACKAGEFILE_ERROR_INVALID_PHPFILE, + array('file' => $file)); + return false; + } + $class = $tokens[$i - 1][1]; + if (strtolower($class) != 'parent') { + $used_classes[$class] = true; + } + continue 2; + } + } + return array( + "source_file" => $file, + "declared_classes" => $declared_classes, + "declared_interfaces" => $declared_interfaces, + "declared_methods" => $declared_methods, + "declared_functions" => $declared_functions, + "used_classes" => array_diff(array_keys($used_classes), $nodeps), + "inheritance" => $extends, + "implements" => $implements, + ); + } + + /** + * Build a "provides" array from data returned by + * analyzeSourceCode(). The format of the built array is like + * this: + * + * array( + * 'class;MyClass' => 'array('type' => 'class', 'name' => 'MyClass'), + * ... + * ) + * + * + * @param array $srcinfo array with information about a source file + * as returned by the analyzeSourceCode() method. + * + * @return void + * + * @access private + * + */ + function _buildProvidesArray($srcinfo) + { + if (!$this->_isValid) { + return false; + } + $file = basename($srcinfo['source_file']); + $pn = $this->getPackage(); + $pnl = strlen($pn); + foreach ($srcinfo['declared_classes'] as $class) { + $key = "class;$class"; + if (isset($this->_packageInfo['provides'][$key])) { + continue; + } + $this->_packageInfo['provides'][$key] = + array('file'=> $file, 'type' => 'class', 'name' => $class); + if (isset($srcinfo['inheritance'][$class])) { + $this->_packageInfo['provides'][$key]['extends'] = + $srcinfo['inheritance'][$class]; + } + } + foreach ($srcinfo['declared_methods'] as $class => $methods) { + foreach ($methods as $method) { + $function = "$class::$method"; + $key = "function;$function"; + if ($method{0} == '_' || !strcasecmp($method, $class) || + isset($this->_packageInfo['provides'][$key])) { + continue; + } + $this->_packageInfo['provides'][$key] = + array('file'=> $file, 'type' => 'function', 'name' => $function); + } + } + + foreach ($srcinfo['declared_functions'] as $function) { + $key = "function;$function"; + if ($function{0} == '_' || isset($this->_packageInfo['provides'][$key])) { + continue; + } + if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) { + $warnings[] = "in1 " . $file . ": function \"$function\" not prefixed with package name \"$pn\""; + } + $this->_packageInfo['provides'][$key] = + array('file'=> $file, 'type' => 'function', 'name' => $function); + } + } + + // }}} +} +?> diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2.php new file mode 100644 index 0000000000000000000000000000000000000000..1ca412dc8cdb74781d7575e67fe00480864a57f1 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2.php @@ -0,0 +1,2049 @@ +<?php +/** + * PEAR_PackageFile_v2, package.xml version 2.0 + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: v2.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * For error handling + */ +require_once 'PEAR/ErrorStack.php'; +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_PackageFile_v2 +{ + + /** + * Parsed package information + * @var array + * @access private + */ + var $_packageInfo = array(); + + /** + * path to package .tgz or false if this is a local/extracted package.xml + * @var string|false + * @access private + */ + var $_archiveFile; + + /** + * path to package .xml or false if this is an abstract parsed-from-string xml + * @var string|false + * @access private + */ + var $_packageFile; + + /** + * This is used by file analysis routines to log progress information + * @var PEAR_Common + * @access protected + */ + var $_logger; + + /** + * This is set to the highest validation level that has been validated + * + * If the package.xml is invalid or unknown, this is set to 0. If + * normal validation has occurred, this is set to PEAR_VALIDATE_NORMAL. If + * downloading/installation validation has occurred it is set to PEAR_VALIDATE_DOWNLOADING + * or INSTALLING, and so on up to PEAR_VALIDATE_PACKAGING. This allows validation + * "caching" to occur, which is particularly important for package validation, so + * that PHP files are not validated twice + * @var int + * @access private + */ + var $_isValid = 0; + + /** + * True if the filelist has been validated + * @param bool + */ + var $_filesValid = false; + + /** + * @var PEAR_Registry + * @access protected + */ + var $_registry; + + /** + * @var PEAR_Config + * @access protected + */ + var $_config; + + /** + * Optional Dependency group requested for installation + * @var string + * @access private + */ + var $_requestedGroup = false; + + /** + * @var PEAR_ErrorStack + * @access protected + */ + var $_stack; + + /** + * Namespace prefix used for tasks in this package.xml - use tasks: whenever possible + */ + var $_tasksNs; + + /** + * Determines whether this packagefile was initialized only with partial package info + * + * If this package file was constructed via parsing REST, it will only contain + * + * - package name + * - channel name + * - dependencies + * @var boolean + * @access private + */ + var $_incomplete = true; + + /** + * @var PEAR_PackageFile_v2_Validator + */ + var $_v2Validator; + + /** + * The constructor merely sets up the private error stack + */ + function PEAR_PackageFile_v2() + { + $this->_stack = new PEAR_ErrorStack('PEAR_PackageFile_v2', false, null); + $this->_isValid = false; + } + + /** + * To make unit-testing easier + * @param PEAR_Frontend_* + * @param array options + * @param PEAR_Config + * @return PEAR_Downloader + * @access protected + */ + function &getPEARDownloader(&$i, $o, &$c) + { + $z = &new PEAR_Downloader($i, $o, $c); + return $z; + } + + /** + * To make unit-testing easier + * @param PEAR_Config + * @param array options + * @param array package name as returned from {@link PEAR_Registry::parsePackageName()} + * @param int PEAR_VALIDATE_* constant + * @return PEAR_Dependency2 + * @access protected + */ + function &getPEARDependency2(&$c, $o, $p, $s = PEAR_VALIDATE_INSTALLING) + { + if (!class_exists('PEAR_Dependency2')) { + require_once 'PEAR/Dependency2.php'; + } + $z = &new PEAR_Dependency2($c, $o, $p, $s); + return $z; + } + + function getInstalledBinary() + { + return isset($this->_packageInfo['#binarypackage']) ? $this->_packageInfo['#binarypackage'] : + false; + } + + /** + * Installation of source package has failed, attempt to download and install the + * binary version of this package. + * @param PEAR_Installer + * @return array|false + */ + function installBinary(&$installer) + { + if (!OS_WINDOWS) { + $a = false; + return $a; + } + if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') { + $releasetype = $this->getPackageType() . 'release'; + if (!is_array($installer->getInstallPackages())) { + $a = false; + return $a; + } + foreach ($installer->getInstallPackages() as $p) { + if ($p->isExtension($this->_packageInfo['providesextension'])) { + if ($p->getPackageType() != 'extsrc' && $p->getPackageType() != 'zendextsrc') { + $a = false; + return $a; // the user probably downloaded it separately + } + } + } + if (isset($this->_packageInfo[$releasetype]['binarypackage'])) { + $installer->log(0, 'Attempting to download binary version of extension "' . + $this->_packageInfo['providesextension'] . '"'); + $params = $this->_packageInfo[$releasetype]['binarypackage']; + if (!is_array($params) || !isset($params[0])) { + $params = array($params); + } + if (isset($this->_packageInfo['channel'])) { + foreach ($params as $i => $param) { + $params[$i] = array('channel' => $this->_packageInfo['channel'], + 'package' => $param, 'version' => $this->getVersion()); + } + } + $dl = &$this->getPEARDownloader($installer->ui, $installer->getOptions(), + $installer->config); + $verbose = $dl->config->get('verbose'); + $dl->config->set('verbose', -1); + foreach ($params as $param) { + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $ret = $dl->download(array($param)); + PEAR::popErrorHandling(); + if (is_array($ret) && count($ret)) { + break; + } + } + $dl->config->set('verbose', $verbose); + if (is_array($ret)) { + if (count($ret) == 1) { + $pf = $ret[0]->getPackageFile(); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $err = $installer->install($ret[0]); + PEAR::popErrorHandling(); + if (is_array($err)) { + $this->_packageInfo['#binarypackage'] = $ret[0]->getPackage(); + // "install" self, so all dependencies will work transparently + $this->_registry->addPackage2($this); + $installer->log(0, 'Download and install of binary extension "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $pf->getChannel(), + 'package' => $pf->getPackage()), true) . '" successful'); + $a = array($ret[0], $err); + return $a; + } + $installer->log(0, 'Download and install of binary extension "' . + $this->_registry->parsedPackageNameToString( + array('channel' => $pf->getChannel(), + 'package' => $pf->getPackage()), true) . '" failed'); + } + } + } + } + $a = false; + return $a; + } + + /** + * @return string|false Extension name + */ + function getProvidesExtension() + { + if (in_array($this->getPackageType(), + array('extsrc', 'extbin', 'zendextsrc', 'zendextbin'))) { + if (isset($this->_packageInfo['providesextension'])) { + return $this->_packageInfo['providesextension']; + } + } + return false; + } + + /** + * @param string Extension name + * @return bool + */ + function isExtension($extension) + { + if (in_array($this->getPackageType(), + array('extsrc', 'extbin', 'zendextsrc', 'zendextbin'))) { + return $this->_packageInfo['providesextension'] == $extension; + } + return false; + } + + /** + * Tests whether every part of the package.xml 1.0 is represented in + * this package.xml 2.0 + * @param PEAR_PackageFile_v1 + * @return bool + */ + function isEquivalent($pf1) + { + if (!$pf1) { + return true; + } + if ($this->getPackageType() == 'bundle') { + return false; + } + $this->_stack->getErrors(true); + if (!$pf1->validate(PEAR_VALIDATE_NORMAL)) { + return false; + } + $pass = true; + if ($pf1->getPackage() != $this->getPackage()) { + $this->_differentPackage($pf1->getPackage()); + $pass = false; + } + if ($pf1->getVersion() != $this->getVersion()) { + $this->_differentVersion($pf1->getVersion()); + $pass = false; + } + if (trim($pf1->getSummary()) != $this->getSummary()) { + $this->_differentSummary($pf1->getSummary()); + $pass = false; + } + if (preg_replace('/\s+/', '', $pf1->getDescription()) != + preg_replace('/\s+/', '', $this->getDescription())) { + $this->_differentDescription($pf1->getDescription()); + $pass = false; + } + if ($pf1->getState() != $this->getState()) { + $this->_differentState($pf1->getState()); + $pass = false; + } + if (!strstr(preg_replace('/\s+/', '', $this->getNotes()), + preg_replace('/\s+/', '', $pf1->getNotes()))) { + $this->_differentNotes($pf1->getNotes()); + $pass = false; + } + $mymaintainers = $this->getMaintainers(); + $yourmaintainers = $pf1->getMaintainers(); + for ($i1 = 0; $i1 < count($yourmaintainers); $i1++) { + $reset = false; + for ($i2 = 0; $i2 < count($mymaintainers); $i2++) { + if ($mymaintainers[$i2]['handle'] == $yourmaintainers[$i1]['handle']) { + if ($mymaintainers[$i2]['role'] != $yourmaintainers[$i1]['role']) { + $this->_differentRole($mymaintainers[$i2]['handle'], + $yourmaintainers[$i1]['role'], $mymaintainers[$i2]['role']); + $pass = false; + } + if ($mymaintainers[$i2]['email'] != $yourmaintainers[$i1]['email']) { + $this->_differentEmail($mymaintainers[$i2]['handle'], + $yourmaintainers[$i1]['email'], $mymaintainers[$i2]['email']); + $pass = false; + } + if ($mymaintainers[$i2]['name'] != $yourmaintainers[$i1]['name']) { + $this->_differentName($mymaintainers[$i2]['handle'], + $yourmaintainers[$i1]['name'], $mymaintainers[$i2]['name']); + $pass = false; + } + unset($mymaintainers[$i2]); + $mymaintainers = array_values($mymaintainers); + unset($yourmaintainers[$i1]); + $yourmaintainers = array_values($yourmaintainers); + $reset = true; + break; + } + } + if ($reset) { + $i1 = -1; + } + } + $this->_unmatchedMaintainers($mymaintainers, $yourmaintainers); + $filelist = $this->getFilelist(); + foreach ($pf1->getFilelist() as $file => $atts) { + if (!isset($filelist[$file])) { + $this->_missingFile($file); + $pass = false; + } + } + return $pass; + } + + function _differentPackage($package) + { + $this->_stack->push(__FUNCTION__, 'error', array('package' => $package, + 'self' => $this->getPackage()), + 'package.xml 1.0 package "%package%" does not match "%self%"'); + } + + function _differentVersion($version) + { + $this->_stack->push(__FUNCTION__, 'error', array('version' => $version, + 'self' => $this->getVersion()), + 'package.xml 1.0 version "%version%" does not match "%self%"'); + } + + function _differentState($state) + { + $this->_stack->push(__FUNCTION__, 'error', array('state' => $state, + 'self' => $this->getState()), + 'package.xml 1.0 state "%state%" does not match "%self%"'); + } + + function _differentRole($handle, $role, $selfrole) + { + $this->_stack->push(__FUNCTION__, 'error', array('handle' => $handle, + 'role' => $role, 'self' => $selfrole), + 'package.xml 1.0 maintainer "%handle%" role "%role%" does not match "%self%"'); + } + + function _differentEmail($handle, $email, $selfemail) + { + $this->_stack->push(__FUNCTION__, 'error', array('handle' => $handle, + 'email' => $email, 'self' => $selfemail), + 'package.xml 1.0 maintainer "%handle%" email "%email%" does not match "%self%"'); + } + + function _differentName($handle, $name, $selfname) + { + $this->_stack->push(__FUNCTION__, 'error', array('handle' => $handle, + 'name' => $name, 'self' => $selfname), + 'package.xml 1.0 maintainer "%handle%" name "%name%" does not match "%self%"'); + } + + function _unmatchedMaintainers($my, $yours) + { + if ($my) { + array_walk($my, create_function('&$i, $k', '$i = $i["handle"];')); + $this->_stack->push(__FUNCTION__, 'error', array('handles' => $my), + 'package.xml 2.0 has unmatched extra maintainers "%handles%"'); + } + if ($yours) { + array_walk($yours, create_function('&$i, $k', '$i = $i["handle"];')); + $this->_stack->push(__FUNCTION__, 'error', array('handles' => $yours), + 'package.xml 1.0 has unmatched extra maintainers "%handles%"'); + } + } + + function _differentNotes($notes) + { + $truncnotes = strlen($notes) < 25 ? $notes : substr($notes, 0, 24) . '...'; + $truncmynotes = strlen($this->getNotes()) < 25 ? $this->getNotes() : + substr($this->getNotes(), 0, 24) . '...'; + $this->_stack->push(__FUNCTION__, 'error', array('notes' => $truncnotes, + 'self' => $truncmynotes), + 'package.xml 1.0 release notes "%notes%" do not match "%self%"'); + } + + function _differentSummary($summary) + { + $truncsummary = strlen($summary) < 25 ? $summary : substr($summary, 0, 24) . '...'; + $truncmysummary = strlen($this->getsummary()) < 25 ? $this->getSummary() : + substr($this->getsummary(), 0, 24) . '...'; + $this->_stack->push(__FUNCTION__, 'error', array('summary' => $truncsummary, + 'self' => $truncmysummary), + 'package.xml 1.0 summary "%summary%" does not match "%self%"'); + } + + function _differentDescription($description) + { + $truncdescription = trim(strlen($description) < 25 ? $description : substr($description, 0, 24) . '...'); + $truncmydescription = trim(strlen($this->getDescription()) < 25 ? $this->getDescription() : + substr($this->getdescription(), 0, 24) . '...'); + $this->_stack->push(__FUNCTION__, 'error', array('description' => $truncdescription, + 'self' => $truncmydescription), + 'package.xml 1.0 description "%description%" does not match "%self%"'); + } + + function _missingFile($file) + { + $this->_stack->push(__FUNCTION__, 'error', array('file' => $file), + 'package.xml 1.0 file "%file%" is not present in <contents>'); + } + + /** + * WARNING - do not use this function unless you know what you're doing + */ + function setRawState($state) + { + if (!isset($this->_packageInfo['stability'])) { + $this->_packageInfo['stability'] = array(); + } + $this->_packageInfo['stability']['release'] = $state; + } + + /** + * WARNING - do not use this function unless you know what you're doing + */ + function setRawCompatible($compatible) + { + $this->_packageInfo['compatible'] = $compatible; + } + + /** + * WARNING - do not use this function unless you know what you're doing + */ + function setRawPackage($package) + { + $this->_packageInfo['name'] = $package; + } + + /** + * WARNING - do not use this function unless you know what you're doing + */ + function setRawChannel($channel) + { + $this->_packageInfo['channel'] = $channel; + } + + function setRequestedGroup($group) + { + $this->_requestedGroup = $group; + } + + function getRequestedGroup() + { + if (isset($this->_requestedGroup)) { + return $this->_requestedGroup; + } + return false; + } + + /** + * For saving in the registry. + * + * Set the last version that was installed + * @param string + */ + function setLastInstalledVersion($version) + { + $this->_packageInfo['_lastversion'] = $version; + } + + /** + * @return string|false + */ + function getLastInstalledVersion() + { + if (isset($this->_packageInfo['_lastversion'])) { + return $this->_packageInfo['_lastversion']; + } + return false; + } + + /** + * Determines whether this package.xml has post-install scripts or not + * @return array|false + */ + function listPostinstallScripts() + { + $filelist = $this->getFilelist(); + $contents = $this->getContents(); + $contents = $contents['dir']['file']; + if (!is_array($contents) || !isset($contents[0])) { + $contents = array($contents); + } + $taskfiles = array(); + foreach ($contents as $file) { + $atts = $file['attribs']; + unset($file['attribs']); + if (count($file)) { + $taskfiles[$atts['name']] = $file; + } + } + $common = new PEAR_Common; + $common->debug = $this->_config->get('verbose'); + $this->_scripts = array(); + $ret = array(); + foreach ($taskfiles as $name => $tasks) { + if (!isset($filelist[$name])) { + // ignored files will not be in the filelist + continue; + } + $atts = $filelist[$name]; + foreach ($tasks as $tag => $raw) { + $task = $this->getTask($tag); + $task = &new $task($this->_config, $common, PEAR_TASK_INSTALL); + if ($task->isScript()) { + $ret[] = $filelist[$name]['installed_as']; + } + } + } + if (count($ret)) { + return $ret; + } + return false; + } + + /** + * Initialize post-install scripts for running + * + * This method can be used to detect post-install scripts, as the return value + * indicates whether any exist + * @return bool + */ + function initPostinstallScripts() + { + $filelist = $this->getFilelist(); + $contents = $this->getContents(); + $contents = $contents['dir']['file']; + if (!is_array($contents) || !isset($contents[0])) { + $contents = array($contents); + } + $taskfiles = array(); + foreach ($contents as $file) { + $atts = $file['attribs']; + unset($file['attribs']); + if (count($file)) { + $taskfiles[$atts['name']] = $file; + } + } + $common = new PEAR_Common; + $common->debug = $this->_config->get('verbose'); + $this->_scripts = array(); + foreach ($taskfiles as $name => $tasks) { + if (!isset($filelist[$name])) { + // file was not installed due to installconditions + continue; + } + $atts = $filelist[$name]; + foreach ($tasks as $tag => $raw) { + $taskname = $this->getTask($tag); + $task = &new $taskname($this->_config, $common, PEAR_TASK_INSTALL); + if (!$task->isScript()) { + continue; // scripts are only handled after installation + } + $lastversion = isset($this->_packageInfo['_lastversion']) ? + $this->_packageInfo['_lastversion'] : null; + $task->init($raw, $atts, $lastversion); + $res = $task->startSession($this, $atts['installed_as']); + if (!$res) { + continue; // skip this file + } + if (PEAR::isError($res)) { + return $res; + } + $assign = &$task; + $this->_scripts[] = &$assign; + } + } + if (count($this->_scripts)) { + return true; + } + return false; + } + + function runPostinstallScripts() + { + if ($this->initPostinstallScripts()) { + $ui = &PEAR_Frontend::singleton(); + if ($ui) { + $ui->runPostinstallScripts($this->_scripts, $this); + } + } + } + + + /** + * Convert a recursive set of <dir> and <file> tags into a single <dir> tag with + * <file> tags. + */ + function flattenFilelist() + { + if (isset($this->_packageInfo['bundle'])) { + return; + } + $filelist = array(); + if (isset($this->_packageInfo['contents']['dir']['dir'])) { + $this->_getFlattenedFilelist($filelist, $this->_packageInfo['contents']['dir']); + if (!isset($filelist[1])) { + $filelist = $filelist[0]; + } + $this->_packageInfo['contents']['dir']['file'] = $filelist; + unset($this->_packageInfo['contents']['dir']['dir']); + } else { + // else already flattened but check for baseinstalldir propagation + if (isset($this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'])) { + if (isset($this->_packageInfo['contents']['dir']['file'][0])) { + foreach ($this->_packageInfo['contents']['dir']['file'] as $i => $file) { + if (isset($file['attribs']['baseinstalldir'])) { + continue; + } + $this->_packageInfo['contents']['dir']['file'][$i]['attribs']['baseinstalldir'] + = $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir']; + } + } else { + if (!isset($this->_packageInfo['contents']['dir']['file']['attribs']['baseinstalldir'])) { + $this->_packageInfo['contents']['dir']['file']['attribs']['baseinstalldir'] + = $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir']; + } + } + } + } + } + + /** + * @param array the final flattened file list + * @param array the current directory being processed + * @param string|false any recursively inherited baeinstalldir attribute + * @param string private recursion variable + * @return array + * @access protected + */ + function _getFlattenedFilelist(&$files, $dir, $baseinstall = false, $path = '') + { + if (isset($dir['attribs']) && isset($dir['attribs']['baseinstalldir'])) { + $baseinstall = $dir['attribs']['baseinstalldir']; + } + if (isset($dir['dir'])) { + if (!isset($dir['dir'][0])) { + $dir['dir'] = array($dir['dir']); + } + foreach ($dir['dir'] as $subdir) { + if (!isset($subdir['attribs']) || !isset($subdir['attribs']['name'])) { + $name = '*unknown*'; + } else { + $name = $subdir['attribs']['name']; + } + $newpath = empty($path) ? $name : + $path . '/' . $name; + $this->_getFlattenedFilelist($files, $subdir, + $baseinstall, $newpath); + } + } + if (isset($dir['file'])) { + if (!isset($dir['file'][0])) { + $dir['file'] = array($dir['file']); + } + foreach ($dir['file'] as $file) { + $attrs = $file['attribs']; + $name = $attrs['name']; + if ($baseinstall && !isset($attrs['baseinstalldir'])) { + $attrs['baseinstalldir'] = $baseinstall; + } + $attrs['name'] = empty($path) ? $name : $path . '/' . $name; + $attrs['name'] = preg_replace(array('!\\\\+!', '!/+!'), array('/', '/'), + $attrs['name']); + $file['attribs'] = $attrs; + $files[] = $file; + } + } + } + + function setConfig(&$config) + { + $this->_config = &$config; + $this->_registry = &$config->getRegistry(); + } + + function setLogger(&$logger) + { + if (!is_object($logger) || !method_exists($logger, 'log')) { + return PEAR::raiseError('Logger must be compatible with PEAR_Common::log'); + } + $this->_logger = &$logger; + } + + /** + * WARNING - do not use this function directly unless you know what you're doing + */ + function setDeps($deps) + { + $this->_packageInfo['dependencies'] = $deps; + } + + /** + * WARNING - do not use this function directly unless you know what you're doing + */ + function setCompatible($compat) + { + $this->_packageInfo['compatible'] = $compat; + } + + function setPackagefile($file, $archive = false) + { + $this->_packageFile = $file; + $this->_archiveFile = $archive ? $archive : $file; + } + + /** + * Wrapper to {@link PEAR_ErrorStack::getErrors()} + * @param boolean determines whether to purge the error stack after retrieving + * @return array + */ + function getValidationWarnings($purge = true) + { + return $this->_stack->getErrors($purge); + } + + function getPackageFile() + { + return $this->_packageFile; + } + + function getArchiveFile() + { + return $this->_archiveFile; + } + + + /** + * Directly set the array that defines this packagefile + * + * WARNING: no validation. This should only be performed by internal methods + * inside PEAR or by inputting an array saved from an existing PEAR_PackageFile_v2 + * @param array + */ + function fromArray($pinfo) + { + unset($pinfo['old']); + unset($pinfo['xsdversion']); + // If the changelog isn't an array then it was passed in as an empty tag + if (isset($pinfo['changelog']) && !is_array($pinfo['changelog'])) { + unset($pinfo['changelog']); + } + $this->_incomplete = false; + $this->_packageInfo = $pinfo; + } + + function isIncomplete() + { + return $this->_incomplete; + } + + /** + * @return array + */ + function toArray($forreg = false) + { + if (!$this->validate(PEAR_VALIDATE_NORMAL)) { + return false; + } + return $this->getArray($forreg); + } + + function getArray($forReg = false) + { + if ($forReg) { + $arr = $this->_packageInfo; + $arr['old'] = array(); + $arr['old']['version'] = $this->getVersion(); + $arr['old']['release_date'] = $this->getDate(); + $arr['old']['release_state'] = $this->getState(); + $arr['old']['release_license'] = $this->getLicense(); + $arr['old']['release_notes'] = $this->getNotes(); + $arr['old']['release_deps'] = $this->getDeps(); + $arr['old']['maintainers'] = $this->getMaintainers(); + $arr['xsdversion'] = '2.0'; + return $arr; + } else { + $info = $this->_packageInfo; + unset($info['dirtree']); + if (isset($info['_lastversion'])) { + unset($info['_lastversion']); + } + if (isset($info['#binarypackage'])) { + unset($info['#binarypackage']); + } + return $info; + } + } + + function packageInfo($field) + { + $arr = $this->getArray(true); + if ($field == 'state') { + return $arr['stability']['release']; + } + if ($field == 'api-version') { + return $arr['version']['api']; + } + if ($field == 'api-state') { + return $arr['stability']['api']; + } + if (isset($arr['old'][$field])) { + if (!is_string($arr['old'][$field])) { + return null; + } + return $arr['old'][$field]; + } + if (isset($arr[$field])) { + if (!is_string($arr[$field])) { + return null; + } + return $arr[$field]; + } + return null; + } + + function getName() + { + return $this->getPackage(); + } + + function getPackage() + { + if (isset($this->_packageInfo['name'])) { + return $this->_packageInfo['name']; + } + return false; + } + + function getChannel() + { + if (isset($this->_packageInfo['uri'])) { + return '__uri'; + } + if (isset($this->_packageInfo['channel'])) { + return strtolower($this->_packageInfo['channel']); + } + return false; + } + + function getUri() + { + if (isset($this->_packageInfo['uri'])) { + return $this->_packageInfo['uri']; + } + return false; + } + + function getExtends() + { + if (isset($this->_packageInfo['extends'])) { + return $this->_packageInfo['extends']; + } + return false; + } + + function getSummary() + { + if (isset($this->_packageInfo['summary'])) { + return $this->_packageInfo['summary']; + } + return false; + } + + function getDescription() + { + if (isset($this->_packageInfo['description'])) { + return $this->_packageInfo['description']; + } + return false; + } + + function getMaintainers($raw = false) + { + if (!isset($this->_packageInfo['lead'])) { + return false; + } + if ($raw) { + $ret = array('lead' => $this->_packageInfo['lead']); + (isset($this->_packageInfo['developer'])) ? + $ret['developer'] = $this->_packageInfo['developer'] :null; + (isset($this->_packageInfo['contributor'])) ? + $ret['contributor'] = $this->_packageInfo['contributor'] :null; + (isset($this->_packageInfo['helper'])) ? + $ret['helper'] = $this->_packageInfo['helper'] :null; + return $ret; + } else { + $ret = array(); + $leads = isset($this->_packageInfo['lead'][0]) ? $this->_packageInfo['lead'] : + array($this->_packageInfo['lead']); + foreach ($leads as $lead) { + $s = $lead; + $s['handle'] = $s['user']; + unset($s['user']); + $s['role'] = 'lead'; + $ret[] = $s; + } + if (isset($this->_packageInfo['developer'])) { + $leads = isset($this->_packageInfo['developer'][0]) ? + $this->_packageInfo['developer'] : + array($this->_packageInfo['developer']); + foreach ($leads as $maintainer) { + $s = $maintainer; + $s['handle'] = $s['user']; + unset($s['user']); + $s['role'] = 'developer'; + $ret[] = $s; + } + } + if (isset($this->_packageInfo['contributor'])) { + $leads = isset($this->_packageInfo['contributor'][0]) ? + $this->_packageInfo['contributor'] : + array($this->_packageInfo['contributor']); + foreach ($leads as $maintainer) { + $s = $maintainer; + $s['handle'] = $s['user']; + unset($s['user']); + $s['role'] = 'contributor'; + $ret[] = $s; + } + } + if (isset($this->_packageInfo['helper'])) { + $leads = isset($this->_packageInfo['helper'][0]) ? + $this->_packageInfo['helper'] : + array($this->_packageInfo['helper']); + foreach ($leads as $maintainer) { + $s = $maintainer; + $s['handle'] = $s['user']; + unset($s['user']); + $s['role'] = 'helper'; + $ret[] = $s; + } + } + return $ret; + } + return false; + } + + function getLeads() + { + if (isset($this->_packageInfo['lead'])) { + return $this->_packageInfo['lead']; + } + return false; + } + + function getDevelopers() + { + if (isset($this->_packageInfo['developer'])) { + return $this->_packageInfo['developer']; + } + return false; + } + + function getContributors() + { + if (isset($this->_packageInfo['contributor'])) { + return $this->_packageInfo['contributor']; + } + return false; + } + + function getHelpers() + { + if (isset($this->_packageInfo['helper'])) { + return $this->_packageInfo['helper']; + } + return false; + } + + function setDate($date) + { + if (!isset($this->_packageInfo['date'])) { + // ensure that the extends tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('time', 'version', + 'stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', + 'zendextbinrelease', 'bundle', 'changelog'), array(), 'date'); + } + $this->_packageInfo['date'] = $date; + $this->_isValid = 0; + } + + function setTime($time) + { + $this->_isValid = 0; + if (!isset($this->_packageInfo['time'])) { + // ensure that the time tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('version', + 'stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', + 'zendextbinrelease', 'bundle', 'changelog'), $time, 'time'); + } + $this->_packageInfo['time'] = $time; + } + + function getDate() + { + if (isset($this->_packageInfo['date'])) { + return $this->_packageInfo['date']; + } + return false; + } + + function getTime() + { + if (isset($this->_packageInfo['time'])) { + return $this->_packageInfo['time']; + } + return false; + } + + /** + * @param package|api version category to return + */ + function getVersion($key = 'release') + { + if (isset($this->_packageInfo['version'][$key])) { + return $this->_packageInfo['version'][$key]; + } + return false; + } + + function getStability() + { + if (isset($this->_packageInfo['stability'])) { + return $this->_packageInfo['stability']; + } + return false; + } + + function getState($key = 'release') + { + if (isset($this->_packageInfo['stability'][$key])) { + return $this->_packageInfo['stability'][$key]; + } + return false; + } + + function getLicense($raw = false) + { + if (isset($this->_packageInfo['license'])) { + if ($raw) { + return $this->_packageInfo['license']; + } + if (is_array($this->_packageInfo['license'])) { + return $this->_packageInfo['license']['_content']; + } else { + return $this->_packageInfo['license']; + } + } + return false; + } + + function getLicenseLocation() + { + if (!isset($this->_packageInfo['license']) || !is_array($this->_packageInfo['license'])) { + return false; + } + return $this->_packageInfo['license']['attribs']; + } + + function getNotes() + { + if (isset($this->_packageInfo['notes'])) { + return $this->_packageInfo['notes']; + } + return false; + } + + /** + * Return the <usesrole> tag contents, if any + * @return array|false + */ + function getUsesrole() + { + if (isset($this->_packageInfo['usesrole'])) { + return $this->_packageInfo['usesrole']; + } + return false; + } + + /** + * Return the <usestask> tag contents, if any + * @return array|false + */ + function getUsestask() + { + if (isset($this->_packageInfo['usestask'])) { + return $this->_packageInfo['usestask']; + } + return false; + } + + /** + * This should only be used to retrieve filenames and install attributes + */ + function getFilelist($preserve = false) + { + if (isset($this->_packageInfo['filelist']) && !$preserve) { + return $this->_packageInfo['filelist']; + } + $this->flattenFilelist(); + if ($contents = $this->getContents()) { + $ret = array(); + if (!isset($contents['dir'])) { + return false; + } + if (!isset($contents['dir']['file'][0])) { + $contents['dir']['file'] = array($contents['dir']['file']); + } + foreach ($contents['dir']['file'] as $file) { + $name = $file['attribs']['name']; + if (!$preserve) { + $file = $file['attribs']; + } + $ret[$name] = $file; + } + if (!$preserve) { + $this->_packageInfo['filelist'] = $ret; + } + return $ret; + } + return false; + } + + /** + * Return configure options array, if any + * + * @return array|false + */ + function getConfigureOptions() + { + if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') { + return false; + } + + $releases = $this->getReleases(); + if (isset($releases[0])) { + $releases = $releases[0]; + } + + if (isset($releases['configureoption'])) { + if (!isset($releases['configureoption'][0])) { + $releases['configureoption'] = array($releases['configureoption']); + } + + for ($i = 0; $i < count($releases['configureoption']); $i++) { + $releases['configureoption'][$i] = $releases['configureoption'][$i]['attribs']; + } + + return $releases['configureoption']; + } + + return false; + } + + /** + * This is only used at install-time, after all serialization + * is over. + */ + function resetFilelist() + { + $this->_packageInfo['filelist'] = array(); + } + + /** + * Retrieve a list of files that should be installed on this computer + * @return array + */ + function getInstallationFilelist($forfilecheck = false) + { + $contents = $this->getFilelist(true); + if (isset($contents['dir']['attribs']['baseinstalldir'])) { + $base = $contents['dir']['attribs']['baseinstalldir']; + } + if (isset($this->_packageInfo['bundle'])) { + return PEAR::raiseError( + 'Exception: bundles should be handled in download code only'); + } + $release = $this->getReleases(); + if ($release) { + if (!isset($release[0])) { + if (!isset($release['installconditions']) && !isset($release['filelist'])) { + if ($forfilecheck) { + return $this->getFilelist(); + } + return $contents; + } + $release = array($release); + } + $depchecker = &$this->getPEARDependency2($this->_config, array(), + array('channel' => $this->getChannel(), 'package' => $this->getPackage()), + PEAR_VALIDATE_INSTALLING); + foreach ($release as $instance) { + if (isset($instance['installconditions'])) { + $installconditions = $instance['installconditions']; + if (is_array($installconditions)) { + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + foreach ($installconditions as $type => $conditions) { + if (!isset($conditions[0])) { + $conditions = array($conditions); + } + foreach ($conditions as $condition) { + $ret = $depchecker->{"validate{$type}Dependency"}($condition); + if (PEAR::isError($ret)) { + PEAR::popErrorHandling(); + continue 3; // skip this release + } + } + } + PEAR::popErrorHandling(); + } + } + // this is the release to use + if (isset($instance['filelist'])) { + // ignore files + if (isset($instance['filelist']['ignore'])) { + $ignore = isset($instance['filelist']['ignore'][0]) ? + $instance['filelist']['ignore'] : + array($instance['filelist']['ignore']); + foreach ($ignore as $ig) { + unset ($contents[$ig['attribs']['name']]); + } + } + // install files as this name + if (isset($instance['filelist']['install'])) { + $installas = isset($instance['filelist']['install'][0]) ? + $instance['filelist']['install'] : + array($instance['filelist']['install']); + foreach ($installas as $as) { + $contents[$as['attribs']['name']]['attribs']['install-as'] = + $as['attribs']['as']; + } + } + } + if ($forfilecheck) { + foreach ($contents as $file => $attrs) { + $contents[$file] = $attrs['attribs']; + } + } + return $contents; + } + } else { // simple release - no installconditions or install-as + if ($forfilecheck) { + return $this->getFilelist(); + } + return $contents; + } + // no releases matched + return PEAR::raiseError('No releases in package.xml matched the existing operating ' . + 'system, extensions installed, or architecture, cannot install'); + } + + /** + * This is only used at install-time, after all serialization + * is over. + * @param string file name + * @param string installed path + */ + function setInstalledAs($file, $path) + { + if ($path) { + return $this->_packageInfo['filelist'][$file]['installed_as'] = $path; + } + unset($this->_packageInfo['filelist'][$file]['installed_as']); + } + + function getInstalledLocation($file) + { + if (isset($this->_packageInfo['filelist'][$file]['installed_as'])) { + return $this->_packageInfo['filelist'][$file]['installed_as']; + } + return false; + } + + /** + * This is only used at install-time, after all serialization + * is over. + */ + function installedFile($file, $atts) + { + if (isset($this->_packageInfo['filelist'][$file])) { + $this->_packageInfo['filelist'][$file] = + array_merge($this->_packageInfo['filelist'][$file], $atts['attribs']); + } else { + $this->_packageInfo['filelist'][$file] = $atts['attribs']; + } + } + + /** + * Retrieve the contents tag + */ + function getContents() + { + if (isset($this->_packageInfo['contents'])) { + return $this->_packageInfo['contents']; + } + return false; + } + + /** + * @param string full path to file + * @param string attribute name + * @param string attribute value + * @param int risky but fast - use this to choose a file based on its position in the list + * of files. Index is zero-based like PHP arrays. + * @return bool success of operation + */ + function setFileAttribute($filename, $attr, $value, $index = false) + { + $this->_isValid = 0; + if (in_array($attr, array('role', 'name', 'baseinstalldir'))) { + $this->_filesValid = false; + } + if ($index !== false && + isset($this->_packageInfo['contents']['dir']['file'][$index]['attribs'])) { + $this->_packageInfo['contents']['dir']['file'][$index]['attribs'][$attr] = $value; + return true; + } + if (!isset($this->_packageInfo['contents']['dir']['file'])) { + return false; + } + $files = $this->_packageInfo['contents']['dir']['file']; + if (!isset($files[0])) { + $files = array($files); + $ind = false; + } else { + $ind = true; + } + foreach ($files as $i => $file) { + if (isset($file['attribs'])) { + if ($file['attribs']['name'] == $filename) { + if ($ind) { + $this->_packageInfo['contents']['dir']['file'][$i]['attribs'][$attr] = $value; + } else { + $this->_packageInfo['contents']['dir']['file']['attribs'][$attr] = $value; + } + return true; + } + } + } + return false; + } + + function setDirtree($path) + { + if (!isset($this->_packageInfo['dirtree'])) { + $this->_packageInfo['dirtree'] = array(); + } + $this->_packageInfo['dirtree'][$path] = true; + } + + function getDirtree() + { + if (isset($this->_packageInfo['dirtree']) && count($this->_packageInfo['dirtree'])) { + return $this->_packageInfo['dirtree']; + } + return false; + } + + function resetDirtree() + { + unset($this->_packageInfo['dirtree']); + } + + /** + * Determines whether this package claims it is compatible with the version of + * the package that has a recommended version dependency + * @param PEAR_PackageFile_v2|PEAR_PackageFile_v1|PEAR_Downloader_Package + * @return boolean + */ + function isCompatible($pf) + { + if (!isset($this->_packageInfo['compatible'])) { + return false; + } + if (!isset($this->_packageInfo['channel'])) { + return false; + } + $me = $pf->getVersion(); + $compatible = $this->_packageInfo['compatible']; + if (!isset($compatible[0])) { + $compatible = array($compatible); + } + $found = false; + foreach ($compatible as $info) { + if (strtolower($info['name']) == strtolower($pf->getPackage())) { + if (strtolower($info['channel']) == strtolower($pf->getChannel())) { + $found = true; + break; + } + } + } + if (!$found) { + return false; + } + if (isset($info['exclude'])) { + if (!isset($info['exclude'][0])) { + $info['exclude'] = array($info['exclude']); + } + foreach ($info['exclude'] as $exclude) { + if (version_compare($me, $exclude, '==')) { + return false; + } + } + } + if (version_compare($me, $info['min'], '>=') && version_compare($me, $info['max'], '<=')) { + return true; + } + return false; + } + + /** + * @return array|false + */ + function getCompatible() + { + if (isset($this->_packageInfo['compatible'])) { + return $this->_packageInfo['compatible']; + } + return false; + } + + function getDependencies() + { + if (isset($this->_packageInfo['dependencies'])) { + return $this->_packageInfo['dependencies']; + } + return false; + } + + function isSubpackageOf($p) + { + return $p->isSubpackage($this); + } + + /** + * Determines whether the passed in package is a subpackage of this package. + * + * No version checking is done, only name verification. + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @return bool + */ + function isSubpackage($p) + { + $sub = array(); + if (isset($this->_packageInfo['dependencies']['required']['subpackage'])) { + $sub = $this->_packageInfo['dependencies']['required']['subpackage']; + if (!isset($sub[0])) { + $sub = array($sub); + } + } + if (isset($this->_packageInfo['dependencies']['optional']['subpackage'])) { + $sub1 = $this->_packageInfo['dependencies']['optional']['subpackage']; + if (!isset($sub1[0])) { + $sub1 = array($sub1); + } + $sub = array_merge($sub, $sub1); + } + if (isset($this->_packageInfo['dependencies']['group'])) { + $group = $this->_packageInfo['dependencies']['group']; + if (!isset($group[0])) { + $group = array($group); + } + foreach ($group as $deps) { + if (isset($deps['subpackage'])) { + $sub2 = $deps['subpackage']; + if (!isset($sub2[0])) { + $sub2 = array($sub2); + } + $sub = array_merge($sub, $sub2); + } + } + } + foreach ($sub as $dep) { + if (strtolower($dep['name']) == strtolower($p->getPackage())) { + if (isset($dep['channel'])) { + if (strtolower($dep['channel']) == strtolower($p->getChannel())) { + return true; + } + } else { + if ($dep['uri'] == $p->getURI()) { + return true; + } + } + } + } + return false; + } + + function dependsOn($package, $channel) + { + if (!($deps = $this->getDependencies())) { + return false; + } + foreach (array('package', 'subpackage') as $type) { + foreach (array('required', 'optional') as $needed) { + if (isset($deps[$needed][$type])) { + if (!isset($deps[$needed][$type][0])) { + $deps[$needed][$type] = array($deps[$needed][$type]); + } + foreach ($deps[$needed][$type] as $dep) { + $depchannel = isset($dep['channel']) ? $dep['channel'] : '__uri'; + if (strtolower($dep['name']) == strtolower($package) && + $depchannel == $channel) { + return true; + } + } + } + } + if (isset($deps['group'])) { + if (!isset($deps['group'][0])) { + $dep['group'] = array($deps['group']); + } + foreach ($deps['group'] as $group) { + if (isset($group[$type])) { + if (!is_array($group[$type])) { + $group[$type] = array($group[$type]); + } + foreach ($group[$type] as $dep) { + $depchannel = isset($dep['channel']) ? $dep['channel'] : '__uri'; + if (strtolower($dep['name']) == strtolower($package) && + $depchannel == $channel) { + return true; + } + } + } + } + } + } + return false; + } + + /** + * Get the contents of a dependency group + * @param string + * @return array|false + */ + function getDependencyGroup($name) + { + $name = strtolower($name); + if (!isset($this->_packageInfo['dependencies']['group'])) { + return false; + } + $groups = $this->_packageInfo['dependencies']['group']; + if (!isset($groups[0])) { + $groups = array($groups); + } + foreach ($groups as $group) { + if (strtolower($group['attribs']['name']) == $name) { + return $group; + } + } + return false; + } + + /** + * Retrieve a partial package.xml 1.0 representation of dependencies + * + * a very limited representation of dependencies is returned by this method. + * The <exclude> tag for excluding certain versions of a dependency is + * completely ignored. In addition, dependency groups are ignored, with the + * assumption that all dependencies in dependency groups are also listed in + * the optional group that work with all dependency groups + * @param boolean return package.xml 2.0 <dependencies> tag + * @return array|false + */ + function getDeps($raw = false, $nopearinstaller = false) + { + if (isset($this->_packageInfo['dependencies'])) { + if ($raw) { + return $this->_packageInfo['dependencies']; + } + $ret = array(); + $map = array( + 'php' => 'php', + 'package' => 'pkg', + 'subpackage' => 'pkg', + 'extension' => 'ext', + 'os' => 'os', + 'pearinstaller' => 'pkg', + ); + foreach (array('required', 'optional') as $type) { + $optional = ($type == 'optional') ? 'yes' : 'no'; + if (!isset($this->_packageInfo['dependencies'][$type]) + || empty($this->_packageInfo['dependencies'][$type])) { + continue; + } + foreach ($this->_packageInfo['dependencies'][$type] as $dtype => $deps) { + if ($dtype == 'pearinstaller' && $nopearinstaller) { + continue; + } + if (!isset($deps[0])) { + $deps = array($deps); + } + foreach ($deps as $dep) { + if (!isset($map[$dtype])) { + // no support for arch type + continue; + } + if ($dtype == 'pearinstaller') { + $dep['name'] = 'PEAR'; + $dep['channel'] = 'pear.php.net'; + } + $s = array('type' => $map[$dtype]); + if (isset($dep['channel'])) { + $s['channel'] = $dep['channel']; + } + if (isset($dep['uri'])) { + $s['uri'] = $dep['uri']; + } + if (isset($dep['name'])) { + $s['name'] = $dep['name']; + } + if (isset($dep['conflicts'])) { + $s['rel'] = 'not'; + } else { + if (!isset($dep['min']) && + !isset($dep['max'])) { + $s['rel'] = 'has'; + $s['optional'] = $optional; + } elseif (isset($dep['min']) && + isset($dep['max'])) { + $s['rel'] = 'ge'; + $s1 = $s; + $s1['rel'] = 'le'; + $s['version'] = $dep['min']; + $s1['version'] = $dep['max']; + if (isset($dep['channel'])) { + $s1['channel'] = $dep['channel']; + } + if ($dtype != 'php') { + $s['name'] = $dep['name']; + $s1['name'] = $dep['name']; + } + $s['optional'] = $optional; + $s1['optional'] = $optional; + $ret[] = $s1; + } elseif (isset($dep['min'])) { + if (isset($dep['exclude']) && + $dep['exclude'] == $dep['min']) { + $s['rel'] = 'gt'; + } else { + $s['rel'] = 'ge'; + } + $s['version'] = $dep['min']; + $s['optional'] = $optional; + if ($dtype != 'php') { + $s['name'] = $dep['name']; + } + } elseif (isset($dep['max'])) { + if (isset($dep['exclude']) && + $dep['exclude'] == $dep['max']) { + $s['rel'] = 'lt'; + } else { + $s['rel'] = 'le'; + } + $s['version'] = $dep['max']; + $s['optional'] = $optional; + if ($dtype != 'php') { + $s['name'] = $dep['name']; + } + } + } + $ret[] = $s; + } + } + } + if (count($ret)) { + return $ret; + } + } + return false; + } + + /** + * @return php|extsrc|extbin|zendextsrc|zendextbin|bundle|false + */ + function getPackageType() + { + if (isset($this->_packageInfo['phprelease'])) { + return 'php'; + } + if (isset($this->_packageInfo['extsrcrelease'])) { + return 'extsrc'; + } + if (isset($this->_packageInfo['extbinrelease'])) { + return 'extbin'; + } + if (isset($this->_packageInfo['zendextsrcrelease'])) { + return 'zendextsrc'; + } + if (isset($this->_packageInfo['zendextbinrelease'])) { + return 'zendextbin'; + } + if (isset($this->_packageInfo['bundle'])) { + return 'bundle'; + } + return false; + } + + /** + * @return array|false + */ + function getReleases() + { + $type = $this->getPackageType(); + if ($type != 'bundle') { + $type .= 'release'; + } + if ($this->getPackageType() && isset($this->_packageInfo[$type])) { + return $this->_packageInfo[$type]; + } + return false; + } + + /** + * @return array + */ + function getChangelog() + { + if (isset($this->_packageInfo['changelog'])) { + return $this->_packageInfo['changelog']; + } + return false; + } + + function hasDeps() + { + return isset($this->_packageInfo['dependencies']); + } + + function getPackagexmlVersion() + { + if (isset($this->_packageInfo['zendextsrcrelease'])) { + return '2.1'; + } + if (isset($this->_packageInfo['zendextbinrelease'])) { + return '2.1'; + } + return '2.0'; + } + + /** + * @return array|false + */ + function getSourcePackage() + { + if (isset($this->_packageInfo['extbinrelease']) || + isset($this->_packageInfo['zendextbinrelease'])) { + return array('channel' => $this->_packageInfo['srcchannel'], + 'package' => $this->_packageInfo['srcpackage']); + } + return false; + } + + function getBundledPackages() + { + if (isset($this->_packageInfo['bundle'])) { + return $this->_packageInfo['contents']['bundledpackage']; + } + return false; + } + + function getLastModified() + { + if (isset($this->_packageInfo['_lastmodified'])) { + return $this->_packageInfo['_lastmodified']; + } + return false; + } + + /** + * Get the contents of a file listed within the package.xml + * @param string + * @return string + */ + function getFileContents($file) + { + if ($this->_archiveFile == $this->_packageFile) { // unpacked + $dir = dirname($this->_packageFile); + $file = $dir . DIRECTORY_SEPARATOR . $file; + $file = str_replace(array('/', '\\'), + array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR), $file); + if (file_exists($file) && is_readable($file)) { + return implode('', file($file)); + } + } else { // tgz + $tar = &new Archive_Tar($this->_archiveFile); + $tar->pushErrorHandling(PEAR_ERROR_RETURN); + if ($file != 'package.xml' && $file != 'package2.xml') { + $file = $this->getPackage() . '-' . $this->getVersion() . '/' . $file; + } + $file = $tar->extractInString($file); + $tar->popErrorHandling(); + if (PEAR::isError($file)) { + return PEAR::raiseError("Cannot locate file '$file' in archive"); + } + return $file; + } + } + + function &getRW() + { + if (!class_exists('PEAR_PackageFile_v2_rw')) { + require_once 'PEAR/PackageFile/v2/rw.php'; + } + $a = new PEAR_PackageFile_v2_rw; + foreach (get_object_vars($this) as $name => $unused) { + if (!isset($this->$name)) { + continue; + } + if ($name == '_config' || $name == '_logger'|| $name == '_registry' || + $name == '_stack') { + $a->$name = &$this->$name; + } else { + $a->$name = $this->$name; + } + } + return $a; + } + + function &getDefaultGenerator() + { + if (!class_exists('PEAR_PackageFile_Generator_v2')) { + require_once 'PEAR/PackageFile/Generator/v2.php'; + } + $a = &new PEAR_PackageFile_Generator_v2($this); + return $a; + } + + function analyzeSourceCode($file, $string = false) + { + if (!isset($this->_v2Validator) || + !is_a($this->_v2Validator, 'PEAR_PackageFile_v2_Validator')) { + if (!class_exists('PEAR_PackageFile_v2_Validator')) { + require_once 'PEAR/PackageFile/v2/Validator.php'; + } + $this->_v2Validator = new PEAR_PackageFile_v2_Validator; + } + return $this->_v2Validator->analyzeSourceCode($file, $string); + } + + function validate($state = PEAR_VALIDATE_NORMAL) + { + if (!isset($this->_packageInfo) || !is_array($this->_packageInfo)) { + return false; + } + if (!isset($this->_v2Validator) || + !is_a($this->_v2Validator, 'PEAR_PackageFile_v2_Validator')) { + if (!class_exists('PEAR_PackageFile_v2_Validator')) { + require_once 'PEAR/PackageFile/v2/Validator.php'; + } + $this->_v2Validator = new PEAR_PackageFile_v2_Validator; + } + if (isset($this->_packageInfo['xsdversion'])) { + unset($this->_packageInfo['xsdversion']); + } + return $this->_v2Validator->validate($this, $state); + } + + function getTasksNs() + { + if (!isset($this->_tasksNs)) { + if (isset($this->_packageInfo['attribs'])) { + foreach ($this->_packageInfo['attribs'] as $name => $value) { + if ($value == 'http://pear.php.net/dtd/tasks-1.0') { + $this->_tasksNs = str_replace('xmlns:', '', $name); + break; + } + } + } + } + return $this->_tasksNs; + } + + /** + * Determine whether a task name is a valid task. Custom tasks may be defined + * using subdirectories by putting a "-" in the name, as in <tasks:mycustom-task> + * + * Note that this method will auto-load the task class file and test for the existence + * of the name with "-" replaced by "_" as in PEAR/Task/mycustom/task.php makes class + * PEAR_Task_mycustom_task + * @param string + * @return boolean + */ + function getTask($task) + { + $this->getTasksNs(); + // transform all '-' to '/' and 'tasks:' to '' so tasks:replace becomes replace + $task = str_replace(array($this->_tasksNs . ':', '-'), array('', ' '), $task); + $taskfile = str_replace(' ', '/', ucwords($task)); + $task = str_replace(array(' ', '/'), '_', ucwords($task)); + if (class_exists("PEAR_Task_$task")) { + return "PEAR_Task_$task"; + } + $fp = @fopen("PEAR/Task/$taskfile.php", 'r', true); + if ($fp) { + fclose($fp); + require_once "PEAR/Task/$taskfile.php"; + return "PEAR_Task_$task"; + } + return false; + } + + /** + * Key-friendly array_splice + * @param tagname to splice a value in before + * @param mixed the value to splice in + * @param string the new tag name + */ + function _ksplice($array, $key, $value, $newkey) + { + $offset = array_search($key, array_keys($array)); + $after = array_slice($array, $offset); + $before = array_slice($array, 0, $offset); + $before[$newkey] = $value; + return array_merge($before, $after); + } + + /** + * @param array a list of possible keys, in the order they may occur + * @param mixed contents of the new package.xml tag + * @param string tag name + * @access private + */ + function _insertBefore($array, $keys, $contents, $newkey) + { + foreach ($keys as $key) { + if (isset($array[$key])) { + return $array = $this->_ksplice($array, $key, $contents, $newkey); + } + } + $array[$newkey] = $contents; + return $array; + } + + /** + * @param subsection of {@link $_packageInfo} + * @param array|string tag contents + * @param array format: + * <pre> + * array( + * tagname => array(list of tag names that follow this one), + * childtagname => array(list of child tag names that follow this one), + * ) + * </pre> + * + * This allows construction of nested tags + * @access private + */ + function _mergeTag($manip, $contents, $order) + { + if (count($order)) { + foreach ($order as $tag => $curorder) { + if (!isset($manip[$tag])) { + // ensure that the tag is set up + $manip = $this->_insertBefore($manip, $curorder, array(), $tag); + } + if (count($order) > 1) { + $manip[$tag] = $this->_mergeTag($manip[$tag], $contents, array_slice($order, 1)); + return $manip; + } + } + } else { + return $manip; + } + if (is_array($manip[$tag]) && !empty($manip[$tag]) && isset($manip[$tag][0])) { + $manip[$tag][] = $contents; + } else { + if (!count($manip[$tag])) { + $manip[$tag] = $contents; + } else { + $manip[$tag] = array($manip[$tag]); + $manip[$tag][] = $contents; + } + } + return $manip; + } +} +?> diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2/Validator.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2/Validator.php new file mode 100644 index 0000000000000000000000000000000000000000..33c8eee38767722f71710e79751557008b1539ec --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2/Validator.php @@ -0,0 +1,2154 @@ +<?php +/** + * PEAR_PackageFile_v2, package.xml version 2.0, read/write version + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Validator.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a8 + */ +/** + * Private validation class used by PEAR_PackageFile_v2 - do not use directly, its + * sole purpose is to split up the PEAR/PackageFile/v2.php file to make it smaller + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a8 + * @access private + */ +class PEAR_PackageFile_v2_Validator +{ + /** + * @var array + */ + var $_packageInfo; + /** + * @var PEAR_PackageFile_v2 + */ + var $_pf; + /** + * @var PEAR_ErrorStack + */ + var $_stack; + /** + * @var int + */ + var $_isValid = 0; + /** + * @var int + */ + var $_filesValid = 0; + /** + * @var int + */ + var $_curState = 0; + /** + * @param PEAR_PackageFile_v2 + * @param int + */ + function validate(&$pf, $state = PEAR_VALIDATE_NORMAL) + { + $this->_pf = &$pf; + $this->_curState = $state; + $this->_packageInfo = $this->_pf->getArray(); + $this->_isValid = $this->_pf->_isValid; + $this->_filesValid = $this->_pf->_filesValid; + $this->_stack = &$pf->_stack; + $this->_stack->getErrors(true); + if (($this->_isValid & $state) == $state) { + return true; + } + if (!isset($this->_packageInfo) || !is_array($this->_packageInfo)) { + return false; + } + if (!isset($this->_packageInfo['attribs']['version']) || + ($this->_packageInfo['attribs']['version'] != '2.0' && + $this->_packageInfo['attribs']['version'] != '2.1') + ) { + $this->_noPackageVersion(); + } + $structure = + array( + 'name', + 'channel|uri', + '*extends', // can't be multiple, but this works fine + 'summary', + 'description', + '+lead', // these all need content checks + '*developer', + '*contributor', + '*helper', + 'date', + '*time', + 'version', + 'stability', + 'license->?uri->?filesource', + 'notes', + 'contents', //special validation needed + '*compatible', + 'dependencies', //special validation needed + '*usesrole', + '*usestask', // reserve these for 1.4.0a1 to implement + // this will allow a package.xml to gracefully say it + // needs a certain package installed in order to implement a role or task + '*providesextension', + '*srcpackage|*srcuri', + '+phprelease|+extsrcrelease|+extbinrelease|' . + '+zendextsrcrelease|+zendextbinrelease|bundle', //special validation needed + '*changelog', + ); + $test = $this->_packageInfo; + if (isset($test['dependencies']) && + isset($test['dependencies']['required']) && + isset($test['dependencies']['required']['pearinstaller']) && + isset($test['dependencies']['required']['pearinstaller']['min']) && + version_compare('1.9.4', + $test['dependencies']['required']['pearinstaller']['min'], '<') + ) { + $this->_pearVersionTooLow($test['dependencies']['required']['pearinstaller']['min']); + return false; + } + // ignore post-installation array fields + if (array_key_exists('filelist', $test)) { + unset($test['filelist']); + } + if (array_key_exists('_lastmodified', $test)) { + unset($test['_lastmodified']); + } + if (array_key_exists('#binarypackage', $test)) { + unset($test['#binarypackage']); + } + if (array_key_exists('old', $test)) { + unset($test['old']); + } + if (array_key_exists('_lastversion', $test)) { + unset($test['_lastversion']); + } + if (!$this->_stupidSchemaValidate($structure, $test, '<package>')) { + return false; + } + if (empty($this->_packageInfo['name'])) { + $this->_tagCannotBeEmpty('name'); + } + $test = isset($this->_packageInfo['uri']) ? 'uri' :'channel'; + if (empty($this->_packageInfo[$test])) { + $this->_tagCannotBeEmpty($test); + } + if (is_array($this->_packageInfo['license']) && + (!isset($this->_packageInfo['license']['_content']) || + empty($this->_packageInfo['license']['_content']))) { + $this->_tagCannotBeEmpty('license'); + } elseif (empty($this->_packageInfo['license'])) { + $this->_tagCannotBeEmpty('license'); + } + if (empty($this->_packageInfo['summary'])) { + $this->_tagCannotBeEmpty('summary'); + } + if (empty($this->_packageInfo['description'])) { + $this->_tagCannotBeEmpty('description'); + } + if (empty($this->_packageInfo['date'])) { + $this->_tagCannotBeEmpty('date'); + } + if (empty($this->_packageInfo['notes'])) { + $this->_tagCannotBeEmpty('notes'); + } + if (isset($this->_packageInfo['time']) && empty($this->_packageInfo['time'])) { + $this->_tagCannotBeEmpty('time'); + } + if (isset($this->_packageInfo['dependencies'])) { + $this->_validateDependencies(); + } + if (isset($this->_packageInfo['compatible'])) { + $this->_validateCompatible(); + } + if (!isset($this->_packageInfo['bundle'])) { + if (empty($this->_packageInfo['contents'])) { + $this->_tagCannotBeEmpty('contents'); + } + if (!isset($this->_packageInfo['contents']['dir'])) { + $this->_filelistMustContainDir('contents'); + return false; + } + if (isset($this->_packageInfo['contents']['file'])) { + $this->_filelistCannotContainFile('contents'); + return false; + } + } + $this->_validateMaintainers(); + $this->_validateStabilityVersion(); + $fail = false; + if (array_key_exists('usesrole', $this->_packageInfo)) { + $roles = $this->_packageInfo['usesrole']; + if (!is_array($roles) || !isset($roles[0])) { + $roles = array($roles); + } + foreach ($roles as $role) { + if (!isset($role['role'])) { + $this->_usesroletaskMustHaveRoleTask('usesrole', 'role'); + $fail = true; + } else { + if (!isset($role['channel'])) { + if (!isset($role['uri'])) { + $this->_usesroletaskMustHaveChannelOrUri($role['role'], 'usesrole'); + $fail = true; + } + } elseif (!isset($role['package'])) { + $this->_usesroletaskMustHavePackage($role['role'], 'usesrole'); + $fail = true; + } + } + } + } + if (array_key_exists('usestask', $this->_packageInfo)) { + $roles = $this->_packageInfo['usestask']; + if (!is_array($roles) || !isset($roles[0])) { + $roles = array($roles); + } + foreach ($roles as $role) { + if (!isset($role['task'])) { + $this->_usesroletaskMustHaveRoleTask('usestask', 'task'); + $fail = true; + } else { + if (!isset($role['channel'])) { + if (!isset($role['uri'])) { + $this->_usesroletaskMustHaveChannelOrUri($role['task'], 'usestask'); + $fail = true; + } + } elseif (!isset($role['package'])) { + $this->_usesroletaskMustHavePackage($role['task'], 'usestask'); + $fail = true; + } + } + } + } + + if ($fail) { + return false; + } + + $list = $this->_packageInfo['contents']; + if (isset($list['dir']) && is_array($list['dir']) && isset($list['dir'][0])) { + $this->_multipleToplevelDirNotAllowed(); + return $this->_isValid = 0; + } + + $this->_validateFilelist(); + $this->_validateRelease(); + if (!$this->_stack->hasErrors()) { + $chan = $this->_pf->_registry->getChannel($this->_pf->getChannel(), true); + if (PEAR::isError($chan)) { + $this->_unknownChannel($this->_pf->getChannel()); + } else { + $valpack = $chan->getValidationPackage(); + // for channel validator packages, always use the default PEAR validator. + // otherwise, they can't be installed or packaged + $validator = $chan->getValidationObject($this->_pf->getPackage()); + if (!$validator) { + $this->_stack->push(__FUNCTION__, 'error', + array('channel' => $chan->getName(), + 'package' => $this->_pf->getPackage(), + 'name' => $valpack['_content'], + 'version' => $valpack['attribs']['version']), + 'package "%channel%/%package%" cannot be properly validated without ' . + 'validation package "%channel%/%name%-%version%"'); + return $this->_isValid = 0; + } + $validator->setPackageFile($this->_pf); + $validator->validate($state); + $failures = $validator->getFailures(); + foreach ($failures['errors'] as $error) { + $this->_stack->push(__FUNCTION__, 'error', $error, + 'Channel validator error: field "%field%" - %reason%'); + } + foreach ($failures['warnings'] as $warning) { + $this->_stack->push(__FUNCTION__, 'warning', $warning, + 'Channel validator warning: field "%field%" - %reason%'); + } + } + } + + $this->_pf->_isValid = $this->_isValid = !$this->_stack->hasErrors('error'); + if ($this->_isValid && $state == PEAR_VALIDATE_PACKAGING && !$this->_filesValid) { + if ($this->_pf->getPackageType() == 'bundle') { + if ($this->_analyzeBundledPackages()) { + $this->_filesValid = $this->_pf->_filesValid = true; + } else { + $this->_pf->_isValid = $this->_isValid = 0; + } + } else { + if (!$this->_analyzePhpFiles()) { + $this->_pf->_isValid = $this->_isValid = 0; + } else { + $this->_filesValid = $this->_pf->_filesValid = true; + } + } + } + + if ($this->_isValid) { + return $this->_pf->_isValid = $this->_isValid = $state; + } + + return $this->_pf->_isValid = $this->_isValid = 0; + } + + function _stupidSchemaValidate($structure, $xml, $root) + { + if (!is_array($xml)) { + $xml = array(); + } + $keys = array_keys($xml); + reset($keys); + $key = current($keys); + while ($key == 'attribs' || $key == '_contents') { + $key = next($keys); + } + $unfoundtags = $optionaltags = array(); + $ret = true; + $mismatch = false; + foreach ($structure as $struc) { + if ($key) { + $tag = $xml[$key]; + } + $test = $this->_processStructure($struc); + if (isset($test['choices'])) { + $loose = true; + foreach ($test['choices'] as $choice) { + if ($key == $choice['tag']) { + $key = next($keys); + while ($key == 'attribs' || $key == '_contents') { + $key = next($keys); + } + $unfoundtags = $optionaltags = array(); + $mismatch = false; + if ($key && $key != $choice['tag'] && isset($choice['multiple'])) { + $unfoundtags[] = $choice['tag']; + $optionaltags[] = $choice['tag']; + if ($key) { + $mismatch = true; + } + } + $ret &= $this->_processAttribs($choice, $tag, $root); + continue 2; + } else { + $unfoundtags[] = $choice['tag']; + $mismatch = true; + } + if (!isset($choice['multiple']) || $choice['multiple'] != '*') { + $loose = false; + } else { + $optionaltags[] = $choice['tag']; + } + } + if (!$loose) { + $this->_invalidTagOrder($unfoundtags, $key, $root); + return false; + } + } else { + if ($key != $test['tag']) { + if (isset($test['multiple']) && $test['multiple'] != '*') { + $unfoundtags[] = $test['tag']; + $this->_invalidTagOrder($unfoundtags, $key, $root); + return false; + } else { + if ($key) { + $mismatch = true; + } + $unfoundtags[] = $test['tag']; + $optionaltags[] = $test['tag']; + } + if (!isset($test['multiple'])) { + $this->_invalidTagOrder($unfoundtags, $key, $root); + return false; + } + continue; + } else { + $unfoundtags = $optionaltags = array(); + $mismatch = false; + } + $key = next($keys); + while ($key == 'attribs' || $key == '_contents') { + $key = next($keys); + } + if ($key && $key != $test['tag'] && isset($test['multiple'])) { + $unfoundtags[] = $test['tag']; + $optionaltags[] = $test['tag']; + $mismatch = true; + } + $ret &= $this->_processAttribs($test, $tag, $root); + continue; + } + } + if (!$mismatch && count($optionaltags)) { + // don't error out on any optional tags + $unfoundtags = array_diff($unfoundtags, $optionaltags); + } + if (count($unfoundtags)) { + $this->_invalidTagOrder($unfoundtags, $key, $root); + } elseif ($key) { + // unknown tags + $this->_invalidTagOrder('*no tags allowed here*', $key, $root); + while ($key = next($keys)) { + $this->_invalidTagOrder('*no tags allowed here*', $key, $root); + } + } + return $ret; + } + + function _processAttribs($choice, $tag, $context) + { + if (isset($choice['attribs'])) { + if (!is_array($tag)) { + $tag = array($tag); + } + $tags = $tag; + if (!isset($tags[0])) { + $tags = array($tags); + } + $ret = true; + foreach ($tags as $i => $tag) { + if (!is_array($tag) || !isset($tag['attribs'])) { + foreach ($choice['attribs'] as $attrib) { + if ($attrib{0} != '?') { + $ret &= $this->_tagHasNoAttribs($choice['tag'], + $context); + continue 2; + } + } + } + foreach ($choice['attribs'] as $attrib) { + if ($attrib{0} != '?') { + if (!isset($tag['attribs'][$attrib])) { + $ret &= $this->_tagMissingAttribute($choice['tag'], + $attrib, $context); + } + } + } + } + return $ret; + } + return true; + } + + function _processStructure($key) + { + $ret = array(); + if (count($pieces = explode('|', $key)) > 1) { + $ret['choices'] = array(); + foreach ($pieces as $piece) { + $ret['choices'][] = $this->_processStructure($piece); + } + return $ret; + } + $multi = $key{0}; + if ($multi == '+' || $multi == '*') { + $ret['multiple'] = $key{0}; + $key = substr($key, 1); + } + if (count($attrs = explode('->', $key)) > 1) { + $ret['tag'] = array_shift($attrs); + $ret['attribs'] = $attrs; + } else { + $ret['tag'] = $key; + } + return $ret; + } + + function _validateStabilityVersion() + { + $structure = array('release', 'api'); + $a = $this->_stupidSchemaValidate($structure, $this->_packageInfo['version'], '<version>'); + $a &= $this->_stupidSchemaValidate($structure, $this->_packageInfo['stability'], '<stability>'); + if ($a) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $this->_packageInfo['version']['release'])) { + $this->_invalidVersion('release', $this->_packageInfo['version']['release']); + } + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $this->_packageInfo['version']['api'])) { + $this->_invalidVersion('api', $this->_packageInfo['version']['api']); + } + if (!in_array($this->_packageInfo['stability']['release'], + array('snapshot', 'devel', 'alpha', 'beta', 'stable'))) { + $this->_invalidState('release', $this->_packageInfo['stability']['release']); + } + if (!in_array($this->_packageInfo['stability']['api'], + array('devel', 'alpha', 'beta', 'stable'))) { + $this->_invalidState('api', $this->_packageInfo['stability']['api']); + } + } + } + + function _validateMaintainers() + { + $structure = + array( + 'name', + 'user', + 'email', + 'active', + ); + foreach (array('lead', 'developer', 'contributor', 'helper') as $type) { + if (!isset($this->_packageInfo[$type])) { + continue; + } + if (isset($this->_packageInfo[$type][0])) { + foreach ($this->_packageInfo[$type] as $lead) { + $this->_stupidSchemaValidate($structure, $lead, '<' . $type . '>'); + } + } else { + $this->_stupidSchemaValidate($structure, $this->_packageInfo[$type], + '<' . $type . '>'); + } + } + } + + function _validatePhpDep($dep, $installcondition = false) + { + $structure = array( + 'min', + '*max', + '*exclude', + ); + $type = $installcondition ? '<installcondition><php>' : '<dependencies><required><php>'; + $this->_stupidSchemaValidate($structure, $dep, $type); + if (isset($dep['min'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?\\z/', + $dep['min'])) { + $this->_invalidVersion($type . '<min>', $dep['min']); + } + } + if (isset($dep['max'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?\\z/', + $dep['max'])) { + $this->_invalidVersion($type . '<max>', $dep['max']); + } + } + if (isset($dep['exclude'])) { + if (!is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + foreach ($dep['exclude'] as $exclude) { + if (!preg_match( + '/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?\\z/', + $exclude)) { + $this->_invalidVersion($type . '<exclude>', $exclude); + } + } + } + } + + function _validatePearinstallerDep($dep) + { + $structure = array( + 'min', + '*max', + '*recommended', + '*exclude', + ); + $this->_stupidSchemaValidate($structure, $dep, '<dependencies><required><pearinstaller>'); + if (isset($dep['min'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['min'])) { + $this->_invalidVersion('<dependencies><required><pearinstaller><min>', + $dep['min']); + } + } + if (isset($dep['max'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['max'])) { + $this->_invalidVersion('<dependencies><required><pearinstaller><max>', + $dep['max']); + } + } + if (isset($dep['recommended'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['recommended'])) { + $this->_invalidVersion('<dependencies><required><pearinstaller><recommended>', + $dep['recommended']); + } + } + if (isset($dep['exclude'])) { + if (!is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + foreach ($dep['exclude'] as $exclude) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $exclude)) { + $this->_invalidVersion('<dependencies><required><pearinstaller><exclude>', + $exclude); + } + } + } + } + + function _validatePackageDep($dep, $group, $type = '<package>') + { + if (isset($dep['uri'])) { + if (isset($dep['conflicts'])) { + $structure = array( + 'name', + 'uri', + 'conflicts', + '*providesextension', + ); + } else { + $structure = array( + 'name', + 'uri', + '*providesextension', + ); + } + } else { + if (isset($dep['conflicts'])) { + $structure = array( + 'name', + 'channel', + '*min', + '*max', + '*exclude', + 'conflicts', + '*providesextension', + ); + } else { + $structure = array( + 'name', + 'channel', + '*min', + '*max', + '*recommended', + '*exclude', + '*nodefault', + '*providesextension', + ); + } + } + if (isset($dep['name'])) { + $type .= '<name>' . $dep['name'] . '</name>'; + } + $this->_stupidSchemaValidate($structure, $dep, '<dependencies>' . $group . $type); + if (isset($dep['uri']) && (isset($dep['min']) || isset($dep['max']) || + isset($dep['recommended']) || isset($dep['exclude']))) { + $this->_uriDepsCannotHaveVersioning('<dependencies>' . $group . $type); + } + if (isset($dep['channel']) && strtolower($dep['channel']) == '__uri') { + $this->_DepchannelCannotBeUri('<dependencies>' . $group . $type); + } + if (isset($dep['min'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['min'])) { + $this->_invalidVersion('<dependencies>' . $group . $type . '<min>', $dep['min']); + } + } + if (isset($dep['max'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['max'])) { + $this->_invalidVersion('<dependencies>' . $group . $type . '<max>', $dep['max']); + } + } + if (isset($dep['recommended'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['recommended'])) { + $this->_invalidVersion('<dependencies>' . $group . $type . '<recommended>', + $dep['recommended']); + } + } + if (isset($dep['exclude'])) { + if (!is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + foreach ($dep['exclude'] as $exclude) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $exclude)) { + $this->_invalidVersion('<dependencies>' . $group . $type . '<exclude>', + $exclude); + } + } + } + } + + function _validateSubpackageDep($dep, $group) + { + $this->_validatePackageDep($dep, $group, '<subpackage>'); + if (isset($dep['providesextension'])) { + $this->_subpackageCannotProvideExtension(isset($dep['name']) ? $dep['name'] : ''); + } + if (isset($dep['conflicts'])) { + $this->_subpackagesCannotConflict(isset($dep['name']) ? $dep['name'] : ''); + } + } + + function _validateExtensionDep($dep, $group = false, $installcondition = false) + { + if (isset($dep['conflicts'])) { + $structure = array( + 'name', + '*min', + '*max', + '*exclude', + 'conflicts', + ); + } else { + $structure = array( + 'name', + '*min', + '*max', + '*recommended', + '*exclude', + ); + } + if ($installcondition) { + $type = '<installcondition><extension>'; + } else { + $type = '<dependencies>' . $group . '<extension>'; + } + if (isset($dep['name'])) { + $type .= '<name>' . $dep['name'] . '</name>'; + } + $this->_stupidSchemaValidate($structure, $dep, $type); + if (isset($dep['min'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['min'])) { + $this->_invalidVersion(substr($type, 1) . '<min', $dep['min']); + } + } + if (isset($dep['max'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['max'])) { + $this->_invalidVersion(substr($type, 1) . '<max', $dep['max']); + } + } + if (isset($dep['recommended'])) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $dep['recommended'])) { + $this->_invalidVersion(substr($type, 1) . '<recommended', $dep['recommended']); + } + } + if (isset($dep['exclude'])) { + if (!is_array($dep['exclude'])) { + $dep['exclude'] = array($dep['exclude']); + } + foreach ($dep['exclude'] as $exclude) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $exclude)) { + $this->_invalidVersion(substr($type, 1) . '<exclude', $exclude); + } + } + } + } + + function _validateOsDep($dep, $installcondition = false) + { + $structure = array( + 'name', + '*conflicts', + ); + $type = $installcondition ? '<installcondition><os>' : '<dependencies><required><os>'; + if ($this->_stupidSchemaValidate($structure, $dep, $type)) { + if ($dep['name'] == '*') { + if (array_key_exists('conflicts', $dep)) { + $this->_cannotConflictWithAllOs($type); + } + } + } + } + + function _validateArchDep($dep, $installcondition = false) + { + $structure = array( + 'pattern', + '*conflicts', + ); + $type = $installcondition ? '<installcondition><arch>' : '<dependencies><required><arch>'; + $this->_stupidSchemaValidate($structure, $dep, $type); + } + + function _validateInstallConditions($cond, $release) + { + $structure = array( + '*php', + '*extension', + '*os', + '*arch', + ); + if (!$this->_stupidSchemaValidate($structure, + $cond, $release)) { + return false; + } + foreach (array('php', 'extension', 'os', 'arch') as $type) { + if (isset($cond[$type])) { + $iter = $cond[$type]; + if (!is_array($iter) || !isset($iter[0])) { + $iter = array($iter); + } + foreach ($iter as $package) { + if ($type == 'extension') { + $this->{"_validate{$type}Dep"}($package, false, true); + } else { + $this->{"_validate{$type}Dep"}($package, true); + } + } + } + } + } + + function _validateDependencies() + { + $structure = array( + 'required', + '*optional', + '*group->name->hint' + ); + if (!$this->_stupidSchemaValidate($structure, + $this->_packageInfo['dependencies'], '<dependencies>')) { + return false; + } + foreach (array('required', 'optional') as $simpledep) { + if (isset($this->_packageInfo['dependencies'][$simpledep])) { + if ($simpledep == 'optional') { + $structure = array( + '*package', + '*subpackage', + '*extension', + ); + } else { + $structure = array( + 'php', + 'pearinstaller', + '*package', + '*subpackage', + '*extension', + '*os', + '*arch', + ); + } + if ($this->_stupidSchemaValidate($structure, + $this->_packageInfo['dependencies'][$simpledep], + "<dependencies><$simpledep>")) { + foreach (array('package', 'subpackage', 'extension') as $type) { + if (isset($this->_packageInfo['dependencies'][$simpledep][$type])) { + $iter = $this->_packageInfo['dependencies'][$simpledep][$type]; + if (!isset($iter[0])) { + $iter = array($iter); + } + foreach ($iter as $package) { + if ($type != 'extension') { + if (isset($package['uri'])) { + if (isset($package['channel'])) { + $this->_UrlOrChannel($type, + $package['name']); + } + } else { + if (!isset($package['channel'])) { + $this->_NoChannel($type, $package['name']); + } + } + } + $this->{"_validate{$type}Dep"}($package, "<$simpledep>"); + } + } + } + if ($simpledep == 'optional') { + continue; + } + foreach (array('php', 'pearinstaller', 'os', 'arch') as $type) { + if (isset($this->_packageInfo['dependencies'][$simpledep][$type])) { + $iter = $this->_packageInfo['dependencies'][$simpledep][$type]; + if (!isset($iter[0])) { + $iter = array($iter); + } + foreach ($iter as $package) { + $this->{"_validate{$type}Dep"}($package); + } + } + } + } + } + } + if (isset($this->_packageInfo['dependencies']['group'])) { + $groups = $this->_packageInfo['dependencies']['group']; + if (!isset($groups[0])) { + $groups = array($groups); + } + $structure = array( + '*package', + '*subpackage', + '*extension', + ); + foreach ($groups as $group) { + if ($this->_stupidSchemaValidate($structure, $group, '<group>')) { + if (!PEAR_Validate::validGroupName($group['attribs']['name'])) { + $this->_invalidDepGroupName($group['attribs']['name']); + } + foreach (array('package', 'subpackage', 'extension') as $type) { + if (isset($group[$type])) { + $iter = $group[$type]; + if (!isset($iter[0])) { + $iter = array($iter); + } + foreach ($iter as $package) { + if ($type != 'extension') { + if (isset($package['uri'])) { + if (isset($package['channel'])) { + $this->_UrlOrChannelGroup($type, + $package['name'], + $group['name']); + } + } else { + if (!isset($package['channel'])) { + $this->_NoChannelGroup($type, + $package['name'], + $group['name']); + } + } + } + $this->{"_validate{$type}Dep"}($package, '<group name="' . + $group['attribs']['name'] . '">'); + } + } + } + } + } + } + } + + function _validateCompatible() + { + $compat = $this->_packageInfo['compatible']; + if (!isset($compat[0])) { + $compat = array($compat); + } + $required = array('name', 'channel', 'min', 'max', '*exclude'); + foreach ($compat as $package) { + $type = '<compatible>'; + if (is_array($package) && array_key_exists('name', $package)) { + $type .= '<name>' . $package['name'] . '</name>'; + } + $this->_stupidSchemaValidate($required, $package, $type); + if (is_array($package) && array_key_exists('min', $package)) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $package['min'])) { + $this->_invalidVersion(substr($type, 1) . '<min', $package['min']); + } + } + if (is_array($package) && array_key_exists('max', $package)) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $package['max'])) { + $this->_invalidVersion(substr($type, 1) . '<max', $package['max']); + } + } + if (is_array($package) && array_key_exists('exclude', $package)) { + if (!is_array($package['exclude'])) { + $package['exclude'] = array($package['exclude']); + } + foreach ($package['exclude'] as $exclude) { + if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/', + $exclude)) { + $this->_invalidVersion(substr($type, 1) . '<exclude', $exclude); + } + } + } + } + } + + function _validateBundle($list) + { + if (!is_array($list) || !isset($list['bundledpackage'])) { + return $this->_NoBundledPackages(); + } + if (!is_array($list['bundledpackage']) || !isset($list['bundledpackage'][0])) { + return $this->_AtLeast2BundledPackages(); + } + foreach ($list['bundledpackage'] as $package) { + if (!is_string($package)) { + $this->_bundledPackagesMustBeFilename(); + } + } + } + + function _validateFilelist($list = false, $allowignore = false, $dirs = '') + { + $iscontents = false; + if (!$list) { + $iscontents = true; + $list = $this->_packageInfo['contents']; + if (isset($this->_packageInfo['bundle'])) { + return $this->_validateBundle($list); + } + } + if ($allowignore) { + $struc = array( + '*install->name->as', + '*ignore->name' + ); + } else { + $struc = array( + '*dir->name->?baseinstalldir', + '*file->name->role->?baseinstalldir->?md5sum' + ); + if (isset($list['dir']) && isset($list['file'])) { + // stave off validation errors without requiring a set order. + $_old = $list; + if (isset($list['attribs'])) { + $list = array('attribs' => $_old['attribs']); + } + $list['dir'] = $_old['dir']; + $list['file'] = $_old['file']; + } + } + if (!isset($list['attribs']) || !isset($list['attribs']['name'])) { + $unknown = $allowignore ? '<filelist>' : '<dir name="*unknown*">'; + $dirname = $iscontents ? '<contents>' : $unknown; + } else { + $dirname = '<dir name="' . $list['attribs']['name'] . '">'; + if (preg_match('~/\.\.?(/|\\z)|^\.\.?/~', + str_replace('\\', '/', $list['attribs']['name']))) { + // file contains .. parent directory or . cur directory + $this->_invalidDirName($list['attribs']['name']); + } + } + $res = $this->_stupidSchemaValidate($struc, $list, $dirname); + if ($allowignore && $res) { + $ignored_or_installed = array(); + $this->_pf->getFilelist(); + $fcontents = $this->_pf->getContents(); + $filelist = array(); + if (!isset($fcontents['dir']['file'][0])) { + $fcontents['dir']['file'] = array($fcontents['dir']['file']); + } + foreach ($fcontents['dir']['file'] as $file) { + $filelist[$file['attribs']['name']] = true; + } + if (isset($list['install'])) { + if (!isset($list['install'][0])) { + $list['install'] = array($list['install']); + } + foreach ($list['install'] as $file) { + if (!isset($filelist[$file['attribs']['name']])) { + $this->_notInContents($file['attribs']['name'], 'install'); + continue; + } + if (array_key_exists($file['attribs']['name'], $ignored_or_installed)) { + $this->_multipleInstallAs($file['attribs']['name']); + } + if (!isset($ignored_or_installed[$file['attribs']['name']])) { + $ignored_or_installed[$file['attribs']['name']] = array(); + } + $ignored_or_installed[$file['attribs']['name']][] = 1; + if (preg_match('~/\.\.?(/|\\z)|^\.\.?/~', + str_replace('\\', '/', $file['attribs']['as']))) { + // file contains .. parent directory or . cur directory references + $this->_invalidFileInstallAs($file['attribs']['name'], + $file['attribs']['as']); + } + } + } + if (isset($list['ignore'])) { + if (!isset($list['ignore'][0])) { + $list['ignore'] = array($list['ignore']); + } + foreach ($list['ignore'] as $file) { + if (!isset($filelist[$file['attribs']['name']])) { + $this->_notInContents($file['attribs']['name'], 'ignore'); + continue; + } + if (array_key_exists($file['attribs']['name'], $ignored_or_installed)) { + $this->_ignoreAndInstallAs($file['attribs']['name']); + } + } + } + } + if (!$allowignore && isset($list['file'])) { + if (is_string($list['file'])) { + $this->_oldStyleFileNotAllowed(); + return false; + } + if (!isset($list['file'][0])) { + // single file + $list['file'] = array($list['file']); + } + foreach ($list['file'] as $i => $file) + { + if (isset($file['attribs']) && isset($file['attribs']['name'])) { + if ($file['attribs']['name']{0} == '.' && + $file['attribs']['name']{1} == '/') { + // name is something like "./doc/whatever.txt" + $this->_invalidFileName($file['attribs']['name'], $dirname); + } + if (preg_match('~/\.\.?(/|\\z)|^\.\.?/~', + str_replace('\\', '/', $file['attribs']['name']))) { + // file contains .. parent directory or . cur directory + $this->_invalidFileName($file['attribs']['name'], $dirname); + } + } + if (isset($file['attribs']) && isset($file['attribs']['role'])) { + if (!$this->_validateRole($file['attribs']['role'])) { + if (isset($this->_packageInfo['usesrole'])) { + $roles = $this->_packageInfo['usesrole']; + if (!isset($roles[0])) { + $roles = array($roles); + } + foreach ($roles as $role) { + if ($role['role'] = $file['attribs']['role']) { + $msg = 'This package contains role "%role%" and requires ' . + 'package "%package%" to be used'; + if (isset($role['uri'])) { + $params = array('role' => $role['role'], + 'package' => $role['uri']); + } else { + $params = array('role' => $role['role'], + 'package' => $this->_pf->_registry-> + parsedPackageNameToString(array('package' => + $role['package'], 'channel' => $role['channel']), + true)); + } + $this->_stack->push('_mustInstallRole', 'error', $params, $msg); + } + } + } + $this->_invalidFileRole($file['attribs']['name'], + $dirname, $file['attribs']['role']); + } + } + if (!isset($file['attribs'])) { + continue; + } + $save = $file['attribs']; + if ($dirs) { + $save['name'] = $dirs . '/' . $save['name']; + } + unset($file['attribs']); + if (count($file) && $this->_curState != PEAR_VALIDATE_DOWNLOADING) { // has tasks + foreach ($file as $task => $value) { + if ($tagClass = $this->_pf->getTask($task)) { + if (!is_array($value) || !isset($value[0])) { + $value = array($value); + } + foreach ($value as $v) { + $ret = call_user_func(array($tagClass, 'validateXml'), + $this->_pf, $v, $this->_pf->_config, $save); + if (is_array($ret)) { + $this->_invalidTask($task, $ret, isset($save['name']) ? + $save['name'] : ''); + } + } + } else { + if (isset($this->_packageInfo['usestask'])) { + $roles = $this->_packageInfo['usestask']; + if (!isset($roles[0])) { + $roles = array($roles); + } + foreach ($roles as $role) { + if ($role['task'] = $task) { + $msg = 'This package contains task "%task%" and requires ' . + 'package "%package%" to be used'; + if (isset($role['uri'])) { + $params = array('task' => $role['task'], + 'package' => $role['uri']); + } else { + $params = array('task' => $role['task'], + 'package' => $this->_pf->_registry-> + parsedPackageNameToString(array('package' => + $role['package'], 'channel' => $role['channel']), + true)); + } + $this->_stack->push('_mustInstallTask', 'error', + $params, $msg); + } + } + } + $this->_unknownTask($task, $save['name']); + } + } + } + } + } + if (isset($list['ignore'])) { + if (!$allowignore) { + $this->_ignoreNotAllowed('ignore'); + } + } + if (isset($list['install'])) { + if (!$allowignore) { + $this->_ignoreNotAllowed('install'); + } + } + if (isset($list['file'])) { + if ($allowignore) { + $this->_fileNotAllowed('file'); + } + } + if (isset($list['dir'])) { + if ($allowignore) { + $this->_fileNotAllowed('dir'); + } else { + if (!isset($list['dir'][0])) { + $list['dir'] = array($list['dir']); + } + foreach ($list['dir'] as $dir) { + if (isset($dir['attribs']) && isset($dir['attribs']['name'])) { + if ($dir['attribs']['name'] == '/' || + !isset($this->_packageInfo['contents']['dir']['dir'])) { + // always use nothing if the filelist has already been flattened + $newdirs = ''; + } elseif ($dirs == '') { + $newdirs = $dir['attribs']['name']; + } else { + $newdirs = $dirs . '/' . $dir['attribs']['name']; + } + } else { + $newdirs = $dirs; + } + $this->_validateFilelist($dir, $allowignore, $newdirs); + } + } + } + } + + function _validateRelease() + { + if (isset($this->_packageInfo['phprelease'])) { + $release = 'phprelease'; + if (isset($this->_packageInfo['providesextension'])) { + $this->_cannotProvideExtension($release); + } + if (isset($this->_packageInfo['srcpackage']) || isset($this->_packageInfo['srcuri'])) { + $this->_cannotHaveSrcpackage($release); + } + $releases = $this->_packageInfo['phprelease']; + if (!is_array($releases)) { + return true; + } + if (!isset($releases[0])) { + $releases = array($releases); + } + foreach ($releases as $rel) { + $this->_stupidSchemaValidate(array( + '*installconditions', + '*filelist', + ), $rel, '<phprelease>'); + } + } + foreach (array('', 'zend') as $prefix) { + $releasetype = $prefix . 'extsrcrelease'; + if (isset($this->_packageInfo[$releasetype])) { + $release = $releasetype; + if (!isset($this->_packageInfo['providesextension'])) { + $this->_mustProvideExtension($release); + } + if (isset($this->_packageInfo['srcpackage']) || isset($this->_packageInfo['srcuri'])) { + $this->_cannotHaveSrcpackage($release); + } + $releases = $this->_packageInfo[$releasetype]; + if (!is_array($releases)) { + return true; + } + if (!isset($releases[0])) { + $releases = array($releases); + } + foreach ($releases as $rel) { + $this->_stupidSchemaValidate(array( + '*installconditions', + '*configureoption->name->prompt->?default', + '*binarypackage', + '*filelist', + ), $rel, '<' . $releasetype . '>'); + if (isset($rel['binarypackage'])) { + if (!is_array($rel['binarypackage']) || !isset($rel['binarypackage'][0])) { + $rel['binarypackage'] = array($rel['binarypackage']); + } + foreach ($rel['binarypackage'] as $bin) { + if (!is_string($bin)) { + $this->_binaryPackageMustBePackagename(); + } + } + } + } + } + $releasetype = 'extbinrelease'; + if (isset($this->_packageInfo[$releasetype])) { + $release = $releasetype; + if (!isset($this->_packageInfo['providesextension'])) { + $this->_mustProvideExtension($release); + } + if (isset($this->_packageInfo['channel']) && + !isset($this->_packageInfo['srcpackage'])) { + $this->_mustSrcPackage($release); + } + if (isset($this->_packageInfo['uri']) && !isset($this->_packageInfo['srcuri'])) { + $this->_mustSrcuri($release); + } + $releases = $this->_packageInfo[$releasetype]; + if (!is_array($releases)) { + return true; + } + if (!isset($releases[0])) { + $releases = array($releases); + } + foreach ($releases as $rel) { + $this->_stupidSchemaValidate(array( + '*installconditions', + '*filelist', + ), $rel, '<' . $releasetype . '>'); + } + } + } + if (isset($this->_packageInfo['bundle'])) { + $release = 'bundle'; + if (isset($this->_packageInfo['providesextension'])) { + $this->_cannotProvideExtension($release); + } + if (isset($this->_packageInfo['srcpackage']) || isset($this->_packageInfo['srcuri'])) { + $this->_cannotHaveSrcpackage($release); + } + $releases = $this->_packageInfo['bundle']; + if (!is_array($releases) || !isset($releases[0])) { + $releases = array($releases); + } + foreach ($releases as $rel) { + $this->_stupidSchemaValidate(array( + '*installconditions', + '*filelist', + ), $rel, '<bundle>'); + } + } + foreach ($releases as $rel) { + if (is_array($rel) && array_key_exists('installconditions', $rel)) { + $this->_validateInstallConditions($rel['installconditions'], + "<$release><installconditions>"); + } + if (is_array($rel) && array_key_exists('filelist', $rel)) { + if ($rel['filelist']) { + + $this->_validateFilelist($rel['filelist'], true); + } + } + } + } + + /** + * This is here to allow role extension through plugins + * @param string + */ + function _validateRole($role) + { + return in_array($role, PEAR_Installer_Role::getValidRoles($this->_pf->getPackageType())); + } + + function _pearVersionTooLow($version) + { + $this->_stack->push(__FUNCTION__, 'error', + array('version' => $version), + 'This package.xml requires PEAR version %version% to parse properly, we are ' . + 'version 1.9.4'); + } + + function _invalidTagOrder($oktags, $actual, $root) + { + $this->_stack->push(__FUNCTION__, 'error', + array('oktags' => $oktags, 'actual' => $actual, 'root' => $root), + 'Invalid tag order in %root%, found <%actual%> expected one of "%oktags%"'); + } + + function _ignoreNotAllowed($type) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type), + '<%type%> is not allowed inside global <contents>, only inside ' . + '<phprelease>/<extbinrelease>/<zendextbinrelease>, use <dir> and <file> only'); + } + + function _fileNotAllowed($type) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type), + '<%type%> is not allowed inside release <filelist>, only inside ' . + '<contents>, use <ignore> and <install> only'); + } + + function _oldStyleFileNotAllowed() + { + $this->_stack->push(__FUNCTION__, 'error', array(), + 'Old-style <file>name</file> is not allowed. Use' . + '<file name="name" role="role"/>'); + } + + function _tagMissingAttribute($tag, $attr, $context) + { + $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag, + 'attribute' => $attr, 'context' => $context), + 'tag <%tag%> in context "%context%" has no attribute "%attribute%"'); + } + + function _tagHasNoAttribs($tag, $context) + { + $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag, + 'context' => $context), + 'tag <%tag%> has no attributes in context "%context%"'); + } + + function _invalidInternalStructure() + { + $this->_stack->push(__FUNCTION__, 'exception', array(), + 'internal array was not generated by compatible parser, or extreme parser error, cannot continue'); + } + + function _invalidFileRole($file, $dir, $role) + { + $this->_stack->push(__FUNCTION__, 'error', array( + 'file' => $file, 'dir' => $dir, 'role' => $role, + 'roles' => PEAR_Installer_Role::getValidRoles($this->_pf->getPackageType())), + 'File "%file%" in directory "%dir%" has invalid role "%role%", should be one of %roles%'); + } + + function _invalidFileName($file, $dir) + { + $this->_stack->push(__FUNCTION__, 'error', array( + 'file' => $file), + 'File "%file%" in directory "%dir%" cannot begin with "./" or contain ".."'); + } + + function _invalidFileInstallAs($file, $as) + { + $this->_stack->push(__FUNCTION__, 'error', array( + 'file' => $file, 'as' => $as), + 'File "%file%" <install as="%as%"/> cannot contain "./" or contain ".."'); + } + + function _invalidDirName($dir) + { + $this->_stack->push(__FUNCTION__, 'error', array( + 'dir' => $file), + 'Directory "%dir%" cannot begin with "./" or contain ".."'); + } + + function _filelistCannotContainFile($filelist) + { + $this->_stack->push(__FUNCTION__, 'error', array('tag' => $filelist), + '<%tag%> can only contain <dir>, contains <file>. Use ' . + '<dir name="/"> as the first dir element'); + } + + function _filelistMustContainDir($filelist) + { + $this->_stack->push(__FUNCTION__, 'error', array('tag' => $filelist), + '<%tag%> must contain <dir>. Use <dir name="/"> as the ' . + 'first dir element'); + } + + function _tagCannotBeEmpty($tag) + { + $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag), + '<%tag%> cannot be empty (<%tag%/>)'); + } + + function _UrlOrChannel($type, $name) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type, + 'name' => $name), + 'Required dependency <%type%> "%name%" can have either url OR ' . + 'channel attributes, and not both'); + } + + function _NoChannel($type, $name) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type, + 'name' => $name), + 'Required dependency <%type%> "%name%" must have either url OR ' . + 'channel attributes'); + } + + function _UrlOrChannelGroup($type, $name, $group) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type, + 'name' => $name, 'group' => $group), + 'Group "%group%" dependency <%type%> "%name%" can have either url OR ' . + 'channel attributes, and not both'); + } + + function _NoChannelGroup($type, $name, $group) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type, + 'name' => $name, 'group' => $group), + 'Group "%group%" dependency <%type%> "%name%" must have either url OR ' . + 'channel attributes'); + } + + function _unknownChannel($channel) + { + $this->_stack->push(__FUNCTION__, 'error', array('channel' => $channel), + 'Unknown channel "%channel%"'); + } + + function _noPackageVersion() + { + $this->_stack->push(__FUNCTION__, 'error', array(), + 'package.xml <package> tag has no version attribute, or version is not 2.0'); + } + + function _NoBundledPackages() + { + $this->_stack->push(__FUNCTION__, 'error', array(), + 'No <bundledpackage> tag was found in <contents>, required for bundle packages'); + } + + function _AtLeast2BundledPackages() + { + $this->_stack->push(__FUNCTION__, 'error', array(), + 'At least 2 packages must be bundled in a bundle package'); + } + + function _ChannelOrUri($name) + { + $this->_stack->push(__FUNCTION__, 'error', array('name' => $name), + 'Bundled package "%name%" can have either a uri or a channel, not both'); + } + + function _noChildTag($child, $tag) + { + $this->_stack->push(__FUNCTION__, 'error', array('child' => $child, 'tag' => $tag), + 'Tag <%tag%> is missing child tag <%child%>'); + } + + function _invalidVersion($type, $value) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type, 'value' => $value), + 'Version type <%type%> is not a valid version (%value%)'); + } + + function _invalidState($type, $value) + { + $states = array('stable', 'beta', 'alpha', 'devel'); + if ($type != 'api') { + $states[] = 'snapshot'; + } + if (strtolower($value) == 'rc') { + $this->_stack->push(__FUNCTION__, 'error', + array('version' => $this->_packageInfo['version']['release']), + 'RC is not a state, it is a version postfix, try %version%RC1, stability beta'); + } + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type, 'value' => $value, + 'types' => $states), + 'Stability type <%type%> is not a valid stability (%value%), must be one of ' . + '%types%'); + } + + function _invalidTask($task, $ret, $file) + { + switch ($ret[0]) { + case PEAR_TASK_ERROR_MISSING_ATTRIB : + $info = array('attrib' => $ret[1], 'task' => $task, 'file' => $file); + $msg = 'task <%task%> is missing attribute "%attrib%" in file %file%'; + break; + case PEAR_TASK_ERROR_NOATTRIBS : + $info = array('task' => $task, 'file' => $file); + $msg = 'task <%task%> has no attributes in file %file%'; + break; + case PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE : + $info = array('attrib' => $ret[1], 'values' => $ret[3], + 'was' => $ret[2], 'task' => $task, 'file' => $file); + $msg = 'task <%task%> attribute "%attrib%" has the wrong value "%was%" '. + 'in file %file%, expecting one of "%values%"'; + break; + case PEAR_TASK_ERROR_INVALID : + $info = array('reason' => $ret[1], 'task' => $task, 'file' => $file); + $msg = 'task <%task%> in file %file% is invalid because of "%reason%"'; + break; + } + $this->_stack->push(__FUNCTION__, 'error', $info, $msg); + } + + function _unknownTask($task, $file) + { + $this->_stack->push(__FUNCTION__, 'error', array('task' => $task, 'file' => $file), + 'Unknown task "%task%" passed in file <file name="%file%">'); + } + + function _subpackageCannotProvideExtension($name) + { + $this->_stack->push(__FUNCTION__, 'error', array('name' => $name), + 'Subpackage dependency "%name%" cannot use <providesextension>, ' . + 'only package dependencies can use this tag'); + } + + function _subpackagesCannotConflict($name) + { + $this->_stack->push(__FUNCTION__, 'error', array('name' => $name), + 'Subpackage dependency "%name%" cannot use <conflicts/>, ' . + 'only package dependencies can use this tag'); + } + + function _cannotProvideExtension($release) + { + $this->_stack->push(__FUNCTION__, 'error', array('release' => $release), + '<%release%> packages cannot use <providesextension>, only extbinrelease, extsrcrelease, zendextsrcrelease, and zendextbinrelease can provide a PHP extension'); + } + + function _mustProvideExtension($release) + { + $this->_stack->push(__FUNCTION__, 'error', array('release' => $release), + '<%release%> packages must use <providesextension> to indicate which PHP extension is provided'); + } + + function _cannotHaveSrcpackage($release) + { + $this->_stack->push(__FUNCTION__, 'error', array('release' => $release), + '<%release%> packages cannot specify a source code package, only extension binaries may use the <srcpackage> tag'); + } + + function _mustSrcPackage($release) + { + $this->_stack->push(__FUNCTION__, 'error', array('release' => $release), + '<extbinrelease>/<zendextbinrelease> packages must specify a source code package with <srcpackage>'); + } + + function _mustSrcuri($release) + { + $this->_stack->push(__FUNCTION__, 'error', array('release' => $release), + '<extbinrelease>/<zendextbinrelease> packages must specify a source code package with <srcuri>'); + } + + function _uriDepsCannotHaveVersioning($type) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type), + '%type%: dependencies with a <uri> tag cannot have any versioning information'); + } + + function _conflictingDepsCannotHaveVersioning($type) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type), + '%type%: conflicting dependencies cannot have versioning info, use <exclude> to ' . + 'exclude specific versions of a dependency'); + } + + function _DepchannelCannotBeUri($type) + { + $this->_stack->push(__FUNCTION__, 'error', array('type' => $type), + '%type%: channel cannot be __uri, this is a pseudo-channel reserved for uri ' . + 'dependencies only'); + } + + function _bundledPackagesMustBeFilename() + { + $this->_stack->push(__FUNCTION__, 'error', array(), + '<bundledpackage> tags must contain only the filename of a package release ' . + 'in the bundle'); + } + + function _binaryPackageMustBePackagename() + { + $this->_stack->push(__FUNCTION__, 'error', array(), + '<binarypackage> tags must contain the name of a package that is ' . + 'a compiled version of this extsrc/zendextsrc package'); + } + + function _fileNotFound($file) + { + $this->_stack->push(__FUNCTION__, 'error', array('file' => $file), + 'File "%file%" in package.xml does not exist'); + } + + function _notInContents($file, $tag) + { + $this->_stack->push(__FUNCTION__, 'error', array('file' => $file, 'tag' => $tag), + '<%tag% name="%file%"> is invalid, file is not in <contents>'); + } + + function _cannotValidateNoPathSet() + { + $this->_stack->push(__FUNCTION__, 'error', array(), + 'Cannot validate files, no path to package file is set (use setPackageFile())'); + } + + function _usesroletaskMustHaveChannelOrUri($role, $tag) + { + $this->_stack->push(__FUNCTION__, 'error', array('role' => $role, 'tag' => $tag), + '<%tag%> for role "%role%" must contain either <uri>, or <channel> and <package>'); + } + + function _usesroletaskMustHavePackage($role, $tag) + { + $this->_stack->push(__FUNCTION__, 'error', array('role' => $role, 'tag' => $tag), + '<%tag%> for role "%role%" must contain <package>'); + } + + function _usesroletaskMustHaveRoleTask($tag, $type) + { + $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag, 'type' => $type), + '<%tag%> must contain <%type%> defining the %type% to be used'); + } + + function _cannotConflictWithAllOs($type) + { + $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag), + '%tag% cannot conflict with all OSes'); + } + + function _invalidDepGroupName($name) + { + $this->_stack->push(__FUNCTION__, 'error', array('name' => $name), + 'Invalid dependency group name "%name%"'); + } + + function _multipleToplevelDirNotAllowed() + { + $this->_stack->push(__FUNCTION__, 'error', array(), + 'Multiple top-level <dir> tags are not allowed. Enclose them ' . + 'in a <dir name="/">'); + } + + function _multipleInstallAs($file) + { + $this->_stack->push(__FUNCTION__, 'error', array('file' => $file), + 'Only one <install> tag is allowed for file "%file%"'); + } + + function _ignoreAndInstallAs($file) + { + $this->_stack->push(__FUNCTION__, 'error', array('file' => $file), + 'Cannot have both <ignore> and <install> tags for file "%file%"'); + } + + function _analyzeBundledPackages() + { + if (!$this->_isValid) { + return false; + } + if (!$this->_pf->getPackageType() == 'bundle') { + return false; + } + if (!isset($this->_pf->_packageFile)) { + return false; + } + $dir_prefix = dirname($this->_pf->_packageFile); + $common = new PEAR_Common; + $log = isset($this->_pf->_logger) ? array(&$this->_pf->_logger, 'log') : + array($common, 'log'); + $info = $this->_pf->getContents(); + $info = $info['bundledpackage']; + if (!is_array($info)) { + $info = array($info); + } + $pkg = &new PEAR_PackageFile($this->_pf->_config); + foreach ($info as $package) { + if (!file_exists($dir_prefix . DIRECTORY_SEPARATOR . $package)) { + $this->_fileNotFound($dir_prefix . DIRECTORY_SEPARATOR . $package); + $this->_isValid = 0; + continue; + } + call_user_func_array($log, array(1, "Analyzing bundled package $package")); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $ret = $pkg->fromAnyFile($dir_prefix . DIRECTORY_SEPARATOR . $package, + PEAR_VALIDATE_NORMAL); + PEAR::popErrorHandling(); + if (PEAR::isError($ret)) { + call_user_func_array($log, array(0, "ERROR: package $package is not a valid " . + 'package')); + $inf = $ret->getUserInfo(); + if (is_array($inf)) { + foreach ($inf as $err) { + call_user_func_array($log, array(1, $err['message'])); + } + } + return false; + } + } + return true; + } + + function _analyzePhpFiles() + { + if (!$this->_isValid) { + return false; + } + if (!isset($this->_pf->_packageFile)) { + $this->_cannotValidateNoPathSet(); + return false; + } + $dir_prefix = dirname($this->_pf->_packageFile); + $common = new PEAR_Common; + $log = isset($this->_pf->_logger) ? array(&$this->_pf->_logger, 'log') : + array(&$common, 'log'); + $info = $this->_pf->getContents(); + if (!$info || !isset($info['dir']['file'])) { + $this->_tagCannotBeEmpty('contents><dir'); + return false; + } + $info = $info['dir']['file']; + if (isset($info['attribs'])) { + $info = array($info); + } + $provides = array(); + foreach ($info as $fa) { + $fa = $fa['attribs']; + $file = $fa['name']; + if (!file_exists($dir_prefix . DIRECTORY_SEPARATOR . $file)) { + $this->_fileNotFound($dir_prefix . DIRECTORY_SEPARATOR . $file); + $this->_isValid = 0; + continue; + } + if (in_array($fa['role'], PEAR_Installer_Role::getPhpRoles()) && $dir_prefix) { + call_user_func_array($log, array(1, "Analyzing $file")); + $srcinfo = $this->analyzeSourceCode($dir_prefix . DIRECTORY_SEPARATOR . $file); + if ($srcinfo) { + $provides = array_merge($provides, $this->_buildProvidesArray($srcinfo)); + } + } + } + $this->_packageName = $pn = $this->_pf->getPackage(); + $pnl = strlen($pn); + foreach ($provides as $key => $what) { + if (isset($what['explicit']) || !$what) { + // skip conformance checks if the provides entry is + // specified in the package.xml file + continue; + } + extract($what); + if ($type == 'class') { + if (!strncasecmp($name, $pn, $pnl)) { + continue; + } + $this->_stack->push(__FUNCTION__, 'warning', + array('file' => $file, 'type' => $type, 'name' => $name, 'package' => $pn), + 'in %file%: %type% "%name%" not prefixed with package name "%package%"'); + } elseif ($type == 'function') { + if (strstr($name, '::') || !strncasecmp($name, $pn, $pnl)) { + continue; + } + $this->_stack->push(__FUNCTION__, 'warning', + array('file' => $file, 'type' => $type, 'name' => $name, 'package' => $pn), + 'in %file%: %type% "%name%" not prefixed with package name "%package%"'); + } + } + return $this->_isValid; + } + + /** + * Analyze the source code of the given PHP file + * + * @param string Filename of the PHP file + * @param boolean whether to analyze $file as the file contents + * @return mixed + */ + function analyzeSourceCode($file, $string = false) + { + if (!function_exists("token_get_all")) { + $this->_stack->push(__FUNCTION__, 'error', array('file' => $file), + 'Parser error: token_get_all() function must exist to analyze source code, PHP may have been compiled with --disable-tokenizer'); + return false; + } + + if (!defined('T_DOC_COMMENT')) { + define('T_DOC_COMMENT', T_COMMENT); + } + + if (!defined('T_INTERFACE')) { + define('T_INTERFACE', -1); + } + + if (!defined('T_IMPLEMENTS')) { + define('T_IMPLEMENTS', -1); + } + + if ($string) { + $contents = $file; + } else { + if (!$fp = @fopen($file, "r")) { + return false; + } + fclose($fp); + $contents = file_get_contents($file); + } + + // Silence this function so we can catch PHP Warnings and show our own custom message + $tokens = @token_get_all($contents); + if (isset($php_errormsg)) { + if (isset($this->_stack)) { + $pn = $this->_pf->getPackage(); + $this->_stack->push(__FUNCTION__, 'warning', + array('file' => $file, 'package' => $pn), + 'in %file%: Could not process file for unkown reasons,' . + ' possibly a PHP parse error in %file% from %package%'); + } + } +/* + for ($i = 0; $i < sizeof($tokens); $i++) { + @list($token, $data) = $tokens[$i]; + if (is_string($token)) { + var_dump($token); + } else { + print token_name($token) . ' '; + var_dump(rtrim($data)); + } + } +*/ + $look_for = 0; + $paren_level = 0; + $bracket_level = 0; + $brace_level = 0; + $lastphpdoc = ''; + $current_class = ''; + $current_interface = ''; + $current_class_level = -1; + $current_function = ''; + $current_function_level = -1; + $declared_classes = array(); + $declared_interfaces = array(); + $declared_functions = array(); + $declared_methods = array(); + $used_classes = array(); + $used_functions = array(); + $extends = array(); + $implements = array(); + $nodeps = array(); + $inquote = false; + $interface = false; + for ($i = 0; $i < sizeof($tokens); $i++) { + if (is_array($tokens[$i])) { + list($token, $data) = $tokens[$i]; + } else { + $token = $tokens[$i]; + $data = ''; + } + + if ($inquote) { + if ($token != '"' && $token != T_END_HEREDOC) { + continue; + } else { + $inquote = false; + continue; + } + } + + switch ($token) { + case T_WHITESPACE : + continue; + case ';': + if ($interface) { + $current_function = ''; + $current_function_level = -1; + } + break; + case '"': + case T_START_HEREDOC: + $inquote = true; + break; + case T_CURLY_OPEN: + case T_DOLLAR_OPEN_CURLY_BRACES: + case '{': $brace_level++; continue 2; + case '}': + $brace_level--; + if ($current_class_level == $brace_level) { + $current_class = ''; + $current_class_level = -1; + } + if ($current_function_level == $brace_level) { + $current_function = ''; + $current_function_level = -1; + } + continue 2; + case '[': $bracket_level++; continue 2; + case ']': $bracket_level--; continue 2; + case '(': $paren_level++; continue 2; + case ')': $paren_level--; continue 2; + case T_INTERFACE: + $interface = true; + case T_CLASS: + if (($current_class_level != -1) || ($current_function_level != -1)) { + if (isset($this->_stack)) { + $this->_stack->push(__FUNCTION__, 'error', array('file' => $file), + 'Parser error: invalid PHP found in file "%file%"'); + } else { + PEAR::raiseError("Parser error: invalid PHP found in file \"$file\"", + PEAR_COMMON_ERROR_INVALIDPHP); + } + + return false; + } + case T_FUNCTION: + case T_NEW: + case T_EXTENDS: + case T_IMPLEMENTS: + $look_for = $token; + continue 2; + case T_STRING: + if (version_compare(zend_version(), '2.0', '<')) { + if (in_array(strtolower($data), + array('public', 'private', 'protected', 'abstract', + 'interface', 'implements', 'throw') + ) + ) { + if (isset($this->_stack)) { + $this->_stack->push(__FUNCTION__, 'warning', array( + 'file' => $file), + 'Error, PHP5 token encountered in %file%,' . + ' analysis should be in PHP5'); + } else { + PEAR::raiseError('Error: PHP5 token encountered in ' . $file . + 'packaging should be done in PHP 5'); + return false; + } + } + } + + if ($look_for == T_CLASS) { + $current_class = $data; + $current_class_level = $brace_level; + $declared_classes[] = $current_class; + } elseif ($look_for == T_INTERFACE) { + $current_interface = $data; + $current_class_level = $brace_level; + $declared_interfaces[] = $current_interface; + } elseif ($look_for == T_IMPLEMENTS) { + $implements[$current_class] = $data; + } elseif ($look_for == T_EXTENDS) { + $extends[$current_class] = $data; + } elseif ($look_for == T_FUNCTION) { + if ($current_class) { + $current_function = "$current_class::$data"; + $declared_methods[$current_class][] = $data; + } elseif ($current_interface) { + $current_function = "$current_interface::$data"; + $declared_methods[$current_interface][] = $data; + } else { + $current_function = $data; + $declared_functions[] = $current_function; + } + + $current_function_level = $brace_level; + $m = array(); + } elseif ($look_for == T_NEW) { + $used_classes[$data] = true; + } + + $look_for = 0; + continue 2; + case T_VARIABLE: + $look_for = 0; + continue 2; + case T_DOC_COMMENT: + case T_COMMENT: + if (preg_match('!^/\*\*\s!', $data)) { + $lastphpdoc = $data; + if (preg_match_all('/@nodep\s+(\S+)/', $lastphpdoc, $m)) { + $nodeps = array_merge($nodeps, $m[1]); + } + } + continue 2; + case T_DOUBLE_COLON: + $token = $tokens[$i - 1][0]; + if (!($token == T_WHITESPACE || $token == T_STRING || $token == T_STATIC)) { + if (isset($this->_stack)) { + $this->_stack->push(__FUNCTION__, 'warning', array('file' => $file), + 'Parser error: invalid PHP found in file "%file%"'); + } else { + PEAR::raiseError("Parser error: invalid PHP found in file \"$file\"", + PEAR_COMMON_ERROR_INVALIDPHP); + } + + return false; + } + + $class = $tokens[$i - 1][1]; + if (strtolower($class) != 'parent') { + $used_classes[$class] = true; + } + + continue 2; + } + } + + return array( + "source_file" => $file, + "declared_classes" => $declared_classes, + "declared_interfaces" => $declared_interfaces, + "declared_methods" => $declared_methods, + "declared_functions" => $declared_functions, + "used_classes" => array_diff(array_keys($used_classes), $nodeps), + "inheritance" => $extends, + "implements" => $implements, + ); + } + + /** + * Build a "provides" array from data returned by + * analyzeSourceCode(). The format of the built array is like + * this: + * + * array( + * 'class;MyClass' => 'array('type' => 'class', 'name' => 'MyClass'), + * ... + * ) + * + * + * @param array $srcinfo array with information about a source file + * as returned by the analyzeSourceCode() method. + * + * @return void + * + * @access private + * + */ + function _buildProvidesArray($srcinfo) + { + if (!$this->_isValid) { + return array(); + } + + $providesret = array(); + $file = basename($srcinfo['source_file']); + $pn = isset($this->_pf) ? $this->_pf->getPackage() : ''; + $pnl = strlen($pn); + foreach ($srcinfo['declared_classes'] as $class) { + $key = "class;$class"; + if (isset($providesret[$key])) { + continue; + } + + $providesret[$key] = + array('file'=> $file, 'type' => 'class', 'name' => $class); + if (isset($srcinfo['inheritance'][$class])) { + $providesret[$key]['extends'] = + $srcinfo['inheritance'][$class]; + } + } + + foreach ($srcinfo['declared_methods'] as $class => $methods) { + foreach ($methods as $method) { + $function = "$class::$method"; + $key = "function;$function"; + if ($method{0} == '_' || !strcasecmp($method, $class) || + isset($providesret[$key])) { + continue; + } + + $providesret[$key] = + array('file'=> $file, 'type' => 'function', 'name' => $function); + } + } + + foreach ($srcinfo['declared_functions'] as $function) { + $key = "function;$function"; + if ($function{0} == '_' || isset($providesret[$key])) { + continue; + } + + if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) { + $warnings[] = "in1 " . $file . ": function \"$function\" not prefixed with package name \"$pn\""; + } + + $providesret[$key] = + array('file'=> $file, 'type' => 'function', 'name' => $function); + } + + return $providesret; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2/rw.php b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2/rw.php new file mode 100644 index 0000000000000000000000000000000000000000..58f76c55947c8419242ea72041f364e25e9c0764 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/PackageFile/v2/rw.php @@ -0,0 +1,1604 @@ +<?php +/** + * PEAR_PackageFile_v2, package.xml version 2.0, read/write version + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a8 + */ +/** + * For base class + */ +require_once 'PEAR/PackageFile/v2.php'; +/** + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a8 + */ +class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2 +{ + /** + * @param string Extension name + * @return bool success of operation + */ + function setProvidesExtension($extension) + { + if (in_array($this->getPackageType(), + array('extsrc', 'extbin', 'zendextsrc', 'zendextbin'))) { + if (!isset($this->_packageInfo['providesextension'])) { + // ensure that the channel tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('usesrole', 'usestask', 'srcpackage', 'srcuri', 'phprelease', + 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'bundle', 'changelog'), + $extension, 'providesextension'); + } + $this->_packageInfo['providesextension'] = $extension; + return true; + } + return false; + } + + function setPackage($package) + { + $this->_isValid = 0; + if (!isset($this->_packageInfo['attribs'])) { + $this->_packageInfo = array_merge(array('attribs' => array( + 'version' => '2.0', + 'xmlns' => 'http://pear.php.net/dtd/package-2.0', + 'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0', + 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + 'xsi:schemaLocation' => 'http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.0 + http://pear.php.net/dtd/package-2.0.xsd', + )), $this->_packageInfo); + } + if (!isset($this->_packageInfo['name'])) { + return $this->_packageInfo = array_merge(array('name' => $package), + $this->_packageInfo); + } + $this->_packageInfo['name'] = $package; + } + + /** + * set this as a package.xml version 2.1 + * @access private + */ + function _setPackageVersion2_1() + { + $info = array( + 'version' => '2.1', + 'xmlns' => 'http://pear.php.net/dtd/package-2.1', + 'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0', + 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + 'xsi:schemaLocation' => 'http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.1 + http://pear.php.net/dtd/package-2.1.xsd', + ); + if (!isset($this->_packageInfo['attribs'])) { + $this->_packageInfo = array_merge(array('attribs' => $info), $this->_packageInfo); + } else { + $this->_packageInfo['attribs'] = $info; + } + } + + function setUri($uri) + { + unset($this->_packageInfo['channel']); + $this->_isValid = 0; + if (!isset($this->_packageInfo['uri'])) { + // ensure that the uri tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('extends', 'summary', 'description', 'lead', + 'developer', 'contributor', 'helper', 'date', 'time', 'version', + 'stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), $uri, 'uri'); + } + $this->_packageInfo['uri'] = $uri; + } + + function setChannel($channel) + { + unset($this->_packageInfo['uri']); + $this->_isValid = 0; + if (!isset($this->_packageInfo['channel'])) { + // ensure that the channel tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('extends', 'summary', 'description', 'lead', + 'developer', 'contributor', 'helper', 'date', 'time', 'version', + 'stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), $channel, 'channel'); + } + $this->_packageInfo['channel'] = $channel; + } + + function setExtends($extends) + { + $this->_isValid = 0; + if (!isset($this->_packageInfo['extends'])) { + // ensure that the extends tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('summary', 'description', 'lead', + 'developer', 'contributor', 'helper', 'date', 'time', 'version', + 'stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), $extends, 'extends'); + } + $this->_packageInfo['extends'] = $extends; + } + + function setSummary($summary) + { + $this->_isValid = 0; + if (!isset($this->_packageInfo['summary'])) { + // ensure that the summary tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('description', 'lead', + 'developer', 'contributor', 'helper', 'date', 'time', 'version', + 'stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), $summary, 'summary'); + } + $this->_packageInfo['summary'] = $summary; + } + + function setDescription($desc) + { + $this->_isValid = 0; + if (!isset($this->_packageInfo['description'])) { + // ensure that the description tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('lead', + 'developer', 'contributor', 'helper', 'date', 'time', 'version', + 'stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), $desc, 'description'); + } + $this->_packageInfo['description'] = $desc; + } + + /** + * Adds a new maintainer - no checking of duplicates is performed, use + * updatemaintainer for that purpose. + */ + function addMaintainer($role, $handle, $name, $email, $active = 'yes') + { + if (!in_array($role, array('lead', 'developer', 'contributor', 'helper'))) { + return false; + } + if (isset($this->_packageInfo[$role])) { + if (!isset($this->_packageInfo[$role][0])) { + $this->_packageInfo[$role] = array($this->_packageInfo[$role]); + } + $this->_packageInfo[$role][] = + array( + 'name' => $name, + 'user' => $handle, + 'email' => $email, + 'active' => $active, + ); + } else { + $testarr = array('lead', + 'developer', 'contributor', 'helper', 'date', 'time', 'version', + 'stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', + 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'); + foreach (array('lead', 'developer', 'contributor', 'helper') as $testrole) { + array_shift($testarr); + if ($role == $testrole) { + break; + } + } + if (!isset($this->_packageInfo[$role])) { + // ensure that the extends tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, $testarr, + array(), $role); + } + $this->_packageInfo[$role] = + array( + 'name' => $name, + 'user' => $handle, + 'email' => $email, + 'active' => $active, + ); + } + $this->_isValid = 0; + } + + function updateMaintainer($newrole, $handle, $name, $email, $active = 'yes') + { + $found = false; + foreach (array('lead', 'developer', 'contributor', 'helper') as $role) { + if (!isset($this->_packageInfo[$role])) { + continue; + } + $info = $this->_packageInfo[$role]; + if (!isset($info[0])) { + if ($info['user'] == $handle) { + $found = true; + break; + } + } + foreach ($info as $i => $maintainer) { + if ($maintainer['user'] == $handle) { + $found = $i; + break 2; + } + } + } + if ($found === false) { + return $this->addMaintainer($newrole, $handle, $name, $email, $active); + } + if ($found !== false) { + if ($found === true) { + unset($this->_packageInfo[$role]); + } else { + unset($this->_packageInfo[$role][$found]); + $this->_packageInfo[$role] = array_values($this->_packageInfo[$role]); + } + } + $this->addMaintainer($newrole, $handle, $name, $email, $active); + $this->_isValid = 0; + } + + function deleteMaintainer($handle) + { + $found = false; + foreach (array('lead', 'developer', 'contributor', 'helper') as $role) { + if (!isset($this->_packageInfo[$role])) { + continue; + } + if (!isset($this->_packageInfo[$role][0])) { + $this->_packageInfo[$role] = array($this->_packageInfo[$role]); + } + foreach ($this->_packageInfo[$role] as $i => $maintainer) { + if ($maintainer['user'] == $handle) { + $found = $i; + break; + } + } + if ($found !== false) { + unset($this->_packageInfo[$role][$found]); + if (!count($this->_packageInfo[$role]) && $role == 'lead') { + $this->_isValid = 0; + } + if (!count($this->_packageInfo[$role])) { + unset($this->_packageInfo[$role]); + return true; + } + $this->_packageInfo[$role] = + array_values($this->_packageInfo[$role]); + if (count($this->_packageInfo[$role]) == 1) { + $this->_packageInfo[$role] = $this->_packageInfo[$role][0]; + } + return true; + } + if (count($this->_packageInfo[$role]) == 1) { + $this->_packageInfo[$role] = $this->_packageInfo[$role][0]; + } + } + return false; + } + + function setReleaseVersion($version) + { + if (isset($this->_packageInfo['version']) && + isset($this->_packageInfo['version']['release'])) { + unset($this->_packageInfo['version']['release']); + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $version, array( + 'version' => array('stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), + 'release' => array('api'))); + $this->_isValid = 0; + } + + function setAPIVersion($version) + { + if (isset($this->_packageInfo['version']) && + isset($this->_packageInfo['version']['api'])) { + unset($this->_packageInfo['version']['api']); + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $version, array( + 'version' => array('stability', 'license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), + 'api' => array())); + $this->_isValid = 0; + } + + /** + * snapshot|devel|alpha|beta|stable + */ + function setReleaseStability($state) + { + if (isset($this->_packageInfo['stability']) && + isset($this->_packageInfo['stability']['release'])) { + unset($this->_packageInfo['stability']['release']); + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $state, array( + 'stability' => array('license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), + 'release' => array('api'))); + $this->_isValid = 0; + } + + /** + * @param devel|alpha|beta|stable + */ + function setAPIStability($state) + { + if (isset($this->_packageInfo['stability']) && + isset($this->_packageInfo['stability']['api'])) { + unset($this->_packageInfo['stability']['api']); + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $state, array( + 'stability' => array('license', 'notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), + 'api' => array())); + $this->_isValid = 0; + } + + function setLicense($license, $uri = false, $filesource = false) + { + if (!isset($this->_packageInfo['license'])) { + // ensure that the license tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('notes', 'contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), 0, 'license'); + } + if ($uri || $filesource) { + $attribs = array(); + if ($uri) { + $attribs['uri'] = $uri; + } + $uri = true; // for test below + if ($filesource) { + $attribs['filesource'] = $filesource; + } + } + $license = $uri ? array('attribs' => $attribs, '_content' => $license) : $license; + $this->_packageInfo['license'] = $license; + $this->_isValid = 0; + } + + function setNotes($notes) + { + $this->_isValid = 0; + if (!isset($this->_packageInfo['notes'])) { + // ensure that the notes tag is set up in the right location + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('contents', 'compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'extbinrelease', 'bundle', 'changelog'), $notes, 'notes'); + } + $this->_packageInfo['notes'] = $notes; + } + + /** + * This is only used at install-time, after all serialization + * is over. + * @param string file name + * @param string installed path + */ + function setInstalledAs($file, $path) + { + if ($path) { + return $this->_packageInfo['filelist'][$file]['installed_as'] = $path; + } + unset($this->_packageInfo['filelist'][$file]['installed_as']); + } + + /** + * This is only used at install-time, after all serialization + * is over. + */ + function installedFile($file, $atts) + { + if (isset($this->_packageInfo['filelist'][$file])) { + $this->_packageInfo['filelist'][$file] = + array_merge($this->_packageInfo['filelist'][$file], $atts['attribs']); + } else { + $this->_packageInfo['filelist'][$file] = $atts['attribs']; + } + } + + /** + * Reset the listing of package contents + * @param string base installation dir for the whole package, if any + */ + function clearContents($baseinstall = false) + { + $this->_filesValid = false; + $this->_isValid = 0; + if (!isset($this->_packageInfo['contents'])) { + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('compatible', + 'dependencies', 'providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', + 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'bundle', 'changelog'), array(), 'contents'); + } + if ($this->getPackageType() != 'bundle') { + $this->_packageInfo['contents'] = + array('dir' => array('attribs' => array('name' => '/'))); + if ($baseinstall) { + $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'] = $baseinstall; + } + } else { + $this->_packageInfo['contents'] = array('bundledpackage' => array()); + } + } + + /** + * @param string relative path of the bundled package. + */ + function addBundledPackage($path) + { + if ($this->getPackageType() != 'bundle') { + return false; + } + $this->_filesValid = false; + $this->_isValid = 0; + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $path, array( + 'contents' => array('compatible', 'dependencies', 'providesextension', + 'usesrole', 'usestask', 'srcpackage', 'srcuri', 'phprelease', + 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'bundle', 'changelog'), + 'bundledpackage' => array())); + } + + /** + * @param string file name + * @param PEAR_Task_Common a read/write task + */ + function addTaskToFile($filename, $task) + { + if (!method_exists($task, 'getXml')) { + return false; + } + if (!method_exists($task, 'getName')) { + return false; + } + if (!method_exists($task, 'validate')) { + return false; + } + if (!$task->validate()) { + return false; + } + if (!isset($this->_packageInfo['contents']['dir']['file'])) { + return false; + } + $this->getTasksNs(); // discover the tasks namespace if not done already + $files = $this->_packageInfo['contents']['dir']['file']; + if (!isset($files[0])) { + $files = array($files); + $ind = false; + } else { + $ind = true; + } + foreach ($files as $i => $file) { + if (isset($file['attribs'])) { + if ($file['attribs']['name'] == $filename) { + if ($ind) { + $t = isset($this->_packageInfo['contents']['dir']['file'][$i] + ['attribs'][$this->_tasksNs . + ':' . $task->getName()]) ? + $this->_packageInfo['contents']['dir']['file'][$i] + ['attribs'][$this->_tasksNs . + ':' . $task->getName()] : false; + if ($t && !isset($t[0])) { + $this->_packageInfo['contents']['dir']['file'][$i] + [$this->_tasksNs . ':' . $task->getName()] = array($t); + } + $this->_packageInfo['contents']['dir']['file'][$i][$this->_tasksNs . + ':' . $task->getName()][] = $task->getXml(); + } else { + $t = isset($this->_packageInfo['contents']['dir']['file'] + ['attribs'][$this->_tasksNs . + ':' . $task->getName()]) ? $this->_packageInfo['contents']['dir']['file'] + ['attribs'][$this->_tasksNs . + ':' . $task->getName()] : false; + if ($t && !isset($t[0])) { + $this->_packageInfo['contents']['dir']['file'] + [$this->_tasksNs . ':' . $task->getName()] = array($t); + } + $this->_packageInfo['contents']['dir']['file'][$this->_tasksNs . + ':' . $task->getName()][] = $task->getXml(); + } + return true; + } + } + } + return false; + } + + /** + * @param string path to the file + * @param string filename + * @param array extra attributes + */ + function addFile($dir, $file, $attrs) + { + if ($this->getPackageType() == 'bundle') { + return false; + } + $this->_filesValid = false; + $this->_isValid = 0; + $dir = preg_replace(array('!\\\\+!', '!/+!'), array('/', '/'), $dir); + if ($dir == '/' || $dir == '') { + $dir = ''; + } else { + $dir .= '/'; + } + $attrs['name'] = $dir . $file; + if (!isset($this->_packageInfo['contents'])) { + // ensure that the contents tag is set up + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, + array('compatible', 'dependencies', 'providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', + 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'bundle', 'changelog'), array(), 'contents'); + } + if (isset($this->_packageInfo['contents']['dir']['file'])) { + if (!isset($this->_packageInfo['contents']['dir']['file'][0])) { + $this->_packageInfo['contents']['dir']['file'] = + array($this->_packageInfo['contents']['dir']['file']); + } + $this->_packageInfo['contents']['dir']['file'][]['attribs'] = $attrs; + } else { + $this->_packageInfo['contents']['dir']['file']['attribs'] = $attrs; + } + } + + /** + * @param string Dependent package name + * @param string Dependent package's channel name + * @param string minimum version of specified package that this release is guaranteed to be + * compatible with + * @param string maximum version of specified package that this release is guaranteed to be + * compatible with + * @param string versions of specified package that this release is not compatible with + */ + function addCompatiblePackage($name, $channel, $min, $max, $exclude = false) + { + $this->_isValid = 0; + $set = array( + 'name' => $name, + 'channel' => $channel, + 'min' => $min, + 'max' => $max, + ); + if ($exclude) { + $set['exclude'] = $exclude; + } + $this->_isValid = 0; + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $set, array( + 'compatible' => array('dependencies', 'providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog') + )); + } + + /** + * Removes the <usesrole> tag entirely + */ + function resetUsesrole() + { + if (isset($this->_packageInfo['usesrole'])) { + unset($this->_packageInfo['usesrole']); + } + } + + /** + * @param string + * @param string package name or uri + * @param string channel name if non-uri + */ + function addUsesrole($role, $packageOrUri, $channel = false) { + $set = array('role' => $role); + if ($channel) { + $set['package'] = $packageOrUri; + $set['channel'] = $channel; + } else { + $set['uri'] = $packageOrUri; + } + $this->_isValid = 0; + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $set, array( + 'usesrole' => array('usestask', 'srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog') + )); + } + + /** + * Removes the <usestask> tag entirely + */ + function resetUsestask() + { + if (isset($this->_packageInfo['usestask'])) { + unset($this->_packageInfo['usestask']); + } + } + + + /** + * @param string + * @param string package name or uri + * @param string channel name if non-uri + */ + function addUsestask($task, $packageOrUri, $channel = false) { + $set = array('task' => $task); + if ($channel) { + $set['package'] = $packageOrUri; + $set['channel'] = $channel; + } else { + $set['uri'] = $packageOrUri; + } + $this->_isValid = 0; + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $set, array( + 'usestask' => array('srcpackage', 'srcuri', + 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog') + )); + } + + /** + * Remove all compatible tags + */ + function clearCompatible() + { + unset($this->_packageInfo['compatible']); + } + + /** + * Reset dependencies prior to adding new ones + */ + function clearDeps() + { + if (!isset($this->_packageInfo['dependencies'])) { + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, array(), + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'))); + } + $this->_packageInfo['dependencies'] = array(); + } + + /** + * @param string minimum PHP version allowed + * @param string maximum PHP version allowed + * @param array $exclude incompatible PHP versions + */ + function setPhpDep($min, $max = false, $exclude = false) + { + $this->_isValid = 0; + $dep = + array( + 'min' => $min, + ); + if ($max) { + $dep['max'] = $max; + } + if ($exclude) { + if (count($exclude) == 1) { + $exclude = $exclude[0]; + } + $dep['exclude'] = $exclude; + } + if (isset($this->_packageInfo['dependencies']['required']['php'])) { + $this->_stack->push(__FUNCTION__, 'warning', array('dep' => + $this->_packageInfo['dependencies']['required']['php']), + 'warning: PHP dependency already exists, overwriting'); + unset($this->_packageInfo['dependencies']['required']['php']); + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + 'required' => array('optional', 'group'), + 'php' => array('pearinstaller', 'package', 'subpackage', 'extension', 'os', 'arch') + )); + return true; + } + + /** + * @param string minimum allowed PEAR installer version + * @param string maximum allowed PEAR installer version + * @param string recommended PEAR installer version + * @param array incompatible version of the PEAR installer + */ + function setPearinstallerDep($min, $max = false, $recommended = false, $exclude = false) + { + $this->_isValid = 0; + $dep = + array( + 'min' => $min, + ); + if ($max) { + $dep['max'] = $max; + } + if ($recommended) { + $dep['recommended'] = $recommended; + } + if ($exclude) { + if (count($exclude) == 1) { + $exclude = $exclude[0]; + } + $dep['exclude'] = $exclude; + } + if (isset($this->_packageInfo['dependencies']['required']['pearinstaller'])) { + $this->_stack->push(__FUNCTION__, 'warning', array('dep' => + $this->_packageInfo['dependencies']['required']['pearinstaller']), + 'warning: PEAR Installer dependency already exists, overwriting'); + unset($this->_packageInfo['dependencies']['required']['pearinstaller']); + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + 'required' => array('optional', 'group'), + 'pearinstaller' => array('package', 'subpackage', 'extension', 'os', 'arch') + )); + } + + /** + * Mark a package as conflicting with this package + * @param string package name + * @param string package channel + * @param string extension this package provides, if any + * @param string|false minimum version required + * @param string|false maximum version allowed + * @param array|false versions to exclude from installation + */ + function addConflictingPackageDepWithChannel($name, $channel, + $providesextension = false, $min = false, $max = false, $exclude = false) + { + $this->_isValid = 0; + $dep = $this->_constructDep($name, $channel, false, $min, $max, false, + $exclude, $providesextension, false, true); + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + 'required' => array('optional', 'group'), + 'package' => array('subpackage', 'extension', 'os', 'arch') + )); + } + + /** + * Mark a package as conflicting with this package + * @param string package name + * @param string package channel + * @param string extension this package provides, if any + */ + function addConflictingPackageDepWithUri($name, $uri, $providesextension = false) + { + $this->_isValid = 0; + $dep = + array( + 'name' => $name, + 'uri' => $uri, + 'conflicts' => '', + ); + if ($providesextension) { + $dep['providesextension'] = $providesextension; + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + 'required' => array('optional', 'group'), + 'package' => array('subpackage', 'extension', 'os', 'arch') + )); + } + + function addDependencyGroup($name, $hint) + { + $this->_isValid = 0; + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, + array('attribs' => array('name' => $name, 'hint' => $hint)), + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + 'group' => array(), + )); + } + + /** + * @param string package name + * @param string|false channel name, false if this is a uri + * @param string|false uri name, false if this is a channel + * @param string|false minimum version required + * @param string|false maximum version allowed + * @param string|false recommended installation version + * @param array|false versions to exclude from installation + * @param string extension this package provides, if any + * @param bool if true, tells the installer to ignore the default optional dependency group + * when installing this package + * @param bool if true, tells the installer to negate this dependency (conflicts) + * @return array + * @access private + */ + function _constructDep($name, $channel, $uri, $min, $max, $recommended, $exclude, + $providesextension = false, $nodefault = false, + $conflicts = false) + { + $dep = + array( + 'name' => $name, + ); + if ($channel) { + $dep['channel'] = $channel; + } elseif ($uri) { + $dep['uri'] = $uri; + } + if ($min) { + $dep['min'] = $min; + } + if ($max) { + $dep['max'] = $max; + } + if ($recommended) { + $dep['recommended'] = $recommended; + } + if ($exclude) { + if (is_array($exclude) && count($exclude) == 1) { + $exclude = $exclude[0]; + } + $dep['exclude'] = $exclude; + } + if ($conflicts) { + $dep['conflicts'] = ''; + } + if ($nodefault) { + $dep['nodefault'] = ''; + } + if ($providesextension) { + $dep['providesextension'] = $providesextension; + } + return $dep; + } + + /** + * @param package|subpackage + * @param string group name + * @param string package name + * @param string package channel + * @param string minimum version + * @param string maximum version + * @param string recommended version + * @param array|false optional excluded versions + * @param string extension this package provides, if any + * @param bool if true, tells the installer to ignore the default optional dependency group + * when installing this package + * @return bool false if the dependency group has not been initialized with + * {@link addDependencyGroup()}, or a subpackage is added with + * a providesextension + */ + function addGroupPackageDepWithChannel($type, $groupname, $name, $channel, $min = false, + $max = false, $recommended = false, $exclude = false, + $providesextension = false, $nodefault = false) + { + if ($type == 'subpackage' && $providesextension) { + return false; // subpackages must be php packages + } + $dep = $this->_constructDep($name, $channel, false, $min, $max, $recommended, $exclude, + $providesextension, $nodefault); + return $this->_addGroupDependency($type, $dep, $groupname); + } + + /** + * @param package|subpackage + * @param string group name + * @param string package name + * @param string package uri + * @param string extension this package provides, if any + * @param bool if true, tells the installer to ignore the default optional dependency group + * when installing this package + * @return bool false if the dependency group has not been initialized with + * {@link addDependencyGroup()} + */ + function addGroupPackageDepWithURI($type, $groupname, $name, $uri, $providesextension = false, + $nodefault = false) + { + if ($type == 'subpackage' && $providesextension) { + return false; // subpackages must be php packages + } + $dep = $this->_constructDep($name, false, $uri, false, false, false, false, + $providesextension, $nodefault); + return $this->_addGroupDependency($type, $dep, $groupname); + } + + /** + * @param string group name (must be pre-existing) + * @param string extension name + * @param string minimum version allowed + * @param string maximum version allowed + * @param string recommended version + * @param array incompatible versions + */ + function addGroupExtensionDep($groupname, $name, $min = false, $max = false, + $recommended = false, $exclude = false) + { + $this->_isValid = 0; + $dep = $this->_constructDep($name, false, false, $min, $max, $recommended, $exclude); + return $this->_addGroupDependency('extension', $dep, $groupname); + } + + /** + * @param package|subpackage|extension + * @param array dependency contents + * @param string name of the dependency group to add this to + * @return boolean + * @access private + */ + function _addGroupDependency($type, $dep, $groupname) + { + $arr = array('subpackage', 'extension'); + if ($type != 'package') { + array_shift($arr); + } + if ($type == 'extension') { + array_shift($arr); + } + if (!isset($this->_packageInfo['dependencies']['group'])) { + return false; + } else { + if (!isset($this->_packageInfo['dependencies']['group'][0])) { + if ($this->_packageInfo['dependencies']['group']['attribs']['name'] == $groupname) { + $this->_packageInfo['dependencies']['group'] = $this->_mergeTag( + $this->_packageInfo['dependencies']['group'], $dep, + array( + $type => $arr + )); + $this->_isValid = 0; + return true; + } else { + return false; + } + } else { + foreach ($this->_packageInfo['dependencies']['group'] as $i => $group) { + if ($group['attribs']['name'] == $groupname) { + $this->_packageInfo['dependencies']['group'][$i] = $this->_mergeTag( + $this->_packageInfo['dependencies']['group'][$i], $dep, + array( + $type => $arr + )); + $this->_isValid = 0; + return true; + } + } + return false; + } + } + } + + /** + * @param optional|required + * @param string package name + * @param string package channel + * @param string minimum version + * @param string maximum version + * @param string recommended version + * @param string extension this package provides, if any + * @param bool if true, tells the installer to ignore the default optional dependency group + * when installing this package + * @param array|false optional excluded versions + */ + function addPackageDepWithChannel($type, $name, $channel, $min = false, $max = false, + $recommended = false, $exclude = false, + $providesextension = false, $nodefault = false) + { + if (!in_array($type, array('optional', 'required'), true)) { + $type = 'required'; + } + $this->_isValid = 0; + $arr = array('optional', 'group'); + if ($type != 'required') { + array_shift($arr); + } + $dep = $this->_constructDep($name, $channel, false, $min, $max, $recommended, $exclude, + $providesextension, $nodefault); + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + $type => $arr, + 'package' => array('subpackage', 'extension', 'os', 'arch') + )); + } + + /** + * @param optional|required + * @param string name of the package + * @param string uri of the package + * @param string extension this package provides, if any + * @param bool if true, tells the installer to ignore the default optional dependency group + * when installing this package + */ + function addPackageDepWithUri($type, $name, $uri, $providesextension = false, + $nodefault = false) + { + $this->_isValid = 0; + $arr = array('optional', 'group'); + if ($type != 'required') { + array_shift($arr); + } + $dep = $this->_constructDep($name, false, $uri, false, false, false, false, + $providesextension, $nodefault); + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + $type => $arr, + 'package' => array('subpackage', 'extension', 'os', 'arch') + )); + } + + /** + * @param optional|required optional, required + * @param string package name + * @param string package channel + * @param string minimum version + * @param string maximum version + * @param string recommended version + * @param array incompatible versions + * @param bool if true, tells the installer to ignore the default optional dependency group + * when installing this package + */ + function addSubpackageDepWithChannel($type, $name, $channel, $min = false, $max = false, + $recommended = false, $exclude = false, + $nodefault = false) + { + $this->_isValid = 0; + $arr = array('optional', 'group'); + if ($type != 'required') { + array_shift($arr); + } + $dep = $this->_constructDep($name, $channel, false, $min, $max, $recommended, $exclude, + $nodefault); + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + $type => $arr, + 'subpackage' => array('extension', 'os', 'arch') + )); + } + + /** + * @param optional|required optional, required + * @param string package name + * @param string package uri for download + * @param bool if true, tells the installer to ignore the default optional dependency group + * when installing this package + */ + function addSubpackageDepWithUri($type, $name, $uri, $nodefault = false) + { + $this->_isValid = 0; + $arr = array('optional', 'group'); + if ($type != 'required') { + array_shift($arr); + } + $dep = $this->_constructDep($name, false, $uri, false, false, false, false, $nodefault); + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + $type => $arr, + 'subpackage' => array('extension', 'os', 'arch') + )); + } + + /** + * @param optional|required optional, required + * @param string extension name + * @param string minimum version + * @param string maximum version + * @param string recommended version + * @param array incompatible versions + */ + function addExtensionDep($type, $name, $min = false, $max = false, $recommended = false, + $exclude = false) + { + $this->_isValid = 0; + $arr = array('optional', 'group'); + if ($type != 'required') { + array_shift($arr); + } + $dep = $this->_constructDep($name, false, false, $min, $max, $recommended, $exclude); + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + $type => $arr, + 'extension' => array('os', 'arch') + )); + } + + /** + * @param string Operating system name + * @param boolean true if this package cannot be installed on this OS + */ + function addOsDep($name, $conflicts = false) + { + $this->_isValid = 0; + $dep = array('name' => $name); + if ($conflicts) { + $dep['conflicts'] = ''; + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + 'required' => array('optional', 'group'), + 'os' => array('arch') + )); + } + + /** + * @param string Architecture matching pattern + * @param boolean true if this package cannot be installed on this architecture + */ + function addArchDep($pattern, $conflicts = false) + { + $this->_isValid = 0; + $dep = array('pattern' => $pattern); + if ($conflicts) { + $dep['conflicts'] = ''; + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep, + array( + 'dependencies' => array('providesextension', 'usesrole', 'usestask', + 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'), + 'required' => array('optional', 'group'), + 'arch' => array() + )); + } + + /** + * Set the kind of package, and erase all release tags + * + * - a php package is a PEAR-style package + * - an extbin package is a PECL-style extension binary + * - an extsrc package is a PECL-style source for a binary + * - an zendextbin package is a PECL-style zend extension binary + * - an zendextsrc package is a PECL-style source for a zend extension binary + * - a bundle package is a collection of other pre-packaged packages + * @param php|extbin|extsrc|zendextsrc|zendextbin|bundle + * @return bool success + */ + function setPackageType($type) + { + $this->_isValid = 0; + if (!in_array($type, array('php', 'extbin', 'extsrc', 'zendextsrc', + 'zendextbin', 'bundle'))) { + return false; + } + + if (in_array($type, array('zendextsrc', 'zendextbin'))) { + $this->_setPackageVersion2_1(); + } + + if ($type != 'bundle') { + $type .= 'release'; + } + + foreach (array('phprelease', 'extbinrelease', 'extsrcrelease', + 'zendextsrcrelease', 'zendextbinrelease', 'bundle') as $test) { + unset($this->_packageInfo[$test]); + } + + if (!isset($this->_packageInfo[$type])) { + // ensure that the release tag is set up + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('changelog'), + array(), $type); + } + + $this->_packageInfo[$type] = array(); + return true; + } + + /** + * @return bool true if package type is set up + */ + function addRelease() + { + if ($type = $this->getPackageType()) { + if ($type != 'bundle') { + $type .= 'release'; + } + $this->_packageInfo = $this->_mergeTag($this->_packageInfo, array(), + array($type => array('changelog'))); + return true; + } + return false; + } + + /** + * Get the current release tag in order to add to it + * @param bool returns only releases that have installcondition if true + * @return array|null + */ + function &_getCurrentRelease($strict = true) + { + if ($p = $this->getPackageType()) { + if ($strict) { + if ($p == 'extsrc' || $p == 'zendextsrc') { + $a = null; + return $a; + } + } + if ($p != 'bundle') { + $p .= 'release'; + } + if (isset($this->_packageInfo[$p][0])) { + return $this->_packageInfo[$p][count($this->_packageInfo[$p]) - 1]; + } else { + return $this->_packageInfo[$p]; + } + } else { + $a = null; + return $a; + } + } + + /** + * Add a file to the current release that should be installed under a different name + * @param string <contents> path to file + * @param string name the file should be installed as + */ + function addInstallAs($path, $as) + { + $r = &$this->_getCurrentRelease(); + if ($r === null) { + return false; + } + $this->_isValid = 0; + $r = $this->_mergeTag($r, array('attribs' => array('name' => $path, 'as' => $as)), + array( + 'filelist' => array(), + 'install' => array('ignore') + )); + } + + /** + * Add a file to the current release that should be ignored + * @param string <contents> path to file + * @return bool success of operation + */ + function addIgnore($path) + { + $r = &$this->_getCurrentRelease(); + if ($r === null) { + return false; + } + $this->_isValid = 0; + $r = $this->_mergeTag($r, array('attribs' => array('name' => $path)), + array( + 'filelist' => array(), + 'ignore' => array() + )); + } + + /** + * Add an extension binary package for this extension source code release + * + * Note that the package must be from the same channel as the extension source package + * @param string + */ + function addBinarypackage($package) + { + if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') { + return false; + } + $r = &$this->_getCurrentRelease(false); + if ($r === null) { + return false; + } + $this->_isValid = 0; + $r = $this->_mergeTag($r, $package, + array( + 'binarypackage' => array('filelist'), + )); + } + + /** + * Add a configureoption to an extension source package + * @param string + * @param string + * @param string + */ + function addConfigureOption($name, $prompt, $default = null) + { + if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') { + return false; + } + + $r = &$this->_getCurrentRelease(false); + if ($r === null) { + return false; + } + + $opt = array('attribs' => array('name' => $name, 'prompt' => $prompt)); + if ($default !== null) { + $opt['attribs']['default'] = $default; + } + + $this->_isValid = 0; + $r = $this->_mergeTag($r, $opt, + array( + 'configureoption' => array('binarypackage', 'filelist'), + )); + } + + /** + * Set an installation condition based on php version for the current release set + * @param string minimum version + * @param string maximum version + * @param false|array incompatible versions of PHP + */ + function setPhpInstallCondition($min, $max, $exclude = false) + { + $r = &$this->_getCurrentRelease(); + if ($r === null) { + return false; + } + $this->_isValid = 0; + if (isset($r['installconditions']['php'])) { + unset($r['installconditions']['php']); + } + $dep = array('min' => $min, 'max' => $max); + if ($exclude) { + if (is_array($exclude) && count($exclude) == 1) { + $exclude = $exclude[0]; + } + $dep['exclude'] = $exclude; + } + if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') { + $r = $this->_mergeTag($r, $dep, + array( + 'installconditions' => array('configureoption', 'binarypackage', + 'filelist'), + 'php' => array('extension', 'os', 'arch') + )); + } else { + $r = $this->_mergeTag($r, $dep, + array( + 'installconditions' => array('filelist'), + 'php' => array('extension', 'os', 'arch') + )); + } + } + + /** + * @param optional|required optional, required + * @param string extension name + * @param string minimum version + * @param string maximum version + * @param string recommended version + * @param array incompatible versions + */ + function addExtensionInstallCondition($name, $min = false, $max = false, $recommended = false, + $exclude = false) + { + $r = &$this->_getCurrentRelease(); + if ($r === null) { + return false; + } + $this->_isValid = 0; + $dep = $this->_constructDep($name, false, false, $min, $max, $recommended, $exclude); + if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') { + $r = $this->_mergeTag($r, $dep, + array( + 'installconditions' => array('configureoption', 'binarypackage', + 'filelist'), + 'extension' => array('os', 'arch') + )); + } else { + $r = $this->_mergeTag($r, $dep, + array( + 'installconditions' => array('filelist'), + 'extension' => array('os', 'arch') + )); + } + } + + /** + * Set an installation condition based on operating system for the current release set + * @param string OS name + * @param bool whether this OS is incompatible with the current release + */ + function setOsInstallCondition($name, $conflicts = false) + { + $r = &$this->_getCurrentRelease(); + if ($r === null) { + return false; + } + $this->_isValid = 0; + if (isset($r['installconditions']['os'])) { + unset($r['installconditions']['os']); + } + $dep = array('name' => $name); + if ($conflicts) { + $dep['conflicts'] = ''; + } + if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') { + $r = $this->_mergeTag($r, $dep, + array( + 'installconditions' => array('configureoption', 'binarypackage', + 'filelist'), + 'os' => array('arch') + )); + } else { + $r = $this->_mergeTag($r, $dep, + array( + 'installconditions' => array('filelist'), + 'os' => array('arch') + )); + } + } + + /** + * Set an installation condition based on architecture for the current release set + * @param string architecture pattern + * @param bool whether this arch is incompatible with the current release + */ + function setArchInstallCondition($pattern, $conflicts = false) + { + $r = &$this->_getCurrentRelease(); + if ($r === null) { + return false; + } + $this->_isValid = 0; + if (isset($r['installconditions']['arch'])) { + unset($r['installconditions']['arch']); + } + $dep = array('pattern' => $pattern); + if ($conflicts) { + $dep['conflicts'] = ''; + } + if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') { + $r = $this->_mergeTag($r, $dep, + array( + 'installconditions' => array('configureoption', 'binarypackage', + 'filelist'), + 'arch' => array() + )); + } else { + $r = $this->_mergeTag($r, $dep, + array( + 'installconditions' => array('filelist'), + 'arch' => array() + )); + } + } + + /** + * For extension binary releases, this is used to specify either the + * static URI to a source package, or the package name and channel of the extsrc/zendextsrc + * package it is based on. + * @param string Package name, or full URI to source package (extsrc/zendextsrc type) + */ + function setSourcePackage($packageOrUri) + { + $this->_isValid = 0; + if (isset($this->_packageInfo['channel'])) { + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('phprelease', + 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'bundle', 'changelog'), + $packageOrUri, 'srcpackage'); + } else { + $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('phprelease', + 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease', + 'bundle', 'changelog'), $packageOrUri, 'srcuri'); + } + } + + /** + * Generate a valid change log entry from the current package.xml + * @param string|false + */ + function generateChangeLogEntry($notes = false) + { + return array( + 'version' => + array( + 'release' => $this->getVersion('release'), + 'api' => $this->getVersion('api'), + ), + 'stability' => + $this->getStability(), + 'date' => $this->getDate(), + 'license' => $this->getLicense(true), + 'notes' => $notes ? $notes : $this->getNotes() + ); + } + + /** + * @param string release version to set change log notes for + * @param array output of {@link generateChangeLogEntry()} + */ + function setChangelogEntry($releaseversion, $contents) + { + if (!isset($this->_packageInfo['changelog'])) { + $this->_packageInfo['changelog']['release'] = $contents; + return; + } + if (!isset($this->_packageInfo['changelog']['release'][0])) { + if ($this->_packageInfo['changelog']['release']['version']['release'] == $releaseversion) { + $this->_packageInfo['changelog']['release'] = array( + $this->_packageInfo['changelog']['release']); + } else { + $this->_packageInfo['changelog']['release'] = array( + $this->_packageInfo['changelog']['release']); + return $this->_packageInfo['changelog']['release'][] = $contents; + } + } + foreach($this->_packageInfo['changelog']['release'] as $index => $changelog) { + if (isset($changelog['version']) && + strnatcasecmp($changelog['version']['release'], $releaseversion) == 0) { + $curlog = $index; + } + } + if (isset($curlog)) { + $this->_packageInfo['changelog']['release'][$curlog] = $contents; + } else { + $this->_packageInfo['changelog']['release'][] = $contents; + } + } + + /** + * Remove the changelog entirely + */ + function clearChangeLog() + { + unset($this->_packageInfo['changelog']); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Packager.php b/vendor/pear-pear.php.net/PEAR/PEAR/Packager.php new file mode 100644 index 0000000000000000000000000000000000000000..8995a167fccda9b45e16b4270a3b38f8e38fe483 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Packager.php @@ -0,0 +1,201 @@ +<?php +/** + * PEAR_Packager for generating releases + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V. V. Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Packager.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR/Common.php'; +require_once 'PEAR/PackageFile.php'; +require_once 'System.php'; + +/** + * Administration class used to make a PEAR release tarball. + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 + */ +class PEAR_Packager extends PEAR_Common +{ + /** + * @var PEAR_Registry + */ + var $_registry; + + function package($pkgfile = null, $compress = true, $pkg2 = null) + { + // {{{ validate supplied package.xml file + if (empty($pkgfile)) { + $pkgfile = 'package.xml'; + } + + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $pkg = &new PEAR_PackageFile($this->config, $this->debug); + $pf = &$pkg->fromPackageFile($pkgfile, PEAR_VALIDATE_NORMAL); + $main = &$pf; + PEAR::staticPopErrorHandling(); + if (PEAR::isError($pf)) { + if (is_array($pf->getUserInfo())) { + foreach ($pf->getUserInfo() as $error) { + $this->log(0, 'Error: ' . $error['message']); + } + } + + $this->log(0, $pf->getMessage()); + return $this->raiseError("Cannot package, errors in package file"); + } + + foreach ($pf->getValidationWarnings() as $warning) { + $this->log(1, 'Warning: ' . $warning['message']); + } + + // }}} + if ($pkg2) { + $this->log(0, 'Attempting to process the second package file'); + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); + $pf2 = &$pkg->fromPackageFile($pkg2, PEAR_VALIDATE_NORMAL); + PEAR::staticPopErrorHandling(); + if (PEAR::isError($pf2)) { + if (is_array($pf2->getUserInfo())) { + foreach ($pf2->getUserInfo() as $error) { + $this->log(0, 'Error: ' . $error['message']); + } + } + $this->log(0, $pf2->getMessage()); + return $this->raiseError("Cannot package, errors in second package file"); + } + + foreach ($pf2->getValidationWarnings() as $warning) { + $this->log(1, 'Warning: ' . $warning['message']); + } + + if ($pf2->getPackagexmlVersion() == '2.0' || + $pf2->getPackagexmlVersion() == '2.1' + ) { + $main = &$pf2; + $other = &$pf; + } else { + $main = &$pf; + $other = &$pf2; + } + + if ($main->getPackagexmlVersion() != '2.0' && + $main->getPackagexmlVersion() != '2.1') { + return PEAR::raiseError('Error: cannot package two package.xml version 1.0, can ' . + 'only package together a package.xml 1.0 and package.xml 2.0'); + } + + if ($other->getPackagexmlVersion() != '1.0') { + return PEAR::raiseError('Error: cannot package two package.xml version 2.0, can ' . + 'only package together a package.xml 1.0 and package.xml 2.0'); + } + } + + $main->setLogger($this); + if (!$main->validate(PEAR_VALIDATE_PACKAGING)) { + foreach ($main->getValidationWarnings() as $warning) { + $this->log(0, 'Error: ' . $warning['message']); + } + return $this->raiseError("Cannot package, errors in package"); + } + + foreach ($main->getValidationWarnings() as $warning) { + $this->log(1, 'Warning: ' . $warning['message']); + } + + if ($pkg2) { + $other->setLogger($this); + $a = false; + if (!$other->validate(PEAR_VALIDATE_NORMAL) || $a = !$main->isEquivalent($other)) { + foreach ($other->getValidationWarnings() as $warning) { + $this->log(0, 'Error: ' . $warning['message']); + } + + foreach ($main->getValidationWarnings() as $warning) { + $this->log(0, 'Error: ' . $warning['message']); + } + + if ($a) { + return $this->raiseError('The two package.xml files are not equivalent!'); + } + + return $this->raiseError("Cannot package, errors in package"); + } + + foreach ($other->getValidationWarnings() as $warning) { + $this->log(1, 'Warning: ' . $warning['message']); + } + + $gen = &$main->getDefaultGenerator(); + $tgzfile = $gen->toTgz2($this, $other, $compress); + if (PEAR::isError($tgzfile)) { + return $tgzfile; + } + + $dest_package = basename($tgzfile); + $pkgdir = dirname($pkgfile); + + // TAR the Package ------------------------------------------- + $this->log(1, "Package $dest_package done"); + if (file_exists("$pkgdir/CVS/Root")) { + $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $pf->getVersion()); + $cvstag = "RELEASE_$cvsversion"; + $this->log(1, 'Tag the released code with "pear cvstag ' . + $main->getPackageFile() . '"'); + $this->log(1, "(or set the CVS tag $cvstag by hand)"); + } elseif (file_exists("$pkgdir/.svn")) { + $svnversion = preg_replace('/[^a-z0-9]/i', '.', $pf->getVersion()); + $svntag = $pf->getName() . "-$svnversion"; + $this->log(1, 'Tag the released code with "pear svntag ' . + $main->getPackageFile() . '"'); + $this->log(1, "(or set the SVN tag $svntag by hand)"); + } + } else { // this branch is executed for single packagefile packaging + $gen = &$pf->getDefaultGenerator(); + $tgzfile = $gen->toTgz($this, $compress); + if (PEAR::isError($tgzfile)) { + $this->log(0, $tgzfile->getMessage()); + return $this->raiseError("Cannot package, errors in package"); + } + + $dest_package = basename($tgzfile); + $pkgdir = dirname($pkgfile); + + // TAR the Package ------------------------------------------- + $this->log(1, "Package $dest_package done"); + if (file_exists("$pkgdir/CVS/Root")) { + $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $pf->getVersion()); + $cvstag = "RELEASE_$cvsversion"; + $this->log(1, "Tag the released code with `pear cvstag $pkgfile'"); + $this->log(1, "(or set the CVS tag $cvstag by hand)"); + } elseif (file_exists("$pkgdir/.svn")) { + $svnversion = preg_replace('/[^a-z0-9]/i', '.', $pf->getVersion()); + $svntag = $pf->getName() . "-$svnversion"; + $this->log(1, "Tag the released code with `pear svntag $pkgfile'"); + $this->log(1, "(or set the SVN tag $svntag by hand)"); + } + } + + return $dest_package; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/REST.php b/vendor/pear-pear.php.net/PEAR/PEAR/REST.php new file mode 100644 index 0000000000000000000000000000000000000000..34a804f2bde4c295ed692f2fa71d324cfdf0c165 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/REST.php @@ -0,0 +1,483 @@ +<?php +/** + * PEAR_REST + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: REST.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * For downloading xml files + */ +require_once 'PEAR.php'; +require_once 'PEAR/XMLParser.php'; + +/** + * Intelligently retrieve data, following hyperlinks if necessary, and re-directing + * as well + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_REST +{ + var $config; + var $_options; + + function PEAR_REST(&$config, $options = array()) + { + $this->config = &$config; + $this->_options = $options; + } + + /** + * Retrieve REST data, but always retrieve the local cache if it is available. + * + * This is useful for elements that should never change, such as information on a particular + * release + * @param string full URL to this resource + * @param array|false contents of the accept-encoding header + * @param boolean if true, xml will be returned as a string, otherwise, xml will be + * parsed using PEAR_XMLParser + * @return string|array + */ + function retrieveCacheFirst($url, $accept = false, $forcestring = false, $channel = false) + { + $cachefile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR . + md5($url) . 'rest.cachefile'; + + if (file_exists($cachefile)) { + return unserialize(implode('', file($cachefile))); + } + + return $this->retrieveData($url, $accept, $forcestring, $channel); + } + + /** + * Retrieve a remote REST resource + * @param string full URL to this resource + * @param array|false contents of the accept-encoding header + * @param boolean if true, xml will be returned as a string, otherwise, xml will be + * parsed using PEAR_XMLParser + * @return string|array + */ + function retrieveData($url, $accept = false, $forcestring = false, $channel = false) + { + $cacheId = $this->getCacheId($url); + if ($ret = $this->useLocalCache($url, $cacheId)) { + return $ret; + } + + $file = $trieddownload = false; + if (!isset($this->_options['offline'])) { + $trieddownload = true; + $file = $this->downloadHttp($url, $cacheId ? $cacheId['lastChange'] : false, $accept, $channel); + } + + if (PEAR::isError($file)) { + if ($file->getCode() !== -9276) { + return $file; + } + + $trieddownload = false; + $file = false; // use local copy if available on socket connect error + } + + if (!$file) { + $ret = $this->getCache($url); + if (!PEAR::isError($ret) && $trieddownload) { + // reset the age of the cache if the server says it was unmodified + $result = $this->saveCache($url, $ret, null, true, $cacheId); + if (PEAR::isError($result)) { + return PEAR::raiseError($result->getMessage()); + } + } + + return $ret; + } + + if (is_array($file)) { + $headers = $file[2]; + $lastmodified = $file[1]; + $content = $file[0]; + } else { + $headers = array(); + $lastmodified = false; + $content = $file; + } + + if ($forcestring) { + $result = $this->saveCache($url, $content, $lastmodified, false, $cacheId); + if (PEAR::isError($result)) { + return PEAR::raiseError($result->getMessage()); + } + + return $content; + } + + if (isset($headers['content-type'])) { + switch ($headers['content-type']) { + case 'text/xml' : + case 'application/xml' : + case 'text/plain' : + if ($headers['content-type'] === 'text/plain') { + $check = substr($content, 0, 5); + if ($check !== '<?xml') { + break; + } + } + + $parser = new PEAR_XMLParser; + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $err = $parser->parse($content); + PEAR::popErrorHandling(); + if (PEAR::isError($err)) { + return PEAR::raiseError('Invalid xml downloaded from "' . $url . '": ' . + $err->getMessage()); + } + $content = $parser->getData(); + case 'text/html' : + default : + // use it as a string + } + } else { + // assume XML + $parser = new PEAR_XMLParser; + $parser->parse($content); + $content = $parser->getData(); + } + + $result = $this->saveCache($url, $content, $lastmodified, false, $cacheId); + if (PEAR::isError($result)) { + return PEAR::raiseError($result->getMessage()); + } + + return $content; + } + + function useLocalCache($url, $cacheid = null) + { + if ($cacheid === null) { + $cacheidfile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR . + md5($url) . 'rest.cacheid'; + if (!file_exists($cacheidfile)) { + return false; + } + + $cacheid = unserialize(implode('', file($cacheidfile))); + } + + $cachettl = $this->config->get('cache_ttl'); + // If cache is newer than $cachettl seconds, we use the cache! + if (time() - $cacheid['age'] < $cachettl) { + return $this->getCache($url); + } + + return false; + } + + function getCacheId($url) + { + $cacheidfile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR . + md5($url) . 'rest.cacheid'; + + if (!file_exists($cacheidfile)) { + return false; + } + + $ret = unserialize(implode('', file($cacheidfile))); + return $ret; + } + + function getCache($url) + { + $cachefile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR . + md5($url) . 'rest.cachefile'; + + if (!file_exists($cachefile)) { + return PEAR::raiseError('No cached content available for "' . $url . '"'); + } + + return unserialize(implode('', file($cachefile))); + } + + /** + * @param string full URL to REST resource + * @param string original contents of the REST resource + * @param array HTTP Last-Modified and ETag headers + * @param bool if true, then the cache id file should be regenerated to + * trigger a new time-to-live value + */ + function saveCache($url, $contents, $lastmodified, $nochange = false, $cacheid = null) + { + $cache_dir = $this->config->get('cache_dir'); + $d = $cache_dir . DIRECTORY_SEPARATOR . md5($url); + $cacheidfile = $d . 'rest.cacheid'; + $cachefile = $d . 'rest.cachefile'; + + if (!is_dir($cache_dir)) { + if (System::mkdir(array('-p', $cache_dir)) === false) { + return PEAR::raiseError("The value of config option cache_dir ($cache_dir) is not a directory and attempts to create the directory failed."); + } + } + + if ($cacheid === null && $nochange) { + $cacheid = unserialize(implode('', file($cacheidfile))); + } + + $idData = serialize(array( + 'age' => time(), + 'lastChange' => ($nochange ? $cacheid['lastChange'] : $lastmodified), + )); + + $result = $this->saveCacheFile($cacheidfile, $idData); + if (PEAR::isError($result)) { + return $result; + } elseif ($nochange) { + return true; + } + + $result = $this->saveCacheFile($cachefile, serialize($contents)); + if (PEAR::isError($result)) { + if (file_exists($cacheidfile)) { + @unlink($cacheidfile); + } + + return $result; + } + + return true; + } + + function saveCacheFile($file, $contents) + { + $len = strlen($contents); + + $cachefile_fp = @fopen($file, 'xb'); // x is the O_CREAT|O_EXCL mode + if ($cachefile_fp !== false) { // create file + if (fwrite($cachefile_fp, $contents, $len) < $len) { + fclose($cachefile_fp); + return PEAR::raiseError("Could not write $file."); + } + } else { // update file + $cachefile_lstat = lstat($file); + $cachefile_fp = @fopen($file, 'wb'); + if (!$cachefile_fp) { + return PEAR::raiseError("Could not open $file for writing."); + } + + $cachefile_fstat = fstat($cachefile_fp); + if ( + $cachefile_lstat['mode'] == $cachefile_fstat['mode'] && + $cachefile_lstat['ino'] == $cachefile_fstat['ino'] && + $cachefile_lstat['dev'] == $cachefile_fstat['dev'] && + $cachefile_fstat['nlink'] === 1 + ) { + if (fwrite($cachefile_fp, $contents, $len) < $len) { + fclose($cachefile_fp); + return PEAR::raiseError("Could not write $file."); + } + } else { + fclose($cachefile_fp); + $link = function_exists('readlink') ? readlink($file) : $file; + return PEAR::raiseError('SECURITY ERROR: Will not write to ' . $file . ' as it is symlinked to ' . $link . ' - Possible symlink attack'); + } + } + + fclose($cachefile_fp); + return true; + } + + /** + * Efficiently Download a file through HTTP. Returns downloaded file as a string in-memory + * This is best used for small files + * + * If an HTTP proxy has been configured (http_proxy PEAR_Config + * setting), the proxy will be used. + * + * @param string $url the URL to download + * @param string $save_dir directory to save file in + * @param false|string|array $lastmodified header values to check against for caching + * use false to return the header values from this download + * @param false|array $accept Accept headers to send + * @return string|array Returns the contents of the downloaded file or a PEAR + * error on failure. If the error is caused by + * socket-related errors, the error object will + * have the fsockopen error code available through + * getCode(). If caching is requested, then return the header + * values. + * + * @access public + */ + function downloadHttp($url, $lastmodified = null, $accept = false, $channel = false) + { + static $redirect = 0; + // always reset , so we are clean case of error + $wasredirect = $redirect; + $redirect = 0; + + $info = parse_url($url); + if (!isset($info['scheme']) || !in_array($info['scheme'], array('http', 'https'))) { + return PEAR::raiseError('Cannot download non-http URL "' . $url . '"'); + } + + if (!isset($info['host'])) { + return PEAR::raiseError('Cannot download from non-URL "' . $url . '"'); + } + + $host = isset($info['host']) ? $info['host'] : null; + $port = isset($info['port']) ? $info['port'] : null; + $path = isset($info['path']) ? $info['path'] : null; + $schema = (isset($info['scheme']) && $info['scheme'] == 'https') ? 'https' : 'http'; + + $proxy_host = $proxy_port = $proxy_user = $proxy_pass = ''; + if ($this->config->get('http_proxy')&& + $proxy = parse_url($this->config->get('http_proxy')) + ) { + $proxy_host = isset($proxy['host']) ? $proxy['host'] : null; + if ($schema === 'https') { + $proxy_host = 'ssl://' . $proxy_host; + } + + $proxy_port = isset($proxy['port']) ? $proxy['port'] : 8080; + $proxy_user = isset($proxy['user']) ? urldecode($proxy['user']) : null; + $proxy_pass = isset($proxy['pass']) ? urldecode($proxy['pass']) : null; + $proxy_schema = (isset($proxy['scheme']) && $proxy['scheme'] == 'https') ? 'https' : 'http'; + } + + if (empty($port)) { + $port = (isset($info['scheme']) && $info['scheme'] == 'https') ? 443 : 80; + } + + if (isset($proxy['host'])) { + $request = "GET $url HTTP/1.1\r\n"; + } else { + $request = "GET $path HTTP/1.1\r\n"; + } + + $request .= "Host: $host\r\n"; + $ifmodifiedsince = ''; + if (is_array($lastmodified)) { + if (isset($lastmodified['Last-Modified'])) { + $ifmodifiedsince = 'If-Modified-Since: ' . $lastmodified['Last-Modified'] . "\r\n"; + } + + if (isset($lastmodified['ETag'])) { + $ifmodifiedsince .= "If-None-Match: $lastmodified[ETag]\r\n"; + } + } else { + $ifmodifiedsince = ($lastmodified ? "If-Modified-Since: $lastmodified\r\n" : ''); + } + + $request .= $ifmodifiedsince . + "User-Agent: PEAR/1.9.4/PHP/" . PHP_VERSION . "\r\n"; + + $username = $this->config->get('username', null, $channel); + $password = $this->config->get('password', null, $channel); + + if ($username && $password) { + $tmp = base64_encode("$username:$password"); + $request .= "Authorization: Basic $tmp\r\n"; + } + + if ($proxy_host != '' && $proxy_user != '') { + $request .= 'Proxy-Authorization: Basic ' . + base64_encode($proxy_user . ':' . $proxy_pass) . "\r\n"; + } + + if ($accept) { + $request .= 'Accept: ' . implode(', ', $accept) . "\r\n"; + } + + $request .= "Accept-Encoding:\r\n"; + $request .= "Connection: close\r\n"; + $request .= "\r\n"; + + if ($proxy_host != '') { + $fp = @fsockopen($proxy_host, $proxy_port, $errno, $errstr, 15); + if (!$fp) { + return PEAR::raiseError("Connection to `$proxy_host:$proxy_port' failed: $errstr", -9276); + } + } else { + if ($schema === 'https') { + $host = 'ssl://' . $host; + } + + $fp = @fsockopen($host, $port, $errno, $errstr); + if (!$fp) { + return PEAR::raiseError("Connection to `$host:$port' failed: $errstr", $errno); + } + } + + fwrite($fp, $request); + + $headers = array(); + $reply = 0; + while ($line = trim(fgets($fp, 1024))) { + if (preg_match('/^([^:]+):\s+(.*)\s*\\z/', $line, $matches)) { + $headers[strtolower($matches[1])] = trim($matches[2]); + } elseif (preg_match('|^HTTP/1.[01] ([0-9]{3}) |', $line, $matches)) { + $reply = (int)$matches[1]; + if ($reply == 304 && ($lastmodified || ($lastmodified === false))) { + return false; + } + + if (!in_array($reply, array(200, 301, 302, 303, 305, 307))) { + return PEAR::raiseError("File $schema://$host:$port$path not valid (received: $line)"); + } + } + } + + if ($reply != 200) { + if (!isset($headers['location'])) { + return PEAR::raiseError("File $schema://$host:$port$path not valid (redirected but no location)"); + } + + if ($wasredirect > 4) { + return PEAR::raiseError("File $schema://$host:$port$path not valid (redirection looped more than 5 times)"); + } + + $redirect = $wasredirect + 1; + return $this->downloadHttp($headers['location'], $lastmodified, $accept, $channel); + } + + $length = isset($headers['content-length']) ? $headers['content-length'] : -1; + + $data = ''; + while ($chunk = @fread($fp, 8192)) { + $data .= $chunk; + } + fclose($fp); + + if ($lastmodified === false || $lastmodified) { + if (isset($headers['etag'])) { + $lastmodified = array('ETag' => $headers['etag']); + } + + if (isset($headers['last-modified'])) { + if (is_array($lastmodified)) { + $lastmodified['Last-Modified'] = $headers['last-modified']; + } else { + $lastmodified = $headers['last-modified']; + } + } + + return array($data, $lastmodified, $headers); + } + + return $data; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/REST/10.php b/vendor/pear-pear.php.net/PEAR/PEAR/REST/10.php new file mode 100644 index 0000000000000000000000000000000000000000..6ded7aeace379c5b6d028d515f28b6d1cd28e88c --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/REST/10.php @@ -0,0 +1,871 @@ +<?php +/** + * PEAR_REST_10 + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: 10.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a12 + */ + +/** + * For downloading REST xml/txt files + */ +require_once 'PEAR/REST.php'; + +/** + * Implement REST 1.0 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a12 + */ +class PEAR_REST_10 +{ + /** + * @var PEAR_REST + */ + var $_rest; + function PEAR_REST_10($config, $options = array()) + { + $this->_rest = &new PEAR_REST($config, $options); + } + + /** + * Retrieve information about a remote package to be downloaded from a REST server + * + * @param string $base The uri to prepend to all REST calls + * @param array $packageinfo an array of format: + * <pre> + * array( + * 'package' => 'packagename', + * 'channel' => 'channelname', + * ['state' => 'alpha' (or valid state),] + * -or- + * ['version' => '1.whatever'] + * </pre> + * @param string $prefstate Current preferred_state config variable value + * @param bool $installed the installed version of this package to compare against + * @return array|false|PEAR_Error see {@link _returnDownloadURL()} + */ + function getDownloadURL($base, $packageinfo, $prefstate, $installed, $channel = false) + { + $states = $this->betterStates($prefstate, true); + if (!$states) { + return PEAR::raiseError('"' . $prefstate . '" is not a valid state'); + } + + $channel = $packageinfo['channel']; + $package = $packageinfo['package']; + $state = isset($packageinfo['state']) ? $packageinfo['state'] : null; + $version = isset($packageinfo['version']) ? $packageinfo['version'] : null; + $restFile = $base . 'r/' . strtolower($package) . '/allreleases.xml'; + + $info = $this->_rest->retrieveData($restFile, false, false, $channel); + if (PEAR::isError($info)) { + return PEAR::raiseError('No releases available for package "' . + $channel . '/' . $package . '"'); + } + + if (!isset($info['r'])) { + return false; + } + + $release = $found = false; + if (!is_array($info['r']) || !isset($info['r'][0])) { + $info['r'] = array($info['r']); + } + + foreach ($info['r'] as $release) { + if (!isset($this->_rest->_options['force']) && ($installed && + version_compare($release['v'], $installed, '<'))) { + continue; + } + + if (isset($state)) { + // try our preferred state first + if ($release['s'] == $state) { + $found = true; + break; + } + // see if there is something newer and more stable + // bug #7221 + if (in_array($release['s'], $this->betterStates($state), true)) { + $found = true; + break; + } + } elseif (isset($version)) { + if ($release['v'] == $version) { + $found = true; + break; + } + } else { + if (in_array($release['s'], $states)) { + $found = true; + break; + } + } + } + + return $this->_returnDownloadURL($base, $package, $release, $info, $found, false, $channel); + } + + function getDepDownloadURL($base, $xsdversion, $dependency, $deppackage, + $prefstate = 'stable', $installed = false, $channel = false) + { + $states = $this->betterStates($prefstate, true); + if (!$states) { + return PEAR::raiseError('"' . $prefstate . '" is not a valid state'); + } + + $channel = $dependency['channel']; + $package = $dependency['name']; + $state = isset($dependency['state']) ? $dependency['state'] : null; + $version = isset($dependency['version']) ? $dependency['version'] : null; + $restFile = $base . 'r/' . strtolower($package) . '/allreleases.xml'; + + $info = $this->_rest->retrieveData($restFile, false, false, $channel); + if (PEAR::isError($info)) { + return PEAR::raiseError('Package "' . $deppackage['channel'] . '/' . $deppackage['package'] + . '" dependency "' . $channel . '/' . $package . '" has no releases'); + } + + if (!is_array($info) || !isset($info['r'])) { + return false; + } + + $exclude = array(); + $min = $max = $recommended = false; + if ($xsdversion == '1.0') { + switch ($dependency['rel']) { + case 'ge' : + $min = $dependency['version']; + break; + case 'gt' : + $min = $dependency['version']; + $exclude = array($dependency['version']); + break; + case 'eq' : + $recommended = $dependency['version']; + break; + case 'lt' : + $max = $dependency['version']; + $exclude = array($dependency['version']); + break; + case 'le' : + $max = $dependency['version']; + break; + case 'ne' : + $exclude = array($dependency['version']); + break; + } + } else { + $min = isset($dependency['min']) ? $dependency['min'] : false; + $max = isset($dependency['max']) ? $dependency['max'] : false; + $recommended = isset($dependency['recommended']) ? + $dependency['recommended'] : false; + if (isset($dependency['exclude'])) { + if (!isset($dependency['exclude'][0])) { + $exclude = array($dependency['exclude']); + } + } + } + $release = $found = false; + if (!is_array($info['r']) || !isset($info['r'][0])) { + $info['r'] = array($info['r']); + } + foreach ($info['r'] as $release) { + if (!isset($this->_rest->_options['force']) && ($installed && + version_compare($release['v'], $installed, '<'))) { + continue; + } + if (in_array($release['v'], $exclude)) { // skip excluded versions + continue; + } + // allow newer releases to say "I'm OK with the dependent package" + if ($xsdversion == '2.0' && isset($release['co'])) { + if (!is_array($release['co']) || !isset($release['co'][0])) { + $release['co'] = array($release['co']); + } + foreach ($release['co'] as $entry) { + if (isset($entry['x']) && !is_array($entry['x'])) { + $entry['x'] = array($entry['x']); + } elseif (!isset($entry['x'])) { + $entry['x'] = array(); + } + if ($entry['c'] == $deppackage['channel'] && + strtolower($entry['p']) == strtolower($deppackage['package']) && + version_compare($deppackage['version'], $entry['min'], '>=') && + version_compare($deppackage['version'], $entry['max'], '<=') && + !in_array($release['v'], $entry['x'])) { + $recommended = $release['v']; + break; + } + } + } + if ($recommended) { + if ($release['v'] != $recommended) { // if we want a specific + // version, then skip all others + continue; + } else { + if (!in_array($release['s'], $states)) { + // the stability is too low, but we must return the + // recommended version if possible + return $this->_returnDownloadURL($base, $package, $release, $info, true, false, $channel); + } + } + } + if ($min && version_compare($release['v'], $min, 'lt')) { // skip too old versions + continue; + } + if ($max && version_compare($release['v'], $max, 'gt')) { // skip too new versions + continue; + } + if ($installed && version_compare($release['v'], $installed, '<')) { + continue; + } + if (in_array($release['s'], $states)) { // if in the preferred state... + $found = true; // ... then use it + break; + } + } + return $this->_returnDownloadURL($base, $package, $release, $info, $found, false, $channel); + } + + /** + * Take raw data and return the array needed for processing a download URL + * + * @param string $base REST base uri + * @param string $package Package name + * @param array $release an array of format array('v' => version, 's' => state) + * describing the release to download + * @param array $info list of all releases as defined by allreleases.xml + * @param bool|null $found determines whether the release was found or this is the next + * best alternative. If null, then versions were skipped because + * of PHP dependency + * @return array|PEAR_Error + * @access private + */ + function _returnDownloadURL($base, $package, $release, $info, $found, $phpversion = false, $channel = false) + { + if (!$found) { + $release = $info['r'][0]; + } + + $packageLower = strtolower($package); + $pinfo = $this->_rest->retrieveCacheFirst($base . 'p/' . $packageLower . '/' . + 'info.xml', false, false, $channel); + if (PEAR::isError($pinfo)) { + return PEAR::raiseError('Package "' . $package . + '" does not have REST info xml available'); + } + + $releaseinfo = $this->_rest->retrieveCacheFirst($base . 'r/' . $packageLower . '/' . + $release['v'] . '.xml', false, false, $channel); + if (PEAR::isError($releaseinfo)) { + return PEAR::raiseError('Package "' . $package . '" Version "' . $release['v'] . + '" does not have REST xml available'); + } + + $packagexml = $this->_rest->retrieveCacheFirst($base . 'r/' . $packageLower . '/' . + 'deps.' . $release['v'] . '.txt', false, true, $channel); + if (PEAR::isError($packagexml)) { + return PEAR::raiseError('Package "' . $package . '" Version "' . $release['v'] . + '" does not have REST dependency information available'); + } + + $packagexml = unserialize($packagexml); + if (!$packagexml) { + $packagexml = array(); + } + + $allinfo = $this->_rest->retrieveData($base . 'r/' . $packageLower . + '/allreleases.xml', false, false, $channel); + if (PEAR::isError($allinfo)) { + return $allinfo; + } + + if (!is_array($allinfo['r']) || !isset($allinfo['r'][0])) { + $allinfo['r'] = array($allinfo['r']); + } + + $compatible = false; + foreach ($allinfo['r'] as $release) { + if ($release['v'] != $releaseinfo['v']) { + continue; + } + + if (!isset($release['co'])) { + break; + } + + $compatible = array(); + if (!is_array($release['co']) || !isset($release['co'][0])) { + $release['co'] = array($release['co']); + } + + foreach ($release['co'] as $entry) { + $comp = array(); + $comp['name'] = $entry['p']; + $comp['channel'] = $entry['c']; + $comp['min'] = $entry['min']; + $comp['max'] = $entry['max']; + if (isset($entry['x']) && !is_array($entry['x'])) { + $comp['exclude'] = $entry['x']; + } + + $compatible[] = $comp; + } + + if (count($compatible) == 1) { + $compatible = $compatible[0]; + } + + break; + } + + $deprecated = false; + if (isset($pinfo['dc']) && isset($pinfo['dp'])) { + if (is_array($pinfo['dp'])) { + $deprecated = array('channel' => (string) $pinfo['dc'], + 'package' => trim($pinfo['dp']['_content'])); + } else { + $deprecated = array('channel' => (string) $pinfo['dc'], + 'package' => trim($pinfo['dp'])); + } + } + + $return = array( + 'version' => $releaseinfo['v'], + 'info' => $packagexml, + 'package' => $releaseinfo['p']['_content'], + 'stability' => $releaseinfo['st'], + 'compatible' => $compatible, + 'deprecated' => $deprecated, + ); + + if ($found) { + $return['url'] = $releaseinfo['g']; + return $return; + } + + $return['php'] = $phpversion; + return $return; + } + + function listPackages($base, $channel = false) + { + $packagelist = $this->_rest->retrieveData($base . 'p/packages.xml', false, false, $channel); + if (PEAR::isError($packagelist)) { + return $packagelist; + } + + if (!is_array($packagelist) || !isset($packagelist['p'])) { + return array(); + } + + if (!is_array($packagelist['p'])) { + $packagelist['p'] = array($packagelist['p']); + } + + return $packagelist['p']; + } + + /** + * List all categories of a REST server + * + * @param string $base base URL of the server + * @return array of categorynames + */ + function listCategories($base, $channel = false) + { + $categories = array(); + + // c/categories.xml does not exist; + // check for every package its category manually + // This is SLOOOWWWW : /// + $packagelist = $this->_rest->retrieveData($base . 'p/packages.xml', false, false, $channel); + if (PEAR::isError($packagelist)) { + return $packagelist; + } + + if (!is_array($packagelist) || !isset($packagelist['p'])) { + $ret = array(); + return $ret; + } + + if (!is_array($packagelist['p'])) { + $packagelist['p'] = array($packagelist['p']); + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + foreach ($packagelist['p'] as $package) { + $inf = $this->_rest->retrieveData($base . 'p/' . strtolower($package) . '/info.xml', false, false, $channel); + if (PEAR::isError($inf)) { + PEAR::popErrorHandling(); + return $inf; + } + $cat = $inf['ca']['_content']; + if (!isset($categories[$cat])) { + $categories[$cat] = $inf['ca']; + } + } + + return array_values($categories); + } + + /** + * List a category of a REST server + * + * @param string $base base URL of the server + * @param string $category name of the category + * @param boolean $info also download full package info + * @return array of packagenames + */ + function listCategory($base, $category, $info = false, $channel = false) + { + // gives '404 Not Found' error when category doesn't exist + $packagelist = $this->_rest->retrieveData($base.'c/'.urlencode($category).'/packages.xml', false, false, $channel); + if (PEAR::isError($packagelist)) { + return $packagelist; + } + + if (!is_array($packagelist) || !isset($packagelist['p'])) { + return array(); + } + + if (!is_array($packagelist['p']) || + !isset($packagelist['p'][0])) { // only 1 pkg + $packagelist = array($packagelist['p']); + } else { + $packagelist = $packagelist['p']; + } + + if ($info == true) { + // get individual package info + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + foreach ($packagelist as $i => $packageitem) { + $url = sprintf('%s'.'r/%s/latest.txt', + $base, + strtolower($packageitem['_content'])); + $version = $this->_rest->retrieveData($url, false, false, $channel); + if (PEAR::isError($version)) { + break; // skipit + } + $url = sprintf('%s'.'r/%s/%s.xml', + $base, + strtolower($packageitem['_content']), + $version); + $info = $this->_rest->retrieveData($url, false, false, $channel); + if (PEAR::isError($info)) { + break; // skipit + } + $packagelist[$i]['info'] = $info; + } + PEAR::popErrorHandling(); + } + + return $packagelist; + } + + + function listAll($base, $dostable, $basic = true, $searchpackage = false, $searchsummary = false, $channel = false) + { + $packagelist = $this->_rest->retrieveData($base . 'p/packages.xml', false, false, $channel); + if (PEAR::isError($packagelist)) { + return $packagelist; + } + if ($this->_rest->config->get('verbose') > 0) { + $ui = &PEAR_Frontend::singleton(); + $ui->log('Retrieving data...0%', true); + } + $ret = array(); + if (!is_array($packagelist) || !isset($packagelist['p'])) { + return $ret; + } + if (!is_array($packagelist['p'])) { + $packagelist['p'] = array($packagelist['p']); + } + + // only search-packagename = quicksearch ! + if ($searchpackage && (!$searchsummary || empty($searchpackage))) { + $newpackagelist = array(); + foreach ($packagelist['p'] as $package) { + if (!empty($searchpackage) && stristr($package, $searchpackage) !== false) { + $newpackagelist[] = $package; + } + } + $packagelist['p'] = $newpackagelist; + } + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $next = .1; + foreach ($packagelist['p'] as $progress => $package) { + if ($this->_rest->config->get('verbose') > 0) { + if ($progress / count($packagelist['p']) >= $next) { + if ($next == .5) { + $ui->log('50%', false); + } else { + $ui->log('.', false); + } + $next += .1; + } + } + + if ($basic) { // remote-list command + if ($dostable) { + $latest = $this->_rest->retrieveData($base . 'r/' . strtolower($package) . + '/stable.txt', false, false, $channel); + } else { + $latest = $this->_rest->retrieveData($base . 'r/' . strtolower($package) . + '/latest.txt', false, false, $channel); + } + if (PEAR::isError($latest)) { + $latest = false; + } + $info = array('stable' => $latest); + } else { // list-all command + $inf = $this->_rest->retrieveData($base . 'p/' . strtolower($package) . '/info.xml', false, false, $channel); + if (PEAR::isError($inf)) { + PEAR::popErrorHandling(); + return $inf; + } + if ($searchpackage) { + $found = (!empty($searchpackage) && stristr($package, $searchpackage) !== false); + if (!$found && !(isset($searchsummary) && !empty($searchsummary) + && (stristr($inf['s'], $searchsummary) !== false + || stristr($inf['d'], $searchsummary) !== false))) + { + continue; + }; + } + $releases = $this->_rest->retrieveData($base . 'r/' . strtolower($package) . + '/allreleases.xml', false, false, $channel); + if (PEAR::isError($releases)) { + continue; + } + if (!isset($releases['r'][0])) { + $releases['r'] = array($releases['r']); + } + unset($latest); + unset($unstable); + unset($stable); + unset($state); + foreach ($releases['r'] as $release) { + if (!isset($latest)) { + if ($dostable && $release['s'] == 'stable') { + $latest = $release['v']; + $state = 'stable'; + } + if (!$dostable) { + $latest = $release['v']; + $state = $release['s']; + } + } + if (!isset($stable) && $release['s'] == 'stable') { + $stable = $release['v']; + if (!isset($unstable)) { + $unstable = $stable; + } + } + if (!isset($unstable) && $release['s'] != 'stable') { + $latest = $unstable = $release['v']; + $state = $release['s']; + } + if (isset($latest) && !isset($state)) { + $state = $release['s']; + } + if (isset($latest) && isset($stable) && isset($unstable)) { + break; + } + } + $deps = array(); + if (!isset($unstable)) { + $unstable = false; + $state = 'stable'; + if (isset($stable)) { + $latest = $unstable = $stable; + } + } else { + $latest = $unstable; + } + if (!isset($latest)) { + $latest = false; + } + if ($latest) { + $d = $this->_rest->retrieveCacheFirst($base . 'r/' . strtolower($package) . '/deps.' . + $latest . '.txt', false, false, $channel); + if (!PEAR::isError($d)) { + $d = unserialize($d); + if ($d) { + if (isset($d['required'])) { + if (!class_exists('PEAR_PackageFile_v2')) { + require_once 'PEAR/PackageFile/v2.php'; + } + if (!isset($pf)) { + $pf = new PEAR_PackageFile_v2; + } + $pf->setDeps($d); + $tdeps = $pf->getDeps(); + } else { + $tdeps = $d; + } + foreach ($tdeps as $dep) { + if ($dep['type'] !== 'pkg') { + continue; + } + $deps[] = $dep; + } + } + } + } + if (!isset($stable)) { + $stable = '-n/a-'; + } + if (!$searchpackage) { + $info = array('stable' => $latest, 'summary' => $inf['s'], 'description' => + $inf['d'], 'deps' => $deps, 'category' => $inf['ca']['_content'], + 'unstable' => $unstable, 'state' => $state); + } else { + $info = array('stable' => $stable, 'summary' => $inf['s'], 'description' => + $inf['d'], 'deps' => $deps, 'category' => $inf['ca']['_content'], + 'unstable' => $unstable, 'state' => $state); + } + } + $ret[$package] = $info; + } + PEAR::popErrorHandling(); + return $ret; + } + + function listLatestUpgrades($base, $pref_state, $installed, $channel, &$reg) + { + $packagelist = $this->_rest->retrieveData($base . 'p/packages.xml', false, false, $channel); + if (PEAR::isError($packagelist)) { + return $packagelist; + } + + $ret = array(); + if (!is_array($packagelist) || !isset($packagelist['p'])) { + return $ret; + } + + if (!is_array($packagelist['p'])) { + $packagelist['p'] = array($packagelist['p']); + } + + foreach ($packagelist['p'] as $package) { + if (!isset($installed[strtolower($package)])) { + continue; + } + + $inst_version = $reg->packageInfo($package, 'version', $channel); + $inst_state = $reg->packageInfo($package, 'release_state', $channel); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $info = $this->_rest->retrieveData($base . 'r/' . strtolower($package) . + '/allreleases.xml', false, false, $channel); + PEAR::popErrorHandling(); + if (PEAR::isError($info)) { + continue; // no remote releases + } + + if (!isset($info['r'])) { + continue; + } + + $release = $found = false; + if (!is_array($info['r']) || !isset($info['r'][0])) { + $info['r'] = array($info['r']); + } + + // $info['r'] is sorted by version number + usort($info['r'], array($this, '_sortReleasesByVersionNumber')); + foreach ($info['r'] as $release) { + if ($inst_version && version_compare($release['v'], $inst_version, '<=')) { + // not newer than the one installed + break; + } + + // new version > installed version + if (!$pref_state) { + // every state is a good state + $found = true; + break; + } else { + $new_state = $release['s']; + // if new state >= installed state: go + if (in_array($new_state, $this->betterStates($inst_state, true))) { + $found = true; + break; + } else { + // only allow to lower the state of package, + // if new state >= preferred state: go + if (in_array($new_state, $this->betterStates($pref_state, true))) { + $found = true; + break; + } + } + } + } + + if (!$found) { + continue; + } + + $relinfo = $this->_rest->retrieveCacheFirst($base . 'r/' . strtolower($package) . '/' . + $release['v'] . '.xml', false, false, $channel); + if (PEAR::isError($relinfo)) { + return $relinfo; + } + + $ret[$package] = array( + 'version' => $release['v'], + 'state' => $release['s'], + 'filesize' => $relinfo['f'], + ); + } + + return $ret; + } + + function packageInfo($base, $package, $channel = false) + { + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $pinfo = $this->_rest->retrieveData($base . 'p/' . strtolower($package) . '/info.xml', false, false, $channel); + if (PEAR::isError($pinfo)) { + PEAR::popErrorHandling(); + return PEAR::raiseError('Unknown package: "' . $package . '" in channel "' . $channel . '"' . "\n". 'Debug: ' . + $pinfo->getMessage()); + } + + $releases = array(); + $allreleases = $this->_rest->retrieveData($base . 'r/' . strtolower($package) . + '/allreleases.xml', false, false, $channel); + if (!PEAR::isError($allreleases)) { + if (!class_exists('PEAR_PackageFile_v2')) { + require_once 'PEAR/PackageFile/v2.php'; + } + + if (!is_array($allreleases['r']) || !isset($allreleases['r'][0])) { + $allreleases['r'] = array($allreleases['r']); + } + + $pf = new PEAR_PackageFile_v2; + foreach ($allreleases['r'] as $release) { + $ds = $this->_rest->retrieveCacheFirst($base . 'r/' . strtolower($package) . '/deps.' . + $release['v'] . '.txt', false, false, $channel); + if (PEAR::isError($ds)) { + continue; + } + + if (!isset($latest)) { + $latest = $release['v']; + } + + $pf->setDeps(unserialize($ds)); + $ds = $pf->getDeps(); + $info = $this->_rest->retrieveCacheFirst($base . 'r/' . strtolower($package) + . '/' . $release['v'] . '.xml', false, false, $channel); + + if (PEAR::isError($info)) { + continue; + } + + $releases[$release['v']] = array( + 'doneby' => $info['m'], + 'license' => $info['l'], + 'summary' => $info['s'], + 'description' => $info['d'], + 'releasedate' => $info['da'], + 'releasenotes' => $info['n'], + 'state' => $release['s'], + 'deps' => $ds ? $ds : array(), + ); + } + } else { + $latest = ''; + } + + PEAR::popErrorHandling(); + if (isset($pinfo['dc']) && isset($pinfo['dp'])) { + if (is_array($pinfo['dp'])) { + $deprecated = array('channel' => (string) $pinfo['dc'], + 'package' => trim($pinfo['dp']['_content'])); + } else { + $deprecated = array('channel' => (string) $pinfo['dc'], + 'package' => trim($pinfo['dp'])); + } + } else { + $deprecated = false; + } + + if (!isset($latest)) { + $latest = ''; + } + + return array( + 'name' => $pinfo['n'], + 'channel' => $pinfo['c'], + 'category' => $pinfo['ca']['_content'], + 'stable' => $latest, + 'license' => $pinfo['l'], + 'summary' => $pinfo['s'], + 'description' => $pinfo['d'], + 'releases' => $releases, + 'deprecated' => $deprecated, + ); + } + + /** + * Return an array containing all of the states that are more stable than + * or equal to the passed in state + * + * @param string Release state + * @param boolean Determines whether to include $state in the list + * @return false|array False if $state is not a valid release state + */ + function betterStates($state, $include = false) + { + static $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable'); + $i = array_search($state, $states); + if ($i === false) { + return false; + } + + if ($include) { + $i--; + } + + return array_slice($states, $i + 1); + } + + /** + * Sort releases by version number + * + * @access private + */ + function _sortReleasesByVersionNumber($a, $b) + { + if (version_compare($a['v'], $b['v'], '=')) { + return 0; + } + + if (version_compare($a['v'], $b['v'], '>')) { + return -1; + } + + if (version_compare($a['v'], $b['v'], '<')) { + return 1; + } + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/REST/11.php b/vendor/pear-pear.php.net/PEAR/PEAR/REST/11.php new file mode 100644 index 0000000000000000000000000000000000000000..831cfccdb7555ef9ff52fc65b2211927eb3ab019 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/REST/11.php @@ -0,0 +1,341 @@ +<?php +/** + * PEAR_REST_11 - implement faster list-all/remote-list command + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: 11.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.3 + */ + +/** + * For downloading REST xml/txt files + */ +require_once 'PEAR/REST.php'; + +/** + * Implement REST 1.1 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.3 + */ +class PEAR_REST_11 +{ + /** + * @var PEAR_REST + */ + var $_rest; + + function PEAR_REST_11($config, $options = array()) + { + $this->_rest = &new PEAR_REST($config, $options); + } + + function listAll($base, $dostable, $basic = true, $searchpackage = false, $searchsummary = false, $channel = false) + { + $categorylist = $this->_rest->retrieveData($base . 'c/categories.xml', false, false, $channel); + if (PEAR::isError($categorylist)) { + return $categorylist; + } + + $ret = array(); + if (!is_array($categorylist['c']) || !isset($categorylist['c'][0])) { + $categorylist['c'] = array($categorylist['c']); + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + + foreach ($categorylist['c'] as $progress => $category) { + $category = $category['_content']; + $packagesinfo = $this->_rest->retrieveData($base . + 'c/' . urlencode($category) . '/packagesinfo.xml', false, false, $channel); + + if (PEAR::isError($packagesinfo)) { + continue; + } + + if (!is_array($packagesinfo) || !isset($packagesinfo['pi'])) { + continue; + } + + if (!is_array($packagesinfo['pi']) || !isset($packagesinfo['pi'][0])) { + $packagesinfo['pi'] = array($packagesinfo['pi']); + } + + foreach ($packagesinfo['pi'] as $packageinfo) { + if (empty($packageinfo)) { + continue; + } + + $info = $packageinfo['p']; + $package = $info['n']; + $releases = isset($packageinfo['a']) ? $packageinfo['a'] : false; + unset($latest); + unset($unstable); + unset($stable); + unset($state); + + if ($releases) { + if (!isset($releases['r'][0])) { + $releases['r'] = array($releases['r']); + } + + foreach ($releases['r'] as $release) { + if (!isset($latest)) { + if ($dostable && $release['s'] == 'stable') { + $latest = $release['v']; + $state = 'stable'; + } + if (!$dostable) { + $latest = $release['v']; + $state = $release['s']; + } + } + + if (!isset($stable) && $release['s'] == 'stable') { + $stable = $release['v']; + if (!isset($unstable)) { + $unstable = $stable; + } + } + + if (!isset($unstable) && $release['s'] != 'stable') { + $unstable = $release['v']; + $state = $release['s']; + } + + if (isset($latest) && !isset($state)) { + $state = $release['s']; + } + + if (isset($latest) && isset($stable) && isset($unstable)) { + break; + } + } + } + + if ($basic) { // remote-list command + if (!isset($latest)) { + $latest = false; + } + + if ($dostable) { + // $state is not set if there are no releases + if (isset($state) && $state == 'stable') { + $ret[$package] = array('stable' => $latest); + } else { + $ret[$package] = array('stable' => '-n/a-'); + } + } else { + $ret[$package] = array('stable' => $latest); + } + + continue; + } + + // list-all command + if (!isset($unstable)) { + $unstable = false; + $state = 'stable'; + if (isset($stable)) { + $latest = $unstable = $stable; + } + } else { + $latest = $unstable; + } + + if (!isset($latest)) { + $latest = false; + } + + $deps = array(); + if ($latest && isset($packageinfo['deps'])) { + if (!is_array($packageinfo['deps']) || + !isset($packageinfo['deps'][0]) + ) { + $packageinfo['deps'] = array($packageinfo['deps']); + } + + $d = false; + foreach ($packageinfo['deps'] as $dep) { + if ($dep['v'] == $latest) { + $d = unserialize($dep['d']); + } + } + + if ($d) { + if (isset($d['required'])) { + if (!class_exists('PEAR_PackageFile_v2')) { + require_once 'PEAR/PackageFile/v2.php'; + } + + if (!isset($pf)) { + $pf = new PEAR_PackageFile_v2; + } + + $pf->setDeps($d); + $tdeps = $pf->getDeps(); + } else { + $tdeps = $d; + } + + foreach ($tdeps as $dep) { + if ($dep['type'] !== 'pkg') { + continue; + } + + $deps[] = $dep; + } + } + } + + $info = array( + 'stable' => $latest, + 'summary' => $info['s'], + 'description' => $info['d'], + 'deps' => $deps, + 'category' => $info['ca']['_content'], + 'unstable' => $unstable, + 'state' => $state + ); + $ret[$package] = $info; + } + } + + PEAR::popErrorHandling(); + return $ret; + } + + /** + * List all categories of a REST server + * + * @param string $base base URL of the server + * @return array of categorynames + */ + function listCategories($base, $channel = false) + { + $categorylist = $this->_rest->retrieveData($base . 'c/categories.xml', false, false, $channel); + if (PEAR::isError($categorylist)) { + return $categorylist; + } + + if (!is_array($categorylist) || !isset($categorylist['c'])) { + return array(); + } + + if (isset($categorylist['c']['_content'])) { + // only 1 category + $categorylist['c'] = array($categorylist['c']); + } + + return $categorylist['c']; + } + + /** + * List packages in a category of a REST server + * + * @param string $base base URL of the server + * @param string $category name of the category + * @param boolean $info also download full package info + * @return array of packagenames + */ + function listCategory($base, $category, $info = false, $channel = false) + { + if ($info == false) { + $url = '%s'.'c/%s/packages.xml'; + } else { + $url = '%s'.'c/%s/packagesinfo.xml'; + } + $url = sprintf($url, + $base, + urlencode($category)); + + // gives '404 Not Found' error when category doesn't exist + $packagelist = $this->_rest->retrieveData($url, false, false, $channel); + if (PEAR::isError($packagelist)) { + return $packagelist; + } + if (!is_array($packagelist)) { + return array(); + } + + if ($info == false) { + if (!isset($packagelist['p'])) { + return array(); + } + if (!is_array($packagelist['p']) || + !isset($packagelist['p'][0])) { // only 1 pkg + $packagelist = array($packagelist['p']); + } else { + $packagelist = $packagelist['p']; + } + return $packagelist; + } + + // info == true + if (!isset($packagelist['pi'])) { + return array(); + } + + if (!is_array($packagelist['pi']) || + !isset($packagelist['pi'][0])) { // only 1 pkg + $packagelist_pre = array($packagelist['pi']); + } else { + $packagelist_pre = $packagelist['pi']; + } + + $packagelist = array(); + foreach ($packagelist_pre as $i => $item) { + // compatibility with r/<latest.txt>.xml + if (isset($item['a']['r'][0])) { + // multiple releases + $item['p']['v'] = $item['a']['r'][0]['v']; + $item['p']['st'] = $item['a']['r'][0]['s']; + } elseif (isset($item['a'])) { + // first and only release + $item['p']['v'] = $item['a']['r']['v']; + $item['p']['st'] = $item['a']['r']['s']; + } + + $packagelist[$i] = array('attribs' => $item['p']['r'], + '_content' => $item['p']['n'], + 'info' => $item['p']); + } + + return $packagelist; + } + + /** + * Return an array containing all of the states that are more stable than + * or equal to the passed in state + * + * @param string Release state + * @param boolean Determines whether to include $state in the list + * @return false|array False if $state is not a valid release state + */ + function betterStates($state, $include = false) + { + static $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable'); + $i = array_search($state, $states); + if ($i === false) { + return false; + } + if ($include) { + $i--; + } + return array_slice($states, $i + 1); + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/REST/13.php b/vendor/pear-pear.php.net/PEAR/PEAR/REST/13.php new file mode 100644 index 0000000000000000000000000000000000000000..722ae0de30fc97a1677310130a9c6ba505304ca4 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/REST/13.php @@ -0,0 +1,299 @@ +<?php +/** + * PEAR_REST_13 + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: 13.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a12 + */ + +/** + * For downloading REST xml/txt files + */ +require_once 'PEAR/REST.php'; +require_once 'PEAR/REST/10.php'; + +/** + * Implement REST 1.3 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a12 + */ +class PEAR_REST_13 extends PEAR_REST_10 +{ + /** + * Retrieve information about a remote package to be downloaded from a REST server + * + * This is smart enough to resolve the minimum PHP version dependency prior to download + * @param string $base The uri to prepend to all REST calls + * @param array $packageinfo an array of format: + * <pre> + * array( + * 'package' => 'packagename', + * 'channel' => 'channelname', + * ['state' => 'alpha' (or valid state),] + * -or- + * ['version' => '1.whatever'] + * </pre> + * @param string $prefstate Current preferred_state config variable value + * @param bool $installed the installed version of this package to compare against + * @return array|false|PEAR_Error see {@link _returnDownloadURL()} + */ + function getDownloadURL($base, $packageinfo, $prefstate, $installed, $channel = false) + { + $states = $this->betterStates($prefstate, true); + if (!$states) { + return PEAR::raiseError('"' . $prefstate . '" is not a valid state'); + } + + $channel = $packageinfo['channel']; + $package = $packageinfo['package']; + $state = isset($packageinfo['state']) ? $packageinfo['state'] : null; + $version = isset($packageinfo['version']) ? $packageinfo['version'] : null; + $restFile = $base . 'r/' . strtolower($package) . '/allreleases2.xml'; + + $info = $this->_rest->retrieveData($restFile, false, false, $channel); + if (PEAR::isError($info)) { + return PEAR::raiseError('No releases available for package "' . + $channel . '/' . $package . '"'); + } + + if (!isset($info['r'])) { + return false; + } + + $release = $found = false; + if (!is_array($info['r']) || !isset($info['r'][0])) { + $info['r'] = array($info['r']); + } + + $skippedphp = false; + foreach ($info['r'] as $release) { + if (!isset($this->_rest->_options['force']) && ($installed && + version_compare($release['v'], $installed, '<'))) { + continue; + } + + if (isset($state)) { + // try our preferred state first + if ($release['s'] == $state) { + if (!isset($version) && version_compare($release['m'], phpversion(), '>')) { + // skip releases that require a PHP version newer than our PHP version + $skippedphp = $release; + continue; + } + $found = true; + break; + } + + // see if there is something newer and more stable + // bug #7221 + if (in_array($release['s'], $this->betterStates($state), true)) { + if (!isset($version) && version_compare($release['m'], phpversion(), '>')) { + // skip releases that require a PHP version newer than our PHP version + $skippedphp = $release; + continue; + } + $found = true; + break; + } + } elseif (isset($version)) { + if ($release['v'] == $version) { + if (!isset($this->_rest->_options['force']) && + !isset($version) && + version_compare($release['m'], phpversion(), '>')) { + // skip releases that require a PHP version newer than our PHP version + $skippedphp = $release; + continue; + } + $found = true; + break; + } + } else { + if (in_array($release['s'], $states)) { + if (version_compare($release['m'], phpversion(), '>')) { + // skip releases that require a PHP version newer than our PHP version + $skippedphp = $release; + continue; + } + $found = true; + break; + } + } + } + + if (!$found && $skippedphp) { + $found = null; + } + + return $this->_returnDownloadURL($base, $package, $release, $info, $found, $skippedphp, $channel); + } + + function getDepDownloadURL($base, $xsdversion, $dependency, $deppackage, + $prefstate = 'stable', $installed = false, $channel = false) + { + $states = $this->betterStates($prefstate, true); + if (!$states) { + return PEAR::raiseError('"' . $prefstate . '" is not a valid state'); + } + + $channel = $dependency['channel']; + $package = $dependency['name']; + $state = isset($dependency['state']) ? $dependency['state'] : null; + $version = isset($dependency['version']) ? $dependency['version'] : null; + $restFile = $base . 'r/' . strtolower($package) .'/allreleases2.xml'; + + $info = $this->_rest->retrieveData($restFile, false, false, $channel); + if (PEAR::isError($info)) { + return PEAR::raiseError('Package "' . $deppackage['channel'] . '/' . $deppackage['package'] + . '" dependency "' . $channel . '/' . $package . '" has no releases'); + } + + if (!is_array($info) || !isset($info['r'])) { + return false; + } + + $exclude = array(); + $min = $max = $recommended = false; + if ($xsdversion == '1.0') { + $pinfo['package'] = $dependency['name']; + $pinfo['channel'] = 'pear.php.net'; // this is always true - don't change this + switch ($dependency['rel']) { + case 'ge' : + $min = $dependency['version']; + break; + case 'gt' : + $min = $dependency['version']; + $exclude = array($dependency['version']); + break; + case 'eq' : + $recommended = $dependency['version']; + break; + case 'lt' : + $max = $dependency['version']; + $exclude = array($dependency['version']); + break; + case 'le' : + $max = $dependency['version']; + break; + case 'ne' : + $exclude = array($dependency['version']); + break; + } + } else { + $pinfo['package'] = $dependency['name']; + $min = isset($dependency['min']) ? $dependency['min'] : false; + $max = isset($dependency['max']) ? $dependency['max'] : false; + $recommended = isset($dependency['recommended']) ? + $dependency['recommended'] : false; + if (isset($dependency['exclude'])) { + if (!isset($dependency['exclude'][0])) { + $exclude = array($dependency['exclude']); + } + } + } + + $skippedphp = $found = $release = false; + if (!is_array($info['r']) || !isset($info['r'][0])) { + $info['r'] = array($info['r']); + } + + foreach ($info['r'] as $release) { + if (!isset($this->_rest->_options['force']) && ($installed && + version_compare($release['v'], $installed, '<'))) { + continue; + } + + if (in_array($release['v'], $exclude)) { // skip excluded versions + continue; + } + + // allow newer releases to say "I'm OK with the dependent package" + if ($xsdversion == '2.0' && isset($release['co'])) { + if (!is_array($release['co']) || !isset($release['co'][0])) { + $release['co'] = array($release['co']); + } + + foreach ($release['co'] as $entry) { + if (isset($entry['x']) && !is_array($entry['x'])) { + $entry['x'] = array($entry['x']); + } elseif (!isset($entry['x'])) { + $entry['x'] = array(); + } + + if ($entry['c'] == $deppackage['channel'] && + strtolower($entry['p']) == strtolower($deppackage['package']) && + version_compare($deppackage['version'], $entry['min'], '>=') && + version_compare($deppackage['version'], $entry['max'], '<=') && + !in_array($release['v'], $entry['x'])) { + if (version_compare($release['m'], phpversion(), '>')) { + // skip dependency releases that require a PHP version + // newer than our PHP version + $skippedphp = $release; + continue; + } + + $recommended = $release['v']; + break; + } + } + } + + if ($recommended) { + if ($release['v'] != $recommended) { // if we want a specific + // version, then skip all others + continue; + } + + if (!in_array($release['s'], $states)) { + // the stability is too low, but we must return the + // recommended version if possible + return $this->_returnDownloadURL($base, $package, $release, $info, true, false, $channel); + } + } + + if ($min && version_compare($release['v'], $min, 'lt')) { // skip too old versions + continue; + } + + if ($max && version_compare($release['v'], $max, 'gt')) { // skip too new versions + continue; + } + + if ($installed && version_compare($release['v'], $installed, '<')) { + continue; + } + + if (in_array($release['s'], $states)) { // if in the preferred state... + if (version_compare($release['m'], phpversion(), '>')) { + // skip dependency releases that require a PHP version + // newer than our PHP version + $skippedphp = $release; + continue; + } + + $found = true; // ... then use it + break; + } + } + + if (!$found && $skippedphp) { + $found = null; + } + + return $this->_returnDownloadURL($base, $package, $release, $info, $found, $skippedphp, $channel); + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Registry.php b/vendor/pear-pear.php.net/PEAR/PEAR/Registry.php new file mode 100644 index 0000000000000000000000000000000000000000..35e17db495298ff69fbc0b7f8d4e563d0f4c5d0f --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Registry.php @@ -0,0 +1,2395 @@ +<?php +/** + * PEAR_Registry + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V. V. Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Registry.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * for PEAR_Error + */ +require_once 'PEAR.php'; +require_once 'PEAR/DependencyDB.php'; + +define('PEAR_REGISTRY_ERROR_LOCK', -2); +define('PEAR_REGISTRY_ERROR_FORMAT', -3); +define('PEAR_REGISTRY_ERROR_FILE', -4); +define('PEAR_REGISTRY_ERROR_CONFLICT', -5); +define('PEAR_REGISTRY_ERROR_CHANNEL_FILE', -6); + +/** + * Administration class used to maintain the installed package database. + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V. V. Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Registry extends PEAR +{ + /** + * File containing all channel information. + * @var string + */ + var $channels = ''; + + /** Directory where registry files are stored. + * @var string + */ + var $statedir = ''; + + /** File where the file map is stored + * @var string + */ + var $filemap = ''; + + /** Directory where registry files for channels are stored. + * @var string + */ + var $channelsdir = ''; + + /** Name of file used for locking the registry + * @var string + */ + var $lockfile = ''; + + /** File descriptor used during locking + * @var resource + */ + var $lock_fp = null; + + /** Mode used during locking + * @var int + */ + var $lock_mode = 0; // XXX UNUSED + + /** Cache of package information. Structure: + * array( + * 'package' => array('id' => ... ), + * ... ) + * @var array + */ + var $pkginfo_cache = array(); + + /** Cache of file map. Structure: + * array( '/path/to/file' => 'package', ... ) + * @var array + */ + var $filemap_cache = array(); + + /** + * @var false|PEAR_ChannelFile + */ + var $_pearChannel; + + /** + * @var false|PEAR_ChannelFile + */ + var $_peclChannel; + + /** + * @var false|PEAR_ChannelFile + */ + var $_docChannel; + + /** + * @var PEAR_DependencyDB + */ + var $_dependencyDB; + + /** + * @var PEAR_Config + */ + var $_config; + + /** + * PEAR_Registry constructor. + * + * @param string (optional) PEAR install directory (for .php files) + * @param PEAR_ChannelFile PEAR_ChannelFile object representing the PEAR channel, if + * default values are not desired. Only used the very first time a PEAR + * repository is initialized + * @param PEAR_ChannelFile PEAR_ChannelFile object representing the PECL channel, if + * default values are not desired. Only used the very first time a PEAR + * repository is initialized + * + * @access public + */ + function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false, + $pecl_channel = false) + { + parent::PEAR(); + $this->setInstallDir($pear_install_dir); + $this->_pearChannel = $pear_channel; + $this->_peclChannel = $pecl_channel; + $this->_config = false; + } + + function setInstallDir($pear_install_dir = PEAR_INSTALL_DIR) + { + $ds = DIRECTORY_SEPARATOR; + $this->install_dir = $pear_install_dir; + $this->channelsdir = $pear_install_dir.$ds.'.channels'; + $this->statedir = $pear_install_dir.$ds.'.registry'; + $this->filemap = $pear_install_dir.$ds.'.filemap'; + $this->lockfile = $pear_install_dir.$ds.'.lock'; + } + + function hasWriteAccess() + { + if (!file_exists($this->install_dir)) { + $dir = $this->install_dir; + while ($dir && $dir != '.') { + $olddir = $dir; + $dir = dirname($dir); + if ($dir != '.' && file_exists($dir)) { + if (is_writeable($dir)) { + return true; + } + + return false; + } + + if ($dir == $olddir) { // this can happen in safe mode + return @is_writable($dir); + } + } + + return false; + } + + return is_writeable($this->install_dir); + } + + function setConfig(&$config, $resetInstallDir = true) + { + $this->_config = &$config; + if ($resetInstallDir) { + $this->setInstallDir($config->get('php_dir')); + } + } + + function _initializeChannelDirs() + { + static $running = false; + if (!$running) { + $running = true; + $ds = DIRECTORY_SEPARATOR; + if (!is_dir($this->channelsdir) || + !file_exists($this->channelsdir . $ds . 'pear.php.net.reg') || + !file_exists($this->channelsdir . $ds . 'pecl.php.net.reg') || + !file_exists($this->channelsdir . $ds . 'doc.php.net.reg') || + !file_exists($this->channelsdir . $ds . '__uri.reg')) { + if (!file_exists($this->channelsdir . $ds . 'pear.php.net.reg')) { + $pear_channel = $this->_pearChannel; + if (!is_a($pear_channel, 'PEAR_ChannelFile') || !$pear_channel->validate()) { + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $pear_channel = new PEAR_ChannelFile; + $pear_channel->setAlias('pear'); + $pear_channel->setServer('pear.php.net'); + $pear_channel->setSummary('PHP Extension and Application Repository'); + $pear_channel->setDefaultPEARProtocols(); + $pear_channel->setBaseURL('REST1.0', 'http://pear.php.net/rest/'); + $pear_channel->setBaseURL('REST1.1', 'http://pear.php.net/rest/'); + $pear_channel->setBaseURL('REST1.3', 'http://pear.php.net/rest/'); + //$pear_channel->setBaseURL('REST1.4', 'http://pear.php.net/rest/'); + } else { + $pear_channel->setServer('pear.php.net'); + $pear_channel->setAlias('pear'); + } + + $pear_channel->validate(); + $this->_addChannel($pear_channel); + } + + if (!file_exists($this->channelsdir . $ds . 'pecl.php.net.reg')) { + $pecl_channel = $this->_peclChannel; + if (!is_a($pecl_channel, 'PEAR_ChannelFile') || !$pecl_channel->validate()) { + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $pecl_channel = new PEAR_ChannelFile; + $pecl_channel->setAlias('pecl'); + $pecl_channel->setServer('pecl.php.net'); + $pecl_channel->setSummary('PHP Extension Community Library'); + $pecl_channel->setDefaultPEARProtocols(); + $pecl_channel->setBaseURL('REST1.0', 'http://pecl.php.net/rest/'); + $pecl_channel->setBaseURL('REST1.1', 'http://pecl.php.net/rest/'); + $pecl_channel->setValidationPackage('PEAR_Validator_PECL', '1.0'); + } else { + $pecl_channel->setServer('pecl.php.net'); + $pecl_channel->setAlias('pecl'); + } + + $pecl_channel->validate(); + $this->_addChannel($pecl_channel); + } + + if (!file_exists($this->channelsdir . $ds . 'doc.php.net.reg')) { + $doc_channel = $this->_docChannel; + if (!is_a($doc_channel, 'PEAR_ChannelFile') || !$doc_channel->validate()) { + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $doc_channel = new PEAR_ChannelFile; + $doc_channel->setAlias('phpdocs'); + $doc_channel->setServer('doc.php.net'); + $doc_channel->setSummary('PHP Documentation Team'); + $doc_channel->setDefaultPEARProtocols(); + $doc_channel->setBaseURL('REST1.0', 'http://doc.php.net/rest/'); + $doc_channel->setBaseURL('REST1.1', 'http://doc.php.net/rest/'); + $doc_channel->setBaseURL('REST1.3', 'http://doc.php.net/rest/'); + } else { + $doc_channel->setServer('doc.php.net'); + $doc_channel->setAlias('doc'); + } + + $doc_channel->validate(); + $this->_addChannel($doc_channel); + } + + if (!file_exists($this->channelsdir . $ds . '__uri.reg')) { + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $private = new PEAR_ChannelFile; + $private->setName('__uri'); + $private->setDefaultPEARProtocols(); + $private->setBaseURL('REST1.0', '****'); + $private->setSummary('Pseudo-channel for static packages'); + $this->_addChannel($private); + } + $this->_rebuildFileMap(); + } + + $running = false; + } + } + + function _initializeDirs() + { + $ds = DIRECTORY_SEPARATOR; + // XXX Compatibility code should be removed in the future + // rename all registry files if any to lowercase + if (!OS_WINDOWS && file_exists($this->statedir) && is_dir($this->statedir) && + $handle = opendir($this->statedir)) { + $dest = $this->statedir . $ds; + while (false !== ($file = readdir($handle))) { + if (preg_match('/^.*[A-Z].*\.reg\\z/', $file)) { + rename($dest . $file, $dest . strtolower($file)); + } + } + closedir($handle); + } + + $this->_initializeChannelDirs(); + if (!file_exists($this->filemap)) { + $this->_rebuildFileMap(); + } + $this->_initializeDepDB(); + } + + function _initializeDepDB() + { + if (!isset($this->_dependencyDB)) { + static $initializing = false; + if (!$initializing) { + $initializing = true; + if (!$this->_config) { // never used? + $file = OS_WINDOWS ? 'pear.ini' : '.pearrc'; + $this->_config = &new PEAR_Config($this->statedir . DIRECTORY_SEPARATOR . + $file); + $this->_config->setRegistry($this); + $this->_config->set('php_dir', $this->install_dir); + } + + $this->_dependencyDB = &PEAR_DependencyDB::singleton($this->_config); + if (PEAR::isError($this->_dependencyDB)) { + // attempt to recover by removing the dep db + if (file_exists($this->_config->get('php_dir', null, 'pear.php.net') . + DIRECTORY_SEPARATOR . '.depdb')) { + @unlink($this->_config->get('php_dir', null, 'pear.php.net') . + DIRECTORY_SEPARATOR . '.depdb'); + } + + $this->_dependencyDB = &PEAR_DependencyDB::singleton($this->_config); + if (PEAR::isError($this->_dependencyDB)) { + echo $this->_dependencyDB->getMessage(); + echo 'Unrecoverable error'; + exit(1); + } + } + + $initializing = false; + } + } + } + + /** + * PEAR_Registry destructor. Makes sure no locks are forgotten. + * + * @access private + */ + function _PEAR_Registry() + { + parent::_PEAR(); + if (is_resource($this->lock_fp)) { + $this->_unlock(); + } + } + + /** + * Make sure the directory where we keep registry files exists. + * + * @return bool TRUE if directory exists, FALSE if it could not be + * created + * + * @access private + */ + function _assertStateDir($channel = false) + { + if ($channel && $this->_getChannelFromAlias($channel) != 'pear.php.net') { + return $this->_assertChannelStateDir($channel); + } + + static $init = false; + if (!file_exists($this->statedir)) { + if (!$this->hasWriteAccess()) { + return false; + } + + require_once 'System.php'; + if (!System::mkdir(array('-p', $this->statedir))) { + return $this->raiseError("could not create directory '{$this->statedir}'"); + } + $init = true; + } elseif (!is_dir($this->statedir)) { + return $this->raiseError('Cannot create directory ' . $this->statedir . ', ' . + 'it already exists and is not a directory'); + } + + $ds = DIRECTORY_SEPARATOR; + if (!file_exists($this->channelsdir)) { + if (!file_exists($this->channelsdir . $ds . 'pear.php.net.reg') || + !file_exists($this->channelsdir . $ds . 'pecl.php.net.reg') || + !file_exists($this->channelsdir . $ds . 'doc.php.net.reg') || + !file_exists($this->channelsdir . $ds . '__uri.reg')) { + $init = true; + } + } elseif (!is_dir($this->channelsdir)) { + return $this->raiseError('Cannot create directory ' . $this->channelsdir . ', ' . + 'it already exists and is not a directory'); + } + + if ($init) { + static $running = false; + if (!$running) { + $running = true; + $this->_initializeDirs(); + $running = false; + $init = false; + } + } else { + $this->_initializeDepDB(); + } + + return true; + } + + /** + * Make sure the directory where we keep registry files exists for a non-standard channel. + * + * @param string channel name + * @return bool TRUE if directory exists, FALSE if it could not be + * created + * + * @access private + */ + function _assertChannelStateDir($channel) + { + $ds = DIRECTORY_SEPARATOR; + if (!$channel || $this->_getChannelFromAlias($channel) == 'pear.php.net') { + if (!file_exists($this->channelsdir . $ds . 'pear.php.net.reg')) { + $this->_initializeChannelDirs(); + } + return $this->_assertStateDir($channel); + } + + $channelDir = $this->_channelDirectoryName($channel); + if (!is_dir($this->channelsdir) || + !file_exists($this->channelsdir . $ds . 'pear.php.net.reg')) { + $this->_initializeChannelDirs(); + } + + if (!file_exists($channelDir)) { + if (!$this->hasWriteAccess()) { + return false; + } + + require_once 'System.php'; + if (!System::mkdir(array('-p', $channelDir))) { + return $this->raiseError("could not create directory '" . $channelDir . + "'"); + } + } elseif (!is_dir($channelDir)) { + return $this->raiseError("could not create directory '" . $channelDir . + "', already exists and is not a directory"); + } + + return true; + } + + /** + * Make sure the directory where we keep registry files for channels exists + * + * @return bool TRUE if directory exists, FALSE if it could not be + * created + * + * @access private + */ + function _assertChannelDir() + { + if (!file_exists($this->channelsdir)) { + if (!$this->hasWriteAccess()) { + return false; + } + + require_once 'System.php'; + if (!System::mkdir(array('-p', $this->channelsdir))) { + return $this->raiseError("could not create directory '{$this->channelsdir}'"); + } + } elseif (!is_dir($this->channelsdir)) { + return $this->raiseError("could not create directory '{$this->channelsdir}" . + "', it already exists and is not a directory"); + } + + if (!file_exists($this->channelsdir . DIRECTORY_SEPARATOR . '.alias')) { + if (!$this->hasWriteAccess()) { + return false; + } + + require_once 'System.php'; + if (!System::mkdir(array('-p', $this->channelsdir . DIRECTORY_SEPARATOR . '.alias'))) { + return $this->raiseError("could not create directory '{$this->channelsdir}/.alias'"); + } + } elseif (!is_dir($this->channelsdir . DIRECTORY_SEPARATOR . '.alias')) { + return $this->raiseError("could not create directory '{$this->channelsdir}" . + "/.alias', it already exists and is not a directory"); + } + + return true; + } + + /** + * Get the name of the file where data for a given package is stored. + * + * @param string channel name, or false if this is a PEAR package + * @param string package name + * + * @return string registry file name + * + * @access public + */ + function _packageFileName($package, $channel = false) + { + if ($channel && $this->_getChannelFromAlias($channel) != 'pear.php.net') { + return $this->_channelDirectoryName($channel) . DIRECTORY_SEPARATOR . + strtolower($package) . '.reg'; + } + + return $this->statedir . DIRECTORY_SEPARATOR . strtolower($package) . '.reg'; + } + + /** + * Get the name of the file where data for a given channel is stored. + * @param string channel name + * @return string registry file name + */ + function _channelFileName($channel, $noaliases = false) + { + if (!$noaliases) { + if (file_exists($this->_getChannelAliasFileName($channel))) { + $channel = implode('', file($this->_getChannelAliasFileName($channel))); + } + } + return $this->channelsdir . DIRECTORY_SEPARATOR . str_replace('/', '_', + strtolower($channel)) . '.reg'; + } + + /** + * @param string + * @return string + */ + function _getChannelAliasFileName($alias) + { + return $this->channelsdir . DIRECTORY_SEPARATOR . '.alias' . + DIRECTORY_SEPARATOR . str_replace('/', '_', strtolower($alias)) . '.txt'; + } + + /** + * Get the name of a channel from its alias + */ + function _getChannelFromAlias($channel) + { + if (!$this->_channelExists($channel)) { + if ($channel == 'pear.php.net') { + return 'pear.php.net'; + } + + if ($channel == 'pecl.php.net') { + return 'pecl.php.net'; + } + + if ($channel == 'doc.php.net') { + return 'doc.php.net'; + } + + if ($channel == '__uri') { + return '__uri'; + } + + return false; + } + + $channel = strtolower($channel); + if (file_exists($this->_getChannelAliasFileName($channel))) { + // translate an alias to an actual channel + return implode('', file($this->_getChannelAliasFileName($channel))); + } + + return $channel; + } + + /** + * Get the alias of a channel from its alias or its name + */ + function _getAlias($channel) + { + if (!$this->_channelExists($channel)) { + if ($channel == 'pear.php.net') { + return 'pear'; + } + + if ($channel == 'pecl.php.net') { + return 'pecl'; + } + + if ($channel == 'doc.php.net') { + return 'phpdocs'; + } + + return false; + } + + $channel = $this->_getChannel($channel); + if (PEAR::isError($channel)) { + return $channel; + } + + return $channel->getAlias(); + } + + /** + * Get the name of the file where data for a given package is stored. + * + * @param string channel name, or false if this is a PEAR package + * @param string package name + * + * @return string registry file name + * + * @access public + */ + function _channelDirectoryName($channel) + { + if (!$channel || $this->_getChannelFromAlias($channel) == 'pear.php.net') { + return $this->statedir; + } + + $ch = $this->_getChannelFromAlias($channel); + if (!$ch) { + $ch = $channel; + } + + return $this->statedir . DIRECTORY_SEPARATOR . strtolower('.channel.' . + str_replace('/', '_', $ch)); + } + + function _openPackageFile($package, $mode, $channel = false) + { + if (!$this->_assertStateDir($channel)) { + return null; + } + + if (!in_array($mode, array('r', 'rb')) && !$this->hasWriteAccess()) { + return null; + } + + $file = $this->_packageFileName($package, $channel); + if (!file_exists($file) && $mode == 'r' || $mode == 'rb') { + return null; + } + + $fp = @fopen($file, $mode); + if (!$fp) { + return null; + } + + return $fp; + } + + function _closePackageFile($fp) + { + fclose($fp); + } + + function _openChannelFile($channel, $mode) + { + if (!$this->_assertChannelDir()) { + return null; + } + + if (!in_array($mode, array('r', 'rb')) && !$this->hasWriteAccess()) { + return null; + } + + $file = $this->_channelFileName($channel); + if (!file_exists($file) && $mode == 'r' || $mode == 'rb') { + return null; + } + + $fp = @fopen($file, $mode); + if (!$fp) { + return null; + } + + return $fp; + } + + function _closeChannelFile($fp) + { + fclose($fp); + } + + function _rebuildFileMap() + { + if (!class_exists('PEAR_Installer_Role')) { + require_once 'PEAR/Installer/Role.php'; + } + + $channels = $this->_listAllPackages(); + $files = array(); + foreach ($channels as $channel => $packages) { + foreach ($packages as $package) { + $version = $this->_packageInfo($package, 'version', $channel); + $filelist = $this->_packageInfo($package, 'filelist', $channel); + if (!is_array($filelist)) { + continue; + } + + foreach ($filelist as $name => $attrs) { + if (isset($attrs['attribs'])) { + $attrs = $attrs['attribs']; + } + + // it is possible for conflicting packages in different channels to + // conflict with data files/doc files + if ($name == 'dirtree') { + continue; + } + + if (isset($attrs['role']) && !in_array($attrs['role'], + PEAR_Installer_Role::getInstallableRoles())) { + // these are not installed + continue; + } + + if (isset($attrs['role']) && !in_array($attrs['role'], + PEAR_Installer_Role::getBaseinstallRoles())) { + $attrs['baseinstalldir'] = $package; + } + + if (isset($attrs['baseinstalldir'])) { + $file = $attrs['baseinstalldir'].DIRECTORY_SEPARATOR.$name; + } else { + $file = $name; + } + + $file = preg_replace(',^/+,', '', $file); + if ($channel != 'pear.php.net') { + if (!isset($files[$attrs['role']])) { + $files[$attrs['role']] = array(); + } + $files[$attrs['role']][$file] = array(strtolower($channel), + strtolower($package)); + } else { + if (!isset($files[$attrs['role']])) { + $files[$attrs['role']] = array(); + } + $files[$attrs['role']][$file] = strtolower($package); + } + } + } + } + + + $this->_assertStateDir(); + if (!$this->hasWriteAccess()) { + return false; + } + + $fp = @fopen($this->filemap, 'wb'); + if (!$fp) { + return false; + } + + $this->filemap_cache = $files; + fwrite($fp, serialize($files)); + fclose($fp); + return true; + } + + function _readFileMap() + { + if (!file_exists($this->filemap)) { + return array(); + } + + $fp = @fopen($this->filemap, 'r'); + if (!$fp) { + return $this->raiseError('PEAR_Registry: could not open filemap "' . $this->filemap . '"', PEAR_REGISTRY_ERROR_FILE, null, null, $php_errormsg); + } + + clearstatcache(); + $rt = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + $fsize = filesize($this->filemap); + fclose($fp); + $data = file_get_contents($this->filemap); + set_magic_quotes_runtime($rt); + $tmp = unserialize($data); + if (!$tmp && $fsize > 7) { + return $this->raiseError('PEAR_Registry: invalid filemap data', PEAR_REGISTRY_ERROR_FORMAT, null, null, $data); + } + + $this->filemap_cache = $tmp; + return true; + } + + /** + * Lock the registry. + * + * @param integer lock mode, one of LOCK_EX, LOCK_SH or LOCK_UN. + * See flock manual for more information. + * + * @return bool TRUE on success, FALSE if locking failed, or a + * PEAR error if some other error occurs (such as the + * lock file not being writable). + * + * @access private + */ + function _lock($mode = LOCK_EX) + { + if (stristr(php_uname(), 'Windows 9')) { + return true; + } + + if ($mode != LOCK_UN && is_resource($this->lock_fp)) { + // XXX does not check type of lock (LOCK_SH/LOCK_EX) + return true; + } + + if (!$this->_assertStateDir()) { + if ($mode == LOCK_EX) { + return $this->raiseError('Registry directory is not writeable by the current user'); + } + + return true; + } + + $open_mode = 'w'; + // XXX People reported problems with LOCK_SH and 'w' + if ($mode === LOCK_SH || $mode === LOCK_UN) { + if (!file_exists($this->lockfile)) { + touch($this->lockfile); + } + $open_mode = 'r'; + } + + if (!is_resource($this->lock_fp)) { + $this->lock_fp = @fopen($this->lockfile, $open_mode); + } + + if (!is_resource($this->lock_fp)) { + $this->lock_fp = null; + return $this->raiseError("could not create lock file" . + (isset($php_errormsg) ? ": " . $php_errormsg : "")); + } + + if (!(int)flock($this->lock_fp, $mode)) { + switch ($mode) { + case LOCK_SH: $str = 'shared'; break; + case LOCK_EX: $str = 'exclusive'; break; + case LOCK_UN: $str = 'unlock'; break; + default: $str = 'unknown'; break; + } + + //is resource at this point, close it on error. + fclose($this->lock_fp); + $this->lock_fp = null; + return $this->raiseError("could not acquire $str lock ($this->lockfile)", + PEAR_REGISTRY_ERROR_LOCK); + } + + return true; + } + + function _unlock() + { + $ret = $this->_lock(LOCK_UN); + if (is_resource($this->lock_fp)) { + fclose($this->lock_fp); + } + + $this->lock_fp = null; + return $ret; + } + + function _packageExists($package, $channel = false) + { + return file_exists($this->_packageFileName($package, $channel)); + } + + /** + * Determine whether a channel exists in the registry + * + * @param string Channel name + * @param bool if true, then aliases will be ignored + * @return boolean + */ + function _channelExists($channel, $noaliases = false) + { + $a = file_exists($this->_channelFileName($channel, $noaliases)); + if (!$a && $channel == 'pear.php.net') { + return true; + } + + if (!$a && $channel == 'pecl.php.net') { + return true; + } + + if (!$a && $channel == 'doc.php.net') { + return true; + } + + return $a; + } + + /** + * Determine whether a mirror exists within the deafult channel in the registry + * + * @param string Channel name + * @param string Mirror name + * + * @return boolean + */ + function _mirrorExists($channel, $mirror) + { + $data = $this->_channelInfo($channel); + if (!isset($data['servers']['mirror'])) { + return false; + } + + foreach ($data['servers']['mirror'] as $m) { + if ($m['attribs']['host'] == $mirror) { + return true; + } + } + + return false; + } + + /** + * @param PEAR_ChannelFile Channel object + * @param donotuse + * @param string Last-Modified HTTP tag from remote request + * @return boolean|PEAR_Error True on creation, false if it already exists + */ + function _addChannel($channel, $update = false, $lastmodified = false) + { + if (!is_a($channel, 'PEAR_ChannelFile')) { + return false; + } + + if (!$channel->validate()) { + return false; + } + + if (file_exists($this->_channelFileName($channel->getName()))) { + if (!$update) { + return false; + } + + $checker = $this->_getChannel($channel->getName()); + if (PEAR::isError($checker)) { + return $checker; + } + + if ($channel->getAlias() != $checker->getAlias()) { + if (file_exists($this->_getChannelAliasFileName($checker->getAlias()))) { + @unlink($this->_getChannelAliasFileName($checker->getAlias())); + } + } + } else { + if ($update && !in_array($channel->getName(), array('pear.php.net', 'pecl.php.net', 'doc.php.net'))) { + return false; + } + } + + $ret = $this->_assertChannelDir(); + if (PEAR::isError($ret)) { + return $ret; + } + + $ret = $this->_assertChannelStateDir($channel->getName()); + if (PEAR::isError($ret)) { + return $ret; + } + + if ($channel->getAlias() != $channel->getName()) { + if (file_exists($this->_getChannelAliasFileName($channel->getAlias())) && + $this->_getChannelFromAlias($channel->getAlias()) != $channel->getName()) { + $channel->setAlias($channel->getName()); + } + + if (!$this->hasWriteAccess()) { + return false; + } + + $fp = @fopen($this->_getChannelAliasFileName($channel->getAlias()), 'w'); + if (!$fp) { + return false; + } + + fwrite($fp, $channel->getName()); + fclose($fp); + } + + if (!$this->hasWriteAccess()) { + return false; + } + + $fp = @fopen($this->_channelFileName($channel->getName()), 'wb'); + if (!$fp) { + return false; + } + + $info = $channel->toArray(); + if ($lastmodified) { + $info['_lastmodified'] = $lastmodified; + } else { + $info['_lastmodified'] = date('r'); + } + + fwrite($fp, serialize($info)); + fclose($fp); + return true; + } + + /** + * Deletion fails if there are any packages installed from the channel + * @param string|PEAR_ChannelFile channel name + * @return boolean|PEAR_Error True on deletion, false if it doesn't exist + */ + function _deleteChannel($channel) + { + if (!is_string($channel)) { + if (!is_a($channel, 'PEAR_ChannelFile')) { + return false; + } + + if (!$channel->validate()) { + return false; + } + $channel = $channel->getName(); + } + + if ($this->_getChannelFromAlias($channel) == '__uri') { + return false; + } + + if ($this->_getChannelFromAlias($channel) == 'pecl.php.net') { + return false; + } + + if ($this->_getChannelFromAlias($channel) == 'doc.php.net') { + return false; + } + + if (!$this->_channelExists($channel)) { + return false; + } + + if (!$channel || $this->_getChannelFromAlias($channel) == 'pear.php.net') { + return false; + } + + $channel = $this->_getChannelFromAlias($channel); + if ($channel == 'pear.php.net') { + return false; + } + + $test = $this->_listChannelPackages($channel); + if (count($test)) { + return false; + } + + $test = @rmdir($this->_channelDirectoryName($channel)); + if (!$test) { + return false; + } + + $file = $this->_getChannelAliasFileName($this->_getAlias($channel)); + if (file_exists($file)) { + $test = @unlink($file); + if (!$test) { + return false; + } + } + + $file = $this->_channelFileName($channel); + $ret = true; + if (file_exists($file)) { + $ret = @unlink($file); + } + + return $ret; + } + + /** + * Determine whether a channel exists in the registry + * @param string Channel Alias + * @return boolean + */ + function _isChannelAlias($alias) + { + return file_exists($this->_getChannelAliasFileName($alias)); + } + + /** + * @param string|null + * @param string|null + * @param string|null + * @return array|null + * @access private + */ + function _packageInfo($package = null, $key = null, $channel = 'pear.php.net') + { + if ($package === null) { + if ($channel === null) { + $channels = $this->_listChannels(); + $ret = array(); + foreach ($channels as $channel) { + $channel = strtolower($channel); + $ret[$channel] = array(); + $packages = $this->_listPackages($channel); + foreach ($packages as $package) { + $ret[$channel][] = $this->_packageInfo($package, null, $channel); + } + } + + return $ret; + } + + $ps = $this->_listPackages($channel); + if (!count($ps)) { + return array(); + } + return array_map(array(&$this, '_packageInfo'), + $ps, array_fill(0, count($ps), null), + array_fill(0, count($ps), $channel)); + } + + $fp = $this->_openPackageFile($package, 'r', $channel); + if ($fp === null) { + return null; + } + + $rt = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + clearstatcache(); + $this->_closePackageFile($fp); + $data = file_get_contents($this->_packageFileName($package, $channel)); + set_magic_quotes_runtime($rt); + $data = unserialize($data); + if ($key === null) { + return $data; + } + + // compatibility for package.xml version 2.0 + if (isset($data['old'][$key])) { + return $data['old'][$key]; + } + + if (isset($data[$key])) { + return $data[$key]; + } + + return null; + } + + /** + * @param string Channel name + * @param bool whether to strictly retrieve info of channels, not just aliases + * @return array|null + */ + function _channelInfo($channel, $noaliases = false) + { + if (!$this->_channelExists($channel, $noaliases)) { + return null; + } + + $fp = $this->_openChannelFile($channel, 'r'); + if ($fp === null) { + return null; + } + + $rt = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + clearstatcache(); + $this->_closeChannelFile($fp); + $data = file_get_contents($this->_channelFileName($channel)); + set_magic_quotes_runtime($rt); + $data = unserialize($data); + return $data; + } + + function _listChannels() + { + $channellist = array(); + if (!file_exists($this->channelsdir) || !is_dir($this->channelsdir)) { + return array('pear.php.net', 'pecl.php.net', 'doc.php.net', '__uri'); + } + + $dp = opendir($this->channelsdir); + while ($ent = readdir($dp)) { + if ($ent{0} == '.' || substr($ent, -4) != '.reg') { + continue; + } + + if ($ent == '__uri.reg') { + $channellist[] = '__uri'; + continue; + } + + $channellist[] = str_replace('_', '/', substr($ent, 0, -4)); + } + + closedir($dp); + if (!in_array('pear.php.net', $channellist)) { + $channellist[] = 'pear.php.net'; + } + + if (!in_array('pecl.php.net', $channellist)) { + $channellist[] = 'pecl.php.net'; + } + + if (!in_array('doc.php.net', $channellist)) { + $channellist[] = 'doc.php.net'; + } + + + if (!in_array('__uri', $channellist)) { + $channellist[] = '__uri'; + } + + natsort($channellist); + return $channellist; + } + + function _listPackages($channel = false) + { + if ($channel && $this->_getChannelFromAlias($channel) != 'pear.php.net') { + return $this->_listChannelPackages($channel); + } + + if (!file_exists($this->statedir) || !is_dir($this->statedir)) { + return array(); + } + + $pkglist = array(); + $dp = opendir($this->statedir); + if (!$dp) { + return $pkglist; + } + + while ($ent = readdir($dp)) { + if ($ent{0} == '.' || substr($ent, -4) != '.reg') { + continue; + } + + $pkglist[] = substr($ent, 0, -4); + } + closedir($dp); + return $pkglist; + } + + function _listChannelPackages($channel) + { + $pkglist = array(); + if (!file_exists($this->_channelDirectoryName($channel)) || + !is_dir($this->_channelDirectoryName($channel))) { + return array(); + } + + $dp = opendir($this->_channelDirectoryName($channel)); + if (!$dp) { + return $pkglist; + } + + while ($ent = readdir($dp)) { + if ($ent{0} == '.' || substr($ent, -4) != '.reg') { + continue; + } + $pkglist[] = substr($ent, 0, -4); + } + + closedir($dp); + return $pkglist; + } + + function _listAllPackages() + { + $ret = array(); + foreach ($this->_listChannels() as $channel) { + $ret[$channel] = $this->_listPackages($channel); + } + + return $ret; + } + + /** + * Add an installed package to the registry + * @param string package name + * @param array package info (parsed by PEAR_Common::infoFrom*() methods) + * @return bool success of saving + * @access private + */ + function _addPackage($package, $info) + { + if ($this->_packageExists($package)) { + return false; + } + + $fp = $this->_openPackageFile($package, 'wb'); + if ($fp === null) { + return false; + } + + $info['_lastmodified'] = time(); + fwrite($fp, serialize($info)); + $this->_closePackageFile($fp); + if (isset($info['filelist'])) { + $this->_rebuildFileMap(); + } + + return true; + } + + /** + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @return bool + * @access private + */ + function _addPackage2($info) + { + if (!is_a($info, 'PEAR_PackageFile_v1') && !is_a($info, 'PEAR_PackageFile_v2')) { + return false; + } + + if (!$info->validate()) { + if (class_exists('PEAR_Common')) { + $ui = PEAR_Frontend::singleton(); + if ($ui) { + foreach ($info->getValidationWarnings() as $err) { + $ui->log($err['message'], true); + } + } + } + return false; + } + + $channel = $info->getChannel(); + $package = $info->getPackage(); + $save = $info; + if ($this->_packageExists($package, $channel)) { + return false; + } + + if (!$this->_channelExists($channel, true)) { + return false; + } + + $info = $info->toArray(true); + if (!$info) { + return false; + } + + $fp = $this->_openPackageFile($package, 'wb', $channel); + if ($fp === null) { + return false; + } + + $info['_lastmodified'] = time(); + fwrite($fp, serialize($info)); + $this->_closePackageFile($fp); + $this->_rebuildFileMap(); + return true; + } + + /** + * @param string Package name + * @param array parsed package.xml 1.0 + * @param bool this parameter is only here for BC. Don't use it. + * @access private + */ + function _updatePackage($package, $info, $merge = true) + { + $oldinfo = $this->_packageInfo($package); + if (empty($oldinfo)) { + return false; + } + + $fp = $this->_openPackageFile($package, 'w'); + if ($fp === null) { + return false; + } + + if (is_object($info)) { + $info = $info->toArray(); + } + $info['_lastmodified'] = time(); + + $newinfo = $info; + if ($merge) { + $info = array_merge($oldinfo, $info); + } else { + $diff = $info; + } + + fwrite($fp, serialize($info)); + $this->_closePackageFile($fp); + if (isset($newinfo['filelist'])) { + $this->_rebuildFileMap(); + } + + return true; + } + + /** + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @return bool + * @access private + */ + function _updatePackage2($info) + { + if (!$this->_packageExists($info->getPackage(), $info->getChannel())) { + return false; + } + + $fp = $this->_openPackageFile($info->getPackage(), 'w', $info->getChannel()); + if ($fp === null) { + return false; + } + + $save = $info; + $info = $save->getArray(true); + $info['_lastmodified'] = time(); + fwrite($fp, serialize($info)); + $this->_closePackageFile($fp); + $this->_rebuildFileMap(); + return true; + } + + /** + * @param string Package name + * @param string Channel name + * @return PEAR_PackageFile_v1|PEAR_PackageFile_v2|null + * @access private + */ + function &_getPackage($package, $channel = 'pear.php.net') + { + $info = $this->_packageInfo($package, null, $channel); + if ($info === null) { + return $info; + } + + $a = $this->_config; + if (!$a) { + $this->_config = &new PEAR_Config; + $this->_config->set('php_dir', $this->statedir); + } + + if (!class_exists('PEAR_PackageFile')) { + require_once 'PEAR/PackageFile.php'; + } + + $pkg = &new PEAR_PackageFile($this->_config); + $pf = &$pkg->fromArray($info); + return $pf; + } + + /** + * @param string channel name + * @param bool whether to strictly retrieve channel names + * @return PEAR_ChannelFile|PEAR_Error + * @access private + */ + function &_getChannel($channel, $noaliases = false) + { + $ch = false; + if ($this->_channelExists($channel, $noaliases)) { + $chinfo = $this->_channelInfo($channel, $noaliases); + if ($chinfo) { + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $ch = &PEAR_ChannelFile::fromArrayWithErrors($chinfo); + } + } + + if ($ch) { + if ($ch->validate()) { + return $ch; + } + + foreach ($ch->getErrors(true) as $err) { + $message = $err['message'] . "\n"; + } + + $ch = PEAR::raiseError($message); + return $ch; + } + + if ($this->_getChannelFromAlias($channel) == 'pear.php.net') { + // the registry is not properly set up, so use defaults + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $pear_channel = new PEAR_ChannelFile; + $pear_channel->setServer('pear.php.net'); + $pear_channel->setAlias('pear'); + $pear_channel->setSummary('PHP Extension and Application Repository'); + $pear_channel->setDefaultPEARProtocols(); + $pear_channel->setBaseURL('REST1.0', 'http://pear.php.net/rest/'); + $pear_channel->setBaseURL('REST1.1', 'http://pear.php.net/rest/'); + $pear_channel->setBaseURL('REST1.3', 'http://pear.php.net/rest/'); + return $pear_channel; + } + + if ($this->_getChannelFromAlias($channel) == 'pecl.php.net') { + // the registry is not properly set up, so use defaults + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + $pear_channel = new PEAR_ChannelFile; + $pear_channel->setServer('pecl.php.net'); + $pear_channel->setAlias('pecl'); + $pear_channel->setSummary('PHP Extension Community Library'); + $pear_channel->setDefaultPEARProtocols(); + $pear_channel->setBaseURL('REST1.0', 'http://pecl.php.net/rest/'); + $pear_channel->setBaseURL('REST1.1', 'http://pecl.php.net/rest/'); + $pear_channel->setValidationPackage('PEAR_Validator_PECL', '1.0'); + return $pear_channel; + } + + if ($this->_getChannelFromAlias($channel) == 'doc.php.net') { + // the registry is not properly set up, so use defaults + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $doc_channel = new PEAR_ChannelFile; + $doc_channel->setServer('doc.php.net'); + $doc_channel->setAlias('phpdocs'); + $doc_channel->setSummary('PHP Documentation Team'); + $doc_channel->setDefaultPEARProtocols(); + $doc_channel->setBaseURL('REST1.0', 'http://doc.php.net/rest/'); + $doc_channel->setBaseURL('REST1.1', 'http://doc.php.net/rest/'); + $doc_channel->setBaseURL('REST1.3', 'http://doc.php.net/rest/'); + return $doc_channel; + } + + + if ($this->_getChannelFromAlias($channel) == '__uri') { + // the registry is not properly set up, so use defaults + if (!class_exists('PEAR_ChannelFile')) { + require_once 'PEAR/ChannelFile.php'; + } + + $private = new PEAR_ChannelFile; + $private->setName('__uri'); + $private->setDefaultPEARProtocols(); + $private->setBaseURL('REST1.0', '****'); + $private->setSummary('Pseudo-channel for static packages'); + return $private; + } + + return $ch; + } + + /** + * @param string Package name + * @param string Channel name + * @return bool + */ + function packageExists($package, $channel = 'pear.php.net') + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_packageExists($package, $channel); + $this->_unlock(); + return $ret; + } + + // }}} + + // {{{ channelExists() + + /** + * @param string channel name + * @param bool if true, then aliases will be ignored + * @return bool + */ + function channelExists($channel, $noaliases = false) + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_channelExists($channel, $noaliases); + $this->_unlock(); + return $ret; + } + + // }}} + + /** + * @param string channel name mirror is in + * @param string mirror name + * + * @return bool + */ + function mirrorExists($channel, $mirror) + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + + $ret = $this->_mirrorExists($channel, $mirror); + $this->_unlock(); + return $ret; + } + + // {{{ isAlias() + + /** + * Determines whether the parameter is an alias of a channel + * @param string + * @return bool + */ + function isAlias($alias) + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_isChannelAlias($alias); + $this->_unlock(); + return $ret; + } + + // }}} + // {{{ packageInfo() + + /** + * @param string|null + * @param string|null + * @param string + * @return array|null + */ + function packageInfo($package = null, $key = null, $channel = 'pear.php.net') + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_packageInfo($package, $key, $channel); + $this->_unlock(); + return $ret; + } + + // }}} + // {{{ channelInfo() + + /** + * Retrieve a raw array of channel data. + * + * Do not use this, instead use {@link getChannel()} for normal + * operations. Array structure is undefined in this method + * @param string channel name + * @param bool whether to strictly retrieve information only on non-aliases + * @return array|null|PEAR_Error + */ + function channelInfo($channel = null, $noaliases = false) + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_channelInfo($channel, $noaliases); + $this->_unlock(); + return $ret; + } + + // }}} + + /** + * @param string + */ + function channelName($channel) + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_getChannelFromAlias($channel); + $this->_unlock(); + return $ret; + } + + /** + * @param string + */ + function channelAlias($channel) + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_getAlias($channel); + $this->_unlock(); + return $ret; + } + // {{{ listPackages() + + function listPackages($channel = false) + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_listPackages($channel); + $this->_unlock(); + return $ret; + } + + // }}} + // {{{ listAllPackages() + + function listAllPackages() + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_listAllPackages(); + $this->_unlock(); + return $ret; + } + + // }}} + // {{{ listChannel() + + function listChannels() + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = $this->_listChannels(); + $this->_unlock(); + return $ret; + } + + // }}} + // {{{ addPackage() + + /** + * Add an installed package to the registry + * @param string|PEAR_PackageFile_v1|PEAR_PackageFile_v2 package name or object + * that will be passed to {@link addPackage2()} + * @param array package info (parsed by PEAR_Common::infoFrom*() methods) + * @return bool success of saving + */ + function addPackage($package, $info) + { + if (is_object($info)) { + return $this->addPackage2($info); + } + if (PEAR::isError($e = $this->_lock(LOCK_EX))) { + return $e; + } + $ret = $this->_addPackage($package, $info); + $this->_unlock(); + if ($ret) { + if (!class_exists('PEAR_PackageFile_v1')) { + require_once 'PEAR/PackageFile/v1.php'; + } + $pf = new PEAR_PackageFile_v1; + $pf->setConfig($this->_config); + $pf->fromArray($info); + $this->_dependencyDB->uninstallPackage($pf); + $this->_dependencyDB->installPackage($pf); + } + return $ret; + } + + // }}} + // {{{ addPackage2() + + function addPackage2($info) + { + if (!is_object($info)) { + return $this->addPackage($info['package'], $info); + } + if (PEAR::isError($e = $this->_lock(LOCK_EX))) { + return $e; + } + $ret = $this->_addPackage2($info); + $this->_unlock(); + if ($ret) { + $this->_dependencyDB->uninstallPackage($info); + $this->_dependencyDB->installPackage($info); + } + return $ret; + } + + // }}} + // {{{ updateChannel() + + /** + * For future expandibility purposes, separate this + * @param PEAR_ChannelFile + */ + function updateChannel($channel, $lastmodified = null) + { + if ($channel->getName() == '__uri') { + return false; + } + return $this->addChannel($channel, $lastmodified, true); + } + + // }}} + // {{{ deleteChannel() + + /** + * Deletion fails if there are any packages installed from the channel + * @param string|PEAR_ChannelFile channel name + * @return boolean|PEAR_Error True on deletion, false if it doesn't exist + */ + function deleteChannel($channel) + { + if (PEAR::isError($e = $this->_lock(LOCK_EX))) { + return $e; + } + + $ret = $this->_deleteChannel($channel); + $this->_unlock(); + if ($ret && is_a($this->_config, 'PEAR_Config')) { + $this->_config->setChannels($this->listChannels()); + } + + return $ret; + } + + // }}} + // {{{ addChannel() + + /** + * @param PEAR_ChannelFile Channel object + * @param string Last-Modified header from HTTP for caching + * @return boolean|PEAR_Error True on creation, false if it already exists + */ + function addChannel($channel, $lastmodified = false, $update = false) + { + if (!is_a($channel, 'PEAR_ChannelFile') || !$channel->validate()) { + return false; + } + + if (PEAR::isError($e = $this->_lock(LOCK_EX))) { + return $e; + } + + $ret = $this->_addChannel($channel, $update, $lastmodified); + $this->_unlock(); + if (!$update && $ret && is_a($this->_config, 'PEAR_Config')) { + $this->_config->setChannels($this->listChannels()); + } + + return $ret; + } + + // }}} + // {{{ deletePackage() + + function deletePackage($package, $channel = 'pear.php.net') + { + if (PEAR::isError($e = $this->_lock(LOCK_EX))) { + return $e; + } + + $file = $this->_packageFileName($package, $channel); + $ret = file_exists($file) ? @unlink($file) : false; + $this->_rebuildFileMap(); + $this->_unlock(); + $p = array('channel' => $channel, 'package' => $package); + $this->_dependencyDB->uninstallPackage($p); + return $ret; + } + + // }}} + // {{{ updatePackage() + + function updatePackage($package, $info, $merge = true) + { + if (is_object($info)) { + return $this->updatePackage2($info, $merge); + } + if (PEAR::isError($e = $this->_lock(LOCK_EX))) { + return $e; + } + $ret = $this->_updatePackage($package, $info, $merge); + $this->_unlock(); + if ($ret) { + if (!class_exists('PEAR_PackageFile_v1')) { + require_once 'PEAR/PackageFile/v1.php'; + } + $pf = new PEAR_PackageFile_v1; + $pf->setConfig($this->_config); + $pf->fromArray($this->packageInfo($package)); + $this->_dependencyDB->uninstallPackage($pf); + $this->_dependencyDB->installPackage($pf); + } + return $ret; + } + + // }}} + // {{{ updatePackage2() + + function updatePackage2($info) + { + + if (!is_object($info)) { + return $this->updatePackage($info['package'], $info, $merge); + } + + if (!$info->validate(PEAR_VALIDATE_DOWNLOADING)) { + return false; + } + + if (PEAR::isError($e = $this->_lock(LOCK_EX))) { + return $e; + } + + $ret = $this->_updatePackage2($info); + $this->_unlock(); + if ($ret) { + $this->_dependencyDB->uninstallPackage($info); + $this->_dependencyDB->installPackage($info); + } + + return $ret; + } + + // }}} + // {{{ getChannel() + /** + * @param string channel name + * @param bool whether to strictly return raw channels (no aliases) + * @return PEAR_ChannelFile|PEAR_Error + */ + function &getChannel($channel, $noaliases = false) + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $ret = &$this->_getChannel($channel, $noaliases); + $this->_unlock(); + if (!$ret) { + return PEAR::raiseError('Unknown channel: ' . $channel); + } + return $ret; + } + + // }}} + // {{{ getPackage() + /** + * @param string package name + * @param string channel name + * @return PEAR_PackageFile_v1|PEAR_PackageFile_v2|null + */ + function &getPackage($package, $channel = 'pear.php.net') + { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $pf = &$this->_getPackage($package, $channel); + $this->_unlock(); + return $pf; + } + + // }}} + + /** + * Get PEAR_PackageFile_v[1/2] objects representing the contents of + * a dependency group that are installed. + * + * This is used at uninstall-time + * @param array + * @return array|false + */ + function getInstalledGroup($group) + { + $ret = array(); + if (isset($group['package'])) { + if (!isset($group['package'][0])) { + $group['package'] = array($group['package']); + } + foreach ($group['package'] as $package) { + $depchannel = isset($package['channel']) ? $package['channel'] : '__uri'; + $p = &$this->getPackage($package['name'], $depchannel); + if ($p) { + $save = &$p; + $ret[] = &$save; + } + } + } + if (isset($group['subpackage'])) { + if (!isset($group['subpackage'][0])) { + $group['subpackage'] = array($group['subpackage']); + } + foreach ($group['subpackage'] as $package) { + $depchannel = isset($package['channel']) ? $package['channel'] : '__uri'; + $p = &$this->getPackage($package['name'], $depchannel); + if ($p) { + $save = &$p; + $ret[] = &$save; + } + } + } + if (!count($ret)) { + return false; + } + return $ret; + } + + // {{{ getChannelValidator() + /** + * @param string channel name + * @return PEAR_Validate|false + */ + function &getChannelValidator($channel) + { + $chan = $this->getChannel($channel); + if (PEAR::isError($chan)) { + return $chan; + } + $val = $chan->getValidationObject(); + return $val; + } + // }}} + // {{{ getChannels() + /** + * @param string channel name + * @return array an array of PEAR_ChannelFile objects representing every installed channel + */ + function &getChannels() + { + $ret = array(); + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + foreach ($this->_listChannels() as $channel) { + $e = &$this->_getChannel($channel); + if (!$e || PEAR::isError($e)) { + continue; + } + $ret[] = $e; + } + $this->_unlock(); + return $ret; + } + + // }}} + // {{{ checkFileMap() + + /** + * Test whether a file or set of files belongs to a package. + * + * If an array is passed in + * @param string|array file path, absolute or relative to the pear + * install dir + * @param string|array name of PEAR package or array('package' => name, 'channel' => + * channel) of a package that will be ignored + * @param string API version - 1.1 will exclude any files belonging to a package + * @param array private recursion variable + * @return array|false which package and channel the file belongs to, or an empty + * string if the file does not belong to an installed package, + * or belongs to the second parameter's package + */ + function checkFileMap($path, $package = false, $api = '1.0', $attrs = false) + { + if (is_array($path)) { + static $notempty; + if (empty($notempty)) { + if (!class_exists('PEAR_Installer_Role')) { + require_once 'PEAR/Installer/Role.php'; + } + $notempty = create_function('$a','return !empty($a);'); + } + $package = is_array($package) ? array(strtolower($package[0]), strtolower($package[1])) + : strtolower($package); + $pkgs = array(); + foreach ($path as $name => $attrs) { + if (is_array($attrs)) { + if (isset($attrs['install-as'])) { + $name = $attrs['install-as']; + } + if (!in_array($attrs['role'], PEAR_Installer_Role::getInstallableRoles())) { + // these are not installed + continue; + } + if (!in_array($attrs['role'], PEAR_Installer_Role::getBaseinstallRoles())) { + $attrs['baseinstalldir'] = is_array($package) ? $package[1] : $package; + } + if (isset($attrs['baseinstalldir'])) { + $name = $attrs['baseinstalldir'] . DIRECTORY_SEPARATOR . $name; + } + } + $pkgs[$name] = $this->checkFileMap($name, $package, $api, $attrs); + if (PEAR::isError($pkgs[$name])) { + return $pkgs[$name]; + } + } + return array_filter($pkgs, $notempty); + } + if (empty($this->filemap_cache)) { + if (PEAR::isError($e = $this->_lock(LOCK_SH))) { + return $e; + } + $err = $this->_readFileMap(); + $this->_unlock(); + if (PEAR::isError($err)) { + return $err; + } + } + if (!$attrs) { + $attrs = array('role' => 'php'); // any old call would be for PHP role only + } + if (isset($this->filemap_cache[$attrs['role']][$path])) { + if ($api >= '1.1' && $this->filemap_cache[$attrs['role']][$path] == $package) { + return false; + } + return $this->filemap_cache[$attrs['role']][$path]; + } + $l = strlen($this->install_dir); + if (substr($path, 0, $l) == $this->install_dir) { + $path = preg_replace('!^'.DIRECTORY_SEPARATOR.'+!', '', substr($path, $l)); + } + if (isset($this->filemap_cache[$attrs['role']][$path])) { + if ($api >= '1.1' && $this->filemap_cache[$attrs['role']][$path] == $package) { + return false; + } + return $this->filemap_cache[$attrs['role']][$path]; + } + return false; + } + + // }}} + // {{{ flush() + /** + * Force a reload of the filemap + * @since 1.5.0RC3 + */ + function flushFileMap() + { + $this->filemap_cache = null; + clearstatcache(); // ensure that the next read gets the full, current filemap + } + + // }}} + // {{{ apiVersion() + /** + * Get the expected API version. Channels API is version 1.1, as it is backwards + * compatible with 1.0 + * @return string + */ + function apiVersion() + { + return '1.1'; + } + // }}} + + + /** + * Parse a package name, or validate a parsed package name array + * @param string|array pass in an array of format + * array( + * 'package' => 'pname', + * ['channel' => 'channame',] + * ['version' => 'version',] + * ['state' => 'state',] + * ['group' => 'groupname']) + * or a string of format + * [channel://][channame/]pname[-version|-state][/group=groupname] + * @return array|PEAR_Error + */ + function parsePackageName($param, $defaultchannel = 'pear.php.net') + { + $saveparam = $param; + if (is_array($param)) { + // convert to string for error messages + $saveparam = $this->parsedPackageNameToString($param); + // process the array + if (!isset($param['package'])) { + return PEAR::raiseError('parsePackageName(): array $param ' . + 'must contain a valid package name in index "param"', + 'package', null, null, $param); + } + if (!isset($param['uri'])) { + if (!isset($param['channel'])) { + $param['channel'] = $defaultchannel; + } + } else { + $param['channel'] = '__uri'; + } + } else { + $components = @parse_url((string) $param); + if (isset($components['scheme'])) { + if ($components['scheme'] == 'http') { + // uri package + $param = array('uri' => $param, 'channel' => '__uri'); + } elseif($components['scheme'] != 'channel') { + return PEAR::raiseError('parsePackageName(): only channel:// uris may ' . + 'be downloaded, not "' . $param . '"', 'invalid', null, null, $param); + } + } + if (!isset($components['path'])) { + return PEAR::raiseError('parsePackageName(): array $param ' . + 'must contain a valid package name in "' . $param . '"', + 'package', null, null, $param); + } + if (isset($components['host'])) { + // remove the leading "/" + $components['path'] = substr($components['path'], 1); + } + if (!isset($components['scheme'])) { + if (strpos($components['path'], '/') !== false) { + if ($components['path']{0} == '/') { + return PEAR::raiseError('parsePackageName(): this is not ' . + 'a package name, it begins with "/" in "' . $param . '"', + 'invalid', null, null, $param); + } + $parts = explode('/', $components['path']); + $components['host'] = array_shift($parts); + if (count($parts) > 1) { + $components['path'] = array_pop($parts); + $components['host'] .= '/' . implode('/', $parts); + } else { + $components['path'] = implode('/', $parts); + } + } else { + $components['host'] = $defaultchannel; + } + } else { + if (strpos($components['path'], '/')) { + $parts = explode('/', $components['path']); + $components['path'] = array_pop($parts); + $components['host'] .= '/' . implode('/', $parts); + } + } + + if (is_array($param)) { + $param['package'] = $components['path']; + } else { + $param = array( + 'package' => $components['path'] + ); + if (isset($components['host'])) { + $param['channel'] = $components['host']; + } + } + if (isset($components['fragment'])) { + $param['group'] = $components['fragment']; + } + if (isset($components['user'])) { + $param['user'] = $components['user']; + } + if (isset($components['pass'])) { + $param['pass'] = $components['pass']; + } + if (isset($components['query'])) { + parse_str($components['query'], $param['opts']); + } + // check for extension + $pathinfo = pathinfo($param['package']); + if (isset($pathinfo['extension']) && + in_array(strtolower($pathinfo['extension']), array('tgz', 'tar'))) { + $param['extension'] = $pathinfo['extension']; + $param['package'] = substr($pathinfo['basename'], 0, + strlen($pathinfo['basename']) - 4); + } + // check for version + if (strpos($param['package'], '-')) { + $test = explode('-', $param['package']); + if (count($test) != 2) { + return PEAR::raiseError('parsePackageName(): only one version/state ' . + 'delimiter "-" is allowed in "' . $saveparam . '"', + 'version', null, null, $param); + } + list($param['package'], $param['version']) = $test; + } + } + // validation + $info = $this->channelExists($param['channel']); + if (PEAR::isError($info)) { + return $info; + } + if (!$info) { + return PEAR::raiseError('unknown channel "' . $param['channel'] . + '" in "' . $saveparam . '"', 'channel', null, null, $param); + } + $chan = $this->getChannel($param['channel']); + if (PEAR::isError($chan)) { + return $chan; + } + if (!$chan) { + return PEAR::raiseError("Exception: corrupt registry, could not " . + "retrieve channel " . $param['channel'] . " information", + 'registry', null, null, $param); + } + $param['channel'] = $chan->getName(); + $validate = $chan->getValidationObject(); + $vpackage = $chan->getValidationPackage(); + // validate package name + if (!$validate->validPackageName($param['package'], $vpackage['_content'])) { + return PEAR::raiseError('parsePackageName(): invalid package name "' . + $param['package'] . '" in "' . $saveparam . '"', + 'package', null, null, $param); + } + if (isset($param['group'])) { + if (!PEAR_Validate::validGroupName($param['group'])) { + return PEAR::raiseError('parsePackageName(): dependency group "' . $param['group'] . + '" is not a valid group name in "' . $saveparam . '"', 'group', null, null, + $param); + } + } + if (isset($param['state'])) { + if (!in_array(strtolower($param['state']), $validate->getValidStates())) { + return PEAR::raiseError('parsePackageName(): state "' . $param['state'] + . '" is not a valid state in "' . $saveparam . '"', + 'state', null, null, $param); + } + } + if (isset($param['version'])) { + if (isset($param['state'])) { + return PEAR::raiseError('parsePackageName(): cannot contain both ' . + 'a version and a stability (state) in "' . $saveparam . '"', + 'version/state', null, null, $param); + } + // check whether version is actually a state + if (in_array(strtolower($param['version']), $validate->getValidStates())) { + $param['state'] = strtolower($param['version']); + unset($param['version']); + } else { + if (!$validate->validVersion($param['version'])) { + return PEAR::raiseError('parsePackageName(): "' . $param['version'] . + '" is neither a valid version nor a valid state in "' . + $saveparam . '"', 'version/state', null, null, $param); + } + } + } + return $param; + } + + /** + * @param array + * @return string + */ + function parsedPackageNameToString($parsed, $brief = false) + { + if (is_string($parsed)) { + return $parsed; + } + if (is_object($parsed)) { + $p = $parsed; + $parsed = array( + 'package' => $p->getPackage(), + 'channel' => $p->getChannel(), + 'version' => $p->getVersion(), + ); + } + if (isset($parsed['uri'])) { + return $parsed['uri']; + } + if ($brief) { + if ($channel = $this->channelAlias($parsed['channel'])) { + return $channel . '/' . $parsed['package']; + } + } + $upass = ''; + if (isset($parsed['user'])) { + $upass = $parsed['user']; + if (isset($parsed['pass'])) { + $upass .= ':' . $parsed['pass']; + } + $upass = "$upass@"; + } + $ret = 'channel://' . $upass . $parsed['channel'] . '/' . $parsed['package']; + if (isset($parsed['version']) || isset($parsed['state'])) { + $ver = isset($parsed['version']) ? $parsed['version'] : ''; + $ver .= isset($parsed['state']) ? $parsed['state'] : ''; + $ret .= '-' . $ver; + } + if (isset($parsed['extension'])) { + $ret .= '.' . $parsed['extension']; + } + if (isset($parsed['opts'])) { + $ret .= '?'; + foreach ($parsed['opts'] as $name => $value) { + $parsed['opts'][$name] = "$name=$value"; + } + $ret .= implode('&', $parsed['opts']); + } + if (isset($parsed['group'])) { + $ret .= '#' . $parsed['group']; + } + return $ret; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/RunTest.php b/vendor/pear-pear.php.net/PEAR/PEAR/RunTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5182490697015f3954aa05c924a80f6f58c47ed3 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/RunTest.php @@ -0,0 +1,968 @@ +<?php +/** + * PEAR_RunTest + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Tomas V.V.Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: RunTest.php 313024 2011-07-06 19:51:24Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.3.3 + */ + +/** + * for error handling + */ +require_once 'PEAR.php'; +require_once 'PEAR/Config.php'; + +define('DETAILED', 1); +putenv("PHP_PEAR_RUNTESTS=1"); + +/** + * Simplified version of PHP's test suite + * + * Try it with: + * + * $ php -r 'include "../PEAR/RunTest.php"; $t=new PEAR_RunTest; $o=$t->run("./pear_system.phpt");print_r($o);' + * + * + * @category pear + * @package PEAR + * @author Tomas V.V.Cox <cox@idecnet.com> + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.3.3 + */ +class PEAR_RunTest +{ + var $_headers = array(); + var $_logger; + var $_options; + var $_php; + var $tests_count; + var $xdebug_loaded; + /** + * Saved value of php executable, used to reset $_php when we + * have a test that uses cgi + * + * @var unknown_type + */ + var $_savephp; + var $ini_overwrites = array( + 'output_handler=', + 'open_basedir=', + 'safe_mode=0', + 'disable_functions=', + 'output_buffering=Off', + 'display_errors=1', + 'log_errors=0', + 'html_errors=0', + 'track_errors=1', + 'report_memleaks=0', + 'report_zend_debug=0', + 'docref_root=', + 'docref_ext=.html', + 'error_prepend_string=', + 'error_append_string=', + 'auto_prepend_file=', + 'auto_append_file=', + 'magic_quotes_runtime=0', + 'xdebug.default_enable=0', + 'allow_url_fopen=1', + ); + + /** + * An object that supports the PEAR_Common->log() signature, or null + * @param PEAR_Common|null + */ + function PEAR_RunTest($logger = null, $options = array()) + { + if (!defined('E_DEPRECATED')) { + define('E_DEPRECATED', 0); + } + if (!defined('E_STRICT')) { + define('E_STRICT', 0); + } + $this->ini_overwrites[] = 'error_reporting=' . (E_ALL & ~(E_DEPRECATED | E_STRICT)); + if (is_null($logger)) { + require_once 'PEAR/Common.php'; + $logger = new PEAR_Common; + } + $this->_logger = $logger; + $this->_options = $options; + + $conf = &PEAR_Config::singleton(); + $this->_php = $conf->get('php_bin'); + } + + /** + * Taken from php-src/run-tests.php + * + * @param string $commandline command name + * @param array $env + * @param string $stdin standard input to pass to the command + * @return unknown + */ + function system_with_timeout($commandline, $env = null, $stdin = null) + { + $data = ''; + if (version_compare(phpversion(), '5.0.0', '<')) { + $proc = proc_open($commandline, array( + 0 => array('pipe', 'r'), + 1 => array('pipe', 'w'), + 2 => array('pipe', 'w') + ), $pipes); + } else { + $proc = proc_open($commandline, array( + 0 => array('pipe', 'r'), + 1 => array('pipe', 'w'), + 2 => array('pipe', 'w') + ), $pipes, null, $env, array('suppress_errors' => true)); + } + + if (!$proc) { + return false; + } + + if (is_string($stdin)) { + fwrite($pipes[0], $stdin); + } + fclose($pipes[0]); + + while (true) { + /* hide errors from interrupted syscalls */ + $r = $pipes; + $e = $w = null; + $n = @stream_select($r, $w, $e, 60); + + if ($n === 0) { + /* timed out */ + $data .= "\n ** ERROR: process timed out **\n"; + proc_terminate($proc); + return array(1234567890, $data); + } else if ($n > 0) { + $line = fread($pipes[1], 8192); + if (strlen($line) == 0) { + /* EOF */ + break; + } + $data .= $line; + } + } + if (function_exists('proc_get_status')) { + $stat = proc_get_status($proc); + if ($stat['signaled']) { + $data .= "\nTermsig=".$stat['stopsig']; + } + } + $code = proc_close($proc); + if (function_exists('proc_get_status')) { + $code = $stat['exitcode']; + } + return array($code, $data); + } + + /** + * Turns a PHP INI string into an array + * + * Turns -d "include_path=/foo/bar" into this: + * array( + * 'include_path' => array( + * 'operator' => '-d', + * 'value' => '/foo/bar', + * ) + * ) + * Works both with quotes and without + * + * @param string an PHP INI string, -d "include_path=/foo/bar" + * @return array + */ + function iniString2array($ini_string) + { + if (!$ini_string) { + return array(); + } + $split = preg_split('/[\s]|=/', $ini_string, -1, PREG_SPLIT_NO_EMPTY); + $key = $split[1][0] == '"' ? substr($split[1], 1) : $split[1]; + $value = $split[2][strlen($split[2]) - 1] == '"' ? substr($split[2], 0, -1) : $split[2]; + // FIXME review if this is really the struct to go with + $array = array($key => array('operator' => $split[0], 'value' => $value)); + return $array; + } + + function settings2array($settings, $ini_settings) + { + foreach ($settings as $setting) { + if (strpos($setting, '=') !== false) { + $setting = explode('=', $setting, 2); + $name = trim(strtolower($setting[0])); + $value = trim($setting[1]); + $ini_settings[$name] = $value; + } + } + return $ini_settings; + } + + function settings2params($ini_settings) + { + $settings = ''; + foreach ($ini_settings as $name => $value) { + if (is_array($value)) { + $operator = $value['operator']; + $value = $value['value']; + } else { + $operator = '-d'; + } + $value = addslashes($value); + $settings .= " $operator \"$name=$value\""; + } + return $settings; + } + + function _preparePhpBin($php, $file, $ini_settings) + { + $file = escapeshellarg($file); + // This was fixed in php 5.3 and is not needed after that + if (OS_WINDOWS && version_compare(PHP_VERSION, '5.3', '<')) { + $cmd = '"'.escapeshellarg($php).' '.$ini_settings.' -f ' . $file .'"'; + } else { + $cmd = $php . $ini_settings . ' -f ' . $file; + } + + return $cmd; + } + + function runPHPUnit($file, $ini_settings = '') + { + if (!file_exists($file) && file_exists(getcwd() . DIRECTORY_SEPARATOR . $file)) { + $file = realpath(getcwd() . DIRECTORY_SEPARATOR . $file); + } elseif (file_exists($file)) { + $file = realpath($file); + } + + $cmd = $this->_preparePhpBin($this->_php, $file, $ini_settings); + if (isset($this->_logger)) { + $this->_logger->log(2, 'Running command "' . $cmd . '"'); + } + + $savedir = getcwd(); // in case the test moves us around + chdir(dirname($file)); + echo `$cmd`; + chdir($savedir); + return 'PASSED'; // we have no way of knowing this information so assume passing + } + + /** + * Runs an individual test case. + * + * @param string The filename of the test + * @param array|string INI settings to be applied to the test run + * @param integer Number what the current running test is of the + * whole test suite being runned. + * + * @return string|object Returns PASSED, WARNED, FAILED depending on how the + * test came out. + * PEAR Error when the tester it self fails + */ + function run($file, $ini_settings = array(), $test_number = 1) + { + if (isset($this->_savephp)) { + $this->_php = $this->_savephp; + unset($this->_savephp); + } + if (empty($this->_options['cgi'])) { + // try to see if php-cgi is in the path + $res = $this->system_with_timeout('php-cgi -v'); + if (false !== $res && !(is_array($res) && in_array($res[0], array(-1, 127)))) { + $this->_options['cgi'] = 'php-cgi'; + } + } + if (1 < $len = strlen($this->tests_count)) { + $test_number = str_pad($test_number, $len, ' ', STR_PAD_LEFT); + $test_nr = "[$test_number/$this->tests_count] "; + } else { + $test_nr = ''; + } + + $file = realpath($file); + $section_text = $this->_readFile($file); + if (PEAR::isError($section_text)) { + return $section_text; + } + + if (isset($section_text['POST_RAW']) && isset($section_text['UPLOAD'])) { + return PEAR::raiseError("Cannot contain both POST_RAW and UPLOAD in test file: $file"); + } + + $cwd = getcwd(); + + $pass_options = ''; + if (!empty($this->_options['ini'])) { + $pass_options = $this->_options['ini']; + } + + if (is_string($ini_settings)) { + $ini_settings = $this->iniString2array($ini_settings); + } + + $ini_settings = $this->settings2array($this->ini_overwrites, $ini_settings); + if ($section_text['INI']) { + if (strpos($section_text['INI'], '{PWD}') !== false) { + $section_text['INI'] = str_replace('{PWD}', dirname($file), $section_text['INI']); + } + $ini = preg_split( "/[\n\r]+/", $section_text['INI']); + $ini_settings = $this->settings2array($ini, $ini_settings); + } + $ini_settings = $this->settings2params($ini_settings); + $shortname = str_replace($cwd . DIRECTORY_SEPARATOR, '', $file); + + $tested = trim($section_text['TEST']); + $tested.= !isset($this->_options['simple']) ? "[$shortname]" : ' '; + + if (!empty($section_text['POST']) || !empty($section_text['POST_RAW']) || + !empty($section_text['UPLOAD']) || !empty($section_text['GET']) || + !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) { + if (empty($this->_options['cgi'])) { + if (!isset($this->_options['quiet'])) { + $this->_logger->log(0, "SKIP $test_nr$tested (reason: --cgi option needed for this test, type 'pear help run-tests')"); + } + if (isset($this->_options['tapoutput'])) { + return array('ok', ' # skip --cgi option needed for this test, "pear help run-tests" for info'); + } + return 'SKIPPED'; + } + $this->_savephp = $this->_php; + $this->_php = $this->_options['cgi']; + } + + $temp_dir = realpath(dirname($file)); + $main_file_name = basename($file, 'phpt'); + $diff_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'diff'; + $log_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'log'; + $exp_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'exp'; + $output_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'out'; + $memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'mem'; + $temp_file = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'php'; + $temp_skipif = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'skip.php'; + $temp_clean = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'clean.php'; + $tmp_post = $temp_dir . DIRECTORY_SEPARATOR . uniqid('phpt.'); + + // unlink old test results + $this->_cleanupOldFiles($file); + + // Check if test should be skipped. + $res = $this->_runSkipIf($section_text, $temp_skipif, $tested, $ini_settings); + if (count($res) != 2) { + return $res; + } + $info = $res['info']; + $warn = $res['warn']; + + // We've satisfied the preconditions - run the test! + if (isset($this->_options['coverage']) && $this->xdebug_loaded) { + $xdebug_file = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'xdebug'; + $text = "\n" . 'function coverage_shutdown() {' . + "\n" . ' $xdebug = var_export(xdebug_get_code_coverage(), true);'; + if (!function_exists('file_put_contents')) { + $text .= "\n" . ' $fh = fopen(\'' . $xdebug_file . '\', "wb");' . + "\n" . ' if ($fh !== false) {' . + "\n" . ' fwrite($fh, $xdebug);' . + "\n" . ' fclose($fh);' . + "\n" . ' }'; + } else { + $text .= "\n" . ' file_put_contents(\'' . $xdebug_file . '\', $xdebug);'; + } + + // Workaround for http://pear.php.net/bugs/bug.php?id=17292 + $lines = explode("\n", $section_text['FILE']); + $numLines = count($lines); + $namespace = ''; + $coverage_shutdown = 'coverage_shutdown'; + + if ( + substr($lines[0], 0, 2) == '<?' || + substr($lines[0], 0, 5) == '<?php' + ) { + unset($lines[0]); + } + + + for ($i = 0; $i < $numLines; $i++) { + if (isset($lines[$i]) && substr($lines[$i], 0, 9) == 'namespace') { + $namespace = substr($lines[$i], 10, -1); + $coverage_shutdown = $namespace . '\\coverage_shutdown'; + $namespace = "namespace " . $namespace . ";\n"; + + unset($lines[$i]); + break; + } + } + + $text .= "\n xdebug_stop_code_coverage();" . + "\n" . '} // end coverage_shutdown()' . + "\n\n" . 'register_shutdown_function("' . $coverage_shutdown . '");'; + $text .= "\n" . 'xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);' . "\n"; + + $this->save_text($temp_file, "<?php\n" . $namespace . $text . "\n" . implode("\n", $lines)); + } else { + $this->save_text($temp_file, $section_text['FILE']); + } + + $args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : ''; + $cmd = $this->_preparePhpBin($this->_php, $temp_file, $ini_settings); + $cmd.= "$args 2>&1"; + if (isset($this->_logger)) { + $this->_logger->log(2, 'Running command "' . $cmd . '"'); + } + + // Reset environment from any previous test. + $env = $this->_resetEnv($section_text, $temp_file); + + $section_text = $this->_processUpload($section_text, $file); + if (PEAR::isError($section_text)) { + return $section_text; + } + + if (array_key_exists('POST_RAW', $section_text) && !empty($section_text['POST_RAW'])) { + $post = trim($section_text['POST_RAW']); + $raw_lines = explode("\n", $post); + + $request = ''; + $started = false; + foreach ($raw_lines as $i => $line) { + if (empty($env['CONTENT_TYPE']) && + preg_match('/^Content-Type:(.*)/i', $line, $res)) { + $env['CONTENT_TYPE'] = trim(str_replace("\r", '', $res[1])); + continue; + } + if ($started) { + $request .= "\n"; + } + $started = true; + $request .= $line; + } + + $env['CONTENT_LENGTH'] = strlen($request); + $env['REQUEST_METHOD'] = 'POST'; + + $this->save_text($tmp_post, $request); + $cmd = "$this->_php$pass_options$ini_settings \"$temp_file\" 2>&1 < $tmp_post"; + } elseif (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) { + $post = trim($section_text['POST']); + $this->save_text($tmp_post, $post); + $content_length = strlen($post); + + $env['REQUEST_METHOD'] = 'POST'; + $env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; + $env['CONTENT_LENGTH'] = $content_length; + + $cmd = "$this->_php$pass_options$ini_settings \"$temp_file\" 2>&1 < $tmp_post"; + } else { + $env['REQUEST_METHOD'] = 'GET'; + $env['CONTENT_TYPE'] = ''; + $env['CONTENT_LENGTH'] = ''; + } + + if (OS_WINDOWS && isset($section_text['RETURNS'])) { + ob_start(); + system($cmd, $return_value); + $out = ob_get_contents(); + ob_end_clean(); + $section_text['RETURNS'] = (int) trim($section_text['RETURNS']); + $returnfail = ($return_value != $section_text['RETURNS']); + } else { + $returnfail = false; + $stdin = isset($section_text['STDIN']) ? $section_text['STDIN'] : null; + $out = $this->system_with_timeout($cmd, $env, $stdin); + $return_value = $out[0]; + $out = $out[1]; + } + + $output = preg_replace('/\r\n/', "\n", trim($out)); + + if (isset($tmp_post) && realpath($tmp_post) && file_exists($tmp_post)) { + @unlink(realpath($tmp_post)); + } + chdir($cwd); // in case the test moves us around + + $this->_testCleanup($section_text, $temp_clean); + + /* when using CGI, strip the headers from the output */ + $output = $this->_stripHeadersCGI($output); + + if (isset($section_text['EXPECTHEADERS'])) { + $testheaders = $this->_processHeaders($section_text['EXPECTHEADERS']); + $missing = array_diff_assoc($testheaders, $this->_headers); + $changed = ''; + foreach ($missing as $header => $value) { + if (isset($this->_headers[$header])) { + $changed .= "-$header: $value\n+$header: "; + $changed .= $this->_headers[$header]; + } else { + $changed .= "-$header: $value\n"; + } + } + if ($missing) { + // tack on failed headers to output: + $output .= "\n====EXPECTHEADERS FAILURE====:\n$changed"; + } + } + // Does the output match what is expected? + do { + if (isset($section_text['EXPECTF']) || isset($section_text['EXPECTREGEX'])) { + if (isset($section_text['EXPECTF'])) { + $wanted = trim($section_text['EXPECTF']); + } else { + $wanted = trim($section_text['EXPECTREGEX']); + } + $wanted_re = preg_replace('/\r\n/', "\n", $wanted); + if (isset($section_text['EXPECTF'])) { + $wanted_re = preg_quote($wanted_re, '/'); + // Stick to basics + $wanted_re = str_replace("%s", ".+?", $wanted_re); //not greedy + $wanted_re = str_replace("%i", "[+\-]?[0-9]+", $wanted_re); + $wanted_re = str_replace("%d", "[0-9]+", $wanted_re); + $wanted_re = str_replace("%x", "[0-9a-fA-F]+", $wanted_re); + $wanted_re = str_replace("%f", "[+\-]?\.?[0-9]+\.?[0-9]*(E-?[0-9]+)?", $wanted_re); + $wanted_re = str_replace("%c", ".", $wanted_re); + // %f allows two points "-.0.0" but that is the best *simple* expression + } + + /* DEBUG YOUR REGEX HERE + var_dump($wanted_re); + print(str_repeat('=', 80) . "\n"); + var_dump($output); + */ + if (!$returnfail && preg_match("/^$wanted_re\$/s", $output)) { + if (file_exists($temp_file)) { + unlink($temp_file); + } + if (array_key_exists('FAIL', $section_text)) { + break; + } + if (!isset($this->_options['quiet'])) { + $this->_logger->log(0, "PASS $test_nr$tested$info"); + } + if (isset($this->_options['tapoutput'])) { + return array('ok', ' - ' . $tested); + } + return 'PASSED'; + } + } else { + if (isset($section_text['EXPECTFILE'])) { + $f = $temp_dir . '/' . trim($section_text['EXPECTFILE']); + if (!($fp = @fopen($f, 'rb'))) { + return PEAR::raiseError('--EXPECTFILE-- section file ' . + $f . ' not found'); + } + fclose($fp); + $section_text['EXPECT'] = file_get_contents($f); + } + + if (isset($section_text['EXPECT'])) { + $wanted = preg_replace('/\r\n/', "\n", trim($section_text['EXPECT'])); + } else { + $wanted = ''; + } + + // compare and leave on success + if (!$returnfail && 0 == strcmp($output, $wanted)) { + if (file_exists($temp_file)) { + unlink($temp_file); + } + if (array_key_exists('FAIL', $section_text)) { + break; + } + if (!isset($this->_options['quiet'])) { + $this->_logger->log(0, "PASS $test_nr$tested$info"); + } + if (isset($this->_options['tapoutput'])) { + return array('ok', ' - ' . $tested); + } + return 'PASSED'; + } + } + } while (false); + + if (array_key_exists('FAIL', $section_text)) { + // we expect a particular failure + // this is only used for testing PEAR_RunTest + $expectf = isset($section_text['EXPECTF']) ? $wanted_re : null; + $faildiff = $this->generate_diff($wanted, $output, null, $expectf); + $faildiff = preg_replace('/\r/', '', $faildiff); + $wanted = preg_replace('/\r/', '', trim($section_text['FAIL'])); + if ($faildiff == $wanted) { + if (!isset($this->_options['quiet'])) { + $this->_logger->log(0, "PASS $test_nr$tested$info"); + } + if (isset($this->_options['tapoutput'])) { + return array('ok', ' - ' . $tested); + } + return 'PASSED'; + } + unset($section_text['EXPECTF']); + $output = $faildiff; + if (isset($section_text['RETURNS'])) { + return PEAR::raiseError('Cannot have both RETURNS and FAIL in the same test: ' . + $file); + } + } + + // Test failed so we need to report details. + $txt = $warn ? 'WARN ' : 'FAIL '; + $this->_logger->log(0, $txt . $test_nr . $tested . $info); + + // write .exp + $res = $this->_writeLog($exp_filename, $wanted); + if (PEAR::isError($res)) { + return $res; + } + + // write .out + $res = $this->_writeLog($output_filename, $output); + if (PEAR::isError($res)) { + return $res; + } + + // write .diff + $returns = isset($section_text['RETURNS']) ? + array(trim($section_text['RETURNS']), $return_value) : null; + $expectf = isset($section_text['EXPECTF']) ? $wanted_re : null; + $data = $this->generate_diff($wanted, $output, $returns, $expectf); + $res = $this->_writeLog($diff_filename, $data); + if (PEAR::isError($res)) { + return $res; + } + + // write .log + $data = " +---- EXPECTED OUTPUT +$wanted +---- ACTUAL OUTPUT +$output +---- FAILED +"; + + if ($returnfail) { + $data .= " +---- EXPECTED RETURN +$section_text[RETURNS] +---- ACTUAL RETURN +$return_value +"; + } + + $res = $this->_writeLog($log_filename, $data); + if (PEAR::isError($res)) { + return $res; + } + + if (isset($this->_options['tapoutput'])) { + $wanted = explode("\n", $wanted); + $wanted = "# Expected output:\n#\n#" . implode("\n#", $wanted); + $output = explode("\n", $output); + $output = "#\n#\n# Actual output:\n#\n#" . implode("\n#", $output); + return array($wanted . $output . 'not ok', ' - ' . $tested); + } + return $warn ? 'WARNED' : 'FAILED'; + } + + function generate_diff($wanted, $output, $rvalue, $wanted_re) + { + $w = explode("\n", $wanted); + $o = explode("\n", $output); + $wr = explode("\n", $wanted_re); + $w1 = array_diff_assoc($w, $o); + $o1 = array_diff_assoc($o, $w); + $o2 = $w2 = array(); + foreach ($w1 as $idx => $val) { + if (!$wanted_re || !isset($wr[$idx]) || !isset($o1[$idx]) || + !preg_match('/^' . $wr[$idx] . '\\z/', $o1[$idx])) { + $w2[sprintf("%03d<", $idx)] = sprintf("%03d- ", $idx + 1) . $val; + } + } + foreach ($o1 as $idx => $val) { + if (!$wanted_re || !isset($wr[$idx]) || + !preg_match('/^' . $wr[$idx] . '\\z/', $val)) { + $o2[sprintf("%03d>", $idx)] = sprintf("%03d+ ", $idx + 1) . $val; + } + } + $diff = array_merge($w2, $o2); + ksort($diff); + $extra = $rvalue ? "##EXPECTED: $rvalue[0]\r\n##RETURNED: $rvalue[1]" : ''; + return implode("\r\n", $diff) . $extra; + } + + // Write the given text to a temporary file, and return the filename. + function save_text($filename, $text) + { + if (!$fp = fopen($filename, 'w')) { + return PEAR::raiseError("Cannot open file '" . $filename . "' (save_text)"); + } + fwrite($fp, $text); + fclose($fp); + if (1 < DETAILED) echo " +FILE $filename {{{ +$text +}}} +"; + } + + function _cleanupOldFiles($file) + { + $temp_dir = realpath(dirname($file)); + $mainFileName = basename($file, 'phpt'); + $diff_filename = $temp_dir . DIRECTORY_SEPARATOR . $mainFileName.'diff'; + $log_filename = $temp_dir . DIRECTORY_SEPARATOR . $mainFileName.'log'; + $exp_filename = $temp_dir . DIRECTORY_SEPARATOR . $mainFileName.'exp'; + $output_filename = $temp_dir . DIRECTORY_SEPARATOR . $mainFileName.'out'; + $memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $mainFileName.'mem'; + $temp_file = $temp_dir . DIRECTORY_SEPARATOR . $mainFileName.'php'; + $temp_skipif = $temp_dir . DIRECTORY_SEPARATOR . $mainFileName.'skip.php'; + $temp_clean = $temp_dir . DIRECTORY_SEPARATOR . $mainFileName.'clean.php'; + $tmp_post = $temp_dir . DIRECTORY_SEPARATOR . uniqid('phpt.'); + + // unlink old test results + @unlink($diff_filename); + @unlink($log_filename); + @unlink($exp_filename); + @unlink($output_filename); + @unlink($memcheck_filename); + @unlink($temp_file); + @unlink($temp_skipif); + @unlink($tmp_post); + @unlink($temp_clean); + } + + function _runSkipIf($section_text, $temp_skipif, $tested, $ini_settings) + { + $info = ''; + $warn = false; + if (array_key_exists('SKIPIF', $section_text) && trim($section_text['SKIPIF'])) { + $this->save_text($temp_skipif, $section_text['SKIPIF']); + $output = $this->system_with_timeout("$this->_php$ini_settings -f \"$temp_skipif\""); + $output = $output[1]; + $loutput = ltrim($output); + unlink($temp_skipif); + if (!strncasecmp('skip', $loutput, 4)) { + $skipreason = "SKIP $tested"; + if (preg_match('/^\s*skip\s*(.+)\s*/i', $output, $m)) { + $skipreason .= '(reason: ' . $m[1] . ')'; + } + if (!isset($this->_options['quiet'])) { + $this->_logger->log(0, $skipreason); + } + if (isset($this->_options['tapoutput'])) { + return array('ok', ' # skip ' . $reason); + } + return 'SKIPPED'; + } + + if (!strncasecmp('info', $loutput, 4) + && preg_match('/^\s*info\s*(.+)\s*/i', $output, $m)) { + $info = " (info: $m[1])"; + } + + if (!strncasecmp('warn', $loutput, 4) + && preg_match('/^\s*warn\s*(.+)\s*/i', $output, $m)) { + $warn = true; /* only if there is a reason */ + $info = " (warn: $m[1])"; + } + } + + return array('warn' => $warn, 'info' => $info); + } + + function _stripHeadersCGI($output) + { + $this->headers = array(); + if (!empty($this->_options['cgi']) && + $this->_php == $this->_options['cgi'] && + preg_match("/^(.*?)(?:\n\n(.*)|\\z)/s", $output, $match)) { + $output = isset($match[2]) ? trim($match[2]) : ''; + $this->_headers = $this->_processHeaders($match[1]); + } + + return $output; + } + + /** + * Return an array that can be used with array_diff() to compare headers + * + * @param string $text + */ + function _processHeaders($text) + { + $headers = array(); + $rh = preg_split("/[\n\r]+/", $text); + foreach ($rh as $line) { + if (strpos($line, ':')!== false) { + $line = explode(':', $line, 2); + $headers[trim($line[0])] = trim($line[1]); + } + } + return $headers; + } + + function _readFile($file) + { + // Load the sections of the test file. + $section_text = array( + 'TEST' => '(unnamed test)', + 'SKIPIF' => '', + 'GET' => '', + 'COOKIE' => '', + 'POST' => '', + 'ARGS' => '', + 'INI' => '', + 'CLEAN' => '', + ); + + if (!is_file($file) || !$fp = fopen($file, "r")) { + return PEAR::raiseError("Cannot open test file: $file"); + } + + $section = ''; + while (!feof($fp)) { + $line = fgets($fp); + + // Match the beginning of a section. + if (preg_match('/^--([_A-Z]+)--/', $line, $r)) { + $section = $r[1]; + $section_text[$section] = ''; + continue; + } elseif (empty($section)) { + fclose($fp); + return PEAR::raiseError("Invalid sections formats in test file: $file"); + } + + // Add to the section text. + $section_text[$section] .= $line; + } + fclose($fp); + + return $section_text; + } + + function _writeLog($logname, $data) + { + if (!$log = fopen($logname, 'w')) { + return PEAR::raiseError("Cannot create test log - $logname"); + } + fwrite($log, $data); + fclose($log); + } + + function _resetEnv($section_text, $temp_file) + { + $env = $_ENV; + $env['REDIRECT_STATUS'] = ''; + $env['QUERY_STRING'] = ''; + $env['PATH_TRANSLATED'] = ''; + $env['SCRIPT_FILENAME'] = ''; + $env['REQUEST_METHOD'] = ''; + $env['CONTENT_TYPE'] = ''; + $env['CONTENT_LENGTH'] = ''; + if (!empty($section_text['ENV'])) { + if (strpos($section_text['ENV'], '{PWD}') !== false) { + $section_text['ENV'] = str_replace('{PWD}', dirname($temp_file), $section_text['ENV']); + } + foreach (explode("\n", trim($section_text['ENV'])) as $e) { + $e = explode('=', trim($e), 2); + if (!empty($e[0]) && isset($e[1])) { + $env[$e[0]] = $e[1]; + } + } + } + if (array_key_exists('GET', $section_text)) { + $env['QUERY_STRING'] = trim($section_text['GET']); + } else { + $env['QUERY_STRING'] = ''; + } + if (array_key_exists('COOKIE', $section_text)) { + $env['HTTP_COOKIE'] = trim($section_text['COOKIE']); + } else { + $env['HTTP_COOKIE'] = ''; + } + $env['REDIRECT_STATUS'] = '1'; + $env['PATH_TRANSLATED'] = $temp_file; + $env['SCRIPT_FILENAME'] = $temp_file; + + return $env; + } + + function _processUpload($section_text, $file) + { + if (array_key_exists('UPLOAD', $section_text) && !empty($section_text['UPLOAD'])) { + $upload_files = trim($section_text['UPLOAD']); + $upload_files = explode("\n", $upload_files); + + $request = "Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737\n" . + "-----------------------------20896060251896012921717172737\n"; + foreach ($upload_files as $fileinfo) { + $fileinfo = explode('=', $fileinfo); + if (count($fileinfo) != 2) { + return PEAR::raiseError("Invalid UPLOAD section in test file: $file"); + } + if (!realpath(dirname($file) . '/' . $fileinfo[1])) { + return PEAR::raiseError("File for upload does not exist: $fileinfo[1] " . + "in test file: $file"); + } + $file_contents = file_get_contents(dirname($file) . '/' . $fileinfo[1]); + $fileinfo[1] = basename($fileinfo[1]); + $request .= "Content-Disposition: form-data; name=\"$fileinfo[0]\"; filename=\"$fileinfo[1]\"\n"; + $request .= "Content-Type: text/plain\n\n"; + $request .= $file_contents . "\n" . + "-----------------------------20896060251896012921717172737\n"; + } + + if (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) { + // encode POST raw + $post = trim($section_text['POST']); + $post = explode('&', $post); + foreach ($post as $i => $post_info) { + $post_info = explode('=', $post_info); + if (count($post_info) != 2) { + return PEAR::raiseError("Invalid POST data in test file: $file"); + } + $post_info[0] = rawurldecode($post_info[0]); + $post_info[1] = rawurldecode($post_info[1]); + $post[$i] = $post_info; + } + foreach ($post as $post_info) { + $request .= "Content-Disposition: form-data; name=\"$post_info[0]\"\n\n"; + $request .= $post_info[1] . "\n" . + "-----------------------------20896060251896012921717172737\n"; + } + unset($section_text['POST']); + } + $section_text['POST_RAW'] = $request; + } + + return $section_text; + } + + function _testCleanup($section_text, $temp_clean) + { + if ($section_text['CLEAN']) { + // perform test cleanup + $this->save_text($temp_clean, $section_text['CLEAN']); + $output = $this->system_with_timeout("$this->_php $temp_clean 2>&1"); + if (strlen($output[1])) { + echo "BORKED --CLEAN-- section! output:\n", $output[1]; + } + if (file_exists($temp_clean)) { + unlink($temp_clean); + } + } + } +} diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Common.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..5b99c2e434795e143e4c2c7af905de902b15be1d --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Common.php @@ -0,0 +1,202 @@ +<?php +/** + * PEAR_Task_Common, base class for installer tasks + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/**#@+ + * Error codes for task validation routines + */ +define('PEAR_TASK_ERROR_NOATTRIBS', 1); +define('PEAR_TASK_ERROR_MISSING_ATTRIB', 2); +define('PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE', 3); +define('PEAR_TASK_ERROR_INVALID', 4); +/**#@-*/ +define('PEAR_TASK_PACKAGE', 1); +define('PEAR_TASK_INSTALL', 2); +define('PEAR_TASK_PACKAGEANDINSTALL', 3); +/** + * A task is an operation that manipulates the contents of a file. + * + * Simple tasks operate on 1 file. Multiple tasks are executed after all files have been + * processed and installed, and are designed to operate on all files containing the task. + * The Post-install script task simply takes advantage of the fact that it will be run + * after installation, replace is a simple task. + * + * Combining tasks is possible, but ordering is significant. + * + * <file name="test.php" role="php"> + * <tasks:replace from="@data-dir@" to="data_dir" type="pear-config"/> + * <tasks:postinstallscript/> + * </file> + * + * This will first replace any instance of @data-dir@ in the test.php file + * with the path to the current data directory. Then, it will include the + * test.php file and run the script it contains to configure the package post-installation. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + * @abstract + */ +class PEAR_Task_Common +{ + /** + * Valid types for this version are 'simple' and 'multiple' + * + * - simple tasks operate on the contents of a file and write out changes to disk + * - multiple tasks operate on the contents of many files and write out the + * changes directly to disk + * + * Child task classes must override this property. + * @access protected + */ + var $type = 'simple'; + /** + * Determines which install phase this task is executed under + */ + var $phase = PEAR_TASK_INSTALL; + /** + * @access protected + */ + var $config; + /** + * @access protected + */ + var $registry; + /** + * @access protected + */ + var $logger; + /** + * @access protected + */ + var $installphase; + /** + * @param PEAR_Config + * @param PEAR_Common + */ + function PEAR_Task_Common(&$config, &$logger, $phase) + { + $this->config = &$config; + $this->registry = &$config->getRegistry(); + $this->logger = &$logger; + $this->installphase = $phase; + if ($this->type == 'multiple') { + $GLOBALS['_PEAR_TASK_POSTINSTANCES'][get_class($this)][] = &$this; + } + } + + /** + * Validate the basic contents of a task tag. + * @param PEAR_PackageFile_v2 + * @param array + * @param PEAR_Config + * @param array the entire parsed <file> tag + * @return true|array On error, return an array in format: + * array(PEAR_TASK_ERROR_???[, param1][, param2][, ...]) + * + * For PEAR_TASK_ERROR_MISSING_ATTRIB, pass the attribute name in + * For PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, pass the attribute name and an array + * of legal values in + * @static + * @abstract + */ + function validateXml($pkg, $xml, $config, $fileXml) + { + } + + /** + * Initialize a task instance with the parameters + * @param array raw, parsed xml + * @param array attributes from the <file> tag containing this task + * @param string|null last installed version of this package + * @abstract + */ + function init($xml, $fileAttributes, $lastVersion) + { + } + + /** + * Begin a task processing session. All multiple tasks will be processed after each file + * has been successfully installed, all simple tasks should perform their task here and + * return any errors using the custom throwError() method to allow forward compatibility + * + * This method MUST NOT write out any changes to disk + * @param PEAR_PackageFile_v2 + * @param string file contents + * @param string the eventual final file location (informational only) + * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail + * (use $this->throwError), otherwise return the new contents + * @abstract + */ + function startSession($pkg, $contents, $dest) + { + } + + /** + * This method is used to process each of the tasks for a particular multiple class + * type. Simple tasks need not implement this method. + * @param array an array of tasks + * @access protected + * @static + * @abstract + */ + function run($tasks) + { + } + + /** + * @static + * @final + */ + function hasPostinstallTasks() + { + return isset($GLOBALS['_PEAR_TASK_POSTINSTANCES']); + } + + /** + * @static + * @final + */ + function runPostinstallTasks() + { + foreach ($GLOBALS['_PEAR_TASK_POSTINSTANCES'] as $class => $tasks) { + $err = call_user_func(array($class, 'run'), + $GLOBALS['_PEAR_TASK_POSTINSTANCES'][$class]); + if ($err) { + return PEAR_Task_Common::throwError($err); + } + } + unset($GLOBALS['_PEAR_TASK_POSTINSTANCES']); + } + + /** + * Determines whether a role is a script + * @return bool + */ + function isScript() + { + return $this->type == 'script'; + } + + function throwError($msg, $code = -1) + { + include_once 'PEAR.php'; + return PEAR::raiseError($msg, $code); + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Postinstallscript.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Postinstallscript.php new file mode 100644 index 0000000000000000000000000000000000000000..e43ecca4b3db0aed7ebb1e17dd674d59cd8c1961 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Postinstallscript.php @@ -0,0 +1,323 @@ +<?php +/** + * <tasks:postinstallscript> + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Postinstallscript.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * Base class + */ +require_once 'PEAR/Task/Common.php'; +/** + * Implements the postinstallscript file task. + * + * Note that post-install scripts are handled separately from installation, by the + * "pear run-scripts" command + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Task_Postinstallscript extends PEAR_Task_Common +{ + var $type = 'script'; + var $_class; + var $_params; + var $_obj; + /** + * + * @var PEAR_PackageFile_v2 + */ + var $_pkg; + var $_contents; + var $phase = PEAR_TASK_INSTALL; + + /** + * Validate the raw xml at parsing-time. + * + * This also attempts to validate the script to make sure it meets the criteria + * for a post-install script + * @param PEAR_PackageFile_v2 + * @param array The XML contents of the <postinstallscript> tag + * @param PEAR_Config + * @param array the entire parsed <file> tag + * @static + */ + function validateXml($pkg, $xml, $config, $fileXml) + { + if ($fileXml['role'] != 'php') { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" must be role="php"'); + } + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $file = $pkg->getFileContents($fileXml['name']); + if (PEAR::isError($file)) { + PEAR::popErrorHandling(); + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" is not valid: ' . + $file->getMessage()); + } elseif ($file === null) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" could not be retrieved for processing!'); + } else { + $analysis = $pkg->analyzeSourceCode($file, true); + if (!$analysis) { + PEAR::popErrorHandling(); + $warnings = ''; + foreach ($pkg->getValidationWarnings() as $warn) { + $warnings .= $warn['message'] . "\n"; + } + return array(PEAR_TASK_ERROR_INVALID, 'Analysis of post-install script "' . + $fileXml['name'] . '" failed: ' . $warnings); + } + if (count($analysis['declared_classes']) != 1) { + PEAR::popErrorHandling(); + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" must declare exactly 1 class'); + } + $class = $analysis['declared_classes'][0]; + if ($class != str_replace(array('/', '.php'), array('_', ''), + $fileXml['name']) . '_postinstall') { + PEAR::popErrorHandling(); + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" class "' . $class . '" must be named "' . + str_replace(array('/', '.php'), array('_', ''), + $fileXml['name']) . '_postinstall"'); + } + if (!isset($analysis['declared_methods'][$class])) { + PEAR::popErrorHandling(); + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" must declare methods init() and run()'); + } + $methods = array('init' => 0, 'run' => 1); + foreach ($analysis['declared_methods'][$class] as $method) { + if (isset($methods[$method])) { + unset($methods[$method]); + } + } + if (count($methods)) { + PEAR::popErrorHandling(); + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" must declare methods init() and run()'); + } + } + PEAR::popErrorHandling(); + $definedparams = array(); + $tasksNamespace = $pkg->getTasksNs() . ':'; + if (!isset($xml[$tasksNamespace . 'paramgroup']) && isset($xml['paramgroup'])) { + // in order to support the older betas, which did not expect internal tags + // to also use the namespace + $tasksNamespace = ''; + } + if (isset($xml[$tasksNamespace . 'paramgroup'])) { + $params = $xml[$tasksNamespace . 'paramgroup']; + if (!is_array($params) || !isset($params[0])) { + $params = array($params); + } + foreach ($params as $param) { + if (!isset($param[$tasksNamespace . 'id'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" <paramgroup> must have ' . + 'an ' . $tasksNamespace . 'id> tag'); + } + if (isset($param[$tasksNamespace . 'name'])) { + if (!in_array($param[$tasksNamespace . 'name'], $definedparams)) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" ' . $tasksNamespace . + 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . + '" parameter "' . $param[$tasksNamespace . 'name'] . + '" has not been previously defined'); + } + if (!isset($param[$tasksNamespace . 'conditiontype'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" ' . $tasksNamespace . + 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . + '" must have a ' . $tasksNamespace . + 'conditiontype> tag containing either "=", ' . + '"!=", or "preg_match"'); + } + if (!in_array($param[$tasksNamespace . 'conditiontype'], + array('=', '!=', 'preg_match'))) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" ' . $tasksNamespace . + 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . + '" must have a ' . $tasksNamespace . + 'conditiontype> tag containing either "=", ' . + '"!=", or "preg_match"'); + } + if (!isset($param[$tasksNamespace . 'value'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" ' . $tasksNamespace . + 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . + '" must have a ' . $tasksNamespace . + 'value> tag containing expected parameter value'); + } + } + if (isset($param[$tasksNamespace . 'instructions'])) { + if (!is_string($param[$tasksNamespace . 'instructions'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" ' . $tasksNamespace . + 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . + '" ' . $tasksNamespace . 'instructions> must be simple text'); + } + } + if (!isset($param[$tasksNamespace . 'param'])) { + continue; // <param> is no longer required + } + $subparams = $param[$tasksNamespace . 'param']; + if (!is_array($subparams) || !isset($subparams[0])) { + $subparams = array($subparams); + } + foreach ($subparams as $subparam) { + if (!isset($subparam[$tasksNamespace . 'name'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" parameter for ' . + $tasksNamespace . 'paramgroup> id "' . + $param[$tasksNamespace . 'id'] . '" must have ' . + 'a ' . $tasksNamespace . 'name> tag'); + } + if (!preg_match('/[a-zA-Z0-9]+/', + $subparam[$tasksNamespace . 'name'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" parameter "' . + $subparam[$tasksNamespace . 'name'] . + '" for ' . $tasksNamespace . 'paramgroup> id "' . + $param[$tasksNamespace . 'id'] . + '" is not a valid name. Must contain only alphanumeric characters'); + } + if (!isset($subparam[$tasksNamespace . 'prompt'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" parameter "' . + $subparam[$tasksNamespace . 'name'] . + '" for ' . $tasksNamespace . 'paramgroup> id "' . + $param[$tasksNamespace . 'id'] . + '" must have a ' . $tasksNamespace . 'prompt> tag'); + } + if (!isset($subparam[$tasksNamespace . 'type'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . + $fileXml['name'] . '" parameter "' . + $subparam[$tasksNamespace . 'name'] . + '" for ' . $tasksNamespace . 'paramgroup> id "' . + $param[$tasksNamespace . 'id'] . + '" must have a ' . $tasksNamespace . 'type> tag'); + } + $definedparams[] = $param[$tasksNamespace . 'id'] . '::' . + $subparam[$tasksNamespace . 'name']; + } + } + } + return true; + } + + /** + * Initialize a task instance with the parameters + * @param array raw, parsed xml + * @param array attributes from the <file> tag containing this task + * @param string|null last installed version of this package, if any (useful for upgrades) + */ + function init($xml, $fileattribs, $lastversion) + { + $this->_class = str_replace('/', '_', $fileattribs['name']); + $this->_filename = $fileattribs['name']; + $this->_class = str_replace ('.php', '', $this->_class) . '_postinstall'; + $this->_params = $xml; + $this->_lastversion = $lastversion; + } + + /** + * Strip the tasks: namespace from internal params + * + * @access private + */ + function _stripNamespace($params = null) + { + if ($params === null) { + $params = array(); + if (!is_array($this->_params)) { + return; + } + foreach ($this->_params as $i => $param) { + if (is_array($param)) { + $param = $this->_stripNamespace($param); + } + $params[str_replace($this->_pkg->getTasksNs() . ':', '', $i)] = $param; + } + $this->_params = $params; + } else { + $newparams = array(); + foreach ($params as $i => $param) { + if (is_array($param)) { + $param = $this->_stripNamespace($param); + } + $newparams[str_replace($this->_pkg->getTasksNs() . ':', '', $i)] = $param; + } + return $newparams; + } + } + + /** + * Unlike other tasks, the installed file name is passed in instead of the file contents, + * because this task is handled post-installation + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string file name + * @return bool|PEAR_Error false to skip this file, PEAR_Error to fail + * (use $this->throwError) + */ + function startSession($pkg, $contents) + { + if ($this->installphase != PEAR_TASK_INSTALL) { + return false; + } + // remove the tasks: namespace if present + $this->_pkg = $pkg; + $this->_stripNamespace(); + $this->logger->log(0, 'Including external post-installation script "' . + $contents . '" - any errors are in this script'); + include_once $contents; + if (class_exists($this->_class)) { + $this->logger->log(0, 'Inclusion succeeded'); + } else { + return $this->throwError('init of post-install script class "' . $this->_class + . '" failed'); + } + $this->_obj = new $this->_class; + $this->logger->log(1, 'running post-install script "' . $this->_class . '->init()"'); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $res = $this->_obj->init($this->config, $pkg, $this->_lastversion); + PEAR::popErrorHandling(); + if ($res) { + $this->logger->log(0, 'init succeeded'); + } else { + return $this->throwError('init of post-install script "' . $this->_class . + '->init()" failed'); + } + $this->_contents = $contents; + return true; + } + + /** + * No longer used + * @see PEAR_PackageFile_v2::runPostinstallScripts() + * @param array an array of tasks + * @param string install or upgrade + * @access protected + * @static + */ + function run() + { + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Postinstallscript/rw.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Postinstallscript/rw.php new file mode 100644 index 0000000000000000000000000000000000000000..8f358bf22bc7b8f488e037ee2dcdd0e32d6dc65f --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Postinstallscript/rw.php @@ -0,0 +1,169 @@ +<?php +/** + * <tasks:postinstallscript> - read/write version + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 + */ +/** + * Base class + */ +require_once 'PEAR/Task/Postinstallscript.php'; +/** + * Abstracts the postinstallscript file task xml. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a10 + */ +class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript +{ + /** + * parent package file object + * + * @var PEAR_PackageFile_v2_rw + */ + var $_pkg; + /** + * Enter description here... + * + * @param PEAR_PackageFile_v2_rw $pkg + * @param PEAR_Config $config + * @param PEAR_Frontend $logger + * @param array $fileXml + * @return PEAR_Task_Postinstallscript_rw + */ + function PEAR_Task_Postinstallscript_rw(&$pkg, &$config, &$logger, $fileXml) + { + parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + $this->_contents = $fileXml; + $this->_pkg = &$pkg; + $this->_params = array(); + } + + function validate() + { + return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents); + } + + function getName() + { + return 'postinstallscript'; + } + + /** + * add a simple <paramgroup> to the post-install script + * + * Order is significant, so call this method in the same + * sequence the users should see the paramgroups. The $params + * parameter should either be the result of a call to {@link getParam()} + * or an array of calls to getParam(). + * + * Use {@link addConditionTypeGroup()} to add a <paramgroup> containing + * a <conditiontype> tag + * @param string $id <paramgroup> id as seen by the script + * @param array|false $params array of getParam() calls, or false for no params + * @param string|false $instructions + */ + function addParamGroup($id, $params = false, $instructions = false) + { + if ($params && isset($params[0]) && !isset($params[1])) { + $params = $params[0]; + } + $stuff = + array( + $this->_pkg->getTasksNs() . ':id' => $id, + ); + if ($instructions) { + $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions; + } + if ($params) { + $stuff[$this->_pkg->getTasksNs() . ':param'] = $params; + } + $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff; + } + + /** + * add a complex <paramgroup> to the post-install script with conditions + * + * This inserts a <paramgroup> with + * + * Order is significant, so call this method in the same + * sequence the users should see the paramgroups. The $params + * parameter should either be the result of a call to {@link getParam()} + * or an array of calls to getParam(). + * + * Use {@link addParamGroup()} to add a simple <paramgroup> + * + * @param string $id <paramgroup> id as seen by the script + * @param string $oldgroup <paramgroup> id of the section referenced by + * <conditiontype> + * @param string $param name of the <param> from the older section referenced + * by <contitiontype> + * @param string $value value to match of the parameter + * @param string $conditiontype one of '=', '!=', 'preg_match' + * @param array|false $params array of getParam() calls, or false for no params + * @param string|false $instructions + */ + function addConditionTypeGroup($id, $oldgroup, $param, $value, $conditiontype = '=', + $params = false, $instructions = false) + { + if ($params && isset($params[0]) && !isset($params[1])) { + $params = $params[0]; + } + $stuff = array( + $this->_pkg->getTasksNs() . ':id' => $id, + ); + if ($instructions) { + $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions; + } + $stuff[$this->_pkg->getTasksNs() . ':name'] = $oldgroup . '::' . $param; + $stuff[$this->_pkg->getTasksNs() . ':conditiontype'] = $conditiontype; + $stuff[$this->_pkg->getTasksNs() . ':value'] = $value; + if ($params) { + $stuff[$this->_pkg->getTasksNs() . ':param'] = $params; + } + $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff; + } + + function getXml() + { + return $this->_params; + } + + /** + * Use to set up a param tag for use in creating a paramgroup + * @static + */ + function getParam($name, $prompt, $type = 'string', $default = null) + { + if ($default !== null) { + return + array( + $this->_pkg->getTasksNs() . ':name' => $name, + $this->_pkg->getTasksNs() . ':prompt' => $prompt, + $this->_pkg->getTasksNs() . ':type' => $type, + $this->_pkg->getTasksNs() . ':default' => $default + ); + } + return + array( + $this->_pkg->getTasksNs() . ':name' => $name, + $this->_pkg->getTasksNs() . ':prompt' => $prompt, + $this->_pkg->getTasksNs() . ':type' => $type, + ); + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Replace.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Replace.php new file mode 100644 index 0000000000000000000000000000000000000000..376df64df65c9e48c99904e63d6412d55a797925 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Replace.php @@ -0,0 +1,176 @@ +<?php +/** + * <tasks:replace> + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Replace.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * Base class + */ +require_once 'PEAR/Task/Common.php'; +/** + * Implements the replace file task. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Task_Replace extends PEAR_Task_Common +{ + var $type = 'simple'; + var $phase = PEAR_TASK_PACKAGEANDINSTALL; + var $_replacements; + + /** + * Validate the raw xml at parsing-time. + * @param PEAR_PackageFile_v2 + * @param array raw, parsed xml + * @param PEAR_Config + * @static + */ + function validateXml($pkg, $xml, $config, $fileXml) + { + if (!isset($xml['attribs'])) { + return array(PEAR_TASK_ERROR_NOATTRIBS); + } + if (!isset($xml['attribs']['type'])) { + return array(PEAR_TASK_ERROR_MISSING_ATTRIB, 'type'); + } + if (!isset($xml['attribs']['to'])) { + return array(PEAR_TASK_ERROR_MISSING_ATTRIB, 'to'); + } + if (!isset($xml['attribs']['from'])) { + return array(PEAR_TASK_ERROR_MISSING_ATTRIB, 'from'); + } + if ($xml['attribs']['type'] == 'pear-config') { + if (!in_array($xml['attribs']['to'], $config->getKeys())) { + return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'], + $config->getKeys()); + } + } elseif ($xml['attribs']['type'] == 'php-const') { + if (defined($xml['attribs']['to'])) { + return true; + } else { + return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'], + array('valid PHP constant')); + } + } elseif ($xml['attribs']['type'] == 'package-info') { + if (in_array($xml['attribs']['to'], + array('name', 'summary', 'channel', 'notes', 'extends', 'description', + 'release_notes', 'license', 'release-license', 'license-uri', + 'version', 'api-version', 'state', 'api-state', 'release_date', + 'date', 'time'))) { + return true; + } else { + return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'], + array('name', 'summary', 'channel', 'notes', 'extends', 'description', + 'release_notes', 'license', 'release-license', 'license-uri', + 'version', 'api-version', 'state', 'api-state', 'release_date', + 'date', 'time')); + } + } else { + return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'type', $xml['attribs']['type'], + array('pear-config', 'package-info', 'php-const')); + } + return true; + } + + /** + * Initialize a task instance with the parameters + * @param array raw, parsed xml + * @param unused + */ + function init($xml, $attribs) + { + $this->_replacements = isset($xml['attribs']) ? array($xml) : $xml; + } + + /** + * Do a package.xml 1.0 replacement, with additional package-info fields available + * + * See validateXml() source for the complete list of allowed fields + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string file contents + * @param string the eventual final file location (informational only) + * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail + * (use $this->throwError), otherwise return the new contents + */ + function startSession($pkg, $contents, $dest) + { + $subst_from = $subst_to = array(); + foreach ($this->_replacements as $a) { + $a = $a['attribs']; + $to = ''; + if ($a['type'] == 'pear-config') { + if ($this->installphase == PEAR_TASK_PACKAGE) { + return false; + } + if ($a['to'] == 'master_server') { + $chan = $this->registry->getChannel($pkg->getChannel()); + if (!PEAR::isError($chan)) { + $to = $chan->getServer(); + } else { + $this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]"); + return false; + } + } else { + if ($this->config->isDefinedLayer('ftp')) { + // try the remote config file first + $to = $this->config->get($a['to'], 'ftp', $pkg->getChannel()); + if (is_null($to)) { + // then default to local + $to = $this->config->get($a['to'], null, $pkg->getChannel()); + } + } else { + $to = $this->config->get($a['to'], null, $pkg->getChannel()); + } + } + if (is_null($to)) { + $this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]"); + return false; + } + } elseif ($a['type'] == 'php-const') { + if ($this->installphase == PEAR_TASK_PACKAGE) { + return false; + } + if (defined($a['to'])) { + $to = constant($a['to']); + } else { + $this->logger->log(0, "$dest: invalid php-const replacement: $a[to]"); + return false; + } + } else { + if ($t = $pkg->packageInfo($a['to'])) { + $to = $t; + } else { + $this->logger->log(0, "$dest: invalid package-info replacement: $a[to]"); + return false; + } + } + if (!is_null($to)) { + $subst_from[] = $a['from']; + $subst_to[] = $to; + } + } + $this->logger->log(3, "doing " . sizeof($subst_from) . + " substitution(s) for $dest"); + if (sizeof($subst_from)) { + $contents = str_replace($subst_from, $subst_to, $contents); + } + return $contents; + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Replace/rw.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Replace/rw.php new file mode 100644 index 0000000000000000000000000000000000000000..32dad58629746623b2bf932a7cd866a2a3f10cb5 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Replace/rw.php @@ -0,0 +1,61 @@ +<?php +/** + * <tasks:replace> - read/write version + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 + */ +/** + * Base class + */ +require_once 'PEAR/Task/Replace.php'; +/** + * Abstracts the replace task xml. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a10 + */ +class PEAR_Task_Replace_rw extends PEAR_Task_Replace +{ + function PEAR_Task_Replace_rw(&$pkg, &$config, &$logger, $fileXml) + { + parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + $this->_contents = $fileXml; + $this->_pkg = &$pkg; + $this->_params = array(); + } + + function validate() + { + return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents); + } + + function setInfo($from, $to, $type) + { + $this->_params = array('attribs' => array('from' => $from, 'to' => $to, 'type' => $type)); + } + + function getName() + { + return 'replace'; + } + + function getXml() + { + return $this->_params; + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Unixeol.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Unixeol.php new file mode 100644 index 0000000000000000000000000000000000000000..89ca81be349c45e7e5d94de2b8fc4ff65d4b9773 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Unixeol.php @@ -0,0 +1,77 @@ +<?php +/** + * <tasks:unixeol> + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Unixeol.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * Base class + */ +require_once 'PEAR/Task/Common.php'; +/** + * Implements the unix line endings file task. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Task_Unixeol extends PEAR_Task_Common +{ + var $type = 'simple'; + var $phase = PEAR_TASK_PACKAGE; + var $_replacements; + + /** + * Validate the raw xml at parsing-time. + * @param PEAR_PackageFile_v2 + * @param array raw, parsed xml + * @param PEAR_Config + * @static + */ + function validateXml($pkg, $xml, $config, $fileXml) + { + if ($xml != '') { + return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed'); + } + return true; + } + + /** + * Initialize a task instance with the parameters + * @param array raw, parsed xml + * @param unused + */ + function init($xml, $attribs) + { + } + + /** + * Replace all line endings with line endings customized for the current OS + * + * See validateXml() source for the complete list of allowed fields + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string file contents + * @param string the eventual final file location (informational only) + * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail + * (use $this->throwError), otherwise return the new contents + */ + function startSession($pkg, $contents, $dest) + { + $this->logger->log(3, "replacing all line endings with \\n in $dest"); + return preg_replace("/\r\n|\n\r|\r|\n/", "\n", $contents); + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Unixeol/rw.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Unixeol/rw.php new file mode 100644 index 0000000000000000000000000000000000000000..b2ae5fa5cbd7437fb05f0deba3363dfbf028088f --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Unixeol/rw.php @@ -0,0 +1,56 @@ +<?php +/** + * <tasks:unixeol> - read/write version + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 + */ +/** + * Base class + */ +require_once 'PEAR/Task/Unixeol.php'; +/** + * Abstracts the unixeol task xml. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a10 + */ +class PEAR_Task_Unixeol_rw extends PEAR_Task_Unixeol +{ + function PEAR_Task_Unixeol_rw(&$pkg, &$config, &$logger, $fileXml) + { + parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + $this->_contents = $fileXml; + $this->_pkg = &$pkg; + $this->_params = array(); + } + + function validate() + { + return true; + } + + function getName() + { + return 'unixeol'; + } + + function getXml() + { + return ''; + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Windowseol.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Windowseol.php new file mode 100644 index 0000000000000000000000000000000000000000..8ba4171159faccaaccdbc641d4a7e9555c50de20 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Windowseol.php @@ -0,0 +1,77 @@ +<?php +/** + * <tasks:windowseol> + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Windowseol.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/** + * Base class + */ +require_once 'PEAR/Task/Common.php'; +/** + * Implements the windows line endsings file task. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Task_Windowseol extends PEAR_Task_Common +{ + var $type = 'simple'; + var $phase = PEAR_TASK_PACKAGE; + var $_replacements; + + /** + * Validate the raw xml at parsing-time. + * @param PEAR_PackageFile_v2 + * @param array raw, parsed xml + * @param PEAR_Config + * @static + */ + function validateXml($pkg, $xml, $config, $fileXml) + { + if ($xml != '') { + return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed'); + } + return true; + } + + /** + * Initialize a task instance with the parameters + * @param array raw, parsed xml + * @param unused + */ + function init($xml, $attribs) + { + } + + /** + * Replace all line endings with windows line endings + * + * See validateXml() source for the complete list of allowed fields + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string file contents + * @param string the eventual final file location (informational only) + * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail + * (use $this->throwError), otherwise return the new contents + */ + function startSession($pkg, $contents, $dest) + { + $this->logger->log(3, "replacing all line endings with \\r\\n in $dest"); + return preg_replace("/\r\n|\n\r|\r|\n/", "\r\n", $contents); + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Task/Windowseol/rw.php b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Windowseol/rw.php new file mode 100644 index 0000000000000000000000000000000000000000..f0f1149c83ec58678c9ee10032852af875d7f765 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Task/Windowseol/rw.php @@ -0,0 +1,56 @@ +<?php +/** + * <tasks:windowseol> - read/write version + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 + */ +/** + * Base class + */ +require_once 'PEAR/Task/Windowseol.php'; +/** + * Abstracts the windowseol task xml. + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a10 + */ +class PEAR_Task_Windowseol_rw extends PEAR_Task_Windowseol +{ + function PEAR_Task_Windowseol_rw(&$pkg, &$config, &$logger, $fileXml) + { + parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + $this->_contents = $fileXml; + $this->_pkg = &$pkg; + $this->_params = array(); + } + + function validate() + { + return true; + } + + function getName() + { + return 'windowseol'; + } + + function getXml() + { + return ''; + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Validate.php b/vendor/pear-pear.php.net/PEAR/PEAR/Validate.php new file mode 100644 index 0000000000000000000000000000000000000000..176560bc2377c1edd4293a2465ec9b57586ad35a --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Validate.php @@ -0,0 +1,629 @@ +<?php +/** + * PEAR_Validate + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Validate.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ +/**#@+ + * Constants for install stage + */ +define('PEAR_VALIDATE_INSTALLING', 1); +define('PEAR_VALIDATE_UNINSTALLING', 2); // this is not bit-mapped like the others +define('PEAR_VALIDATE_NORMAL', 3); +define('PEAR_VALIDATE_DOWNLOADING', 4); // this is not bit-mapped like the others +define('PEAR_VALIDATE_PACKAGING', 7); +/**#@-*/ +require_once 'PEAR/Common.php'; +require_once 'PEAR/Validator/PECL.php'; + +/** + * Validation class for package.xml - channel-level advanced validation + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_Validate +{ + var $packageregex = _PEAR_COMMON_PACKAGE_NAME_PREG; + /** + * @var PEAR_PackageFile_v1|PEAR_PackageFile_v2 + */ + var $_packagexml; + /** + * @var int one of the PEAR_VALIDATE_* constants + */ + var $_state = PEAR_VALIDATE_NORMAL; + /** + * Format: ('error' => array('field' => name, 'reason' => reason), 'warning' => same) + * @var array + * @access private + */ + var $_failures = array('error' => array(), 'warning' => array()); + + /** + * Override this method to handle validation of normal package names + * @param string + * @return bool + * @access protected + */ + function _validPackageName($name) + { + return (bool) preg_match('/^' . $this->packageregex . '\\z/', $name); + } + + /** + * @param string package name to validate + * @param string name of channel-specific validation package + * @final + */ + function validPackageName($name, $validatepackagename = false) + { + if ($validatepackagename) { + if (strtolower($name) == strtolower($validatepackagename)) { + return (bool) preg_match('/^[a-zA-Z0-9_]+(?:\.[a-zA-Z0-9_]+)*\\z/', $name); + } + } + return $this->_validPackageName($name); + } + + /** + * This validates a bundle name, and bundle names must conform + * to the PEAR naming convention, so the method is final and static. + * @param string + * @final + * @static + */ + function validGroupName($name) + { + return (bool) preg_match('/^' . _PEAR_COMMON_PACKAGE_NAME_PREG . '\\z/', $name); + } + + /** + * Determine whether $state represents a valid stability level + * @param string + * @return bool + * @static + * @final + */ + function validState($state) + { + return in_array($state, array('snapshot', 'devel', 'alpha', 'beta', 'stable')); + } + + /** + * Get a list of valid stability levels + * @return array + * @static + * @final + */ + function getValidStates() + { + return array('snapshot', 'devel', 'alpha', 'beta', 'stable'); + } + + /** + * Determine whether a version is a properly formatted version number that can be used + * by version_compare + * @param string + * @return bool + * @static + * @final + */ + function validVersion($ver) + { + return (bool) preg_match(PEAR_COMMON_PACKAGE_VERSION_PREG, $ver); + } + + /** + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + */ + function setPackageFile(&$pf) + { + $this->_packagexml = &$pf; + } + + /** + * @access private + */ + function _addFailure($field, $reason) + { + $this->_failures['errors'][] = array('field' => $field, 'reason' => $reason); + } + + /** + * @access private + */ + function _addWarning($field, $reason) + { + $this->_failures['warnings'][] = array('field' => $field, 'reason' => $reason); + } + + function getFailures() + { + $failures = $this->_failures; + $this->_failures = array('warnings' => array(), 'errors' => array()); + return $failures; + } + + /** + * @param int one of the PEAR_VALIDATE_* constants + */ + function validate($state = null) + { + if (!isset($this->_packagexml)) { + return false; + } + if ($state !== null) { + $this->_state = $state; + } + $this->_failures = array('warnings' => array(), 'errors' => array()); + $this->validatePackageName(); + $this->validateVersion(); + $this->validateMaintainers(); + $this->validateDate(); + $this->validateSummary(); + $this->validateDescription(); + $this->validateLicense(); + $this->validateNotes(); + if ($this->_packagexml->getPackagexmlVersion() == '1.0') { + $this->validateState(); + $this->validateFilelist(); + } elseif ($this->_packagexml->getPackagexmlVersion() == '2.0' || + $this->_packagexml->getPackagexmlVersion() == '2.1') { + $this->validateTime(); + $this->validateStability(); + $this->validateDeps(); + $this->validateMainFilelist(); + $this->validateReleaseFilelist(); + //$this->validateGlobalTasks(); + $this->validateChangelog(); + } + return !((bool) count($this->_failures['errors'])); + } + + /** + * @access protected + */ + function validatePackageName() + { + if ($this->_state == PEAR_VALIDATE_PACKAGING || + $this->_state == PEAR_VALIDATE_NORMAL) { + if (($this->_packagexml->getPackagexmlVersion() == '2.0' || + $this->_packagexml->getPackagexmlVersion() == '2.1') && + $this->_packagexml->getExtends()) { + $version = $this->_packagexml->getVersion() . ''; + $name = $this->_packagexml->getPackage(); + $test = array_shift($a = explode('.', $version)); + if ($test == '0') { + return true; + } + $vlen = strlen($test); + $majver = substr($name, strlen($name) - $vlen); + while ($majver && !is_numeric($majver{0})) { + $majver = substr($majver, 1); + } + if ($majver != $test) { + $this->_addWarning('package', "package $name extends package " . + $this->_packagexml->getExtends() . ' and so the name should ' . + 'have a postfix equal to the major version like "' . + $this->_packagexml->getExtends() . $test . '"'); + return true; + } elseif (substr($name, 0, strlen($name) - $vlen) != + $this->_packagexml->getExtends()) { + $this->_addWarning('package', "package $name extends package " . + $this->_packagexml->getExtends() . ' and so the name must ' . + 'be an extension like "' . $this->_packagexml->getExtends() . + $test . '"'); + return true; + } + } + } + if (!$this->validPackageName($this->_packagexml->getPackage())) { + $this->_addFailure('name', 'package name "' . + $this->_packagexml->getPackage() . '" is invalid'); + return false; + } + } + + /** + * @access protected + */ + function validateVersion() + { + if ($this->_state != PEAR_VALIDATE_PACKAGING) { + if (!$this->validVersion($this->_packagexml->getVersion())) { + $this->_addFailure('version', + 'Invalid version number "' . $this->_packagexml->getVersion() . '"'); + } + return false; + } + $version = $this->_packagexml->getVersion(); + $versioncomponents = explode('.', $version); + if (count($versioncomponents) != 3) { + $this->_addWarning('version', + 'A version number should have 3 decimals (x.y.z)'); + return true; + } + $name = $this->_packagexml->getPackage(); + // version must be based upon state + switch ($this->_packagexml->getState()) { + case 'snapshot' : + return true; + case 'devel' : + if ($versioncomponents[0] . 'a' == '0a') { + return true; + } + if ($versioncomponents[0] == 0) { + $versioncomponents[0] = '0'; + $this->_addWarning('version', + 'version "' . $version . '" should be "' . + implode('.' ,$versioncomponents) . '"'); + } else { + $this->_addWarning('version', + 'packages with devel stability must be < version 1.0.0'); + } + return true; + break; + case 'alpha' : + case 'beta' : + // check for a package that extends a package, + // like Foo and Foo2 + if ($this->_state == PEAR_VALIDATE_PACKAGING) { + if (substr($versioncomponents[2], 1, 2) == 'rc') { + $this->_addFailure('version', 'Release Candidate versions ' . + 'must have capital RC, not lower-case rc'); + return false; + } + } + if (!$this->_packagexml->getExtends()) { + if ($versioncomponents[0] == '1') { + if ($versioncomponents[2]{0} == '0') { + if ($versioncomponents[2] == '0') { + // version 1.*.0000 + $this->_addWarning('version', + 'version 1.' . $versioncomponents[1] . + '.0 probably should not be alpha or beta'); + return true; + } elseif (strlen($versioncomponents[2]) > 1) { + // version 1.*.0RC1 or 1.*.0beta24 etc. + return true; + } else { + // version 1.*.0 + $this->_addWarning('version', + 'version 1.' . $versioncomponents[1] . + '.0 probably should not be alpha or beta'); + return true; + } + } else { + $this->_addWarning('version', + 'bugfix versions (1.3.x where x > 0) probably should ' . + 'not be alpha or beta'); + return true; + } + } elseif ($versioncomponents[0] != '0') { + $this->_addWarning('version', + 'major versions greater than 1 are not allowed for packages ' . + 'without an <extends> tag or an identical postfix (foo2 v2.0.0)'); + return true; + } + if ($versioncomponents[0] . 'a' == '0a') { + return true; + } + if ($versioncomponents[0] == 0) { + $versioncomponents[0] = '0'; + $this->_addWarning('version', + 'version "' . $version . '" should be "' . + implode('.' ,$versioncomponents) . '"'); + } + } else { + $vlen = strlen($versioncomponents[0] . ''); + $majver = substr($name, strlen($name) - $vlen); + while ($majver && !is_numeric($majver{0})) { + $majver = substr($majver, 1); + } + if (($versioncomponents[0] != 0) && $majver != $versioncomponents[0]) { + $this->_addWarning('version', 'first version number "' . + $versioncomponents[0] . '" must match the postfix of ' . + 'package name "' . $name . '" (' . + $majver . ')'); + return true; + } + if ($versioncomponents[0] == $majver) { + if ($versioncomponents[2]{0} == '0') { + if ($versioncomponents[2] == '0') { + // version 2.*.0000 + $this->_addWarning('version', + "version $majver." . $versioncomponents[1] . + '.0 probably should not be alpha or beta'); + return false; + } elseif (strlen($versioncomponents[2]) > 1) { + // version 2.*.0RC1 or 2.*.0beta24 etc. + return true; + } else { + // version 2.*.0 + $this->_addWarning('version', + "version $majver." . $versioncomponents[1] . + '.0 cannot be alpha or beta'); + return true; + } + } else { + $this->_addWarning('version', + "bugfix versions ($majver.x.y where y > 0) should " . + 'not be alpha or beta'); + return true; + } + } elseif ($versioncomponents[0] != '0') { + $this->_addWarning('version', + "only versions 0.x.y and $majver.x.y are allowed for alpha/beta releases"); + return true; + } + if ($versioncomponents[0] . 'a' == '0a') { + return true; + } + if ($versioncomponents[0] == 0) { + $versioncomponents[0] = '0'; + $this->_addWarning('version', + 'version "' . $version . '" should be "' . + implode('.' ,$versioncomponents) . '"'); + } + } + return true; + break; + case 'stable' : + if ($versioncomponents[0] == '0') { + $this->_addWarning('version', 'versions less than 1.0.0 cannot ' . + 'be stable'); + return true; + } + if (!is_numeric($versioncomponents[2])) { + if (preg_match('/\d+(rc|a|alpha|b|beta)\d*/i', + $versioncomponents[2])) { + $this->_addWarning('version', 'version "' . $version . '" or any ' . + 'RC/beta/alpha version cannot be stable'); + return true; + } + } + // check for a package that extends a package, + // like Foo and Foo2 + if ($this->_packagexml->getExtends()) { + $vlen = strlen($versioncomponents[0] . ''); + $majver = substr($name, strlen($name) - $vlen); + while ($majver && !is_numeric($majver{0})) { + $majver = substr($majver, 1); + } + if (($versioncomponents[0] != 0) && $majver != $versioncomponents[0]) { + $this->_addWarning('version', 'first version number "' . + $versioncomponents[0] . '" must match the postfix of ' . + 'package name "' . $name . '" (' . + $majver . ')'); + return true; + } + } elseif ($versioncomponents[0] > 1) { + $this->_addWarning('version', 'major version x in x.y.z may not be greater than ' . + '1 for any package that does not have an <extends> tag'); + } + return true; + break; + default : + return false; + break; + } + } + + /** + * @access protected + */ + function validateMaintainers() + { + // maintainers can only be truly validated server-side for most channels + // but allow this customization for those who wish it + return true; + } + + /** + * @access protected + */ + function validateDate() + { + if ($this->_state == PEAR_VALIDATE_NORMAL || + $this->_state == PEAR_VALIDATE_PACKAGING) { + + if (!preg_match('/(\d\d\d\d)\-(\d\d)\-(\d\d)/', + $this->_packagexml->getDate(), $res) || + count($res) < 4 + || !checkdate($res[2], $res[3], $res[1]) + ) { + $this->_addFailure('date', 'invalid release date "' . + $this->_packagexml->getDate() . '"'); + return false; + } + + if ($this->_state == PEAR_VALIDATE_PACKAGING && + $this->_packagexml->getDate() != date('Y-m-d')) { + $this->_addWarning('date', 'Release Date "' . + $this->_packagexml->getDate() . '" is not today'); + } + } + return true; + } + + /** + * @access protected + */ + function validateTime() + { + if (!$this->_packagexml->getTime()) { + // default of no time value set + return true; + } + + // packager automatically sets time, so only validate if pear validate is called + if ($this->_state = PEAR_VALIDATE_NORMAL) { + if (!preg_match('/\d\d:\d\d:\d\d/', + $this->_packagexml->getTime())) { + $this->_addFailure('time', 'invalid release time "' . + $this->_packagexml->getTime() . '"'); + return false; + } + + $result = preg_match('|\d{2}\:\d{2}\:\d{2}|', $this->_packagexml->getTime(), $matches); + if ($result === false || empty($matches)) { + $this->_addFailure('time', 'invalid release time "' . + $this->_packagexml->getTime() . '"'); + return false; + } + } + + return true; + } + + /** + * @access protected + */ + function validateState() + { + // this is the closest to "final" php4 can get + if (!PEAR_Validate::validState($this->_packagexml->getState())) { + if (strtolower($this->_packagexml->getState() == 'rc')) { + $this->_addFailure('state', 'RC is not a state, it is a version ' . + 'postfix, use ' . $this->_packagexml->getVersion() . 'RC1, state beta'); + } + $this->_addFailure('state', 'invalid release state "' . + $this->_packagexml->getState() . '", must be one of: ' . + implode(', ', PEAR_Validate::getValidStates())); + return false; + } + return true; + } + + /** + * @access protected + */ + function validateStability() + { + $ret = true; + $packagestability = $this->_packagexml->getState(); + $apistability = $this->_packagexml->getState('api'); + if (!PEAR_Validate::validState($packagestability)) { + $this->_addFailure('state', 'invalid release stability "' . + $this->_packagexml->getState() . '", must be one of: ' . + implode(', ', PEAR_Validate::getValidStates())); + $ret = false; + } + $apistates = PEAR_Validate::getValidStates(); + array_shift($apistates); // snapshot is not allowed + if (!in_array($apistability, $apistates)) { + $this->_addFailure('state', 'invalid API stability "' . + $this->_packagexml->getState('api') . '", must be one of: ' . + implode(', ', $apistates)); + $ret = false; + } + return $ret; + } + + /** + * @access protected + */ + function validateSummary() + { + return true; + } + + /** + * @access protected + */ + function validateDescription() + { + return true; + } + + /** + * @access protected + */ + function validateLicense() + { + return true; + } + + /** + * @access protected + */ + function validateNotes() + { + return true; + } + + /** + * for package.xml 2.0 only - channels can't use package.xml 1.0 + * @access protected + */ + function validateDependencies() + { + return true; + } + + /** + * for package.xml 1.0 only + * @access private + */ + function _validateFilelist() + { + return true; // placeholder for now + } + + /** + * for package.xml 2.0 only + * @access protected + */ + function validateMainFilelist() + { + return true; // placeholder for now + } + + /** + * for package.xml 2.0 only + * @access protected + */ + function validateReleaseFilelist() + { + return true; // placeholder for now + } + + /** + * @access protected + */ + function validateChangelog() + { + return true; + } + + /** + * @access protected + */ + function validateFilelist() + { + return true; + } + + /** + * @access protected + */ + function validateDeps() + { + return true; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/Validator/PECL.php b/vendor/pear-pear.php.net/PEAR/PEAR/Validator/PECL.php new file mode 100644 index 0000000000000000000000000000000000000000..89b951f7b67c64fe80b647b9cc7f6a9554ee535d --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/Validator/PECL.php @@ -0,0 +1,63 @@ +<?php +/** + * Channel Validator for the pecl.php.net channel + * + * PHP 4 and PHP 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2006 The PHP Group + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: PECL.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a5 + */ +/** + * This is the parent class for all validators + */ +require_once 'PEAR/Validate.php'; +/** + * Channel Validator for the pecl.php.net channel + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a5 + */ +class PEAR_Validator_PECL extends PEAR_Validate +{ + function validateVersion() + { + if ($this->_state == PEAR_VALIDATE_PACKAGING) { + $version = $this->_packagexml->getVersion(); + $versioncomponents = explode('.', $version); + $last = array_pop($versioncomponents); + if (substr($last, 1, 2) == 'rc') { + $this->_addFailure('version', 'Release Candidate versions must have ' . + 'upper-case RC, not lower-case rc'); + return false; + } + } + return true; + } + + function validatePackageName() + { + $ret = parent::validatePackageName(); + if ($this->_packagexml->getPackageType() == 'extsrc' || + $this->_packagexml->getPackageType() == 'zendextsrc') { + if (strtolower($this->_packagexml->getPackage()) != + strtolower($this->_packagexml->getProvidesExtension())) { + $this->_addWarning('providesextension', 'package name "' . + $this->_packagexml->getPackage() . '" is different from extension name "' . + $this->_packagexml->getProvidesExtension() . '"'); + } + } + return $ret; + } +} +?> \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR/XMLParser.php b/vendor/pear-pear.php.net/PEAR/PEAR/XMLParser.php new file mode 100644 index 0000000000000000000000000000000000000000..7f091c16fadba71c35552ea4774277403a6b6f94 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR/XMLParser.php @@ -0,0 +1,253 @@ +<?php +/** + * PEAR_XMLParser + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @author Stephan Schmidt (original XML_Unserializer code) + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license New BSD License + * @version CVS: $Id: XMLParser.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 + */ + +/** + * Parser for any xml file + * @category pear + * @package PEAR + * @author Greg Beaver <cellog@php.net> + * @author Stephan Schmidt (original XML_Unserializer code) + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license New BSD License + * @version Release: 1.9.4 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 + */ +class PEAR_XMLParser +{ + /** + * unserilialized data + * @var string $_serializedData + */ + var $_unserializedData = null; + + /** + * name of the root tag + * @var string $_root + */ + var $_root = null; + + /** + * stack for all data that is found + * @var array $_dataStack + */ + var $_dataStack = array(); + + /** + * stack for all values that are generated + * @var array $_valStack + */ + var $_valStack = array(); + + /** + * current tag depth + * @var int $_depth + */ + var $_depth = 0; + + /** + * The XML encoding to use + * @var string $encoding + */ + var $encoding = 'ISO-8859-1'; + + /** + * @return array + */ + function getData() + { + return $this->_unserializedData; + } + + /** + * @param string xml content + * @return true|PEAR_Error + */ + function parse($data) + { + if (!extension_loaded('xml')) { + include_once 'PEAR.php'; + return PEAR::raiseError("XML Extension not found", 1); + } + $this->_dataStack = $this->_valStack = array(); + $this->_depth = 0; + + if ( + strpos($data, 'encoding="UTF-8"') + || strpos($data, 'encoding="utf-8"') + || strpos($data, "encoding='UTF-8'") + || strpos($data, "encoding='utf-8'") + ) { + $this->encoding = 'UTF-8'; + } + + if (version_compare(phpversion(), '5.0.0', 'lt') && $this->encoding == 'UTF-8') { + $data = utf8_decode($data); + $this->encoding = 'ISO-8859-1'; + } + + $xp = xml_parser_create($this->encoding); + xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, 0); + xml_set_object($xp, $this); + xml_set_element_handler($xp, 'startHandler', 'endHandler'); + xml_set_character_data_handler($xp, 'cdataHandler'); + if (!xml_parse($xp, $data)) { + $msg = xml_error_string(xml_get_error_code($xp)); + $line = xml_get_current_line_number($xp); + xml_parser_free($xp); + include_once 'PEAR.php'; + return PEAR::raiseError("XML Error: '$msg' on line '$line'", 2); + } + xml_parser_free($xp); + return true; + } + + /** + * Start element handler for XML parser + * + * @access private + * @param object $parser XML parser object + * @param string $element XML element + * @param array $attribs attributes of XML tag + * @return void + */ + function startHandler($parser, $element, $attribs) + { + $this->_depth++; + $this->_dataStack[$this->_depth] = null; + + $val = array( + 'name' => $element, + 'value' => null, + 'type' => 'string', + 'childrenKeys' => array(), + 'aggregKeys' => array() + ); + + if (count($attribs) > 0) { + $val['children'] = array(); + $val['type'] = 'array'; + $val['children']['attribs'] = $attribs; + } + + array_push($this->_valStack, $val); + } + + /** + * post-process data + * + * @param string $data + * @param string $element element name + */ + function postProcess($data, $element) + { + return trim($data); + } + + /** + * End element handler for XML parser + * + * @access private + * @param object XML parser object + * @param string + * @return void + */ + function endHandler($parser, $element) + { + $value = array_pop($this->_valStack); + $data = $this->postProcess($this->_dataStack[$this->_depth], $element); + + // adjust type of the value + switch (strtolower($value['type'])) { + // unserialize an array + case 'array': + if ($data !== '') { + $value['children']['_content'] = $data; + } + + $value['value'] = isset($value['children']) ? $value['children'] : array(); + break; + + /* + * unserialize a null value + */ + case 'null': + $data = null; + break; + + /* + * unserialize any scalar value + */ + default: + settype($data, $value['type']); + $value['value'] = $data; + break; + } + + $parent = array_pop($this->_valStack); + if ($parent === null) { + $this->_unserializedData = &$value['value']; + $this->_root = &$value['name']; + return true; + } + + // parent has to be an array + if (!isset($parent['children']) || !is_array($parent['children'])) { + $parent['children'] = array(); + if ($parent['type'] != 'array') { + $parent['type'] = 'array'; + } + } + + if (!empty($value['name'])) { + // there already has been a tag with this name + if (in_array($value['name'], $parent['childrenKeys'])) { + // no aggregate has been created for this tag + if (!in_array($value['name'], $parent['aggregKeys'])) { + if (isset($parent['children'][$value['name']])) { + $parent['children'][$value['name']] = array($parent['children'][$value['name']]); + } else { + $parent['children'][$value['name']] = array(); + } + array_push($parent['aggregKeys'], $value['name']); + } + array_push($parent['children'][$value['name']], $value['value']); + } else { + $parent['children'][$value['name']] = &$value['value']; + array_push($parent['childrenKeys'], $value['name']); + } + } else { + array_push($parent['children'],$value['value']); + } + array_push($this->_valStack, $parent); + + $this->_depth--; + } + + /** + * Handler for character data + * + * @access private + * @param object XML parser object + * @param string CDATA + * @return void + */ + function cdataHandler($parser, $cdata) + { + $this->_dataStack[$this->_depth] .= $cdata; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/PEAR5.php b/vendor/pear-pear.php.net/PEAR/PEAR5.php new file mode 100644 index 0000000000000000000000000000000000000000..428606780b7bf322bbf8bf2379da80d1340cb86b --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/PEAR5.php @@ -0,0 +1,33 @@ +<?php +/** + * This is only meant for PHP 5 to get rid of certain strict warning + * that doesn't get hidden since it's in the shutdown function + */ +class PEAR5 +{ + /** + * If you have a class that's mostly/entirely static, and you need static + * properties, you can use this method to simulate them. Eg. in your method(s) + * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar'); + * You MUST use a reference, or they will not persist! + * + * @access public + * @param string $class The calling classname, to prevent clashes + * @param string $var The variable to retrieve. + * @return mixed A reference to the variable. If not set it will be + * auto initialised to NULL. + */ + static function &getStaticProperty($class, $var) + { + static $properties; + if (!isset($properties[$class])) { + $properties[$class] = array(); + } + + if (!array_key_exists($var, $properties[$class])) { + $properties[$class][$var] = null; + } + + return $properties[$class][$var]; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/System.php b/vendor/pear-pear.php.net/PEAR/System.php new file mode 100644 index 0000000000000000000000000000000000000000..c27d44658e3eed375e5e3763b753fe2024b2235f --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/System.php @@ -0,0 +1,629 @@ +<?php +/** + * File/Directory manipulation + * + * PHP versions 4 and 5 + * + * @category pear + * @package System + * @author Tomas V.V.Cox <cox@idecnet.com> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: System.php 313024 2011-07-06 19:51:24Z dufuz $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 0.1 + */ + +/** + * base class + */ +require_once 'PEAR.php'; +require_once 'Console/Getopt.php'; + +$GLOBALS['_System_temp_files'] = array(); + +/** +* System offers cross plattform compatible system functions +* +* Static functions for different operations. Should work under +* Unix and Windows. The names and usage has been taken from its respectively +* GNU commands. The functions will return (bool) false on error and will +* trigger the error with the PHP trigger_error() function (you can silence +* the error by prefixing a '@' sign after the function call, but this +* is not recommended practice. Instead use an error handler with +* {@link set_error_handler()}). +* +* Documentation on this class you can find in: +* http://pear.php.net/manual/ +* +* Example usage: +* if (!@System::rm('-r file1 dir1')) { +* print "could not delete file1 or dir1"; +* } +* +* In case you need to to pass file names with spaces, +* pass the params as an array: +* +* System::rm(array('-r', $file1, $dir1)); +* +* @category pear +* @package System +* @author Tomas V.V. Cox <cox@idecnet.com> +* @copyright 1997-2006 The PHP Group +* @license http://opensource.org/licenses/bsd-license.php New BSD License +* @version Release: 1.9.4 +* @link http://pear.php.net/package/PEAR +* @since Class available since Release 0.1 +* @static +*/ +class System +{ + /** + * returns the commandline arguments of a function + * + * @param string $argv the commandline + * @param string $short_options the allowed option short-tags + * @param string $long_options the allowed option long-tags + * @return array the given options and there values + * @static + * @access private + */ + function _parseArgs($argv, $short_options, $long_options = null) + { + if (!is_array($argv) && $argv !== null) { + // Find all items, quoted or otherwise + preg_match_all("/(?:[\"'])(.*?)(?:['\"])|([^\s]+)/", $argv, $av); + $argv = $av[1]; + foreach ($av[2] as $k => $a) { + if (empty($a)) { + continue; + } + $argv[$k] = trim($a) ; + } + } + return Console_Getopt::getopt2($argv, $short_options, $long_options); + } + + /** + * Output errors with PHP trigger_error(). You can silence the errors + * with prefixing a "@" sign to the function call: @System::mkdir(..); + * + * @param mixed $error a PEAR error or a string with the error message + * @return bool false + * @static + * @access private + */ + function raiseError($error) + { + if (PEAR::isError($error)) { + $error = $error->getMessage(); + } + trigger_error($error, E_USER_WARNING); + return false; + } + + /** + * Creates a nested array representing the structure of a directory + * + * System::_dirToStruct('dir1', 0) => + * Array + * ( + * [dirs] => Array + * ( + * [0] => dir1 + * ) + * + * [files] => Array + * ( + * [0] => dir1/file2 + * [1] => dir1/file3 + * ) + * ) + * @param string $sPath Name of the directory + * @param integer $maxinst max. deep of the lookup + * @param integer $aktinst starting deep of the lookup + * @param bool $silent if true, do not emit errors. + * @return array the structure of the dir + * @static + * @access private + */ + function _dirToStruct($sPath, $maxinst, $aktinst = 0, $silent = false) + { + $struct = array('dirs' => array(), 'files' => array()); + if (($dir = @opendir($sPath)) === false) { + if (!$silent) { + System::raiseError("Could not open dir $sPath"); + } + return $struct; // XXX could not open error + } + + $struct['dirs'][] = $sPath = realpath($sPath); // XXX don't add if '.' or '..' ? + $list = array(); + while (false !== ($file = readdir($dir))) { + if ($file != '.' && $file != '..') { + $list[] = $file; + } + } + + closedir($dir); + natsort($list); + if ($aktinst < $maxinst || $maxinst == 0) { + foreach ($list as $val) { + $path = $sPath . DIRECTORY_SEPARATOR . $val; + if (is_dir($path) && !is_link($path)) { + $tmp = System::_dirToStruct($path, $maxinst, $aktinst+1, $silent); + $struct = array_merge_recursive($struct, $tmp); + } else { + $struct['files'][] = $path; + } + } + } + + return $struct; + } + + /** + * Creates a nested array representing the structure of a directory and files + * + * @param array $files Array listing files and dirs + * @return array + * @static + * @see System::_dirToStruct() + */ + function _multipleToStruct($files) + { + $struct = array('dirs' => array(), 'files' => array()); + settype($files, 'array'); + foreach ($files as $file) { + if (is_dir($file) && !is_link($file)) { + $tmp = System::_dirToStruct($file, 0); + $struct = array_merge_recursive($tmp, $struct); + } else { + if (!in_array($file, $struct['files'])) { + $struct['files'][] = $file; + } + } + } + return $struct; + } + + /** + * The rm command for removing files. + * Supports multiple files and dirs and also recursive deletes + * + * @param string $args the arguments for rm + * @return mixed PEAR_Error or true for success + * @static + * @access public + */ + function rm($args) + { + $opts = System::_parseArgs($args, 'rf'); // "f" does nothing but I like it :-) + if (PEAR::isError($opts)) { + return System::raiseError($opts); + } + foreach ($opts[0] as $opt) { + if ($opt[0] == 'r') { + $do_recursive = true; + } + } + $ret = true; + if (isset($do_recursive)) { + $struct = System::_multipleToStruct($opts[1]); + foreach ($struct['files'] as $file) { + if (!@unlink($file)) { + $ret = false; + } + } + + rsort($struct['dirs']); + foreach ($struct['dirs'] as $dir) { + if (!@rmdir($dir)) { + $ret = false; + } + } + } else { + foreach ($opts[1] as $file) { + $delete = (is_dir($file)) ? 'rmdir' : 'unlink'; + if (!@$delete($file)) { + $ret = false; + } + } + } + return $ret; + } + + /** + * Make directories. + * + * The -p option will create parent directories + * @param string $args the name of the director(y|ies) to create + * @return bool True for success + * @static + * @access public + */ + function mkDir($args) + { + $opts = System::_parseArgs($args, 'pm:'); + if (PEAR::isError($opts)) { + return System::raiseError($opts); + } + + $mode = 0777; // default mode + foreach ($opts[0] as $opt) { + if ($opt[0] == 'p') { + $create_parents = true; + } elseif ($opt[0] == 'm') { + // if the mode is clearly an octal number (starts with 0) + // convert it to decimal + if (strlen($opt[1]) && $opt[1]{0} == '0') { + $opt[1] = octdec($opt[1]); + } else { + // convert to int + $opt[1] += 0; + } + $mode = $opt[1]; + } + } + + $ret = true; + if (isset($create_parents)) { + foreach ($opts[1] as $dir) { + $dirstack = array(); + while ((!file_exists($dir) || !is_dir($dir)) && + $dir != DIRECTORY_SEPARATOR) { + array_unshift($dirstack, $dir); + $dir = dirname($dir); + } + + while ($newdir = array_shift($dirstack)) { + if (!is_writeable(dirname($newdir))) { + $ret = false; + break; + } + + if (!mkdir($newdir, $mode)) { + $ret = false; + } + } + } + } else { + foreach($opts[1] as $dir) { + if ((@file_exists($dir) || !is_dir($dir)) && !mkdir($dir, $mode)) { + $ret = false; + } + } + } + + return $ret; + } + + /** + * Concatenate files + * + * Usage: + * 1) $var = System::cat('sample.txt test.txt'); + * 2) System::cat('sample.txt test.txt > final.txt'); + * 3) System::cat('sample.txt test.txt >> final.txt'); + * + * Note: as the class use fopen, urls should work also (test that) + * + * @param string $args the arguments + * @return boolean true on success + * @static + * @access public + */ + function &cat($args) + { + $ret = null; + $files = array(); + if (!is_array($args)) { + $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY); + } + + $count_args = count($args); + for ($i = 0; $i < $count_args; $i++) { + if ($args[$i] == '>') { + $mode = 'wb'; + $outputfile = $args[$i+1]; + break; + } elseif ($args[$i] == '>>') { + $mode = 'ab+'; + $outputfile = $args[$i+1]; + break; + } else { + $files[] = $args[$i]; + } + } + $outputfd = false; + if (isset($mode)) { + if (!$outputfd = fopen($outputfile, $mode)) { + $err = System::raiseError("Could not open $outputfile"); + return $err; + } + $ret = true; + } + foreach ($files as $file) { + if (!$fd = fopen($file, 'r')) { + System::raiseError("Could not open $file"); + continue; + } + while ($cont = fread($fd, 2048)) { + if (is_resource($outputfd)) { + fwrite($outputfd, $cont); + } else { + $ret .= $cont; + } + } + fclose($fd); + } + if (is_resource($outputfd)) { + fclose($outputfd); + } + return $ret; + } + + /** + * Creates temporary files or directories. This function will remove + * the created files when the scripts finish its execution. + * + * Usage: + * 1) $tempfile = System::mktemp("prefix"); + * 2) $tempdir = System::mktemp("-d prefix"); + * 3) $tempfile = System::mktemp(); + * 4) $tempfile = System::mktemp("-t /var/tmp prefix"); + * + * prefix -> The string that will be prepended to the temp name + * (defaults to "tmp"). + * -d -> A temporary dir will be created instead of a file. + * -t -> The target dir where the temporary (file|dir) will be created. If + * this param is missing by default the env vars TMP on Windows or + * TMPDIR in Unix will be used. If these vars are also missing + * c:\windows\temp or /tmp will be used. + * + * @param string $args The arguments + * @return mixed the full path of the created (file|dir) or false + * @see System::tmpdir() + * @static + * @access public + */ + function mktemp($args = null) + { + static $first_time = true; + $opts = System::_parseArgs($args, 't:d'); + if (PEAR::isError($opts)) { + return System::raiseError($opts); + } + + foreach ($opts[0] as $opt) { + if ($opt[0] == 'd') { + $tmp_is_dir = true; + } elseif ($opt[0] == 't') { + $tmpdir = $opt[1]; + } + } + + $prefix = (isset($opts[1][0])) ? $opts[1][0] : 'tmp'; + if (!isset($tmpdir)) { + $tmpdir = System::tmpdir(); + } + + if (!System::mkDir(array('-p', $tmpdir))) { + return false; + } + + $tmp = tempnam($tmpdir, $prefix); + if (isset($tmp_is_dir)) { + unlink($tmp); // be careful possible race condition here + if (!mkdir($tmp, 0700)) { + return System::raiseError("Unable to create temporary directory $tmpdir"); + } + } + + $GLOBALS['_System_temp_files'][] = $tmp; + if (isset($tmp_is_dir)) { + //$GLOBALS['_System_temp_files'][] = dirname($tmp); + } + + if ($first_time) { + PEAR::registerShutdownFunc(array('System', '_removeTmpFiles')); + $first_time = false; + } + + return $tmp; + } + + /** + * Remove temporary files created my mkTemp. This function is executed + * at script shutdown time + * + * @static + * @access private + */ + function _removeTmpFiles() + { + if (count($GLOBALS['_System_temp_files'])) { + $delete = $GLOBALS['_System_temp_files']; + array_unshift($delete, '-r'); + System::rm($delete); + $GLOBALS['_System_temp_files'] = array(); + } + } + + /** + * Get the path of the temporal directory set in the system + * by looking in its environments variables. + * Note: php.ini-recommended removes the "E" from the variables_order setting, + * making unavaible the $_ENV array, that s why we do tests with _ENV + * + * @static + * @return string The temporary directory on the system + */ + function tmpdir() + { + if (OS_WINDOWS) { + if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) { + return $var; + } + if ($var = isset($_ENV['TEMP']) ? $_ENV['TEMP'] : getenv('TEMP')) { + return $var; + } + if ($var = isset($_ENV['USERPROFILE']) ? $_ENV['USERPROFILE'] : getenv('USERPROFILE')) { + return $var; + } + if ($var = isset($_ENV['windir']) ? $_ENV['windir'] : getenv('windir')) { + return $var; + } + return getenv('SystemRoot') . '\temp'; + } + if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) { + return $var; + } + return realpath('/tmp'); + } + + /** + * The "which" command (show the full path of a command) + * + * @param string $program The command to search for + * @param mixed $fallback Value to return if $program is not found + * + * @return mixed A string with the full path or false if not found + * @static + * @author Stig Bakken <ssb@php.net> + */ + function which($program, $fallback = false) + { + // enforce API + if (!is_string($program) || '' == $program) { + return $fallback; + } + + // full path given + if (basename($program) != $program) { + $path_elements[] = dirname($program); + $program = basename($program); + } else { + // Honor safe mode + if (!ini_get('safe_mode') || !$path = ini_get('safe_mode_exec_dir')) { + $path = getenv('PATH'); + if (!$path) { + $path = getenv('Path'); // some OSes are just stupid enough to do this + } + } + $path_elements = explode(PATH_SEPARATOR, $path); + } + + if (OS_WINDOWS) { + $exe_suffixes = getenv('PATHEXT') + ? explode(PATH_SEPARATOR, getenv('PATHEXT')) + : array('.exe','.bat','.cmd','.com'); + // allow passing a command.exe param + if (strpos($program, '.') !== false) { + array_unshift($exe_suffixes, ''); + } + // is_executable() is not available on windows for PHP4 + $pear_is_executable = (function_exists('is_executable')) ? 'is_executable' : 'is_file'; + } else { + $exe_suffixes = array(''); + $pear_is_executable = 'is_executable'; + } + + foreach ($exe_suffixes as $suff) { + foreach ($path_elements as $dir) { + $file = $dir . DIRECTORY_SEPARATOR . $program . $suff; + if (@$pear_is_executable($file)) { + return $file; + } + } + } + return $fallback; + } + + /** + * The "find" command + * + * Usage: + * + * System::find($dir); + * System::find("$dir -type d"); + * System::find("$dir -type f"); + * System::find("$dir -name *.php"); + * System::find("$dir -name *.php -name *.htm*"); + * System::find("$dir -maxdepth 1"); + * + * Params implmented: + * $dir -> Start the search at this directory + * -type d -> return only directories + * -type f -> return only files + * -maxdepth <n> -> max depth of recursion + * -name <pattern> -> search pattern (bash style). Multiple -name param allowed + * + * @param mixed Either array or string with the command line + * @return array Array of found files + * @static + * + */ + function find($args) + { + if (!is_array($args)) { + $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY); + } + $dir = realpath(array_shift($args)); + if (!$dir) { + return array(); + } + $patterns = array(); + $depth = 0; + $do_files = $do_dirs = true; + $args_count = count($args); + for ($i = 0; $i < $args_count; $i++) { + switch ($args[$i]) { + case '-type': + if (in_array($args[$i+1], array('d', 'f'))) { + if ($args[$i+1] == 'd') { + $do_files = false; + } else { + $do_dirs = false; + } + } + $i++; + break; + case '-name': + $name = preg_quote($args[$i+1], '#'); + // our magic characters ? and * have just been escaped, + // so now we change the escaped versions to PCRE operators + $name = strtr($name, array('\?' => '.', '\*' => '.*')); + $patterns[] = '('.$name.')'; + $i++; + break; + case '-maxdepth': + $depth = $args[$i+1]; + break; + } + } + $path = System::_dirToStruct($dir, $depth, 0, true); + if ($do_files && $do_dirs) { + $files = array_merge($path['files'], $path['dirs']); + } elseif ($do_dirs) { + $files = $path['dirs']; + } else { + $files = $path['files']; + } + if (count($patterns)) { + $dsq = preg_quote(DIRECTORY_SEPARATOR, '#'); + $pattern = '#(^|'.$dsq.')'.implode('|', $patterns).'($|'.$dsq.')#'; + $ret = array(); + $files_count = count($files); + for ($i = 0; $i < $files_count; $i++) { + // only search in the part of the file below the current directory + $filepart = basename($files[$i]); + if (preg_match($pattern, $filepart)) { + $ret[] = $files[$i]; + } + } + return $ret; + } + return $files; + } +} \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/bin/scripts/pear.bat b/vendor/pear-pear.php.net/PEAR/bin/scripts/pear.bat new file mode 100644 index 0000000000000000000000000000000000000000..d7675bbfdf26fb5610662ca3eaa262b9d85ac8d4 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/bin/scripts/pear.bat @@ -0,0 +1,111 @@ +@ECHO OFF + +REM ---------------------------------------------------------------------- +REM PHP version 5 +REM ---------------------------------------------------------------------- +REM Copyright (c) 1997-2010 The Authors +REM ---------------------------------------------------------------------- +REM http://opensource.org/licenses/bsd-license.php New BSD License +REM ---------------------------------------------------------------------- +REM Authors: Alexander Merz (alexmerz@php.net) +REM ---------------------------------------------------------------------- +REM +REM Last updated 12/29/2004 ($Id$ is not replaced if the file is binary) + +REM change this lines to match the paths of your system +REM ------------------- + + +REM Test to see if this is a raw pear.bat (uninstalled version) +SET TMPTMPTMPTMPT=@includ +SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ +FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) + +REM Check PEAR global ENV, set them if they do not exist +IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@" +IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@" +IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@" + +GOTO :INSTALLED + +:NOTINSTALLED +ECHO WARNING: This is a raw, uninstalled pear.bat + +REM Check to see if we can grab the directory of this file (Windows NT+) +IF %~n0 == pear ( +FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( +SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" +echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" +"%PHP_PEAR_PHP_BIN%" -v +GOTO :NEXTTEST +)) +GOTO :FAILAUTODETECT +:NEXTTEST +IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( + +REM We can use this PHP to run a temporary php file to get the dirname of pear + +echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php +"%PHP_PEAR_PHP_BIN%" ~~getloc.php +set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a +DEL ~a.a +DEL ~~getloc.php +set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" + +REM Make sure there is a pearcmd.php at our disposal + +IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( +IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +) +) +GOTO :INSTALLED +) ELSE ( +REM Windows Me/98 cannot succeed, so allow the batch to fail +) +:FAILAUTODETECT +echo WARNING: failed to auto-detect pear information +:INSTALLED + +REM Check Folders and files +IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR +IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2 +IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR +IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR + +REM launch pearcmd +GOTO RUN +:PEAR_INSTALL_ERROR +ECHO PHP_PEAR_INSTALL_DIR is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_INSTALL_DIR% +GOTO END +:PEAR_INSTALL_ERROR2 +ECHO PHP_PEAR_INSTALL_DIR is not set correctly. +ECHO pearcmd.php could not be found there. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_INSTALL_DIR% +GOTO END +:PEAR_BIN_ERROR +ECHO PHP_PEAR_BIN_DIR is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_BIN_DIR% +GOTO END +:PEAR_PHPBIN_ERROR +ECHO PHP_PEAR_PHP_BIN is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_PHP_BIN% +GOTO END +:RUN +"%PHP_PEAR_PHP_BIN%" -C -d date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d register_argc_argv="On" -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9 +:END +@ECHO ON \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/bin/scripts/pear.sh b/vendor/pear-pear.php.net/PEAR/bin/scripts/pear.sh new file mode 100644 index 0000000000000000000000000000000000000000..48ab0677c8c0fe4fa017d8e5d856f65889d6bcc4 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/bin/scripts/pear.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# first find which PHP binary to use +if test "x$PHP_PEAR_PHP_BIN" != "x"; then + PHP="$PHP_PEAR_PHP_BIN" +else + if test "@php_bin@" = '@'php_bin'@'; then + PHP=php + else + PHP="@php_bin@" + fi +fi + +# then look for the right pear include dir +if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then + INCDIR=$PHP_PEAR_INSTALL_DIR + INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR" +else + if test "@php_dir@" = '@'php_dir'@'; then + INCDIR=`dirname $0` + INCARG="" + else + INCDIR="@php_dir@" + INCARG="-d include_path=@php_dir@" + fi +fi + +exec $PHP -C -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d open_basedir="" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d auto_append_file="" $INCDIR/pearcmd.php "$@" diff --git a/vendor/pear-pear.php.net/PEAR/bin/scripts/peardev.bat b/vendor/pear-pear.php.net/PEAR/bin/scripts/peardev.bat new file mode 100644 index 0000000000000000000000000000000000000000..8b67c7d9fbe62d474d14b5e64abdfcd487d16d51 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/bin/scripts/peardev.bat @@ -0,0 +1,115 @@ +@ECHO OFF + +REM ---------------------------------------------------------------------- +REM PHP version 5 +REM ---------------------------------------------------------------------- +REM Copyright (c) 1997-2004 The PHP Group +REM ---------------------------------------------------------------------- +REM This source file is subject to version 3.0 of the PHP license, +REM that is bundled with this package in the file LICENSE, and is +REM available at through the world-wide-web at +REM http://www.php.net/license/3_0.txt. +REM If you did not receive a copy of the PHP license and are unable to +REM obtain it through the world-wide-web, please send a note to +REM license@php.net so we can mail you a copy immediately. +REM ---------------------------------------------------------------------- +REM Authors: Alexander Merz (alexmerz@php.net) +REM ---------------------------------------------------------------------- +REM +REM $Id: peardev.bat,v 1.6 2007-09-03 03:00:17 cellog Exp $ + +REM change this lines to match the paths of your system +REM ------------------- + + +REM Test to see if this is a raw pear.bat (uninstalled version) +SET TMPTMPTMPTMPT=@includ +SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ +FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) + +REM Check PEAR global ENV, set them if they do not exist +IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@" +IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@" +IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@" +GOTO :INSTALLED + +:NOTINSTALLED +ECHO WARNING: This is a raw, uninstalled pear.bat + +REM Check to see if we can grab the directory of this file (Windows NT+) +IF %~n0 == pear ( +FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( +SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" +echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" +"%PHP_PEAR_PHP_BIN%" -v +GOTO :NEXTTEST +)) +GOTO :FAILAUTODETECT +:NEXTTEST +IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( + +REM We can use this PHP to run a temporary php file to get the dirname of pear + +echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php +"%PHP_PEAR_PHP_BIN%" ~~getloc.php +set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a +DEL ~a.a +DEL ~~getloc.php +set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" + +REM Make sure there is a pearcmd.php at our disposal + +IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( +IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +) +) +GOTO :INSTALLED +) ELSE ( +REM Windows Me/98 cannot succeed, so allow the batch to fail +) +:FAILAUTODETECT +echo WARNING: failed to auto-detect pear information +:INSTALLED + +REM Check Folders and files +IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR +IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2 +IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR +IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR +REM launch pearcmd +GOTO RUN +:PEAR_INSTALL_ERROR +ECHO PHP_PEAR_INSTALL_DIR is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_INSTALL_DIR% +GOTO END +:PEAR_INSTALL_ERROR2 +ECHO PHP_PEAR_INSTALL_DIR is not set correctly. +ECHO pearcmd.php could not be found there. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_INSTALL_DIR% +GOTO END +:PEAR_BIN_ERROR +ECHO PHP_PEAR_BIN_DIR is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_BIN_DIR% +GOTO END +:PEAR_PHPBIN_ERROR +ECHO PHP_PEAR_PHP_BIN is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_PHP_BIN% +GOTO END +:RUN +"%PHP_PEAR_PHP_BIN%" -C -d date.timezone=UTC -d memory_limit="-1" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d open_basedir="" -d output_buffering=1 -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9 +:END +@ECHO ON \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/bin/scripts/peardev.sh b/vendor/pear-pear.php.net/PEAR/bin/scripts/peardev.sh new file mode 100644 index 0000000000000000000000000000000000000000..635ec7581eaf5307db46900b3d936be3d95a7948 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/bin/scripts/peardev.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# first find which PHP binary to use +if test "x$PHP_PEAR_PHP_BIN" != "x"; then + PHP="$PHP_PEAR_PHP_BIN" +else + if test "@php_bin@" = '@'php_bin'@'; then + PHP=php + else + PHP="@php_bin@" + fi +fi + +# then look for the right pear include dir +if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then + INCDIR=$PHP_PEAR_INSTALL_DIR + INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR" +else + if test "@php_dir@" = '@'php_dir'@'; then + INCDIR=`dirname $0` + INCARG="" + else + INCDIR="@php_dir@" + INCARG="-d include_path=@php_dir@" + fi +fi + +exec $PHP -d date.timezone=UTC -d memory_limit="-1" -C -q $INCARG -d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d variables_order=EGPCS -d auto_append_file="" $INCDIR/pearcmd.php "$@" diff --git a/vendor/pear-pear.php.net/PEAR/bin/scripts/pecl.bat b/vendor/pear-pear.php.net/PEAR/bin/scripts/pecl.bat new file mode 100644 index 0000000000000000000000000000000000000000..e7c823bc144a858309b904e11a82e5eb704bf9aa --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/bin/scripts/pecl.bat @@ -0,0 +1,115 @@ +@ECHO OFF + +REM ---------------------------------------------------------------------- +REM PHP version 5 +REM ---------------------------------------------------------------------- +REM Copyright (c) 1997-2004 The PHP Group +REM ---------------------------------------------------------------------- +REM This source file is subject to version 3.0 of the PHP license, +REM that is bundled with this package in the file LICENSE, and is +REM available at through the world-wide-web at +REM http://www.php.net/license/3_0.txt. +REM If you did not receive a copy of the PHP license and are unable to +REM obtain it through the world-wide-web, please send a note to +REM license@php.net so we can mail you a copy immediately. +REM ---------------------------------------------------------------------- +REM Authors: Alexander Merz (alexmerz@php.net) +REM ---------------------------------------------------------------------- +REM +REM Last updated 02/08/2004 ($Id$ is not replaced if the file is binary) + +REM change this lines to match the paths of your system +REM ------------------- + + +REM Test to see if this is a raw pear.bat (uninstalled version) +SET TMPTMPTMPTMPT=@includ +SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ +FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) + +REM Check PEAR global ENV, set them if they do not exist +IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@" +IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@" +IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@" +GOTO :INSTALLED + +:NOTINSTALLED +ECHO WARNING: This is a raw, uninstalled pear.bat + +REM Check to see if we can grab the directory of this file (Windows NT+) +IF %~n0 == pear ( +FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( +SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" +echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" +"%PHP_PEAR_PHP_BIN%" -v +GOTO :NEXTTEST +)) +GOTO :FAILAUTODETECT +:NEXTTEST +IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( + +REM We can use this PHP to run a temporary php file to get the dirname of pear + +echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php +"%PHP_PEAR_PHP_BIN%" ~~getloc.php +set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a +DEL ~a.a +DEL ~~getloc.php +set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" + +REM Make sure there is a pearcmd.php at our disposal + +IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( +IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +) +) +GOTO :INSTALLED +) ELSE ( +REM Windows Me/98 cannot succeed, so allow the batch to fail +) +:FAILAUTODETECT +echo WARNING: failed to auto-detect pear information +:INSTALLED + +REM Check Folders and files +IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR +IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2 +IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR +IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR +REM launch pearcmd +GOTO RUN +:PEAR_INSTALL_ERROR +ECHO PHP_PEAR_INSTALL_DIR is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_INSTALL_DIR% +GOTO END +:PEAR_INSTALL_ERROR2 +ECHO PHP_PEAR_INSTALL_DIR is not set correctly. +ECHO pearcmd.php could not be found there. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_INSTALL_DIR% +GOTO END +:PEAR_BIN_ERROR +ECHO PHP_PEAR_BIN_DIR is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_BIN_DIR% +GOTO END +:PEAR_PHPBIN_ERROR +ECHO PHP_PEAR_PHP_BIN is not set correctly. +ECHO Please fix it using your environment variable or modify +ECHO the default value in pear.bat +ECHO The current value is: +ECHO %PHP_PEAR_PHP_BIN% +GOTO END +:RUN +"%PHP_PEAR_PHP_BIN%" -C -n -d date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -d register_argc_argv="On" -d variables_order=EGPCS -f "%PHP_PEAR_INSTALL_DIR%\peclcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9 +:END +@ECHO ON \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/bin/scripts/pecl.sh b/vendor/pear-pear.php.net/PEAR/bin/scripts/pecl.sh new file mode 100644 index 0000000000000000000000000000000000000000..332890c534a7f899a3ccb14dcbac03ba722317c6 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/bin/scripts/pecl.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# first find which PHP binary to use +if test "x$PHP_PEAR_PHP_BIN" != "x"; then + PHP="$PHP_PEAR_PHP_BIN" +else + if test "@php_bin@" = '@'php_bin'@'; then + PHP=php + else + PHP="@php_bin@" + fi +fi + +# then look for the right pear include dir +if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then + INCDIR=$PHP_PEAR_INSTALL_DIR + INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR" +else + if test "@php_dir@" = '@'php_dir'@'; then + INCDIR=`dirname $0` + INCARG="" + else + INCDIR="@php_dir@" + INCARG="-d include_path=@php_dir@" + fi +fi + +exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@" diff --git a/vendor/pear-pear.php.net/PEAR/data/PEAR/package.dtd b/vendor/pear-pear.php.net/PEAR/data/PEAR/package.dtd new file mode 100644 index 0000000000000000000000000000000000000000..5b471b7fec6cf214b3564cd8a62c18e2cb6e5f77 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/data/PEAR/package.dtd @@ -0,0 +1,103 @@ +<!-- + $Id: package.dtd,v 1.38 2005-11-12 02:23:07 cellog Exp $ + + This is the PEAR package description, version 1.0. + It should be used with the informal public identifier: + + "-//PHP Group//DTD PEAR Package 1.0//EN//XML" + + Copyright (c) 1997-2005 The PHP Group + + This source file is subject to version 3.00 of the PHP license, + that is bundled with this package in the file LICENSE, and is + available at through the world-wide-web at + http://www.php.net/license/3_0.txt. + If you did not receive a copy of the PHP license and are unable to + obtain it through the world-wide-web, please send a note to + license@php.net so we can mail you a copy immediately. + + Authors: + Stig S. Bakken <ssb@fast.no> + Gregory Beaver <cellog@php.net> + + --> +<!ENTITY % NUMBER "CDATA"> +<!ELEMENT package (name,summary,description,license?,maintainers,release,changelog?)> +<!ATTLIST package type (source|binary|empty) "empty" + version CDATA #REQUIRED + packagerversion CDATA #IMPLIED> + +<!ELEMENT name (#PCDATA)> + +<!ELEMENT summary (#PCDATA)> + +<!ELEMENT license (#PCDATA)> + +<!ELEMENT description (#PCDATA)> + +<!ELEMENT maintainers (maintainer)+> + +<!ELEMENT maintainer (user|role|name|email)+> + +<!ELEMENT user (#PCDATA)> + +<!ELEMENT role (#PCDATA)> + +<!ELEMENT email (#PCDATA)> + +<!ELEMENT changelog (release)+> + +<!ELEMENT release (version,date,license,state,notes,warnings?,provides*,deps?,configureoptions?,filelist?)> + +<!ELEMENT version (#PCDATA)> + +<!ELEMENT date (#PCDATA)> + +<!ELEMENT state (#PCDATA)> + +<!ELEMENT notes (#PCDATA)> + +<!ELEMENT warnings (#PCDATA)> + +<!ELEMENT deps (dep*)> + +<!ELEMENT dep (#PCDATA)> +<!ATTLIST dep type (pkg|ext|php) #REQUIRED + rel (has|eq|lt|le|gt|ge) #IMPLIED + version CDATA #IMPLIED + optional (yes|no) 'no'> + +<!ELEMENT configureoptions (configureoption)+> + +<!ELEMENT configureoption EMPTY> +<!ATTLIST configureoption name CDATA #REQUIRED + default CDATA #IMPLIED + prompt CDATA #REQUIRED> + +<!ELEMENT provides EMPTY> +<!ATTLIST provides type (ext|prog|class|function|feature|api) #REQUIRED + name CDATA #REQUIRED + extends CDATA #IMPLIED> +<!ELEMENT filelist (dir|file)+> + +<!ELEMENT dir (dir|file)+> +<!ATTLIST dir name CDATA #REQUIRED + role (php|ext|src|test|doc|data|script) 'php' + baseinstalldir CDATA #IMPLIED> + +<!ELEMENT file (replace*)> +<!ATTLIST file role (php|ext|src|test|doc|data|script) 'php' + debug (na|on|off) 'na' + format CDATA #IMPLIED + baseinstalldir CDATA #IMPLIED + platform CDATA #IMPLIED + md5sum CDATA #IMPLIED + name CDATA #REQUIRED + install-as CDATA #IMPLIED> + +<!ELEMENT replace EMPTY> +<!ATTLIST replace type (php-const|pear-config|package-info) #REQUIRED + from CDATA #REQUIRED + to CDATA #REQUIRED> + + diff --git a/vendor/pear-pear.php.net/PEAR/data/PEAR/template.spec b/vendor/pear-pear.php.net/PEAR/data/PEAR/template.spec new file mode 100644 index 0000000000000000000000000000000000000000..37b477f8f0ad5751989c40a3474690132c3fce22 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/data/PEAR/template.spec @@ -0,0 +1,72 @@ +Summary: PEAR: @summary@ +Name: @rpm_package@ +Version: @version@ +Release: 1 +License: @release_license@ +Group: Development/Libraries +Source: http://@master_server@/get/@package@-%{version}.tgz +BuildRoot: %{_tmppath}/%{name}-root +URL: http://@master_server@/package/@package@ +Prefix: %{_prefix} +BuildArchitectures: @arch@ +@extra_headers@ + +%description +@description@ + +%prep +rm -rf %{buildroot}/* +%setup -c -T +# XXX Source files location is missing here in pear cmd +pear -v -c %{buildroot}/pearrc \ + -d php_dir=%{_libdir}/php/pear \ + -d doc_dir=/docs \ + -d bin_dir=%{_bindir} \ + -d data_dir=%{_libdir}/php/pear/data \ + -d test_dir=%{_libdir}/php/pear/tests \ + -d ext_dir=%{_libdir} \@extra_config@ + -s + +%build +echo BuildRoot=%{buildroot} + +%postun +# if refcount = 0 then package has been removed (not upgraded) +if [ "$1" -eq "0" ]; then + pear uninstall --nodeps -r @possible_channel@@package@ + rm @rpm_xml_dir@/@package@.xml +fi + + +%post +# if refcount = 2 then package has been upgraded +if [ "$1" -ge "2" ]; then + pear upgrade --nodeps -r @rpm_xml_dir@/@package@.xml +else + pear install --nodeps -r @rpm_xml_dir@/@package@.xml +fi + +%install +pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \ + $RPM_SOURCE_DIR/@package@-%{version}.tgz +rm %{buildroot}/pearrc +rm %{buildroot}/%{_libdir}/php/pear/.filemap +rm %{buildroot}/%{_libdir}/php/pear/.lock +rm -rf %{buildroot}/%{_libdir}/php/pear/.registry +if [ "@doc_files@" != "" ]; then + mv %{buildroot}/docs/@package@/* . + rm -rf %{buildroot}/docs +fi +mkdir -p %{buildroot}@rpm_xml_dir@ +tar -xzf $RPM_SOURCE_DIR/@package@-%{version}.tgz package@package2xml@.xml +cp -p package@package2xml@.xml %{buildroot}@rpm_xml_dir@/@package@.xml + +#rm -rf %{buildroot}/* +#pear -q install -R %{buildroot} -n package@package2xml@.xml +#mkdir -p %{buildroot}@rpm_xml_dir@ +#cp -p package@package2xml@.xml %{buildroot}@rpm_xml_dir@/@package@.xml + +%files + %defattr(-,root,root) + %doc @doc_files@ + / diff --git a/vendor/pear-pear.php.net/PEAR/scripts/pearcmd.php b/vendor/pear-pear.php.net/PEAR/scripts/pearcmd.php new file mode 100644 index 0000000000000000000000000000000000000000..a3a928a3c09b6dd253e8f166768ed53a588ed786 --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/scripts/pearcmd.php @@ -0,0 +1,448 @@ +<?php +/** + * PEAR, the PHP Extension and Application Repository + * + * Command line interface + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V.Cox <cox@idecnet.com> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: pearcmd.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + */ + +ob_end_clean(); +if (!defined('PEAR_RUNTYPE')) { + // this is defined in peclcmd.php as 'pecl' + define('PEAR_RUNTYPE', 'pear'); +} +define('PEAR_IGNORE_BACKTRACE', 1); +/** + * @nodep Gtk + */ +if ('@include_path@' != '@'.'include_path'.'@') { + ini_set('include_path', '@include_path@'); + $raw = false; +} else { + // this is a raw, uninstalled pear, either a cvs checkout, or php distro + $raw = true; +} +@ini_set('allow_url_fopen', true); +if (!ini_get('safe_mode')) { + @set_time_limit(0); +} +ob_implicit_flush(true); +@ini_set('track_errors', true); +@ini_set('html_errors', false); +@ini_set('magic_quotes_runtime', false); +$_PEAR_PHPDIR = '#$%^&*'; +set_error_handler('error_handler'); + +$pear_package_version = "@pear_version@"; + +require_once 'PEAR.php'; +require_once 'PEAR/Frontend.php'; +require_once 'PEAR/Config.php'; +require_once 'PEAR/Command.php'; +require_once 'Console/Getopt.php'; + + +PEAR_Command::setFrontendType('CLI'); +$all_commands = PEAR_Command::getCommands(); + +// remove this next part when we stop supporting that crap-ass PHP 4.2 +if (!isset($_SERVER['argv']) && !isset($argv) && !isset($HTTP_SERVER_VARS['argv'])) { + echo 'ERROR: either use the CLI php executable, or set register_argc_argv=On in php.ini'; + exit(1); +} + +$argv = Console_Getopt::readPHPArgv(); +// fix CGI sapi oddity - the -- in pear.bat/pear is not removed +if (php_sapi_name() != 'cli' && isset($argv[1]) && $argv[1] == '--') { + unset($argv[1]); + $argv = array_values($argv); +} +$progname = PEAR_RUNTYPE; +array_shift($argv); +$options = Console_Getopt::getopt2($argv, "c:C:d:D:Gh?sSqu:vV"); +if (PEAR::isError($options)) { + usage($options); +} + +$opts = $options[0]; + +$fetype = 'CLI'; +if ($progname == 'gpear' || $progname == 'pear-gtk') { + $fetype = 'Gtk'; +} else { + foreach ($opts as $opt) { + if ($opt[0] == 'G') { + $fetype = 'Gtk'; + } + } +} +//Check if Gtk and PHP >= 5.1.0 +if ($fetype == 'Gtk' && version_compare(phpversion(), '5.1.0', '>=')) { + $fetype = 'Gtk2'; +} + +$pear_user_config = ''; +$pear_system_config = ''; +$store_user_config = false; +$store_system_config = false; +$verbose = 1; + +foreach ($opts as $opt) { + switch ($opt[0]) { + case 'c': + $pear_user_config = $opt[1]; + break; + case 'C': + $pear_system_config = $opt[1]; + break; + } +} + +PEAR_Command::setFrontendType($fetype); +$ui = &PEAR_Command::getFrontendObject(); +$config = &PEAR_Config::singleton($pear_user_config, $pear_system_config); + +if (PEAR::isError($config)) { + $_file = ''; + if ($pear_user_config !== false) { + $_file .= $pear_user_config; + } + if ($pear_system_config !== false) { + $_file .= '/' . $pear_system_config; + } + if ($_file == '/') { + $_file = 'The default config file'; + } + $config->getMessage(); + $ui->outputData("ERROR: $_file is not a valid config file or is corrupted."); + // We stop, we have no idea where we are :) + exit(1); +} + +// this is used in the error handler to retrieve a relative path +$_PEAR_PHPDIR = $config->get('php_dir'); +$ui->setConfig($config); +PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError")); +if (ini_get('safe_mode')) { + $ui->outputData('WARNING: running in safe mode requires that all files created ' . + 'be the same uid as the current script. PHP reports this script is uid: ' . + @getmyuid() . ', and current user is: ' . @get_current_user()); +} + +$verbose = $config->get("verbose"); +$cmdopts = array(); + +if ($raw) { + if (!$config->isDefinedLayer('user') && !$config->isDefinedLayer('system')) { + $found = false; + foreach ($opts as $opt) { + if ($opt[0] == 'd' || $opt[0] == 'D') { + $found = true; // the user knows what they are doing, and are setting config values + } + } + if (!$found) { + // no prior runs, try to install PEAR + if (strpos(dirname(__FILE__), 'scripts')) { + $packagexml = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'package2.xml'; + $pearbase = dirname(dirname(__FILE__)); + } else { + $packagexml = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'package2.xml'; + $pearbase = dirname(__FILE__); + } + if (file_exists($packagexml)) { + $options[1] = array( + 'install', + $packagexml + ); + $config->set('php_dir', $pearbase . DIRECTORY_SEPARATOR . 'php'); + $config->set('data_dir', $pearbase . DIRECTORY_SEPARATOR . 'data'); + $config->set('doc_dir', $pearbase . DIRECTORY_SEPARATOR . 'docs'); + $config->set('test_dir', $pearbase . DIRECTORY_SEPARATOR . 'tests'); + $config->set('ext_dir', $pearbase . DIRECTORY_SEPARATOR . 'extensions'); + $config->set('bin_dir', $pearbase); + $config->mergeConfigFile($pearbase . 'pear.ini', false); + $config->store(); + $config->set('auto_discover', 1); + } + } + } +} +foreach ($opts as $opt) { + $param = !empty($opt[1]) ? $opt[1] : true; + switch ($opt[0]) { + case 'd': + if ($param === true) { + die('Invalid usage of "-d" option, expected -d config_value=value, ' . + 'received "-d"' . "\n"); + } + $possible = explode('=', $param); + if (count($possible) != 2) { + die('Invalid usage of "-d" option, expected -d config_value=value, received "' . + $param . '"' . "\n"); + } + list($key, $value) = explode('=', $param); + $config->set($key, $value, 'user'); + break; + case 'D': + if ($param === true) { + die('Invalid usage of "-d" option, expected -d config_value=value, ' . + 'received "-d"' . "\n"); + } + $possible = explode('=', $param); + if (count($possible) != 2) { + die('Invalid usage of "-d" option, expected -d config_value=value, received "' . + $param . '"' . "\n"); + } + list($key, $value) = explode('=', $param); + $config->set($key, $value, 'system'); + break; + case 's': + $store_user_config = true; + break; + case 'S': + $store_system_config = true; + break; + case 'u': + $config->remove($param, 'user'); + break; + case 'v': + $config->set('verbose', $config->get('verbose') + 1); + break; + case 'q': + $config->set('verbose', $config->get('verbose') - 1); + break; + case 'V': + usage(null, 'version'); + case 'c': + case 'C': + break; + default: + // all non pear params goes to the command + $cmdopts[$opt[0]] = $param; + break; + } +} + +if ($store_system_config) { + $config->store('system'); +} + +if ($store_user_config) { + $config->store('user'); +} + +$command = (isset($options[1][0])) ? $options[1][0] : null; +if (empty($command) && ($store_user_config || $store_system_config)) { + exit; +} + +if ($fetype == 'Gtk' || $fetype == 'Gtk2') { + if (!$config->validConfiguration()) { + PEAR::raiseError('CRITICAL ERROR: no existing valid configuration files found in files ' . + "'$pear_user_config' or '$pear_system_config', please copy an existing configuration" . + 'file to one of these locations, or use the -c and -s options to create one'); + } + Gtk::main(); +} else do { + if ($command == 'help') { + usage(null, @$options[1][1]); + } + + if (!$config->validConfiguration()) { + PEAR::raiseError('CRITICAL ERROR: no existing valid configuration files found in files ' . + "'$pear_user_config' or '$pear_system_config', please copy an existing configuration" . + 'file to one of these locations, or use the -c and -s options to create one'); + } + + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $cmd = PEAR_Command::factory($command, $config); + PEAR::popErrorHandling(); + if (PEAR::isError($cmd)) { + usage(null, @$options[1][0]); + } + + $short_args = $long_args = null; + PEAR_Command::getGetoptArgs($command, $short_args, $long_args); + array_shift($options[1]); + $tmp = Console_Getopt::getopt2($options[1], $short_args, $long_args); + + if (PEAR::isError($tmp)) { + break; + } + + list($tmpopt, $params) = $tmp; + $opts = array(); + foreach ($tmpopt as $foo => $tmp2) { + list($opt, $value) = $tmp2; + if ($value === null) { + $value = true; // options without args + } + + if (strlen($opt) == 1) { + $cmdoptions = $cmd->getOptions($command); + foreach ($cmdoptions as $o => $d) { + if (isset($d['shortopt']) && $d['shortopt'] == $opt) { + $opts[$o] = $value; + } + } + } else { + if (substr($opt, 0, 2) == '--') { + $opts[substr($opt, 2)] = $value; + } + } + } + + $ok = $cmd->run($command, $opts, $params); + if ($ok === false) { + PEAR::raiseError("unknown command `$command'"); + } + + if (PEAR::isError($ok)) { + PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError")); + PEAR::raiseError($ok); + } +} while (false); + +// {{{ usage() + +function usage($error = null, $helpsubject = null) +{ + global $progname, $all_commands; + $stdout = fopen('php://stdout', 'w'); + if (PEAR::isError($error)) { + fputs($stdout, $error->getMessage() . "\n"); + } elseif ($error !== null) { + fputs($stdout, "$error\n"); + } + + if ($helpsubject != null) { + $put = cmdHelp($helpsubject); + } else { + $put = "Commands:\n"; + $maxlen = max(array_map("strlen", $all_commands)); + $formatstr = "%-{$maxlen}s %s\n"; + ksort($all_commands); + foreach ($all_commands as $cmd => $class) { + $put .= sprintf($formatstr, $cmd, PEAR_Command::getDescription($cmd)); + } + $put .= + "Usage: $progname [options] command [command-options] <parameters>\n". + "Type \"$progname help options\" to list all options.\n". + "Type \"$progname help shortcuts\" to list all command shortcuts.\n". + "Type \"$progname help <command>\" to get the help for the specified command."; + } + fputs($stdout, "$put\n"); + fclose($stdout); + + if ($error === null) { + exit(0); + } + exit(1); +} + +function cmdHelp($command) +{ + global $progname, $all_commands, $config; + if ($command == "options") { + return + "Options:\n". + " -v increase verbosity level (default 1)\n". + " -q be quiet, decrease verbosity level\n". + " -c file find user configuration in `file'\n". + " -C file find system configuration in `file'\n". + " -d foo=bar set user config variable `foo' to `bar'\n". + " -D foo=bar set system config variable `foo' to `bar'\n". + " -G start in graphical (Gtk) mode\n". + " -s store user configuration\n". + " -S store system configuration\n". + " -u foo unset `foo' in the user configuration\n". + " -h, -? display help/usage (this message)\n". + " -V version information\n"; + } elseif ($command == "shortcuts") { + $sc = PEAR_Command::getShortcuts(); + $ret = "Shortcuts:\n"; + foreach ($sc as $s => $c) { + $ret .= sprintf(" %-8s %s\n", $s, $c); + } + return $ret; + + } elseif ($command == "version") { + return "PEAR Version: ".$GLOBALS['pear_package_version']. + "\nPHP Version: ".phpversion(). + "\nZend Engine Version: ".zend_version(). + "\nRunning on: ".php_uname(); + + } elseif ($help = PEAR_Command::getHelp($command)) { + if (is_string($help)) { + return "$progname $command [options] $help\n"; + } + + if ($help[1] === null) { + return "$progname $command $help[0]"; + } + + return "$progname $command [options] $help[0]\n$help[1]"; + } + + return "Command '$command' is not valid, try '$progname help'"; +} + +// }}} + +function error_handler($errno, $errmsg, $file, $line, $vars) { + if ((defined('E_STRICT') && $errno & E_STRICT) || (defined('E_DEPRECATED') && + $errno & E_DEPRECATED) || !error_reporting()) { + if (defined('E_STRICT') && $errno & E_STRICT) { + return; // E_STRICT + } + if (defined('E_DEPRECATED') && $errno & E_DEPRECATED) { + return; // E_DEPRECATED + } + if ($GLOBALS['config']->get('verbose') < 4) { + return false; // @silenced error, show all if debug is high enough + } + } + $errortype = array ( + E_ERROR => "Error", + E_WARNING => "Warning", + E_PARSE => "Parsing Error", + E_NOTICE => "Notice", + E_CORE_ERROR => "Core Error", + E_CORE_WARNING => "Core Warning", + E_COMPILE_ERROR => "Compile Error", + E_COMPILE_WARNING => "Compile Warning", + E_USER_ERROR => "User Error", + E_USER_WARNING => "User Warning", + E_USER_NOTICE => "User Notice" + ); + $prefix = $errortype[$errno]; + global $_PEAR_PHPDIR; + if (stristr($file, $_PEAR_PHPDIR)) { + $file = substr($file, strlen($_PEAR_PHPDIR) + 1); + } else { + $file = basename($file); + } + print "\n$prefix: $errmsg in $file on line $line\n"; + return false; +} + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * mode: php + * End: + */ +// vim600:syn=php \ No newline at end of file diff --git a/vendor/pear-pear.php.net/PEAR/scripts/peclcmd.php b/vendor/pear-pear.php.net/PEAR/scripts/peclcmd.php new file mode 100644 index 0000000000000000000000000000000000000000..498caafd11c730785115e2a3cabff4efb8d5584d --- /dev/null +++ b/vendor/pear-pear.php.net/PEAR/scripts/peclcmd.php @@ -0,0 +1,41 @@ +<?php +/** + * PEAR, the PHP Extension and Application Repository + * + * Command line interface + * + * PHP versions 4 and 5 + * + * @category pear + * @package PEAR + * @author Stig Bakken <ssb@php.net> + * @author Tomas V.V.Cox <cox@idecnet.com> + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: peclcmd.php 313023 2011-07-06 19:17:11Z dufuz $ + * @link http://pear.php.net/package/PEAR + */ + +/** + * @nodep Gtk + */ +if ('@include_path@' != '@'.'include_path'.'@') { + ini_set('include_path', '@include_path@'); + $raw = false; +} else { + // this is a raw, uninstalled pear, either a cvs checkout, or php distro + $raw = true; +} +define('PEAR_RUNTYPE', 'pecl'); +require_once 'pearcmd.php'; +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * mode: php + * End: + */ +// vim600:syn=php + +?> diff --git a/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph.php b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph.php new file mode 100644 index 0000000000000000000000000000000000000000..3757f1584fd3d18cfaf840a426d28a524efd6018 --- /dev/null +++ b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph.php @@ -0,0 +1,154 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */ +// +-----------------------------------------------------------------------------+ +// | Copyright (c) 2003 Sérgio Gonçalves Carvalho | +// +-----------------------------------------------------------------------------+ +// | This file is part of Structures_Graph. | +// | | +// | Structures_Graph is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU Lesser General Public License as published by | +// | the Free Software Foundation; either version 2.1 of the License, or | +// | (at your option) any later version. | +// | | +// | Structures_Graph is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public License | +// | along with Structures_Graph; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | +// | 02111-1307 USA | +// +-----------------------------------------------------------------------------+ +// | Author: Sérgio Carvalho <sergio.carvalho@portugalmail.com> | +// +-----------------------------------------------------------------------------+ +// +/** + * The Graph.php file contains the definition of the Structures_Graph class + * + * @see Structures_Graph + * @package Structures_Graph + */ + +/* dependencies {{{ */ +/** PEAR base classes */ +require_once 'PEAR.php'; +/** Graph Node */ +require_once 'Structures/Graph/Node.php'; +/* }}} */ + +define('STRUCTURES_GRAPH_ERROR_GENERIC', 100); + +/* class Structures_Graph {{{ */ +/** + * The Structures_Graph class represents a graph data structure. + * + * A Graph is a data structure composed by a set of nodes, connected by arcs. + * Graphs may either be directed or undirected. In a directed graph, arcs are + * directional, and can be traveled only one way. In an undirected graph, arcs + * are bidirectional, and can be traveled both ways. + * + * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com> + * @copyright (c) 2004 by Sérgio Carvalho + * @package Structures_Graph + */ +/* }}} */ +class Structures_Graph { + /* fields {{{ */ + /** + * @access private + */ + var $_nodes = array(); + /** + * @access private + */ + var $_directed = false; + /* }}} */ + + /* Constructor {{{ */ + /** + * + * Constructor + * + * @param boolean Set to true if the graph is directed. Set to false if it is not directed. (Optional, defaults to true) + * @access public + */ + function Structures_Graph($directed = true) { + $this->_directed = $directed; + } + /* }}} */ + + /* isDirected {{{ */ + /** + * + * Return true if a graph is directed + * + * @return boolean true if the graph is directed + * @access public + */ + function isDirected() { + return (boolean) $this->_directed; + } + /* }}} */ + + /* addNode {{{ */ + /** + * + * Add a Node to the Graph + * + * @param Structures_Graph_Node The node to be added. + * @access public + */ + function addNode(&$newNode) { + // We only add nodes + if (!is_a($newNode, 'Structures_Graph_Node')) return Pear::raiseError('Structures_Graph::addNode received an object that is not a Structures_Graph_Node', STRUCTURES_GRAPH_ERROR_GENERIC); + // Graphs are node *sets*, so duplicates are forbidden. We allow nodes that are exactly equal, but disallow equal references. + foreach($this->_nodes as $key => $node) { + /* + ZE1 equality operators choke on the recursive cycle introduced by the _graph field in the Node object. + So, we'll check references the hard way (change $this->_nodes[$key] and check if the change reflects in + $node) + */ + $savedData = $this->_nodes[$key]; + $referenceIsEqualFlag = false; + $this->_nodes[$key] = true; + if ($node === true) { + $this->_nodes[$key] = false; + if ($node === false) $referenceIsEqualFlag = true; + } + $this->_nodes[$key] = $savedData; + if ($referenceIsEqualFlag) return Pear::raiseError('Structures_Graph::addNode received an object that is a duplicate for this dataset', STRUCTURES_GRAPH_ERROR_GENERIC); + } + $this->_nodes[] =& $newNode; + $newNode->setGraph($this); + } + /* }}} */ + + /* removeNode (unimplemented) {{{ */ + /** + * + * Remove a Node from the Graph + * + * @todo This is unimplemented + * @param Structures_Graph_Node The node to be removed from the graph + * @access public + */ + function removeNode(&$node) { + } + /* }}} */ + + /* getNodes {{{ */ + /** + * + * Return the node set, in no particular order. For ordered node sets, use a Graph Manipulator insted. + * + * @access public + * @see Structures_Graph_Manipulator_TopologicalSorter + * @return array The set of nodes in this graph + */ + function &getNodes() { + return $this->_nodes; + } + /* }}} */ +} +?> diff --git a/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Manipulator/AcyclicTest.php b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Manipulator/AcyclicTest.php new file mode 100644 index 0000000000000000000000000000000000000000..fc1ba92f6a202aa9e9ae8381596bb2af3fd0ba88 --- /dev/null +++ b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Manipulator/AcyclicTest.php @@ -0,0 +1,136 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */ +// +-----------------------------------------------------------------------------+ +// | Copyright (c) 2003 Sérgio Gonçalves Carvalho | +// +-----------------------------------------------------------------------------+ +// | This file is part of Structures_Graph. | +// | | +// | Structures_Graph is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU Lesser General Public License as published by | +// | the Free Software Foundation; either version 2.1 of the License, or | +// | (at your option) any later version. | +// | | +// | Structures_Graph is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public License | +// | along with Structures_Graph; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | +// | 02111-1307 USA | +// +-----------------------------------------------------------------------------+ +// | Author: Sérgio Carvalho <sergio.carvalho@portugalmail.com> | +// +-----------------------------------------------------------------------------+ +// +/** + * This file contains the definition of the Structures_Graph_Manipulator_AcyclicTest graph manipulator. + * + * @see Structures_Graph_Manipulator_AcyclicTest + * @package Structures_Graph + */ + +/* dependencies {{{ */ +/** */ +require_once 'PEAR.php'; +/** */ +require_once 'Structures/Graph.php'; +/** */ +require_once 'Structures/Graph/Node.php'; +/* }}} */ + +/* class Structures_Graph_Manipulator_AcyclicTest {{{ */ +/** + * The Structures_Graph_Manipulator_AcyclicTest is a graph manipulator + * which tests whether a graph contains a cycle. + * + * The definition of an acyclic graph used in this manipulator is that of a + * DAG. The graph must be directed, or else it is considered cyclic, even when + * there are no arcs. + * + * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com> + * @copyright (c) 2004 by Sérgio Carvalho + * @package Structures_Graph + */ +class Structures_Graph_Manipulator_AcyclicTest { + /* _nonVisitedInDegree {{{ */ + /** + * + * This is a variant of Structures_Graph::inDegree which does + * not count nodes marked as visited. + * + * @access private + * @return integer Number of non-visited nodes that link to this one + */ + function _nonVisitedInDegree(&$node) { + $result = 0; + $graphNodes =& $node->_graph->getNodes(); + foreach (array_keys($graphNodes) as $key) { + if ((!$graphNodes[$key]->getMetadata('acyclic-test-visited')) && $graphNodes[$key]->connectsTo($node)) $result++; + } + return $result; + + } + /* }}} */ + + /* _isAcyclic {{{ */ + /** + * @access private + */ + function _isAcyclic(&$graph) { + // Mark every node as not visited + $nodes =& $graph->getNodes(); + $nodeKeys = array_keys($nodes); + $refGenerator = array(); + foreach($nodeKeys as $key) { + $refGenerator[] = false; + $nodes[$key]->setMetadata('acyclic-test-visited', $refGenerator[sizeof($refGenerator) - 1]); + } + + // Iteratively peel off leaf nodes + do { + // Find out which nodes are leafs (excluding visited nodes) + $leafNodes = array(); + foreach($nodeKeys as $key) { + if ((!$nodes[$key]->getMetadata('acyclic-test-visited')) && Structures_Graph_Manipulator_AcyclicTest::_nonVisitedInDegree($nodes[$key]) == 0) { + $leafNodes[] =& $nodes[$key]; + } + } + // Mark leafs as visited + for ($i=sizeof($leafNodes) - 1; $i>=0; $i--) { + $visited =& $leafNodes[$i]->getMetadata('acyclic-test-visited'); + $visited = true; + $leafNodes[$i]->setMetadata('acyclic-test-visited', $visited); + } + } while (sizeof($leafNodes) > 0); + + // If graph is a DAG, there should be no non-visited nodes. Let's try to prove otherwise + $result = true; + foreach($nodeKeys as $key) if (!$nodes[$key]->getMetadata('acyclic-test-visited')) $result = false; + + // Cleanup visited marks + foreach($nodeKeys as $key) $nodes[$key]->unsetMetadata('acyclic-test-visited'); + + return $result; + } + /* }}} */ + + /* isAcyclic {{{ */ + /** + * + * isAcyclic returns true if a graph contains no cycles, false otherwise. + * + * @return boolean true iff graph is acyclic + * @access public + */ + function isAcyclic(&$graph) { + // We only test graphs + if (!is_a($graph, 'Structures_Graph')) return Pear::raiseError('Structures_Graph_Manipulator_AcyclicTest::isAcyclic received an object that is not a Structures_Graph', STRUCTURES_GRAPH_ERROR_GENERIC); + if (!$graph->isDirected()) return false; // Only directed graphs may be acyclic + + return Structures_Graph_Manipulator_AcyclicTest::_isAcyclic($graph); + } + /* }}} */ +} +/* }}} */ +?> diff --git a/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Manipulator/TopologicalSorter.php b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Manipulator/TopologicalSorter.php new file mode 100644 index 0000000000000000000000000000000000000000..98a9fa0b607ec403b52434347cc43b51de49a700 --- /dev/null +++ b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Manipulator/TopologicalSorter.php @@ -0,0 +1,153 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */ +// +-----------------------------------------------------------------------------+ +// | Copyright (c) 2003 Sérgio Gonçalves Carvalho | +// +-----------------------------------------------------------------------------+ +// | This file is part of Structures_Graph. | +// | | +// | Structures_Graph is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU Lesser General Public License as published by | +// | the Free Software Foundation; either version 2.1 of the License, or | +// | (at your option) any later version. | +// | | +// | Structures_Graph is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public License | +// | along with Structures_Graph; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | +// | 02111-1307 USA | +// +-----------------------------------------------------------------------------+ +// | Author: Sérgio Carvalho <sergio.carvalho@portugalmail.com> | +// +-----------------------------------------------------------------------------+ +// +/** + * This file contains the definition of the Structures_Graph_Manipulator_TopologicalSorter class. + * + * @see Structures_Graph_Manipulator_TopologicalSorter + * @package Structures_Graph + */ + +/* dependencies {{{ */ +/** */ +require_once 'PEAR.php'; +/** */ +require_once 'Structures/Graph.php'; +/** */ +require_once 'Structures/Graph/Node.php'; +/** */ +require_once 'Structures/Graph/Manipulator/AcyclicTest.php'; +/* }}} */ + +/* class Structures_Graph_Manipulator_TopologicalSorter {{{ */ +/** + * The Structures_Graph_Manipulator_TopologicalSorter is a manipulator + * which is able to return the set of nodes in a graph, sorted by topological + * order. + * + * A graph may only be sorted topologically iff it's a DAG. You can test it + * with the Structures_Graph_Manipulator_AcyclicTest. + * + * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com> + * @copyright (c) 2004 by Sérgio Carvalho + * @see Structures_Graph_Manipulator_AcyclicTest + * @package Structures_Graph + */ +class Structures_Graph_Manipulator_TopologicalSorter { + /* _nonVisitedInDegree {{{ */ + /** + * + * This is a variant of Structures_Graph::inDegree which does + * not count nodes marked as visited. + * + * @access private + * @return integer Number of non-visited nodes that link to this one + */ + function _nonVisitedInDegree(&$node) { + $result = 0; + $graphNodes =& $node->_graph->getNodes(); + foreach (array_keys($graphNodes) as $key) { + if ((!$graphNodes[$key]->getMetadata('topological-sort-visited')) && $graphNodes[$key]->connectsTo($node)) $result++; + } + return $result; + + } + /* }}} */ + + /* _sort {{{ */ + /** + * @access private + */ + function _sort(&$graph) { + // Mark every node as not visited + $nodes =& $graph->getNodes(); + $nodeKeys = array_keys($nodes); + $refGenerator = array(); + foreach($nodeKeys as $key) { + $refGenerator[] = false; + $nodes[$key]->setMetadata('topological-sort-visited', $refGenerator[sizeof($refGenerator) - 1]); + } + + // Iteratively peel off leaf nodes + $topologicalLevel = 0; + do { + // Find out which nodes are leafs (excluding visited nodes) + $leafNodes = array(); + foreach($nodeKeys as $key) { + if ((!$nodes[$key]->getMetadata('topological-sort-visited')) && Structures_Graph_Manipulator_TopologicalSorter::_nonVisitedInDegree($nodes[$key]) == 0) { + $leafNodes[] =& $nodes[$key]; + } + } + // Mark leafs as visited + $refGenerator[] = $topologicalLevel; + for ($i=sizeof($leafNodes) - 1; $i>=0; $i--) { + $visited =& $leafNodes[$i]->getMetadata('topological-sort-visited'); + $visited = true; + $leafNodes[$i]->setMetadata('topological-sort-visited', $visited); + $leafNodes[$i]->setMetadata('topological-sort-level', $refGenerator[sizeof($refGenerator) - 1]); + } + $topologicalLevel++; + } while (sizeof($leafNodes) > 0); + + // Cleanup visited marks + foreach($nodeKeys as $key) $nodes[$key]->unsetMetadata('topological-sort-visited'); + } + /* }}} */ + + /* sort {{{ */ + /** + * + * sort returns the graph's nodes, sorted by topological order. + * + * The result is an array with + * as many entries as topological levels. Each entry in this array is an array of nodes within + * the given topological level. + * + * @return array The graph's nodes, sorted by topological order. + * @access public + */ + function sort(&$graph) { + // We only sort graphs + if (!is_a($graph, 'Structures_Graph')) return Pear::raiseError('Structures_Graph_Manipulator_TopologicalSorter::sort received an object that is not a Structures_Graph', STRUCTURES_GRAPH_ERROR_GENERIC); + if (!Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph)) return Pear::raiseError('Structures_Graph_Manipulator_TopologicalSorter::sort received an graph that has cycles', STRUCTURES_GRAPH_ERROR_GENERIC); + + Structures_Graph_Manipulator_TopologicalSorter::_sort($graph); + $result = array(); + + // Fill out result array + $nodes =& $graph->getNodes(); + $nodeKeys = array_keys($nodes); + foreach($nodeKeys as $key) { + if (!array_key_exists($nodes[$key]->getMetadata('topological-sort-level'), $result)) $result[$nodes[$key]->getMetadata('topological-sort-level')] = array(); + $result[$nodes[$key]->getMetadata('topological-sort-level')][] =& $nodes[$key]; + $nodes[$key]->unsetMetadata('topological-sort-level'); + } + + return $result; + } + /* }}} */ +} +/* }}} */ +?> diff --git a/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Node.php b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Node.php new file mode 100644 index 0000000000000000000000000000000000000000..95afa2b12f97fb4b3d7baf557ac4ae55ae766e58 --- /dev/null +++ b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Node.php @@ -0,0 +1,342 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */ +// +-----------------------------------------------------------------------------+ +// | Copyright (c) 2003 Sérgio Gonçalves Carvalho | +// +-----------------------------------------------------------------------------+ +// | This file is part of Structures_Graph. | +// | | +// | Structures_Graph is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU Lesser General Public License as published by | +// | the Free Software Foundation; either version 2.1 of the License, or | +// | (at your option) any later version. | +// | | +// | Structures_Graph is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU Lesser General Public License for more details. | +// | | +// | You should have received a copy of the GNU Lesser General Public License | +// | along with Structures_Graph; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | +// | 02111-1307 USA | +// +-----------------------------------------------------------------------------+ +// | Author: Sérgio Carvalho <sergio.carvalho@portugalmail.com> | +// +-----------------------------------------------------------------------------+ +// +/** + * This file contains the definition of the Structures_Graph_Node class + * + * @see Structures_Graph_Node + * @package Structures_Graph + */ + +/* dependencies {{{ */ +/** */ +require_once 'PEAR.php'; +/** */ +require_once 'Structures/Graph.php'; +/* }}} */ + +/* class Structures_Graph_Node {{{ */ +/** + * The Structures_Graph_Node class represents a Node that can be member of a + * graph node set. + * + * A graph node can contain data. Under this API, the node contains default data, + * and key index data. It behaves, thus, both as a regular data node, and as a + * dictionary (or associative array) node. + * + * Regular data is accessed via getData and setData. Key indexed data is accessed + * via getMetadata and setMetadata. + * + * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com> + * @copyright (c) 2004 by Sérgio Carvalho + * @package Structures_Graph + */ +/* }}} */ +class Structures_Graph_Node { + /* fields {{{ */ + /** + * @access private + */ + var $_data = null; + /** @access private */ + var $_metadata = array(); + /** @access private */ + var $_arcs = array(); + /** @access private */ + var $_graph = null; + /* }}} */ + + /* Constructor {{{ */ + /** + * + * Constructor + * + * @access public + */ + function Structures_Graph_Node() { + } + /* }}} */ + + /* getGraph {{{ */ + /** + * + * Node graph getter + * + * @return Structures_Graph Graph where node is stored + * @access public + */ + function &getGraph() { + return $this->_graph; + } + /* }}} */ + + /* setGraph {{{ */ + /** + * + * Node graph setter. This method should not be called directly. Use Graph::addNode instead. + * + * @param Structures_Graph Set the graph for this node. + * @see Structures_Graph::addNode() + * @access public + */ + function setGraph(&$graph) { + $this->_graph =& $graph; + } + /* }}} */ + + /* getData {{{ */ + /** + * + * Node data getter. + * + * Each graph node can contain a reference to one variable. This is the getter for that reference. + * + * @return mixed Data stored in node + * @access public + */ + function &getData() { + return $this->_data; + } + /* }}} */ + + /* setData {{{ */ + /** + * + * Node data setter + * + * Each graph node can contain a reference to one variable. This is the setter for that reference. + * + * @return mixed Data to store in node + * @access public + */ + function setData($data) { + $this->_data =& $data; + } + /* }}} */ + + /* metadataKeyExists {{{ */ + /** + * + * Test for existence of metadata under a given key. + * + * Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an + * associative array or in a dictionary. This method tests whether a given metadata key exists for this node. + * + * @param string Key to test + * @return boolean + * @access public + */ + function metadataKeyExists($key) { + return array_key_exists($key, $this->_metadata); + } + /* }}} */ + + /* getMetadata {{{ */ + /** + * + * Node metadata getter + * + * Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an + * associative array or in a dictionary. This method gets the data under the given key. If the key does + * not exist, an error will be thrown, so testing using metadataKeyExists might be needed. + * + * @param string Key + * @param boolean nullIfNonexistent (defaults to false). + * @return mixed Metadata Data stored in node under given key + * @see metadataKeyExists + * @access public + */ + function &getMetadata($key, $nullIfNonexistent = false) { + if (array_key_exists($key, $this->_metadata)) { + return $this->_metadata[$key]; + } else { + if ($nullIfNonexistent) { + $a = null; + return $a; + } else { + $a = Pear::raiseError('Structures_Graph_Node::getMetadata: Requested key does not exist', STRUCTURES_GRAPH_ERROR_GENERIC); + return $a; + } + } + } + /* }}} */ + + /* unsetMetadata {{{ */ + /** + * + * Delete metadata by key + * + * Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an + * associative array or in a dictionary. This method removes any data that might be stored under the provided key. + * If the key does not exist, no error is thrown, so it is safe using this method without testing for key existence. + * + * @param string Key + * @access public + */ + function unsetMetadata($key) { + if (array_key_exists($key, $this->_metadata)) unset($this->_metadata[$key]); + } + /* }}} */ + + /* setMetadata {{{ */ + /** + * + * Node metadata setter + * + * Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an + * associative array or in a dictionary. This method stores data under the given key. If the key already exists, + * previously stored data is discarded. + * + * @param string Key + * @param mixed Data + * @access public + */ + function setMetadata($key, $data) { + $this->_metadata[$key] =& $data; + } + /* }}} */ + + /* _connectTo {{{ */ + /** @access private */ + function _connectTo(&$destinationNode) { + $this->_arcs[] =& $destinationNode; + } + /* }}} */ + + /* connectTo {{{ */ + /** + * + * Connect this node to another one. + * + * If the graph is not directed, the reverse arc, connecting $destinationNode to $this is also created. + * + * @param Structures_Graph_Node Node to connect to + * @access public + */ + function connectTo(&$destinationNode) { + // We only connect to nodes + if (!is_a($destinationNode, 'Structures_Graph_Node')) return Pear::raiseError('Structures_Graph_Node::connectTo received an object that is not a Structures_Graph_Node', STRUCTURES_GRAPH_ERROR_GENERIC); + // Nodes must already be in graphs to be connected + if ($this->_graph == null) return Pear::raiseError('Structures_Graph_Node::connectTo Tried to connect a node that is not in a graph', STRUCTURES_GRAPH_ERROR_GENERIC); + if ($destinationNode->getGraph() == null) return Pear::raiseError('Structures_Graph_Node::connectTo Tried to connect to a node that is not in a graph', STRUCTURES_GRAPH_ERROR_GENERIC); + // Connect here + $this->_connectTo($destinationNode); + // If graph is undirected, connect back + if (!$this->_graph->isDirected()) { + $destinationNode->_connectTo($this); + } + } + /* }}} */ + + /* getNeighbours {{{ */ + /** + * + * Return nodes connected to this one. + * + * @return array Array of nodes + * @access public + */ + function getNeighbours() { + return $this->_arcs; + } + /* }}} */ + + /* connectsTo {{{ */ + /** + * + * Test wether this node has an arc to the target node + * + * @return boolean True if the two nodes are connected + * @access public + */ + function connectsTo(&$target) { + if (version_compare(PHP_VERSION, '5.0.0') >= 0) { + return in_array($target, $this->getNeighbours(), true); + } + + $copy = $target; + $arcKeys = array_keys($this->_arcs); + foreach($arcKeys as $key) { + /* ZE1 chokes on this expression: + if ($target === $arc) return true; + so, we'll use more convoluted stuff + */ + $arc =& $this->_arcs[$key]; + $target = true; + if ($arc === true) { + $target = false; + if ($arc === false) { + $target = $copy; + return true; + } + } + } + $target = $copy; + return false; + } + /* }}} */ + + /* inDegree {{{ */ + /** + * + * Calculate the in degree of the node. + * + * The indegree for a node is the number of arcs entering the node. For non directed graphs, + * the indegree is equal to the outdegree. + * + * @return integer In degree of the node + * @access public + */ + function inDegree() { + if ($this->_graph == null) return 0; + if (!$this->_graph->isDirected()) return $this->outDegree(); + $result = 0; + $graphNodes =& $this->_graph->getNodes(); + foreach (array_keys($graphNodes) as $key) { + if ($graphNodes[$key]->connectsTo($this)) $result++; + } + return $result; + + } + /* }}} */ + + /* outDegree {{{ */ + /** + * + * Calculate the out degree of the node. + * + * The outdegree for a node is the number of arcs exiting the node. For non directed graphs, + * the outdegree is always equal to the indegree. + * + * @return integer Out degree of the node + * @access public + */ + function outDegree() { + if ($this->_graph == null) return 0; + return sizeof($this->_arcs); + } + /* }}} */ +} +?> diff --git a/vendor/pear-pear.php.net/Structures_Graph/data/Structures_Graph/LICENSE b/vendor/pear-pear.php.net/Structures_Graph/data/Structures_Graph/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b1e3f5a2638797271cbc9b91b856c05ed6942c8f --- /dev/null +++ b/vendor/pear-pear.php.net/Structures_Graph/data/Structures_Graph/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/vendor/Structures/LinkedList/Double.php b/vendor/pear-pear.php.net/Structures_LinkedList/Structures/LinkedList/Double.php similarity index 100% rename from vendor/Structures/LinkedList/Double.php rename to vendor/pear-pear.php.net/Structures_LinkedList/Structures/LinkedList/Double.php diff --git a/vendor/Structures/LinkedList/Single.php b/vendor/pear-pear.php.net/Structures_LinkedList/Structures/LinkedList/Single.php similarity index 100% rename from vendor/Structures/LinkedList/Single.php rename to vendor/pear-pear.php.net/Structures_LinkedList/Structures/LinkedList/Single.php diff --git a/vendor/pear-pear.php.net/Validate/Validate.php b/vendor/pear-pear.php.net/Validate/Validate.php new file mode 100644 index 0000000000000000000000000000000000000000..a8f621cdf521076b69bb259c7e194d9a2398c55a --- /dev/null +++ b/vendor/pear-pear.php.net/Validate/Validate.php @@ -0,0 +1,1149 @@ +<?php +/** + * Validation class + * + * Copyright (c) 1997-2006 Pierre-Alain Joye,Tomas V.V.Cox, Amir Saied + * + * This source file is subject to the New BSD license, That is bundled + * with this package in the file LICENSE, and is available through + * the world-wide-web at + * http://www.opensource.org/licenses/bsd-license.php + * If you did not receive a copy of the new BSDlicense and are unable + * to obtain it through the world-wide-web, please send a note to + * pajoye@php.net so we can mail you a copy immediately. + * + * Author: Tomas V.V.Cox <cox@idecnet.com> + * Pierre-Alain Joye <pajoye@php.net> + * Amir Mohammad Saied <amir@php.net> + * + * + * Package to validate various datas. It includes : + * - numbers (min/max, decimal or not) + * - email (syntax, domain check) + * - string (predifined type alpha upper and/or lowercase, numeric,...) + * - date (min, max, rfc822 compliant) + * - uri (RFC2396) + * - possibility valid multiple data with a single method call (::multiple) + * + * @category Validate + * @package Validate + * @author Tomas V.V.Cox <cox@idecnet.com> + * @author Pierre-Alain Joye <pajoye@php.net> + * @author Amir Mohammad Saied <amir@php.net> + * @copyright 1997-2006 Pierre-Alain Joye,Tomas V.V.Cox,Amir Mohammad Saied + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id$ + * @link http://pear.php.net/package/Validate + */ + +// {{{ Constants +/** + * Methods for common data validations + */ +define('VALIDATE_NUM', '0-9'); +define('VALIDATE_SPACE', '\s'); +define('VALIDATE_ALPHA_LOWER', 'a-z'); +define('VALIDATE_ALPHA_UPPER', 'A-Z'); +define('VALIDATE_ALPHA', VALIDATE_ALPHA_LOWER . VALIDATE_ALPHA_UPPER); +define('VALIDATE_EALPHA_LOWER', VALIDATE_ALPHA_LOWER . 'áéÃóúýà èìòùäëïöüÿâêîôûãñõ¨åæç½ðøþß'); +define('VALIDATE_EALPHA_UPPER', VALIDATE_ALPHA_UPPER . 'ÃÉÃÓÚÃÀÈÌÒÙÄËÃÖܾÂÊÎÔÛÃÑÕ¦ÅÆǼÃØÞ'); +define('VALIDATE_EALPHA', VALIDATE_EALPHA_LOWER . VALIDATE_EALPHA_UPPER); +define('VALIDATE_PUNCTUATION', VALIDATE_SPACE . '\.,;\:&"\'\?\!\(\)'); +define('VALIDATE_NAME', VALIDATE_EALPHA . VALIDATE_SPACE . "'" . '\-'); +define('VALIDATE_STREET', VALIDATE_NUM . VALIDATE_NAME . "/\\ºª\."); + +define('VALIDATE_ITLD_EMAILS', 1); +define('VALIDATE_GTLD_EMAILS', 2); +define('VALIDATE_CCTLD_EMAILS', 4); +define('VALIDATE_ALL_EMAILS', 8); +// }}} + +/** + * Validation class + * + * Package to validate various datas. It includes : + * - numbers (min/max, decimal or not) + * - email (syntax, domain check) + * - string (predifined type alpha upper and/or lowercase, numeric,...) + * - date (min, max) + * - uri (RFC2396) + * - possibility valid multiple data with a single method call (::multiple) + * + * @category Validate + * @package Validate + * @author Tomas V.V.Cox <cox@idecnet.com> + * @author Pierre-Alain Joye <pajoye@php.net> + * @author Amir Mohammad Saied <amir@php.net> + * @copyright 1997-2006 Pierre-Alain Joye,Tomas V.V.Cox,Amir Mohammad Saied + * @license http://www.opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/Validate + */ +class Validate +{ + // {{{ International, Generic and Country code TLDs + /** + * International Top-Level Domain + * + * This is an array of the known international + * top-level domain names. + * + * @access protected + * @var array $_iTld (International top-level domains) + */ + var $_itld = array( + 'arpa', + 'root', + ); + + /** + * Generic top-level domain + * + * This is an array of the official + * generic top-level domains. + * + * @access protected + * @var array $_gTld (Generic top-level domains) + */ + var $_gtld = array( + 'aero', + 'biz', + 'cat', + 'com', + 'coop', + 'edu', + 'gov', + 'info', + 'int', + 'jobs', + 'mil', + 'mobi', + 'museum', + 'name', + 'net', + 'org', + 'pro', + 'travel', + 'asia', + 'post', + 'tel', + 'geo', + ); + + /** + * Country code top-level domains + * + * This is an array of the official country + * codes top-level domains + * + * @access protected + * @var array $_ccTld (Country Code Top-Level Domain) + */ + var $_cctld = array( + 'ac', + 'ad','ae','af','ag', + 'ai','al','am','an', + 'ao','aq','ar','as', + 'at','au','aw','ax', + 'az','ba','bb','bd', + 'be','bf','bg','bh', + 'bi','bj','bm','bn', + 'bo','br','bs','bt', + 'bu','bv','bw','by', + 'bz','ca','cc','cd', + 'cf','cg','ch','ci', + 'ck','cl','cm','cn', + 'co','cr','cs','cu', + 'cv','cx','cy','cz', + 'de','dj','dk','dm', + 'do','dz','ec','ee', + 'eg','eh','er','es', + 'et','eu','fi','fj', + 'fk','fm','fo','fr', + 'ga','gb','gd','ge', + 'gf','gg','gh','gi', + 'gl','gm','gn','gp', + 'gq','gr','gs','gt', + 'gu','gw','gy','hk', + 'hm','hn','hr','ht', + 'hu','id','ie','il', + 'im','in','io','iq', + 'ir','is','it','je', + 'jm','jo','jp','ke', + 'kg','kh','ki','km', + 'kn','kp','kr','kw', + 'ky','kz','la','lb', + 'lc','li','lk','lr', + 'ls','lt','lu','lv', + 'ly','ma','mc','md', + 'me','mg','mh','mk', + 'ml','mm','mn','mo', + 'mp','mq','mr','ms', + 'mt','mu','mv','mw', + 'mx','my','mz','na', + 'nc','ne','nf','ng', + 'ni','nl','no','np', + 'nr','nu','nz','om', + 'pa','pe','pf','pg', + 'ph','pk','pl','pm', + 'pn','pr','ps','pt', + 'pw','py','qa','re', + 'ro','rs','ru','rw', + 'sa','sb','sc','sd', + 'se','sg','sh','si', + 'sj','sk','sl','sm', + 'sn','so','sr','st', + 'su','sv','sy','sz', + 'tc','td','tf','tg', + 'th','tj','tk','tl', + 'tm','tn','to','tp', + 'tr','tt','tv','tw', + 'tz','ua','ug','uk', + 'us','uy','uz','va', + 'vc','ve','vg','vi', + 'vn','vu','wf','ws', + 'ye','yt','yu','za', + 'zm','zw', + ); + // }}} + + /** + * Validate a tag URI (RFC4151) + * + * @param string $uri tag URI to validate + * + * @return boolean true if valid tag URI, false if not + * + * @access private + */ + function __uriRFC4151($uri) + { + $datevalid = false; + if (preg_match( + '/^tag:(?<name>.*),(?<date>\d{4}-?\d{0,2}-?\d{0,2}):(?<specific>.*)(.*:)*$/', $uri, $matches)) { + $date = $matches['date']; + $date6 = strtotime($date); + if ((strlen($date) == 4) && $date <= date('Y')) { + $datevalid = true; + } elseif ((strlen($date) == 7) && ($date6 < strtotime("now"))) { + $datevalid = true; + } elseif ((strlen($date) == 10) && ($date6 < strtotime("now"))) { + $datevalid = true; + } + if (self::email($matches['name'])) { + $namevalid = true; + } else { + $namevalid = self::email('info@' . $matches['name']); + } + return $datevalid && $namevalid; + } else { + return false; + } + } + + /** + * Validate a number + * + * @param string $number Number to validate + * @param array $options array where: + * 'decimal' is the decimal char or false when decimal + * not allowed. + * i.e. ',.' to allow both ',' and '.' + * 'dec_prec' Number of allowed decimals + * 'min' minimum value + * 'max' maximum value + * + * @return boolean true if valid number, false if not + * + * @access public + */ + function number($number, $options = array()) + { + $decimal = $dec_prec = $min = $max = null; + if (is_array($options)) { + extract($options); + } + + $dec_prec = $dec_prec ? "{1,$dec_prec}" : '+'; + $dec_regex = $decimal ? "[$decimal][0-9]$dec_prec" : ''; + + if (!preg_match("|^[-+]?\s*[0-9]+($dec_regex)?\$|", $number)) { + return false; + } + + if ($decimal != '.') { + $number = strtr($number, $decimal, '.'); + } + + $number = (float)str_replace(' ', '', $number); + if ($min !== null && $min > $number) { + return false; + } + + if ($max !== null && $max < $number) { + return false; + } + return true; + } + + /** + * Converting a string to UTF-7 (RFC 2152) + * + * @param string $string string to be converted + * + * @return string converted string + * + * @access private + */ + function __stringToUtf7($string) + { + $return = ''; + $utf7 = array( + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', + 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', + 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', + 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', + '3', '4', '5', '6', '7', '8', '9', '+', ',' + ); + + + $state = 0; + + if (!empty($string)) { + $i = 0; + while ($i <= strlen($string)) { + $char = substr($string, $i, 1); + if ($state == 0) { + if ((ord($char) >= 0x7F) || (ord($char) <= 0x1F)) { + if ($char) { + $return .= '&'; + } + $state = 1; + } elseif ($char == '&') { + $return .= '&-'; + } else { + $return .= $char; + } + } elseif (($i == strlen($string) || + !((ord($char) >= 0x7F)) || (ord($char) <= 0x1F))) { + if ($state != 1) { + if (ord($char) > 64) { + $return .= ''; + } else { + $return .= $utf7[ord($char)]; + } + } + $return .= '-'; + $state = 0; + } else { + switch($state) { + case 1: + $return .= $utf7[ord($char) >> 2]; + $residue = (ord($char) & 0x03) << 4; + $state = 2; + break; + case 2: + $return .= $utf7[$residue | (ord($char) >> 4)]; + $residue = (ord($char) & 0x0F) << 2; + $state = 3; + break; + case 3: + $return .= $utf7[$residue | (ord($char) >> 6)]; + $return .= $utf7[ord($char) & 0x3F]; + $state = 1; + break; + } + } + $i++; + } + return $return; + } + return ''; + } + + /** + * Validate an email according to full RFC822 (inclusive human readable part) + * + * @param string $email email to validate, + * will return the address for optional dns validation + * @param array $options email() options + * + * @return boolean true if valid email, false if not + * + * @access private + */ + function __emailRFC822(&$email, &$options) + { + static $address = null; + static $uncomment = null; + if (!$address) { + // atom = 1*<any CHAR except specials, SPACE and CTLs> + $atom = '[^][()<>@,;:\\".\s\000-\037\177-\377]+\s*'; + // qtext = <any CHAR excepting <">, ; => may be folded + // "\" & CR, and including linear-white-space> + $qtext = '[^"\\\\\r]'; + // quoted-pair = "\" CHAR ; may quote any char + $quoted_pair = '\\\\.'; + // quoted-string = <"> *(qtext/quoted-pair) <">; Regular qtext or + // ; quoted chars. + $quoted_string = '"(?:' . $qtext . '|' . $quoted_pair . ')*"\s*'; + // word = atom / quoted-string + $word = '(?:' . $atom . '|' . $quoted_string . ')'; + // local-part = word *("." word) ; uninterpreted + // ; case-preserved + $local_part = $word . '(?:\.\s*' . $word . ')*'; + // dtext = <any CHAR excluding "[", ; => may be folded + // "]", "\" & CR, & including linear-white-space> + $dtext = '[^][\\\\\r]'; + // domain-literal = "[" *(dtext / quoted-pair) "]" + $domain_literal = '\[(?:' . $dtext . '|' . $quoted_pair . ')*\]\s*'; + // sub-domain = domain-ref / domain-literal + // domain-ref = atom ; symbolic reference + $sub_domain = '(?:' . $atom . '|' . $domain_literal . ')'; + // domain = sub-domain *("." sub-domain) + $domain = $sub_domain . '(?:\.\s*' . $sub_domain . ')*'; + // addr-spec = local-part "@" domain ; global address + $addr_spec = $local_part . '@\s*' . $domain; + // route = 1#("@" domain) ":" ; path-relative + $route = '@' . $domain . '(?:,@\s*' . $domain . ')*:\s*'; + // route-addr = "<" [route] addr-spec ">" + $route_addr = '<\s*(?:' . $route . ')?' . $addr_spec . '>\s*'; + // phrase = 1*word ; Sequence of words + $phrase = $word . '+'; + // mailbox = addr-spec ; simple address + // / phrase route-addr ; name & addr-spec + $mailbox = '(?:' . $addr_spec . '|' . $phrase . $route_addr . ')'; + // group = phrase ":" [#mailbox] ";" + $group = $phrase . ':\s*(?:' . $mailbox . '(?:,\s*' . $mailbox . ')*)?;\s*'; + // address = mailbox ; one addressee + // / group ; named list + $address = '/^\s*(?:' . $mailbox . '|' . $group . ')$/'; + + $uncomment = + '/((?:(?:\\\\"|[^("])*(?:' . $quoted_string . + ')?)*)((?<!\\\\)\((?:(?2)|.)*?(?<!\\\\)\))/'; + } + // strip comments + $email = preg_replace($uncomment, '$1 ', $email); + return preg_match($address, $email); + } + + /** + * Full TLD Validation function + * + * This function is used to make a much more proficient validation + * against all types of official domain names. + * + * @param string $email The email address to check. + * @param array $options The options for validation + * + * @access protected + * + * @return bool True if validating succeeds + */ + function _fullTLDValidation($email, $options) + { + $validate = array(); + if(!empty($options["VALIDATE_ITLD_EMAILS"])) array_push($validate, 'itld'); + if(!empty($options["VALIDATE_GTLD_EMAILS"])) array_push($validate, 'gtld'); + if(!empty($options["VALIDATE_CCTLD_EMAILS"])) array_push($validate, 'cctld'); + + if (count($validate) === 0) { + array_push($validate, 'itld', 'gtld', 'cctld'); + } + + $self = new Validate; + + $toValidate = array(); + + foreach ($validate as $valid) { + $tmpVar = '_' . (string)$valid; + + $toValidate[$valid] = $self->{$tmpVar}; + } + + $e = $self->executeFullEmailValidation($email, $toValidate); + + return $e; + } + + /** + * Execute the validation + * + * This function will execute the full email vs tld + * validation using an array of tlds passed to it. + * + * @param string $email The email to validate. + * @param array $arrayOfTLDs The array of the TLDs to validate + * + * @access public + * + * @return true or false (Depending on if it validates or if it does not) + */ + function executeFullEmailValidation($email, $arrayOfTLDs) + { + $emailEnding = explode('.', $email); + $emailEnding = $emailEnding[count($emailEnding)-1]; + foreach ($arrayOfTLDs as $validator => $keys) { + if (in_array($emailEnding, $keys)) { + return true; + } + } + return false; + } + + /** + * Validate an email + * + * @param string $email email to validate + * @param mixed boolean (BC) $check_domain Check or not if the domain exists + * array $options associative array of options + * 'check_domain' boolean Check or not if the domain exists + * 'use_rfc822' boolean Apply the full RFC822 grammar + * + * Ex. + * $options = array( + * 'check_domain' => 'true', + * 'fullTLDValidation' => 'true', + * 'use_rfc822' => 'true', + * 'VALIDATE_GTLD_EMAILS' => 'true', + * 'VALIDATE_CCTLD_EMAILS' => 'true', + * 'VALIDATE_ITLD_EMAILS' => 'true', + * ); + * + * @return boolean true if valid email, false if not + * + * @access public + */ + function email($email, $options = null) + { + $check_domain = false; + $use_rfc822 = false; + if (is_bool($options)) { + $check_domain = $options; + } elseif (is_array($options)) { + extract($options); + } + + /** + * Check for IDN usage so we can encode the domain as Punycode + * before continuing. + */ + $hasIDNA = false; + + if (Validate::_includePathFileExists('Net/IDNA.php')) { + include_once('Net/IDNA.php'); + $hasIDNA = true; + } + + if ($hasIDNA === true) { + if (strpos($email, '@') !== false) { + $tmpEmail = explode('@', $email); + $domain = array_pop($tmpEmail); + + // Check if the domain contains characters > 127 which means + // it's an idn domain name. + $chars = count_chars($domain, 1); + if (!empty($chars) && max(array_keys($chars)) > 127) { + $idna =& Net_IDNA::singleton(); + $domain = $idna->encode($domain); + } + + array_push($tmpEmail, $domain); + $email = implode('@', $tmpEmail); + } + } + + /** + * @todo Fix bug here.. even if it passes this, it won't be passing + * The regular expression below + */ + if (isset($fullTLDValidation)) { + //$valid = Validate::_fullTLDValidation($email, $fullTLDValidation); + $valid = Validate::_fullTLDValidation($email, $options); + + if (!$valid) { + return false; + } + } + + // the base regexp for address + $regex = '&^(?: # recipient: + ("\s*(?:[^"\f\n\r\t\v\b\s]+\s*)+")| #1 quoted name + ([-\w!\#\$%\&\'*+~/^`|{}]+(?:\.[-\w!\#\$%\&\'*+~/^`|{}]+)*)) #2 OR dot-atom + @(((\[)? #3 domain, 4 as IPv4, 5 optionally bracketed + (?:(?:(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:[0-1]?[0-9]?[0-9]))\.){3} + (?:(?:25[0-5])|(?:2[0-4][0-9])|(?:[0-1]?[0-9]?[0-9]))))(?(5)\])| + ((?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)*[a-z0-9](?:[-a-z0-9]*[a-z0-9])?) #6 domain as hostname + \.((?:([^- ])[-a-z]*[-a-z]))) #7 TLD + $&xi'; + + //checks if exists the domain (MX or A) + if ($use_rfc822? Validate::__emailRFC822($email, $options) : + preg_match($regex, $email)) { + if ($check_domain && function_exists('checkdnsrr')) { + $domain = preg_replace('/[^-a-z.0-9]/i', '', array_pop(explode('@', $email))); + if (checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A')) { + return true; + } + return false; + } + return true; + } + return false; + } + + /** + * Validate a string using the given format 'format' + * + * @param string $string String to validate + * @param array $options Options array where: + * 'format' is the format of the string + * Ex:VALIDATE_NUM . VALIDATE_ALPHA (see constants) + * 'min_length' minimum length + * 'max_length' maximum length + * + * @return boolean true if valid string, false if not + * + * @access public + */ + function string($string, $options) + { + $format = null; + $min_length = 0; + $max_length = 0; + + if (is_array($options)) { + extract($options); + } + + if ($format && !preg_match("|^[$format]*\$|s", $string)) { + return false; + } + + if ($min_length && strlen($string) < $min_length) { + return false; + } + + if ($max_length && strlen($string) > $max_length) { + return false; + } + + return true; + } + + /** + * Validate an URI (RFC2396) + * This function will validate 'foobarstring' by default, to get it to validate + * only http, https, ftp and such you have to pass it in the allowed_schemes + * option, like this: + * <code> + * $options = array('allowed_schemes' => array('http', 'https', 'ftp')) + * var_dump(Validate::uri('http://www.example.org', $options)); + * </code> + * + * NOTE 1: The rfc2396 normally allows middle '-' in the top domain + * e.g. http://example.co-m should be valid + * However, as '-' is not used in any known TLD, it is invalid + * NOTE 2: As double shlashes // are allowed in the path part, only full URIs + * including an authority can be valid, no relative URIs + * the // are mandatory (optionally preceeded by the 'sheme:' ) + * NOTE 3: the full complience to rfc2396 is not achieved by default + * the characters ';/?:@$,' will not be accepted in the query part + * if not urlencoded, refer to the option "strict'" + * + * @param string $url URI to validate + * @param array $options Options used by the validation method. + * key => type + * 'domain_check' => boolean + * Whether to check the DNS entry or not + * 'allowed_schemes' => array, list of protocols + * List of allowed schemes ('http', + * 'ssh+svn', 'mms') + * 'strict' => string the refused chars + * in query and fragment parts + * default: ';/?:@$,' + * empty: accept all rfc2396 foreseen chars + * + * @return boolean true if valid uri, false if not + * + * @access public + */ + function uri($url, $options = null) + { + $strict = ';/?:@$,'; + $domain_check = false; + $allowed_schemes = null; + if (is_array($options)) { + extract($options); + } + if (is_array($allowed_schemes) && + in_array("tag", $allowed_schemes) + ) { + if (strpos($url, "tag:") === 0) { + return self::__uriRFC4151($url); + } + } + + if (preg_match( + '&^(?:([a-z][-+.a-z0-9]*):)? # 1. scheme + (?:// # authority start + (?:((?:%[0-9a-f]{2}|[-a-z0-9_.!~*\'();:\&=+$,])*)@)? # 2. authority-userinfo + (?:((?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)*[a-z](?:[a-z0-9]+)?\.?) # 3. authority-hostname OR + |([0-9]{1,3}(?:\.[0-9]{1,3}){3})) # 4. authority-ipv4 + (?::([0-9]*))?) # 5. authority-port + ((?:/(?:%[0-9a-f]{2}|[-a-z0-9_.!~*\'():@\&=+$,;])*)*/?)? # 6. path + (?:\?([^#]*))? # 7. query + (?:\#((?:%[0-9a-f]{2}|[-a-z0-9_.!~*\'();/?:@\&=+$,])*))? # 8. fragment + $&xi', $url, $matches)) { + $scheme = isset($matches[1]) ? $matches[1] : ''; + $authority = isset($matches[3]) ? $matches[3] : '' ; + if (is_array($allowed_schemes) && + !in_array($scheme, $allowed_schemes) + ) { + return false; + } + if (!empty($matches[4])) { + $parts = explode('.', $matches[4]); + foreach ($parts as $part) { + if ($part > 255) { + return false; + } + } + } elseif ($domain_check && function_exists('checkdnsrr')) { + if (!checkdnsrr($authority, 'A')) { + return false; + } + } + if ($strict) { + $strict = '#[' . preg_quote($strict, '#') . ']#'; + if ((!empty($matches[7]) && preg_match($strict, $matches[7])) + || (!empty($matches[8]) && preg_match($strict, $matches[8]))) { + return false; + } + } + return true; + } + return false; + } + + /** + * Validate date and times. Note that this method need the Date_Calc class + * + * @param string $date Date to validate + * @param array $options array options where : + * 'format' The format of the date (%d-%m-%Y) + * or rfc822_compliant + * 'min' The date has to be greater + * than this array($day, $month, $year) + * or PEAR::Date object + * 'max' The date has to be smaller than + * this array($day, $month, $year) + * or PEAR::Date object + * + * @return boolean true if valid date/time, false if not + * + * @access public + */ + function date($date, $options) + { + $max = false; + $min = false; + $format = ''; + + if (is_array($options)) { + extract($options); + } + + if (strtolower($format) == 'rfc822_compliant') { + $preg = '&^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),) \s+ + (?:(\d{2})?) \s+ + (?:(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)?) \s+ + (?:(\d{2}(\d{2})?)?) \s+ + (?:(\d{2}?)):(?:(\d{2}?))(:(?:(\d{2}?)))? \s+ + (?:[+-]\d{4}|UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|[A-IK-Za-ik-z])$&xi'; + + if (!preg_match($preg, $date, $matches)) { + return false; + } + + $year = (int)$matches[4]; + $months = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); + $month = array_keys($months, $matches[3]); + $month = (int)$month[0]+1; + $day = (int)$matches[2]; + $weekday = $matches[1]; + $hour = (int)$matches[6]; + $minute = (int)$matches[7]; + isset($matches[9]) ? $second = (int)$matches[9] : $second = 0; + + if ((strlen($year) != 4) || + ($day > 31 || $day < 1)|| + ($hour > 23) || + ($minute > 59) || + ($second > 59)) { + return false; + } + } else { + $date_len = strlen($format); + for ($i = 0; $i < $date_len; $i++) { + $c = $format{$i}; + if ($c == '%') { + $next = $format{$i + 1}; + switch ($next) { + case 'j': + case 'd': + if ($next == 'j') { + $day = (int)Validate::_substr($date, 1, 2); + } else { + $day = (int)Validate::_substr($date, 0, 2); + } + if ($day < 1 || $day > 31) { + return false; + } + break; + case 'm': + case 'n': + if ($next == 'm') { + $month = (int)Validate::_substr($date, 0, 2); + } else { + $month = (int)Validate::_substr($date, 1, 2); + } + if ($month < 1 || $month > 12) { + return false; + } + break; + case 'Y': + case 'y': + if ($next == 'Y') { + $year = Validate::_substr($date, 4); + $year = (int)$year?$year:''; + } else { + $year = (int)(substr(date('Y'), 0, 2) . + Validate::_substr($date, 2)); + } + if (strlen($year) != 4 || $year < 0 || $year > 9999) { + return false; + } + break; + case 'g': + case 'h': + if ($next == 'g') { + $hour = Validate::_substr($date, 1, 2); + } else { + $hour = Validate::_substr($date, 2); + } + if (!preg_match('/^\d+$/', $hour) || $hour < 0 || $hour > 12) { + return false; + } + break; + case 'G': + case 'H': + if ($next == 'G') { + $hour = Validate::_substr($date, 1, 2); + } else { + $hour = Validate::_substr($date, 2); + } + if (!preg_match('/^\d+$/', $hour) || $hour < 0 || $hour > 24) { + return false; + } + break; + case 's': + case 'i': + $t = Validate::_substr($date, 2); + if (!preg_match('/^\d+$/', $t) || $t < 0 || $t > 59) { + return false; + } + break; + default: + trigger_error("Not supported char `$next' after % in offset " . ($i+2), E_USER_WARNING); + } + $i++; + } else { + //literal + if (Validate::_substr($date, 1) != $c) { + return false; + } + } + } + } + // there is remaing data, we don't want it + if (strlen($date) && (strtolower($format) != 'rfc822_compliant')) { + return false; + } + + if (isset($day) && isset($month) && isset($year)) { + if (!checkdate($month, $day, $year)) { + return false; + } + + if (strtolower($format) == 'rfc822_compliant') { + if ($weekday != date("D", mktime(0, 0, 0, $month, $day, $year))) { + return false; + } + } + + if ($min) { + include_once 'Date/Calc.php'; + if (is_a($min, 'Date') && + (Date_Calc::compareDates($day, $month, $year, + $min->getDay(), $min->getMonth(), $min->getYear()) < 0) + ) { + return false; + } elseif (is_array($min) && + (Date_Calc::compareDates($day, $month, $year, + $min[0], $min[1], $min[2]) < 0) + ) { + return false; + } + } + + if ($max) { + include_once 'Date/Calc.php'; + if (is_a($max, 'Date') && + (Date_Calc::compareDates($day, $month, $year, + $max->getDay(), $max->getMonth(), $max->getYear()) > 0) + ) { + return false; + } elseif (is_array($max) && + (Date_Calc::compareDates($day, $month, $year, + $max[0], $max[1], $max[2]) > 0) + ) { + return false; + } + } + } + + return true; + } + + /** + * Substr + * + * @param string &$date Date + * @param string $num Length + * @param string $opt Unknown + * + * @access private + * @return string + */ + function _substr(&$date, $num, $opt = false) + { + if ($opt && strlen($date) >= $opt && preg_match('/^[0-9]{'.$opt.'}/', $date, $m)) { + $ret = $m[0]; + } else { + $ret = substr($date, 0, $num); + } + $date = substr($date, strlen($ret)); + return $ret; + } + + function _modf($val, $div) + { + if (function_exists('bcmod')) { + return bcmod($val, $div); + } elseif (function_exists('fmod')) { + return fmod($val, $div); + } + $r = $val / $div; + $i = intval($r); + return intval($val - $i * $div + .1); + } + + /** + * Calculates sum of product of number digits with weights + * + * @param string $number number string + * @param array $weights reference to array of weights + * + * @access protected + * + * @return int returns product of number digits with weights + */ + function _multWeights($number, &$weights) + { + if (!is_array($weights)) { + return -1; + } + $sum = 0; + + $count = min(count($weights), strlen($number)); + if ($count == 0) { // empty string or weights array + return -1; + } + for ($i = 0; $i < $count; ++$i) { + $sum += intval(substr($number, $i, 1)) * $weights[$i]; + } + + return $sum; + } + + /** + * Calculates control digit for a given number + * + * @param string $number number string + * @param array $weights reference to array of weights + * @param int $modulo (optionsl) number + * @param int $subtract (optional) number + * @param bool $allow_high (optional) true if function can return number higher than 10 + * + * @access protected + * + * @return int -1 calculated control number is returned + */ + function _getControlNumber($number, &$weights, $modulo = 10, $subtract = 0, $allow_high = false) + { + // calc sum + $sum = Validate::_multWeights($number, $weights); + if ($sum == -1) { + return -1; + } + $mod = Validate::_modf($sum, $modulo); // calculate control digit + + if ($subtract > $mod && $mod > 0) { + $mod = $subtract - $mod; + } + if ($allow_high === false) { + $mod %= 10; // change 10 to zero + } + return $mod; + } + + /** + * Validates a number + * + * @param string $number number to validate + * @param array $weights reference to array of weights + * @param int $modulo (optional) number + * @param int $subtract (optional) number + * + * @access protected + * + * @return bool true if valid, false if not + */ + function _checkControlNumber($number, &$weights, $modulo = 10, $subtract = 0) + { + if (strlen($number) < count($weights)) { + return false; + } + $target_digit = substr($number, count($weights), 1); + $control_digit = Validate::_getControlNumber($number, $weights, $modulo, $subtract, $modulo > 10); + + if ($control_digit == -1) { + return false; + } + if ($target_digit === 'X' && $control_digit == 10) { + return true; + } + if ($control_digit != $target_digit) { + return false; + } + return true; + } + + /** + * Bulk data validation for data introduced in the form of an + * assoc array in the form $var_name => $value. + * Can be used on any of Validate subpackages + * + * @param array $data Ex: array('name' => 'toto', 'email' => 'toto@thing.info'); + * @param array $val_type Contains the validation type and all parameters used in. + * 'val_type' is not optional + * others validations properties must have the same name as the function + * parameters. + * Ex: array('toto'=>array('type'=>'string','format'='toto@thing.info','min_length'=>5)); + * @param boolean $remove if set, the elements not listed in data will be removed + * + * @return array value name => true|false the value name comes from the data key + * + * @access public + */ + function multiple(&$data, &$val_type, $remove = false) + { + $keys = array_keys($data); + $valid = array(); + + foreach ($keys as $var_name) { + if (!isset($val_type[$var_name])) { + if ($remove) { + unset($data[$var_name]); + } + continue; + } + $opt = $val_type[$var_name]; + $methods = get_class_methods('Validate'); + $val2check = $data[$var_name]; + // core validation method + if (in_array(strtolower($opt['type']), $methods)) { + //$opt[$opt['type']] = $data[$var_name]; + $method = $opt['type']; + unset($opt['type']); + + if (sizeof($opt) == 1 && is_array(reset($opt))) { + $opt = array_pop($opt); + } + $valid[$var_name] = call_user_func(array('Validate', $method), $val2check, $opt); + + /** + * external validation method in the form: + * "<class name><underscore><method name>" + * Ex: us_ssn will include class Validate/US.php and call method ssn() + */ + } elseif (strpos($opt['type'], '_') !== false) { + $validateType = explode('_', $opt['type']); + $method = array_pop($validateType); + $class = implode('_', $validateType); + $classPath = str_replace('_', DIRECTORY_SEPARATOR, $class); + $class = 'Validate_' . $class; + if (Validate::_includePathFileExists("Validate/$classPath.php")) { + include_once "Validate/$classPath.php"; + } else { + trigger_error("$class isn't installed or you may have some permission issues", E_USER_ERROR); + } + + $ce = substr(phpversion(), 0, 1) > 4 ? + class_exists($class, false) : class_exists($class); + if (!$ce || + !in_array($method, get_class_methods($class)) + ) { + trigger_error("Invalid validation type $class::$method", + E_USER_WARNING); + continue; + } + unset($opt['type']); + if (sizeof($opt) == 1) { + $opt = array_pop($opt); + } + $valid[$var_name] = call_user_func(array($class, $method), + $data[$var_name], $opt); + } else { + trigger_error("Invalid validation type {$opt['type']}", + E_USER_WARNING); + } + } + return $valid; + } + + /** + * Determine whether specified file exists along the include path. + * + * @param string $filename file to search for + * + * @access private + * + * @return bool true if file exists + */ + function _includePathFileExists($filename) + { + $paths = explode(":", ini_get("include_path")); + $result = false; + + while ((!($result)) && (list($key,$val) = each($paths))) { + $result = file_exists($val . "/" . $filename); + } + return $result; + } +} + diff --git a/vendor/Validate/ISPN.php b/vendor/pear-pear.php.net/Validate_ISPN/Validate/ISPN.php similarity index 100% rename from vendor/Validate/ISPN.php rename to vendor/pear-pear.php.net/Validate_ISPN/Validate/ISPN.php diff --git a/vendor/pear-pear.php.net/XML_Util/XML/Util.php b/vendor/pear-pear.php.net/XML_Util/XML/Util.php new file mode 100644 index 0000000000000000000000000000000000000000..f5927b16cfd45bac188d11ac0a68a6fdaeeeac45 --- /dev/null +++ b/vendor/pear-pear.php.net/XML_Util/XML/Util.php @@ -0,0 +1,911 @@ +<?php + +/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ + +/** + * XML_Util + * + * XML Utilities package + * + * PHP versions 4 and 5 + * + * LICENSE: + * + * Copyright (c) 2003-2008 Stephan Schmidt <schst@php.net> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category XML + * @package XML_Util + * @author Stephan Schmidt <schst@php.net> + * @copyright 2003-2008 Stephan Schmidt <schst@php.net> + * @license http://opensource.org/licenses/bsd-license New BSD License + * @version CVS: $Id: Util.php,v 1.38 2008/11/13 00:03:38 ashnazg Exp $ + * @link http://pear.php.net/package/XML_Util + */ + +/** + * error code for invalid chars in XML name + */ +define('XML_UTIL_ERROR_INVALID_CHARS', 51); + +/** + * error code for invalid chars in XML name + */ +define('XML_UTIL_ERROR_INVALID_START', 52); + +/** + * error code for non-scalar tag content + */ +define('XML_UTIL_ERROR_NON_SCALAR_CONTENT', 60); + +/** + * error code for missing tag name + */ +define('XML_UTIL_ERROR_NO_TAG_NAME', 61); + +/** + * replace XML entities + */ +define('XML_UTIL_REPLACE_ENTITIES', 1); + +/** + * embedd content in a CData Section + */ +define('XML_UTIL_CDATA_SECTION', 5); + +/** + * do not replace entitites + */ +define('XML_UTIL_ENTITIES_NONE', 0); + +/** + * replace all XML entitites + * This setting will replace <, >, ", ' and & + */ +define('XML_UTIL_ENTITIES_XML', 1); + +/** + * replace only required XML entitites + * This setting will replace <, " and & + */ +define('XML_UTIL_ENTITIES_XML_REQUIRED', 2); + +/** + * replace HTML entitites + * @link http://www.php.net/htmlentities + */ +define('XML_UTIL_ENTITIES_HTML', 3); + +/** + * Collapse all empty tags. + */ +define('XML_UTIL_COLLAPSE_ALL', 1); + +/** + * Collapse only empty XHTML tags that have no end tag. + */ +define('XML_UTIL_COLLAPSE_XHTML_ONLY', 2); + +/** + * utility class for working with XML documents + * + + * @category XML + * @package XML_Util + * @author Stephan Schmidt <schst@php.net> + * @copyright 2003-2008 Stephan Schmidt <schst@php.net> + * @license http://opensource.org/licenses/bsd-license New BSD License + * @version Release: 1.2.1 + * @link http://pear.php.net/package/XML_Util + */ +class XML_Util +{ + /** + * return API version + * + * @return string $version API version + * @access public + * @static + */ + function apiVersion() + { + return '1.1'; + } + + /** + * replace XML entities + * + * With the optional second parameter, you may select, which + * entities should be replaced. + * + * <code> + * require_once 'XML/Util.php'; + * + * // replace XML entites: + * $string = XML_Util::replaceEntities('This string contains < & >.'); + * </code> + * + * With the optional third parameter, you may pass the character encoding + * <code> + * require_once 'XML/Util.php'; + * + * // replace XML entites in UTF-8: + * $string = XML_Util::replaceEntities( + * 'This string contains < & > as well as ä, ö, ß, à and ê', + * XML_UTIL_ENTITIES_HTML, + * 'UTF-8' + * ); + * </code> + * + * @param string $string string where XML special chars + * should be replaced + * @param int $replaceEntities setting for entities in attribute values + * (one of XML_UTIL_ENTITIES_XML, + * XML_UTIL_ENTITIES_XML_REQUIRED, + * XML_UTIL_ENTITIES_HTML) + * @param string $encoding encoding value (if any)... + * must be a valid encoding as determined + * by the htmlentities() function + * + * @return string string with replaced chars + * @access public + * @static + * @see reverseEntities() + */ + function replaceEntities($string, $replaceEntities = XML_UTIL_ENTITIES_XML, + $encoding = 'ISO-8859-1') + { + switch ($replaceEntities) { + case XML_UTIL_ENTITIES_XML: + return strtr($string, array( + '&' => '&', + '>' => '>', + '<' => '<', + '"' => '"', + '\'' => ''' )); + break; + case XML_UTIL_ENTITIES_XML_REQUIRED: + return strtr($string, array( + '&' => '&', + '<' => '<', + '"' => '"' )); + break; + case XML_UTIL_ENTITIES_HTML: + return htmlentities($string, ENT_COMPAT, $encoding); + break; + } + return $string; + } + + /** + * reverse XML entities + * + * With the optional second parameter, you may select, which + * entities should be reversed. + * + * <code> + * require_once 'XML/Util.php'; + * + * // reverse XML entites: + * $string = XML_Util::reverseEntities('This string contains < & >.'); + * </code> + * + * With the optional third parameter, you may pass the character encoding + * <code> + * require_once 'XML/Util.php'; + * + * // reverse XML entites in UTF-8: + * $string = XML_Util::reverseEntities( + * 'This string contains < & > as well as' + * . ' ä, ö, ß, à and ê', + * XML_UTIL_ENTITIES_HTML, + * 'UTF-8' + * ); + * </code> + * + * @param string $string string where XML special chars + * should be replaced + * @param int $replaceEntities setting for entities in attribute values + * (one of XML_UTIL_ENTITIES_XML, + * XML_UTIL_ENTITIES_XML_REQUIRED, + * XML_UTIL_ENTITIES_HTML) + * @param string $encoding encoding value (if any)... + * must be a valid encoding as determined + * by the html_entity_decode() function + * + * @return string string with replaced chars + * @access public + * @static + * @see replaceEntities() + */ + function reverseEntities($string, $replaceEntities = XML_UTIL_ENTITIES_XML, + $encoding = 'ISO-8859-1') + { + switch ($replaceEntities) { + case XML_UTIL_ENTITIES_XML: + return strtr($string, array( + '&' => '&', + '>' => '>', + '<' => '<', + '"' => '"', + ''' => '\'' )); + break; + case XML_UTIL_ENTITIES_XML_REQUIRED: + return strtr($string, array( + '&' => '&', + '<' => '<', + '"' => '"' )); + break; + case XML_UTIL_ENTITIES_HTML: + return html_entity_decode($string, ENT_COMPAT, $encoding); + break; + } + return $string; + } + + /** + * build an xml declaration + * + * <code> + * require_once 'XML/Util.php'; + * + * // get an XML declaration: + * $xmlDecl = XML_Util::getXMLDeclaration('1.0', 'UTF-8', true); + * </code> + * + * @param string $version xml version + * @param string $encoding character encoding + * @param bool $standalone document is standalone (or not) + * + * @return string xml declaration + * @access public + * @static + * @uses attributesToString() to serialize the attributes of the XML declaration + */ + function getXMLDeclaration($version = '1.0', $encoding = null, + $standalone = null) + { + $attributes = array( + 'version' => $version, + ); + // add encoding + if ($encoding !== null) { + $attributes['encoding'] = $encoding; + } + // add standalone, if specified + if ($standalone !== null) { + $attributes['standalone'] = $standalone ? 'yes' : 'no'; + } + + return sprintf('<?xml%s?>', + XML_Util::attributesToString($attributes, false)); + } + + /** + * build a document type declaration + * + * <code> + * require_once 'XML/Util.php'; + * + * // get a doctype declaration: + * $xmlDecl = XML_Util::getDocTypeDeclaration('rootTag','myDocType.dtd'); + * </code> + * + * @param string $root name of the root tag + * @param string $uri uri of the doctype definition + * (or array with uri and public id) + * @param string $internalDtd internal dtd entries + * + * @return string doctype declaration + * @access public + * @static + * @since 0.2 + */ + function getDocTypeDeclaration($root, $uri = null, $internalDtd = null) + { + if (is_array($uri)) { + $ref = sprintf(' PUBLIC "%s" "%s"', $uri['id'], $uri['uri']); + } elseif (!empty($uri)) { + $ref = sprintf(' SYSTEM "%s"', $uri); + } else { + $ref = ''; + } + + if (empty($internalDtd)) { + return sprintf('<!DOCTYPE %s%s>', $root, $ref); + } else { + return sprintf("<!DOCTYPE %s%s [\n%s\n]>", $root, $ref, $internalDtd); + } + } + + /** + * create string representation of an attribute list + * + * <code> + * require_once 'XML/Util.php'; + * + * // build an attribute string + * $att = array( + * 'foo' => 'bar', + * 'argh' => 'tomato' + * ); + * + * $attList = XML_Util::attributesToString($att); + * </code> + * + * @param array $attributes attribute array + * @param bool|array $sort sort attribute list alphabetically, + * may also be an assoc array containing + * the keys 'sort', 'multiline', 'indent', + * 'linebreak' and 'entities' + * @param bool $multiline use linebreaks, if more than + * one attribute is given + * @param string $indent string used for indentation of + * multiline attributes + * @param string $linebreak string used for linebreaks of + * multiline attributes + * @param int $entities setting for entities in attribute values + * (one of XML_UTIL_ENTITIES_NONE, + * XML_UTIL_ENTITIES_XML, + * XML_UTIL_ENTITIES_XML_REQUIRED, + * XML_UTIL_ENTITIES_HTML) + * + * @return string string representation of the attributes + * @access public + * @static + * @uses replaceEntities() to replace XML entities in attribute values + * @todo allow sort also to be an options array + */ + function attributesToString($attributes, $sort = true, $multiline = false, + $indent = ' ', $linebreak = "\n", $entities = XML_UTIL_ENTITIES_XML) + { + /* + * second parameter may be an array + */ + if (is_array($sort)) { + if (isset($sort['multiline'])) { + $multiline = $sort['multiline']; + } + if (isset($sort['indent'])) { + $indent = $sort['indent']; + } + if (isset($sort['linebreak'])) { + $multiline = $sort['linebreak']; + } + if (isset($sort['entities'])) { + $entities = $sort['entities']; + } + if (isset($sort['sort'])) { + $sort = $sort['sort']; + } else { + $sort = true; + } + } + $string = ''; + if (is_array($attributes) && !empty($attributes)) { + if ($sort) { + ksort($attributes); + } + if ( !$multiline || count($attributes) == 1) { + foreach ($attributes as $key => $value) { + if ($entities != XML_UTIL_ENTITIES_NONE) { + if ($entities === XML_UTIL_CDATA_SECTION) { + $entities = XML_UTIL_ENTITIES_XML; + } + $value = XML_Util::replaceEntities($value, $entities); + } + $string .= ' ' . $key . '="' . $value . '"'; + } + } else { + $first = true; + foreach ($attributes as $key => $value) { + if ($entities != XML_UTIL_ENTITIES_NONE) { + $value = XML_Util::replaceEntities($value, $entities); + } + if ($first) { + $string .= ' ' . $key . '="' . $value . '"'; + $first = false; + } else { + $string .= $linebreak . $indent . $key . '="' . $value . '"'; + } + } + } + } + return $string; + } + + /** + * Collapses empty tags. + * + * @param string $xml XML + * @param int $mode Whether to collapse all empty tags (XML_UTIL_COLLAPSE_ALL) + * or only XHTML (XML_UTIL_COLLAPSE_XHTML_ONLY) ones. + * + * @return string XML + * @access public + * @static + * @todo PEAR CS - unable to avoid "space after open parens" error + * in the IF branch + */ + function collapseEmptyTags($xml, $mode = XML_UTIL_COLLAPSE_ALL) + { + if ($mode == XML_UTIL_COLLAPSE_XHTML_ONLY) { + return preg_replace( + '/<(area|base(?:font)?|br|col|frame|hr|img|input|isindex|link|meta|' + . 'param)([^>]*)><\/\\1>/s', + '<\\1\\2 />', + $xml); + } else { + return preg_replace('/<(\w+)([^>]*)><\/\\1>/s', '<\\1\\2 />', $xml); + } + } + + /** + * create a tag + * + * This method will call XML_Util::createTagFromArray(), which + * is more flexible. + * + * <code> + * require_once 'XML/Util.php'; + * + * // create an XML tag: + * $tag = XML_Util::createTag('myNs:myTag', + * array('foo' => 'bar'), + * 'This is inside the tag', + * 'http://www.w3c.org/myNs#'); + * </code> + * + * @param string $qname qualified tagname (including namespace) + * @param array $attributes array containg attributes + * @param mixed $content the content + * @param string $namespaceUri URI of the namespace + * @param int $replaceEntities whether to replace XML special chars in + * content, embedd it in a CData section + * or none of both + * @param bool $multiline whether to create a multiline tag where + * each attribute gets written to a single line + * @param string $indent string used to indent attributes + * (_auto indents attributes so they start + * at the same column) + * @param string $linebreak string used for linebreaks + * @param bool $sortAttributes Whether to sort the attributes or not + * + * @return string XML tag + * @access public + * @static + * @see createTagFromArray() + * @uses createTagFromArray() to create the tag + */ + function createTag($qname, $attributes = array(), $content = null, + $namespaceUri = null, $replaceEntities = XML_UTIL_REPLACE_ENTITIES, + $multiline = false, $indent = '_auto', $linebreak = "\n", + $sortAttributes = true) + { + $tag = array( + 'qname' => $qname, + 'attributes' => $attributes + ); + + // add tag content + if ($content !== null) { + $tag['content'] = $content; + } + + // add namespace Uri + if ($namespaceUri !== null) { + $tag['namespaceUri'] = $namespaceUri; + } + + return XML_Util::createTagFromArray($tag, $replaceEntities, $multiline, + $indent, $linebreak, $sortAttributes); + } + + /** + * create a tag from an array + * this method awaits an array in the following format + * <pre> + * array( + * // qualified name of the tag + * 'qname' => $qname + * + * // namespace prefix (optional, if qname is specified or no namespace) + * 'namespace' => $namespace + * + * // local part of the tagname (optional, if qname is specified) + * 'localpart' => $localpart, + * + * // array containing all attributes (optional) + * 'attributes' => array(), + * + * // tag content (optional) + * 'content' => $content, + * + * // namespaceUri for the given namespace (optional) + * 'namespaceUri' => $namespaceUri + * ) + * </pre> + * + * <code> + * require_once 'XML/Util.php'; + * + * $tag = array( + * 'qname' => 'foo:bar', + * 'namespaceUri' => 'http://foo.com', + * 'attributes' => array('key' => 'value', 'argh' => 'fruit&vegetable'), + * 'content' => 'I\'m inside the tag', + * ); + * // creating a tag with qualified name and namespaceUri + * $string = XML_Util::createTagFromArray($tag); + * </code> + * + * @param array $tag tag definition + * @param int $replaceEntities whether to replace XML special chars in + * content, embedd it in a CData section + * or none of both + * @param bool $multiline whether to create a multiline tag where each + * attribute gets written to a single line + * @param string $indent string used to indent attributes + * (_auto indents attributes so they start + * at the same column) + * @param string $linebreak string used for linebreaks + * @param bool $sortAttributes Whether to sort the attributes or not + * + * @return string XML tag + * @access public + * @static + * @see createTag() + * @uses attributesToString() to serialize the attributes of the tag + * @uses splitQualifiedName() to get local part and namespace of a qualified name + * @uses createCDataSection() + * @uses raiseError() + */ + function createTagFromArray($tag, $replaceEntities = XML_UTIL_REPLACE_ENTITIES, + $multiline = false, $indent = '_auto', $linebreak = "\n", + $sortAttributes = true) + { + if (isset($tag['content']) && !is_scalar($tag['content'])) { + return XML_Util::raiseError('Supplied non-scalar value as tag content', + XML_UTIL_ERROR_NON_SCALAR_CONTENT); + } + + if (!isset($tag['qname']) && !isset($tag['localPart'])) { + return XML_Util::raiseError('You must either supply a qualified name ' + . '(qname) or local tag name (localPart).', + XML_UTIL_ERROR_NO_TAG_NAME); + } + + // if no attributes hav been set, use empty attributes + if (!isset($tag['attributes']) || !is_array($tag['attributes'])) { + $tag['attributes'] = array(); + } + + if (isset($tag['namespaces'])) { + foreach ($tag['namespaces'] as $ns => $uri) { + $tag['attributes']['xmlns:' . $ns] = $uri; + } + } + + if (!isset($tag['qname'])) { + // qualified name is not given + + // check for namespace + if (isset($tag['namespace']) && !empty($tag['namespace'])) { + $tag['qname'] = $tag['namespace'] . ':' . $tag['localPart']; + } else { + $tag['qname'] = $tag['localPart']; + } + } elseif (isset($tag['namespaceUri']) && !isset($tag['namespace'])) { + // namespace URI is set, but no namespace + + $parts = XML_Util::splitQualifiedName($tag['qname']); + + $tag['localPart'] = $parts['localPart']; + if (isset($parts['namespace'])) { + $tag['namespace'] = $parts['namespace']; + } + } + + if (isset($tag['namespaceUri']) && !empty($tag['namespaceUri'])) { + // is a namespace given + if (isset($tag['namespace']) && !empty($tag['namespace'])) { + $tag['attributes']['xmlns:' . $tag['namespace']] = + $tag['namespaceUri']; + } else { + // define this Uri as the default namespace + $tag['attributes']['xmlns'] = $tag['namespaceUri']; + } + } + + // check for multiline attributes + if ($multiline === true) { + if ($indent === '_auto') { + $indent = str_repeat(' ', (strlen($tag['qname'])+2)); + } + } + + // create attribute list + $attList = XML_Util::attributesToString($tag['attributes'], + $sortAttributes, $multiline, $indent, $linebreak, $replaceEntities); + if (!isset($tag['content']) || (string)$tag['content'] == '') { + $tag = sprintf('<%s%s />', $tag['qname'], $attList); + } else { + switch ($replaceEntities) { + case XML_UTIL_ENTITIES_NONE: + break; + case XML_UTIL_CDATA_SECTION: + $tag['content'] = XML_Util::createCDataSection($tag['content']); + break; + default: + $tag['content'] = XML_Util::replaceEntities($tag['content'], + $replaceEntities); + break; + } + $tag = sprintf('<%s%s>%s</%s>', $tag['qname'], $attList, $tag['content'], + $tag['qname']); + } + return $tag; + } + + /** + * create a start element + * + * <code> + * require_once 'XML/Util.php'; + * + * // create an XML start element: + * $tag = XML_Util::createStartElement('myNs:myTag', + * array('foo' => 'bar') ,'http://www.w3c.org/myNs#'); + * </code> + * + * @param string $qname qualified tagname (including namespace) + * @param array $attributes array containg attributes + * @param string $namespaceUri URI of the namespace + * @param bool $multiline whether to create a multiline tag where each + * attribute gets written to a single line + * @param string $indent string used to indent attributes (_auto indents + * attributes so they start at the same column) + * @param string $linebreak string used for linebreaks + * @param bool $sortAttributes Whether to sort the attributes or not + * + * @return string XML start element + * @access public + * @static + * @see createEndElement(), createTag() + */ + function createStartElement($qname, $attributes = array(), $namespaceUri = null, + $multiline = false, $indent = '_auto', $linebreak = "\n", + $sortAttributes = true) + { + // if no attributes hav been set, use empty attributes + if (!isset($attributes) || !is_array($attributes)) { + $attributes = array(); + } + + if ($namespaceUri != null) { + $parts = XML_Util::splitQualifiedName($qname); + } + + // check for multiline attributes + if ($multiline === true) { + if ($indent === '_auto') { + $indent = str_repeat(' ', (strlen($qname)+2)); + } + } + + if ($namespaceUri != null) { + // is a namespace given + if (isset($parts['namespace']) && !empty($parts['namespace'])) { + $attributes['xmlns:' . $parts['namespace']] = $namespaceUri; + } else { + // define this Uri as the default namespace + $attributes['xmlns'] = $namespaceUri; + } + } + + // create attribute list + $attList = XML_Util::attributesToString($attributes, $sortAttributes, + $multiline, $indent, $linebreak); + $element = sprintf('<%s%s>', $qname, $attList); + return $element; + } + + /** + * create an end element + * + * <code> + * require_once 'XML/Util.php'; + * + * // create an XML start element: + * $tag = XML_Util::createEndElement('myNs:myTag'); + * </code> + * + * @param string $qname qualified tagname (including namespace) + * + * @return string XML end element + * @access public + * @static + * @see createStartElement(), createTag() + */ + function createEndElement($qname) + { + $element = sprintf('</%s>', $qname); + return $element; + } + + /** + * create an XML comment + * + * <code> + * require_once 'XML/Util.php'; + * + * // create an XML start element: + * $tag = XML_Util::createComment('I am a comment'); + * </code> + * + * @param string $content content of the comment + * + * @return string XML comment + * @access public + * @static + */ + function createComment($content) + { + $comment = sprintf('<!-- %s -->', $content); + return $comment; + } + + /** + * create a CData section + * + * <code> + * require_once 'XML/Util.php'; + * + * // create a CData section + * $tag = XML_Util::createCDataSection('I am content.'); + * </code> + * + * @param string $data data of the CData section + * + * @return string CData section with content + * @access public + * @static + */ + function createCDataSection($data) + { + return sprintf('<![CDATA[%s]]>', + preg_replace('/\]\]>/', ']]]]><![CDATA[>', strval($data))); + + } + + /** + * split qualified name and return namespace and local part + * + * <code> + * require_once 'XML/Util.php'; + * + * // split qualified tag + * $parts = XML_Util::splitQualifiedName('xslt:stylesheet'); + * </code> + * the returned array will contain two elements: + * <pre> + * array( + * 'namespace' => 'xslt', + * 'localPart' => 'stylesheet' + * ); + * </pre> + * + * @param string $qname qualified tag name + * @param string $defaultNs default namespace (optional) + * + * @return array array containing namespace and local part + * @access public + * @static + */ + function splitQualifiedName($qname, $defaultNs = null) + { + if (strstr($qname, ':')) { + $tmp = explode(':', $qname); + return array( + 'namespace' => $tmp[0], + 'localPart' => $tmp[1] + ); + } + return array( + 'namespace' => $defaultNs, + 'localPart' => $qname + ); + } + + /** + * check, whether string is valid XML name + * + * <p>XML names are used for tagname, attribute names and various + * other, lesser known entities.</p> + * <p>An XML name may only consist of alphanumeric characters, + * dashes, undescores and periods, and has to start with a letter + * or an underscore.</p> + * + * <code> + * require_once 'XML/Util.php'; + * + * // verify tag name + * $result = XML_Util::isValidName('invalidTag?'); + * if (is_a($result, 'PEAR_Error')) { + * print 'Invalid XML name: ' . $result->getMessage(); + * } + * </code> + * + * @param string $string string that should be checked + * + * @return mixed true, if string is a valid XML name, PEAR error otherwise + * @access public + * @static + * @todo support for other charsets + * @todo PEAR CS - unable to avoid 85-char limit on second preg_match + */ + function isValidName($string) + { + // check for invalid chars + if (!preg_match('/^[[:alpha:]_]$/', $string{0})) { + return XML_Util::raiseError('XML names may only start with letter ' + . 'or underscore', XML_UTIL_ERROR_INVALID_START); + } + + // check for invalid chars + if (!preg_match('/^([[:alpha:]_]([[:alnum:]\-\.]*)?:)?[[:alpha:]_]([[:alnum:]\_\-\.]+)?$/', + $string) + ) { + return XML_Util::raiseError('XML names may only contain alphanumeric ' + . 'chars, period, hyphen, colon and underscores', + XML_UTIL_ERROR_INVALID_CHARS); + } + // XML name is valid + return true; + } + + /** + * replacement for XML_Util::raiseError + * + * Avoids the necessity to always require + * PEAR.php + * + * @param string $msg error message + * @param int $code error code + * + * @return PEAR_Error + * @access public + * @static + * @todo PEAR CS - should this use include_once instead? + */ + function raiseError($msg, $code) + { + require_once 'PEAR.php'; + return PEAR::raiseError($msg, $code); + } +} +?> diff --git a/vendor/serialssolutions/summon/LICENSE b/vendor/serialssolutions/summon/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4eb3f1e9596a3213c1eeba7ec401ecac70ff1801 --- /dev/null +++ b/vendor/serialssolutions/summon/LICENSE @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/vendor/serialssolutions/summon/README.md b/vendor/serialssolutions/summon/README.md new file mode 100644 index 0000000000000000000000000000000000000000..50b4c680729dabbe29cde5c907fd2cd54316dc36 --- /dev/null +++ b/vendor/serialssolutions/summon/README.md @@ -0,0 +1,8 @@ +Serials Solutions Summon Library +================================ + +Introduction +------------ +This is a generic library for interacting with Serials Solutions' Summon. +Implementations are provided for PEAR, Zend Framework 1.x and Zend +Framework 2.x. \ No newline at end of file diff --git a/vendor/SerialsSolutions/Summon/Base.php b/vendor/serialssolutions/summon/SerialsSolutions/Summon/Base.php similarity index 100% rename from vendor/SerialsSolutions/Summon/Base.php rename to vendor/serialssolutions/summon/SerialsSolutions/Summon/Base.php diff --git a/vendor/SerialsSolutions/Summon/Exception.php b/vendor/serialssolutions/summon/SerialsSolutions/Summon/Exception.php similarity index 100% rename from vendor/SerialsSolutions/Summon/Exception.php rename to vendor/serialssolutions/summon/SerialsSolutions/Summon/Exception.php diff --git a/vendor/SerialsSolutions/Summon/PEAR.php b/vendor/serialssolutions/summon/SerialsSolutions/Summon/PEAR.php similarity index 100% rename from vendor/SerialsSolutions/Summon/PEAR.php rename to vendor/serialssolutions/summon/SerialsSolutions/Summon/PEAR.php diff --git a/vendor/SerialsSolutions/Summon/Query.php b/vendor/serialssolutions/summon/SerialsSolutions/Summon/Query.php similarity index 100% rename from vendor/SerialsSolutions/Summon/Query.php rename to vendor/serialssolutions/summon/SerialsSolutions/Summon/Query.php diff --git a/vendor/SerialsSolutions/Summon/Zend.php b/vendor/serialssolutions/summon/SerialsSolutions/Summon/Zend.php similarity index 100% rename from vendor/SerialsSolutions/Summon/Zend.php rename to vendor/serialssolutions/summon/SerialsSolutions/Summon/Zend.php diff --git a/vendor/SerialsSolutions/Summon/Zend2.php b/vendor/serialssolutions/summon/SerialsSolutions/Summon/Zend2.php similarity index 100% rename from vendor/SerialsSolutions/Summon/Zend2.php rename to vendor/serialssolutions/summon/SerialsSolutions/Summon/Zend2.php diff --git a/vendor/serialssolutions/summon/composer.json b/vendor/serialssolutions/summon/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..0270a3431f2e595fab024db84db00cf35be0ef71 --- /dev/null +++ b/vendor/serialssolutions/summon/composer.json @@ -0,0 +1,16 @@ +{ + "name": "serialssolutions/summon", + "description": "Library for interacting with Serials Solutions' Summon API.", + "authors": [ + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu" + } + ], + "autoload": { + "psr-0": { + "SerialsSolutions": "" + } + }, + "license": "GPL-2.0" +} diff --git a/vendor/Symfony/Component/Yaml/CHANGELOG.md b/vendor/symfony/yaml/Symfony/Component/Yaml/CHANGELOG.md similarity index 100% rename from vendor/Symfony/Component/Yaml/CHANGELOG.md rename to vendor/symfony/yaml/Symfony/Component/Yaml/CHANGELOG.md diff --git a/vendor/Symfony/Component/Yaml/Dumper.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php similarity index 64% rename from vendor/Symfony/Component/Yaml/Dumper.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php index 220cb39742569d67fcaf8d30165c8c59c4acf9dc..1b2a2516555b37caf2c8ad187b97da53a0415d5d 100644 --- a/vendor/Symfony/Component/Yaml/Dumper.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php @@ -38,19 +38,21 @@ class Dumper /** * Dumps a PHP value to YAML. * - * @param mixed $input The PHP value - * @param integer $inline The level where you switch to inline YAML - * @param integer $indent The level of indentation (used internally) + * @param mixed $input The PHP value + * @param integer $inline The level where you switch to inline YAML + * @param integer $indent The level of indentation (used internally) + * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param Boolean $objectSupport true if object support is enabled, false otherwise * * @return string The YAML representation of the PHP value */ - public function dump($input, $inline = 0, $indent = 0) + public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = false, $objectSupport = false) { $output = ''; $prefix = $indent ? str_repeat(' ', $indent) : ''; if ($inline <= 0 || !is_array($input) || empty($input)) { - $output .= $prefix.Inline::dump($input); + $output .= $prefix.Inline::dump($input, $exceptionOnInvalidType, $objectSupport); } else { $isAHash = array_keys($input) !== range(0, count($input) - 1); @@ -59,9 +61,9 @@ class Dumper $output .= sprintf('%s%s%s%s', $prefix, - $isAHash ? Inline::dump($key).':' : '-', + $isAHash ? Inline::dump($key, $exceptionOnInvalidType, $objectSupport).':' : '-', $willBeInlined ? ' ' : "\n", - $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation) + $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $exceptionOnInvalidType, $objectSupport) ).($willBeInlined ? "\n" : ''); } } diff --git a/vendor/Symfony/Component/Yaml/Escaper.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php similarity index 100% rename from vendor/Symfony/Component/Yaml/Escaper.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php diff --git a/vendor/Symfony/Component/Yaml/Exception/DumpException.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php similarity index 100% rename from vendor/Symfony/Component/Yaml/Exception/DumpException.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.php diff --git a/vendor/Symfony/Component/Yaml/Exception/ExceptionInterface.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php similarity index 100% rename from vendor/Symfony/Component/Yaml/Exception/ExceptionInterface.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.php diff --git a/vendor/Symfony/Component/Yaml/Exception/ParseException.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php similarity index 100% rename from vendor/Symfony/Component/Yaml/Exception/ParseException.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php diff --git a/vendor/Symfony/Component/Yaml/Inline.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php similarity index 83% rename from vendor/Symfony/Component/Yaml/Inline.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php index df8928577c3c8d8c49234d90ceabf57d9c0eb7fe..92bfb52726b0e794000042d54d002f19063bb8ba 100644 --- a/vendor/Symfony/Component/Yaml/Inline.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php @@ -22,15 +22,23 @@ class Inline { const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')'; + private static $exceptionOnInvalidType = false; + private static $objectSupport = false; + /** * Converts a YAML string to a PHP array. * - * @param string $value A YAML string + * @param string $value A YAML string + * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param Boolean $objectSupport true if object support is enabled, false otherwise * * @return array A PHP array representing the YAML string */ - public static function parse($value) + public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false) { + self::$exceptionOnInvalidType = $exceptionOnInvalidType; + self::$objectSupport = $objectSupport; + $value = trim($value); if (0 == strlen($value)) { @@ -69,21 +77,35 @@ class Inline /** * Dumps a given PHP variable to a YAML string. * - * @param mixed $value The PHP variable to convert + * @param mixed $value The PHP variable to convert + * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param Boolean $objectSupport true if object support is enabled, false otherwise * * @return string The YAML string representing the PHP array * * @throws DumpException When trying to dump PHP resource */ - public static function dump($value) + public static function dump($value, $exceptionOnInvalidType = false, $objectSupport = false) { switch (true) { case is_resource($value): - throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); + if ($exceptionOnInvalidType) { + throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); + } + + return 'null'; case is_object($value): - return '!!php/object:'.serialize($value); + if ($objectSupport) { + return '!!php/object:'.serialize($value); + } + + if ($exceptionOnInvalidType) { + throw new DumpException('Object support when dumping a YAML file has been disabled.'); + } + + return 'null'; case is_array($value): - return self::dumpArray($value); + return self::dumpArray($value, $exceptionOnInvalidType, $objectSupport); case null === $value: return 'null'; case true === $value: @@ -121,11 +143,13 @@ class Inline /** * Dumps a PHP array to a YAML string. * - * @param array $value The PHP array to dump + * @param array $value The PHP array to dump + * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param Boolean $objectSupport true if object support is enabled, false otherwise * * @return string The YAML string representing the PHP array */ - private static function dumpArray($value) + private static function dumpArray($value, $exceptionOnInvalidType, $objectSupport) { // array $keys = array_keys($value); @@ -134,7 +158,7 @@ class Inline ) { $output = array(); foreach ($value as $val) { - $output[] = self::dump($val); + $output[] = self::dump($val, $exceptionOnInvalidType, $objectSupport); } return sprintf('[%s]', implode(', ', $output)); @@ -143,7 +167,7 @@ class Inline // mapping $output = array(); foreach ($value as $key => $val) { - $output[] = sprintf('%s: %s', self::dump($key), self::dump($val)); + $output[] = sprintf('%s: %s', self::dump($key, $exceptionOnInvalidType, $objectSupport), self::dump($val, $exceptionOnInvalidType, $objectSupport)); } return sprintf('{ %s }', implode(', ', $output)); @@ -373,7 +397,15 @@ class Inline case 0 === strpos($scalar, '! '): return intval(self::parseScalar(substr($scalar, 2))); case 0 === strpos($scalar, '!!php/object:'): - return unserialize(substr($scalar, 13)); + if (self::$objectSupport) { + return unserialize(substr($scalar, 13)); + } + + if (self::$exceptionOnInvalidType) { + throw new ParseException('Object support when parsing a YAML file has been disabled.'); + } + + return null; case ctype_digit($scalar): $raw = $scalar; $cast = intval($scalar); diff --git a/vendor/Symfony/Component/Yaml/LICENSE b/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE similarity index 96% rename from vendor/Symfony/Component/Yaml/LICENSE rename to vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE index cdffe7aebc04acd5c2b9c3042a0923d8e8f31998..88a57f8d8da49126c6f7d225d567ad216ace4d83 100644 --- a/vendor/Symfony/Component/Yaml/LICENSE +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2012 Fabien Potencier +Copyright (c) 2004-2013 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/Symfony/Component/Yaml/Parser.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php similarity index 94% rename from vendor/Symfony/Component/Yaml/Parser.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php index d09227b2797ec89a8c0cb46607277c07b9893a3e..1d87d94a19f183bc5ac0f1ba8a80326afc631e7b 100644 --- a/vendor/Symfony/Component/Yaml/Parser.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php @@ -38,13 +38,15 @@ class Parser /** * Parses a YAML string to a PHP value. * - * @param string $value A YAML string + * @param string $value A YAML string + * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param Boolean $objectSupport true if object support is enabled, false otherwise * * @return mixed A PHP value * * @throws ParseException If the YAML is not valid */ - public function parse($value) + public function parse($value, $exceptionOnInvalidType = false, $objectSupport = false) { $this->currentLineNb = -1; $this->currentLine = ''; @@ -88,7 +90,7 @@ class Parser $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); $parser->refs =& $this->refs; - $data[] = $parser->parse($this->getNextEmbedBlock()); + $data[] = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport); } else { if (isset($values['leadspaces']) && ' ' == $values['leadspaces'] @@ -104,9 +106,9 @@ class Parser $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2); } - $data[] = $parser->parse($block); + $data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport); } else { - $data[] = $this->parseValue($values['value']); + $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport); } } } elseif (preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values)) { @@ -115,6 +117,8 @@ class Parser } $context = 'mapping'; + // force correct settings + Inline::parse(null, $exceptionOnInvalidType, $objectSupport); try { $key = Inline::parseScalar($values['key']); } catch (ParseException $e) { @@ -139,7 +143,7 @@ class Parser $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); $parser->refs =& $this->refs; - $parsed = $parser->parse($value); + $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport); $merged = array(); if (!is_array($parsed)) { @@ -176,20 +180,20 @@ class Parser $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); $parser->refs =& $this->refs; - $data[$key] = $parser->parse($this->getNextEmbedBlock()); + $data[$key] = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport); } } else { if ($isInPlace) { $data = $this->refs[$isInPlace]; } else { - $data[$key] = $this->parseValue($values['value']); + $data[$key] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport); } } } else { // 1-liner followed by newline if (2 == count($this->lines) && empty($this->lines[1])) { try { - $value = Inline::parse($this->lines[0]); + $value = Inline::parse($this->lines[0], $exceptionOnInvalidType, $objectSupport); } catch (ParseException $e) { $e->setParsedLine($this->getRealCurrentLineNb() + 1); $e->setSnippet($this->currentLine); @@ -366,7 +370,7 @@ class Parser * * @throws ParseException When reference does not exist */ - private function parseValue($value) + private function parseValue($value, $exceptionOnInvalidType, $objectSupport) { if (0 === strpos($value, '*')) { if (false !== $pos = strpos($value, '#')) { @@ -389,7 +393,7 @@ class Parser } try { - return Inline::parse($value); + return Inline::parse($value, $exceptionOnInvalidType, $objectSupport); } catch (ParseException $e) { $e->setParsedLine($this->getRealCurrentLineNb() + 1); $e->setSnippet($this->currentLine); diff --git a/vendor/Symfony/Component/Yaml/README.md b/vendor/symfony/yaml/Symfony/Component/Yaml/README.md similarity index 100% rename from vendor/Symfony/Component/Yaml/README.md rename to vendor/symfony/yaml/Symfony/Component/Yaml/README.md diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1199118d779813ac1cf6fd159bbabb581f454aef --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php @@ -0,0 +1,181 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Yaml\Parser; +use Symfony\Component\Yaml\Dumper; + +class DumperTest extends \PHPUnit_Framework_TestCase +{ + protected $parser; + protected $dumper; + protected $path; + + protected function setUp() + { + $this->parser = new Parser(); + $this->dumper = new Dumper(); + $this->path = __DIR__.'/Fixtures'; + } + + protected function tearDown() + { + $this->parser = null; + $this->dumper = null; + $this->path = null; + } + + public function testSpecifications() + { + $files = $this->parser->parse(file_get_contents($this->path.'/index.yml')); + foreach ($files as $file) { + $yamls = file_get_contents($this->path.'/'.$file.'.yml'); + + // split YAMLs documents + foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) { + if (!$yaml) { + continue; + } + + $test = $this->parser->parse($yaml); + if (isset($test['dump_skip']) && $test['dump_skip']) { + continue; + } elseif (isset($test['todo']) && $test['todo']) { + // TODO + } else { + $expected = eval('return '.trim($test['php']).';'); + + $this->assertEquals($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']); + } + } + } + } + + public function testInlineLevel() + { + // inline level + $array = array( + '' => 'bar', + 'foo' => '#bar', + 'foo\'bar' => array(), + 'bar' => array(1, 'foo'), + 'foobar' => array( + 'foo' => 'bar', + 'bar' => array(1, 'foo'), + 'foobar' => array( + 'foo' => 'bar', + 'bar' => array(1, 'foo'), + ), + ), + ); + + $expected = <<<EOF +{ '': bar, foo: '#bar', 'foo''bar': { }, bar: [1, foo], foobar: { foo: bar, bar: [1, foo], foobar: { foo: bar, bar: [1, foo] } } } +EOF; +$this->assertEquals($expected, $this->dumper->dump($array, -10), '->dump() takes an inline level argument'); +$this->assertEquals($expected, $this->dumper->dump($array, 0), '->dump() takes an inline level argument'); + +$expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: [1, foo] +foobar: { foo: bar, bar: [1, foo], foobar: { foo: bar, bar: [1, foo] } } + +EOF; + $this->assertEquals($expected, $this->dumper->dump($array, 1), '->dump() takes an inline level argument'); + + $expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: + - 1 + - foo +foobar: + foo: bar + bar: [1, foo] + foobar: { foo: bar, bar: [1, foo] } + +EOF; + $this->assertEquals($expected, $this->dumper->dump($array, 2), '->dump() takes an inline level argument'); + + $expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: + - 1 + - foo +foobar: + foo: bar + bar: + - 1 + - foo + foobar: + foo: bar + bar: [1, foo] + +EOF; + $this->assertEquals($expected, $this->dumper->dump($array, 3), '->dump() takes an inline level argument'); + + $expected = <<<EOF +'': bar +foo: '#bar' +'foo''bar': { } +bar: + - 1 + - foo +foobar: + foo: bar + bar: + - 1 + - foo + foobar: + foo: bar + bar: + - 1 + - foo + +EOF; + $this->assertEquals($expected, $this->dumper->dump($array, 4), '->dump() takes an inline level argument'); + $this->assertEquals($expected, $this->dumper->dump($array, 10), '->dump() takes an inline level argument'); + } + + public function testObjectSupportEnabled() + { + $dump = $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, 0, false, true); + + $this->assertEquals('{ foo: !!php/object:O:30:"Symfony\Component\Yaml\Tests\A":1:{s:1:"a";s:3:"foo";}, bar: 1 }', $dump, '->dump() is able to dump objects'); + } + + public function testObjectSupportDisabledButNoExceptions() + { + $dump = $this->dumper->dump(array('foo' => new A(), 'bar' => 1)); + + $this->assertEquals('{ foo: null, bar: 1 }', $dump, '->dump() does not dump objects when disabled'); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\DumpException + */ + public function testObjectSupportDisabledWithExceptions() + { + $this->dumper->dump(array('foo' => new A(), 'bar' => 1), 0, 0, true, false); + } +} + +class A +{ + public $a = 'foo'; +} diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml new file mode 100644 index 0000000000000000000000000000000000000000..5f9c94275b7d21afa263db2c857cf6e243e374ae --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml @@ -0,0 +1,31 @@ +--- %YAML:1.0 +test: Simple Alias Example +brief: > + If you need to refer to the same item of data twice, + you can give that item an alias. The alias is a plain + string, starting with an ampersand. The item may then + be referred to by the alias throughout your document + by using an asterisk before the name of the alias. + This is called an anchor. +yaml: | + - &showell Steve + - Clark + - Brian + - Oren + - *showell +php: | + array('Steve', 'Clark', 'Brian', 'Oren', 'Steve') + +--- +test: Alias of a Mapping +brief: > + An alias can be used on any item of data, including + sequences, mappings, and other complex data types. +yaml: | + - &hello + Meat: pork + Starch: potato + - banana + - *hello +php: | + array(array('Meat'=>'pork', 'Starch'=>'potato'), 'banana', array('Meat'=>'pork', 'Starch'=>'potato')) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml new file mode 100644 index 0000000000000000000000000000000000000000..5542b0dc6326caf9855a3f2e86243780bd735adb --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml @@ -0,0 +1,178 @@ +--- %YAML:1.0 +test: Simple Sequence +brief: | + You can specify a list in YAML by placing each + member of the list on a new line with an opening + dash. These lists are called sequences. +yaml: | + - apple + - banana + - carrot +php: | + array('apple', 'banana', 'carrot') +--- +test: Nested Sequences +brief: | + You can include a sequence within another + sequence by giving the sequence an empty + dash, followed by an indented list. +yaml: | + - + - foo + - bar + - baz +php: | + array(array('foo', 'bar', 'baz')) +--- +test: Mixed Sequences +brief: | + Sequences can contain any YAML data, + including strings and other sequences. +yaml: | + - apple + - + - foo + - bar + - x123 + - banana + - carrot +php: | + array('apple', array('foo', 'bar', 'x123'), 'banana', 'carrot') +--- +test: Deeply Nested Sequences +brief: | + Sequences can be nested even deeper, with each + level of indentation representing a level of + depth. +yaml: | + - + - + - uno + - dos +php: | + array(array(array('uno', 'dos'))) +--- +test: Simple Mapping +brief: | + You can add a keyed list (also known as a dictionary or + hash) to your document by placing each member of the + list on a new line, with a colon seperating the key + from its value. In YAML, this type of list is called + a mapping. +yaml: | + foo: whatever + bar: stuff +php: | + array('foo' => 'whatever', 'bar' => 'stuff') +--- +test: Sequence in a Mapping +brief: | + A value in a mapping can be a sequence. +yaml: | + foo: whatever + bar: + - uno + - dos +php: | + array('foo' => 'whatever', 'bar' => array('uno', 'dos')) +--- +test: Nested Mappings +brief: | + A value in a mapping can be another mapping. +yaml: | + foo: whatever + bar: + fruit: apple + name: steve + sport: baseball +php: | + array( + 'foo' => 'whatever', + 'bar' => array( + 'fruit' => 'apple', + 'name' => 'steve', + 'sport' => 'baseball' + ) + ) +--- +test: Mixed Mapping +brief: | + A mapping can contain any assortment + of mappings and sequences as values. +yaml: | + foo: whatever + bar: + - + fruit: apple + name: steve + sport: baseball + - more + - + python: rocks + perl: papers + ruby: scissorses +php: | + array( + 'foo' => 'whatever', + 'bar' => array( + array( + 'fruit' => 'apple', + 'name' => 'steve', + 'sport' => 'baseball' + ), + 'more', + array( + 'python' => 'rocks', + 'perl' => 'papers', + 'ruby' => 'scissorses' + ) + ) + ) +--- +test: Mapping-in-Sequence Shortcut +todo: true +brief: | + If you are adding a mapping to a sequence, you + can place the mapping on the same line as the + dash as a shortcut. +yaml: | + - work on YAML.py: + - work on Store +php: | + array(array('work on YAML.py' => array('work on Store'))) +--- +test: Sequence-in-Mapping Shortcut +todo: true +brief: | + The dash in a sequence counts as indentation, so + you can add a sequence inside of a mapping without + needing spaces as indentation. +yaml: | + allow: + - 'localhost' + - '%.sourceforge.net' + - '%.freepan.org' +php: | + array('allow' => array('localhost', '%.sourceforge.net', '%.freepan.org')) +--- +todo: true +test: Merge key +brief: | + A merge key ('<<') can be used in a mapping to insert other mappings. If + the value associated with the merge key is a mapping, each of its key/value + pairs is inserted into the current mapping. +yaml: | + mapping: + name: Joe + job: Accountant + <<: + age: 38 +php: | + array( + 'mapping' => + array( + 'name' => 'Joe', + 'job' => 'Accountant', + 'age' => 38 + ) + ) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml new file mode 100644 index 0000000000000000000000000000000000000000..f7ca469b40793389ef841852b3889e25ade296b1 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBlockMapping.yml @@ -0,0 +1,51 @@ +--- +test: One Element Mapping +brief: | + A mapping with one key/value pair +yaml: | + foo: bar +php: | + array('foo' => 'bar') +--- +test: Multi Element Mapping +brief: | + More than one key/value pair +yaml: | + red: baron + white: walls + blue: berries +php: | + array( + 'red' => 'baron', + 'white' => 'walls', + 'blue' => 'berries', + ) +--- +test: Values aligned +brief: | + Often times human editors of documents will align the values even + though YAML emitters generally don't. +yaml: | + red: baron + white: walls + blue: berries +php: | + array( + 'red' => 'baron', + 'white' => 'walls', + 'blue' => 'berries', + ) +--- +test: Colons aligned +brief: | + Spaces can come before the ': ' key/value separator. +yaml: | + red : baron + white : walls + blue : berries +php: | + array( + 'red' => 'baron', + 'white' => 'walls', + 'blue' => 'berries', + ) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml new file mode 100644 index 0000000000000000000000000000000000000000..f8501ddc29646bfc13f35c346ae28bb7d281ef4e --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsDocumentSeparator.yml @@ -0,0 +1,85 @@ +--- %YAML:1.0 +test: Trailing Document Separator +todo: true +brief: > + You can separate YAML documents + with a string of three dashes. +yaml: | + - foo: 1 + bar: 2 + --- + more: stuff +python: | + [ + [ { 'foo': 1, 'bar': 2 } ], + { 'more': 'stuff' } + ] +ruby: | + [ { 'foo' => 1, 'bar' => 2 } ] + +--- +test: Leading Document Separator +todo: true +brief: > + You can explicity give an opening + document separator to your YAML stream. +yaml: | + --- + - foo: 1 + bar: 2 + --- + more: stuff +python: | + [ + [ {'foo': 1, 'bar': 2}], + {'more': 'stuff'} + ] +ruby: | + [ { 'foo' => 1, 'bar' => 2 } ] + +--- +test: YAML Header +todo: true +brief: > + The opening separator can contain directives + to the YAML parser, such as the version + number. +yaml: | + --- %YAML:1.0 + foo: 1 + bar: 2 +php: | + array('foo' => 1, 'bar' => 2) +documents: 1 + +--- +test: Red Herring Document Separator +brief: > + Separators included in blocks or strings + are treated as blocks or strings, as the + document separator should have no indentation + preceding it. +yaml: | + foo: | + --- +php: | + array('foo' => "---\n") + +--- +test: Multiple Document Separators in Block +brief: > + This technique allows you to embed other YAML + documents within literal blocks. +yaml: | + foo: | + --- + foo: bar + --- + yo: baz + bar: | + fooness +php: | + array( + 'foo' => "---\nfoo: bar\n---\nyo: baz\n", + 'bar' => "fooness\n" + ) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml new file mode 100644 index 0000000000000000000000000000000000000000..e8506fcb66bb31afdced90f8a1277c8828cfab9a --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsErrorTests.yml @@ -0,0 +1,25 @@ +--- +test: Missing value for hash item +todo: true +brief: | + Third item in this hash doesn't have a value +yaml: | + okay: value + also okay: ~ + causes error because no value specified + last key: value okay here too +python-error: causes error because no value specified + +--- +test: Not indenting enough +brief: | + There was a bug in PyYaml where it was off by one + in the indentation check. It was allowing the YAML + below. +# This is actually valid YAML now. Someone should tell showell. +yaml: | + foo: + firstline: 1 + secondline: 2 +php: | + array('foo' => null, 'firstline' => 1, 'secondline' => 2) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml new file mode 100644 index 0000000000000000000000000000000000000000..03090e4abc40e0fb6e43d66cd6a1b90dabd8e0db --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFlowCollections.yml @@ -0,0 +1,60 @@ +--- +test: Simple Inline Array +brief: > + Sequences can be contained on a + single line, using the inline syntax. + Separate each entry with commas and + enclose in square brackets. +yaml: | + seq: [ a, b, c ] +php: | + array('seq' => array('a', 'b', 'c')) +--- +test: Simple Inline Hash +brief: > + Mapping can also be contained on + a single line, using the inline + syntax. Each key-value pair is + separated by a colon, with a comma + between each entry in the mapping. + Enclose with curly braces. +yaml: | + hash: { name: Steve, foo: bar } +php: | + array('hash' => array('name' => 'Steve', 'foo' => 'bar')) +--- +test: Multi-line Inline Collections +todo: true +brief: > + Both inline sequences and inline mappings + can span multiple lines, provided that you + indent the additional lines. +yaml: | + languages: [ Ruby, + Perl, + Python ] + websites: { YAML: yaml.org, + Ruby: ruby-lang.org, + Python: python.org, + Perl: use.perl.org } +php: | + array( + 'languages' => array('Ruby', 'Perl', 'Python'), + 'websites' => array( + 'YAML' => 'yaml.org', + 'Ruby' => 'ruby-lang.org', + 'Python' => 'python.org', + 'Perl' => 'use.perl.org' + ) + ) +--- +test: Commas in Values (not in the spec!) +todo: true +brief: > + List items in collections are delimited by commas, but + there must be a space after each comma. This allows you + to add numbers without quoting. +yaml: | + attendances: [ 45,123, 70,000, 17,222 ] +php: | + array('attendances' => array(45123, 70000, 17222)) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml new file mode 100644 index 0000000000000000000000000000000000000000..a14735a55a507dd9068dad58c29338cb1eddc1b8 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsFoldedScalars.yml @@ -0,0 +1,176 @@ +--- %YAML:1.0 +test: Single ending newline +brief: > + A pipe character, followed by an indented + block of text is treated as a literal + block, in which newlines are preserved + throughout the block, including the final + newline. +yaml: | + --- + this: | + Foo + Bar +php: | + array('this' => "Foo\nBar\n") +--- +test: The '+' indicator +brief: > + The '+' indicator says to keep newlines at the end of text + blocks. +yaml: | + normal: | + extra new lines not kept + + preserving: |+ + extra new lines are kept + + + dummy: value +php: | + array( + 'normal' => "extra new lines not kept\n", + 'preserving' => "extra new lines are kept\n\n\n", + 'dummy' => 'value' + ) +--- +test: Three trailing newlines in literals +brief: > + To give you more control over how space + is preserved in text blocks, YAML has + the keep '+' and chomp '-' indicators. + The keep indicator will preserve all + ending newlines, while the chomp indicator + will strip all ending newlines. +yaml: | + clipped: | + This has one newline. + + + + same as "clipped" above: "This has one newline.\n" + + stripped: |- + This has no newline. + + + + same as "stripped" above: "This has no newline." + + kept: |+ + This has four newlines. + + + + same as "kept" above: "This has four newlines.\n\n\n\n" +php: | + array( + 'clipped' => "This has one newline.\n", + 'same as "clipped" above' => "This has one newline.\n", + 'stripped' => 'This has no newline.', + 'same as "stripped" above' => 'This has no newline.', + 'kept' => "This has four newlines.\n\n\n\n", + 'same as "kept" above' => "This has four newlines.\n\n\n\n" + ) +--- +test: Extra trailing newlines with spaces +todo: true +brief: > + Normally, only a single newline is kept + from the end of a literal block, unless the + keep '+' character is used in combination + with the pipe. The following example + will preserve all ending whitespace + since the last line of both literal blocks + contains spaces which extend past the indentation + level. +yaml: | + --- + this: | + Foo + + + kept: |+ + Foo + + +php: | + array('this' => "Foo\n\n \n", + 'kept' => "Foo\n\n \n" ) + +--- +test: Folded Block in a Sequence +brief: > + A greater-then character, followed by an indented + block of text is treated as a folded block, in + which lines of text separated by a single newline + are concatenated as a single line. +yaml: | + --- + - apple + - banana + - > + can't you see + the beauty of yaml? + hmm + - dog +php: | + array( + 'apple', + 'banana', + "can't you see the beauty of yaml? hmm\n", + 'dog' + ) +--- +test: Folded Block as a Mapping Value +brief: > + Both literal and folded blocks can be + used in collections, as values in a + sequence or a mapping. +yaml: | + --- + quote: > + Mark McGwire's + year was crippled + by a knee injury. + source: espn +php: | + array( + 'quote' => "Mark McGwire's year was crippled by a knee injury.\n", + 'source' => 'espn' + ) +--- +test: Three trailing newlines in folded blocks +brief: > + The keep and chomp indicators can also + be applied to folded blocks. +yaml: | + clipped: > + This has one newline. + + + + same as "clipped" above: "This has one newline.\n" + + stripped: >- + This has no newline. + + + + same as "stripped" above: "This has no newline." + + kept: >+ + This has four newlines. + + + + same as "kept" above: "This has four newlines.\n\n\n\n" +php: | + array( + 'clipped' => "This has one newline.\n", + 'same as "clipped" above' => "This has one newline.\n", + 'stripped' => 'This has no newline.', + 'same as "stripped" above' => 'This has no newline.', + 'kept' => "This has four newlines.\n\n\n\n", + 'same as "kept" above' => "This has four newlines.\n\n\n\n" + ) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml new file mode 100644 index 0000000000000000000000000000000000000000..9a5300f2eff6aa56bd0fd914ad86ecd709207a74 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsNullsAndEmpties.yml @@ -0,0 +1,45 @@ +--- %YAML:1.0 +test: Empty Sequence +brief: > + You can represent the empty sequence + with an empty inline sequence. +yaml: | + empty: [] +php: | + array('empty' => array()) +--- +test: Empty Mapping +brief: > + You can represent the empty mapping + with an empty inline mapping. +yaml: | + empty: {} +php: | + array('empty' => array()) +--- +test: Empty Sequence as Entire Document +yaml: | + [] +php: | + array() +--- +test: Empty Mapping as Entire Document +yaml: | + {} +php: | + array() +--- +test: Null as Document +yaml: | + ~ +php: | + null +--- +test: Empty String +brief: > + You can represent an empty string + with a pair of quotes. +yaml: | + '' +php: | + '' diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml new file mode 100644 index 0000000000000000000000000000000000000000..6f99f7545306020ae07ee6a610c5509a39079930 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml @@ -0,0 +1,1695 @@ +--- %YAML:1.0 +test: Sequence of scalars +spec: 2.1 +yaml: | + - Mark McGwire + - Sammy Sosa + - Ken Griffey +php: | + array('Mark McGwire', 'Sammy Sosa', 'Ken Griffey') +--- +test: Mapping of scalars to scalars +spec: 2.2 +yaml: | + hr: 65 + avg: 0.278 + rbi: 147 +php: | + array('hr' => 65, 'avg' => 0.278, 'rbi' => 147) +--- +test: Mapping of scalars to sequences +spec: 2.3 +yaml: | + american: + - Boston Red Sox + - Detroit Tigers + - New York Yankees + national: + - New York Mets + - Chicago Cubs + - Atlanta Braves +php: | + array('american' => + array( 'Boston Red Sox', 'Detroit Tigers', + 'New York Yankees' ), + 'national' => + array( 'New York Mets', 'Chicago Cubs', + 'Atlanta Braves' ) + ) +--- +test: Sequence of mappings +spec: 2.4 +yaml: | + - + name: Mark McGwire + hr: 65 + avg: 0.278 + - + name: Sammy Sosa + hr: 63 + avg: 0.288 +php: | + array( + array('name' => 'Mark McGwire', 'hr' => 65, 'avg' => 0.278), + array('name' => 'Sammy Sosa', 'hr' => 63, 'avg' => 0.288) + ) +--- +test: Legacy A5 +todo: true +spec: legacy_A5 +yaml: | + ? + - New York Yankees + - Atlanta Braves + : + - 2001-07-02 + - 2001-08-12 + - 2001-08-14 + ? + - Detroit Tigers + - Chicago Cubs + : + - 2001-07-23 +perl-busted: > + YAML.pm will be able to emulate this behavior soon. In this regard + it may be somewhat more correct than Python's native behaviour which + can only use tuples as mapping keys. PyYAML will also need to figure + out some clever way to roundtrip structured keys. +python: | + [ + { + ('New York Yankees', 'Atlanta Braves'): + [yaml.timestamp('2001-07-02'), + yaml.timestamp('2001-08-12'), + yaml.timestamp('2001-08-14')], + ('Detroit Tigers', 'Chicago Cubs'): + [yaml.timestamp('2001-07-23')] + } + ] +ruby: | + { + [ 'New York Yankees', 'Atlanta Braves' ] => + [ Date.new( 2001, 7, 2 ), Date.new( 2001, 8, 12 ), Date.new( 2001, 8, 14 ) ], + [ 'Detroit Tigers', 'Chicago Cubs' ] => + [ Date.new( 2001, 7, 23 ) ] + } +syck: | + struct test_node seq1[] = { + { T_STR, 0, "New York Yankees" }, + { T_STR, 0, "Atlanta Braves" }, + end_node + }; + struct test_node seq2[] = { + { T_STR, 0, "2001-07-02" }, + { T_STR, 0, "2001-08-12" }, + { T_STR, 0, "2001-08-14" }, + end_node + }; + struct test_node seq3[] = { + { T_STR, 0, "Detroit Tigers" }, + { T_STR, 0, "Chicago Cubs" }, + end_node + }; + struct test_node seq4[] = { + { T_STR, 0, "2001-07-23" }, + end_node + }; + struct test_node map[] = { + { T_SEQ, 0, 0, seq1 }, + { T_SEQ, 0, 0, seq2 }, + { T_SEQ, 0, 0, seq3 }, + { T_SEQ, 0, 0, seq4 }, + end_node + }; + struct test_node stream[] = { + { T_MAP, 0, 0, map }, + end_node + }; + +--- +test: Sequence of sequences +spec: 2.5 +yaml: | + - [ name , hr , avg ] + - [ Mark McGwire , 65 , 0.278 ] + - [ Sammy Sosa , 63 , 0.288 ] +php: | + array( + array( 'name', 'hr', 'avg' ), + array( 'Mark McGwire', 65, 0.278 ), + array( 'Sammy Sosa', 63, 0.288 ) + ) +--- +test: Mapping of mappings +todo: true +spec: 2.6 +yaml: | + Mark McGwire: {hr: 65, avg: 0.278} + Sammy Sosa: { + hr: 63, + avg: 0.288 + } +php: | + array( + 'Mark McGwire' => + array( 'hr' => 65, 'avg' => 0.278 ), + 'Sammy Sosa' => + array( 'hr' => 63, 'avg' => 0.288 ) + ) +--- +test: Two documents in a stream each with a leading comment +todo: true +spec: 2.7 +yaml: | + # Ranking of 1998 home runs + --- + - Mark McGwire + - Sammy Sosa + - Ken Griffey + + # Team ranking + --- + - Chicago Cubs + - St Louis Cardinals +ruby: | + y = YAML::Stream.new + y.add( [ 'Mark McGwire', 'Sammy Sosa', 'Ken Griffey' ] ) + y.add( [ 'Chicago Cubs', 'St Louis Cardinals' ] ) +documents: 2 + +--- +test: Play by play feed from a game +todo: true +spec: 2.8 +yaml: | + --- + time: 20:03:20 + player: Sammy Sosa + action: strike (miss) + ... + --- + time: 20:03:47 + player: Sammy Sosa + action: grand slam + ... +perl: | + [ 'Mark McGwire', 'Sammy Sosa', 'Ken Griffey' ] +documents: 2 + +--- +test: Single document with two comments +spec: 2.9 +yaml: | + hr: # 1998 hr ranking + - Mark McGwire + - Sammy Sosa + rbi: + # 1998 rbi ranking + - Sammy Sosa + - Ken Griffey +php: | + array( + 'hr' => array( 'Mark McGwire', 'Sammy Sosa' ), + 'rbi' => array( 'Sammy Sosa', 'Ken Griffey' ) + ) +--- +test: Node for Sammy Sosa appears twice in this document +spec: 2.10 +yaml: | + --- + hr: + - Mark McGwire + # Following node labeled SS + - &SS Sammy Sosa + rbi: + - *SS # Subsequent occurance + - Ken Griffey +php: | + array( + 'hr' => + array('Mark McGwire', 'Sammy Sosa'), + 'rbi' => + array('Sammy Sosa', 'Ken Griffey') + ) +--- +test: Mapping between sequences +todo: true +spec: 2.11 +yaml: | + ? # PLAY SCHEDULE + - Detroit Tigers + - Chicago Cubs + : + - 2001-07-23 + + ? [ New York Yankees, + Atlanta Braves ] + : [ 2001-07-02, 2001-08-12, + 2001-08-14 ] +ruby: | + { + [ 'Detroit Tigers', 'Chicago Cubs' ] => [ Date.new( 2001, 7, 23 ) ], + [ 'New York Yankees', 'Atlanta Braves' ] => [ Date.new( 2001, 7, 2 ), Date.new( 2001, 8, 12 ), Date.new( 2001, 8, 14 ) ] + } +syck: | + struct test_node seq1[] = { + { T_STR, 0, "New York Yankees" }, + { T_STR, 0, "Atlanta Braves" }, + end_node + }; + struct test_node seq2[] = { + { T_STR, 0, "2001-07-02" }, + { T_STR, 0, "2001-08-12" }, + { T_STR, 0, "2001-08-14" }, + end_node + }; + struct test_node seq3[] = { + { T_STR, 0, "Detroit Tigers" }, + { T_STR, 0, "Chicago Cubs" }, + end_node + }; + struct test_node seq4[] = { + { T_STR, 0, "2001-07-23" }, + end_node + }; + struct test_node map[] = { + { T_SEQ, 0, 0, seq3 }, + { T_SEQ, 0, 0, seq4 }, + { T_SEQ, 0, 0, seq1 }, + { T_SEQ, 0, 0, seq2 }, + end_node + }; + struct test_node stream[] = { + { T_MAP, 0, 0, map }, + end_node + }; + +--- +test: Sequence key shortcut +spec: 2.12 +yaml: | + --- + # products purchased + - item : Super Hoop + quantity: 1 + - item : Basketball + quantity: 4 + - item : Big Shoes + quantity: 1 +php: | + array ( + array ( + 'item' => 'Super Hoop', + 'quantity' => 1, + ), + array ( + 'item' => 'Basketball', + 'quantity' => 4, + ), + array ( + 'item' => 'Big Shoes', + 'quantity' => 1, + ) + ) +perl: | + [ + { item => 'Super Hoop', quantity => 1 }, + { item => 'Basketball', quantity => 4 }, + { item => 'Big Shoes', quantity => 1 } + ] + +ruby: | + [ + { 'item' => 'Super Hoop', 'quantity' => 1 }, + { 'item' => 'Basketball', 'quantity' => 4 }, + { 'item' => 'Big Shoes', 'quantity' => 1 } + ] +python: | + [ + { 'item': 'Super Hoop', 'quantity': 1 }, + { 'item': 'Basketball', 'quantity': 4 }, + { 'item': 'Big Shoes', 'quantity': 1 } + ] +syck: | + struct test_node map1[] = { + { T_STR, 0, "item" }, + { T_STR, 0, "Super Hoop" }, + { T_STR, 0, "quantity" }, + { T_STR, 0, "1" }, + end_node + }; + struct test_node map2[] = { + { T_STR, 0, "item" }, + { T_STR, 0, "Basketball" }, + { T_STR, 0, "quantity" }, + { T_STR, 0, "4" }, + end_node + }; + struct test_node map3[] = { + { T_STR, 0, "item" }, + { T_STR, 0, "Big Shoes" }, + { T_STR, 0, "quantity" }, + { T_STR, 0, "1" }, + end_node + }; + struct test_node seq[] = { + { T_MAP, 0, 0, map1 }, + { T_MAP, 0, 0, map2 }, + { T_MAP, 0, 0, map3 }, + end_node + }; + struct test_node stream[] = { + { T_SEQ, 0, 0, seq }, + end_node + }; + + +--- +test: Literal perserves newlines +todo: true +spec: 2.13 +yaml: | + # ASCII Art + --- | + \//||\/|| + // || ||_ +perl: | + "\\//||\\/||\n// || ||_\n" +ruby: | + "\\//||\\/||\n// || ||_\n" +python: | + [ + flushLeft( + """ + \//||\/|| + // || ||_ + """ + ) + ] +syck: | + struct test_node stream[] = { + { T_STR, 0, "\\//||\\/||\n// || ||_\n" }, + end_node + }; + +--- +test: Folded treats newlines as a space +todo: true +spec: 2.14 +yaml: | + --- + Mark McGwire's + year was crippled + by a knee injury. +perl: | + "Mark McGwire's year was crippled by a knee injury." +ruby: | + "Mark McGwire's year was crippled by a knee injury." +python: | + [ "Mark McGwire's year was crippled by a knee injury." ] +syck: | + struct test_node stream[] = { + { T_STR, 0, "Mark McGwire's year was crippled by a knee injury." }, + end_node + }; + +--- +test: Newlines preserved for indented and blank lines +todo: true +spec: 2.15 +yaml: | + --- > + Sammy Sosa completed another + fine season with great stats. + + 63 Home Runs + 0.288 Batting Average + + What a year! +perl: | + "Sammy Sosa completed another fine season with great stats.\n\n 63 Home Runs\n 0.288 Batting Average\n\nWhat a year!\n" +ruby: | + "Sammy Sosa completed another fine season with great stats.\n\n 63 Home Runs\n 0.288 Batting Average\n\nWhat a year!\n" +python: | + [ + flushLeft( + """ + Sammy Sosa completed another fine season with great stats. + + 63 Home Runs + 0.288 Batting Average + + What a year! + """ + ) + ] +syck: | + struct test_node stream[] = { + { T_STR, 0, "Sammy Sosa completed another fine season with great stats.\n\n 63 Home Runs\n 0.288 Batting Average\n\nWhat a year!\n" }, + end_node + }; + + +--- +test: Indentation determines scope +spec: 2.16 +yaml: | + name: Mark McGwire + accomplishment: > + Mark set a major league + home run record in 1998. + stats: | + 65 Home Runs + 0.278 Batting Average +php: | + array( + 'name' => 'Mark McGwire', + 'accomplishment' => "Mark set a major league home run record in 1998.\n", + 'stats' => "65 Home Runs\n0.278 Batting Average\n" + ) +--- +test: Quoted scalars +todo: true +spec: 2.17 +yaml: | + unicode: "Sosa did fine.\u263A" + control: "\b1998\t1999\t2000\n" + hexesc: "\x0D\x0A is \r\n" + + single: '"Howdy!" he cried.' + quoted: ' # not a ''comment''.' + tie-fighter: '|\-*-/|' +ruby: | + { + "tie-fighter" => "|\\-*-/|", + "control"=>"\0101998\t1999\t2000\n", + "unicode"=>"Sosa did fine." + ["263A".hex ].pack('U*'), + "quoted"=>" # not a 'comment'.", + "single"=>"\"Howdy!\" he cried.", + "hexesc"=>"\r\n is \r\n" + } +--- +test: Multiline flow scalars +todo: true +spec: 2.18 +yaml: | + plain: + This unquoted scalar + spans many lines. + + quoted: "So does this + quoted scalar.\n" +ruby: | + { + 'plain' => 'This unquoted scalar spans many lines.', + 'quoted' => "So does this quoted scalar.\n" + } +--- +test: Integers +spec: 2.19 +yaml: | + canonical: 12345 + decimal: +12,345 + octal: 014 + hexadecimal: 0xC +php: | + array( + 'canonical' => 12345, + 'decimal' => 12345, + 'octal' => 014, + 'hexadecimal' => 0xC + ) +--- +# FIX: spec shows parens around -inf and NaN +test: Floating point +spec: 2.20 +yaml: | + canonical: 1.23015e+3 + exponential: 12.3015e+02 + fixed: 1,230.15 + negative infinity: -.inf + not a number: .NaN +php: | + array( + 'canonical' => 1230.15, + 'exponential' => 1230.15, + 'fixed' => 1230.15, + 'negative infinity' => log(0), + 'not a number' => -log(0), + ) +--- +test: Miscellaneous +spec: 2.21 +yaml: | + null: ~ + true: true + false: false + string: '12345' +php: | + array( + '' => null, + 1 => true, + 0 => false, + 'string' => '12345' + ) +--- +test: Timestamps +todo: true +spec: 2.22 +yaml: | + canonical: 2001-12-15T02:59:43.1Z + iso8601: 2001-12-14t21:59:43.10-05:00 + spaced: 2001-12-14 21:59:43.10 -05:00 + date: 2002-12-14 # Time is noon UTC +php: | + array( + 'canonical' => YAML::mktime( 2001, 12, 15, 2, 59, 43, 0.10 ), + 'iso8601' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'spaced' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'date' => Date.new( 2002, 12, 14 ) + ) +--- +test: legacy Timestamps test +todo: true +spec: legacy D4 +yaml: | + canonical: 2001-12-15T02:59:43.00Z + iso8601: 2001-02-28t21:59:43.00-05:00 + spaced: 2001-12-14 21:59:43.00 -05:00 + date: 2002-12-14 +php: | + array( + 'canonical' => Time::utc( 2001, 12, 15, 2, 59, 43, 0 ), + 'iso8601' => YAML::mktime( 2001, 2, 28, 21, 59, 43, 0, "-05:00" ), + 'spaced' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0, "-05:00" ), + 'date' => Date.new( 2002, 12, 14 ) + ) +--- +test: Various explicit families +todo: true +spec: 2.23 +yaml: | + not-date: !str 2002-04-28 + picture: !binary | + R0lGODlhDAAMAIQAAP//9/X + 17unp5WZmZgAAAOfn515eXv + Pz7Y6OjuDg4J+fn5OTk6enp + 56enmleECcgggoBADs= + + application specific tag: !!something | + The semantics of the tag + above may be different for + different documents. + +ruby-setup: | + YAML.add_private_type( "something" ) do |type, val| + "SOMETHING: #{val}" + end +ruby: | + { + 'not-date' => '2002-04-28', + 'picture' => "GIF89a\f\000\f\000\204\000\000\377\377\367\365\365\356\351\351\345fff\000\000\000\347\347\347^^^\363\363\355\216\216\216\340\340\340\237\237\237\223\223\223\247\247\247\236\236\236i^\020' \202\n\001\000;", + 'application specific tag' => "SOMETHING: The semantics of the tag\nabove may be different for\ndifferent documents.\n" + } +--- +test: Application specific family +todo: true +spec: 2.24 +yaml: | + # Establish a tag prefix + --- !clarkevans.com,2002/graph/^shape + # Use the prefix: shorthand for + # !clarkevans.com,2002/graph/circle + - !^circle + center: &ORIGIN {x: 73, 'y': 129} + radius: 7 + - !^line # !clarkevans.com,2002/graph/line + start: *ORIGIN + finish: { x: 89, 'y': 102 } + - !^label + start: *ORIGIN + color: 0xFFEEBB + value: Pretty vector drawing. +ruby-setup: | + YAML.add_domain_type( "clarkevans.com,2002", 'graph/shape' ) { |type, val| + if Array === val + val << "Shape Container" + val + else + raise YAML::Error, "Invalid graph of class #{ val.class }: " + val.inspect + end + } + one_shape_proc = Proc.new { |type, val| + scheme, domain, type = type.split( /:/, 3 ) + if val.is_a? ::Hash + val['TYPE'] = "Shape: #{type}" + val + else + raise YAML::Error, "Invalid graph of class #{ val.class }: " + val.inspect + end + } + YAML.add_domain_type( "clarkevans.com,2002", 'graph/circle', &one_shape_proc ) + YAML.add_domain_type( "clarkevans.com,2002", 'graph/line', &one_shape_proc ) + YAML.add_domain_type( "clarkevans.com,2002", 'graph/label', &one_shape_proc ) +ruby: | + [ + { + "radius" => 7, + "center"=> + { + "x" => 73, + "y" => 129 + }, + "TYPE" => "Shape: graph/circle" + }, { + "finish" => + { + "x" => 89, + "y" => 102 + }, + "TYPE" => "Shape: graph/line", + "start" => + { + "x" => 73, + "y" => 129 + } + }, { + "TYPE" => "Shape: graph/label", + "value" => "Pretty vector drawing.", + "start" => + { + "x" => 73, + "y" => 129 + }, + "color" => 16772795 + }, + "Shape Container" + ] +# --- +# test: Unordered set +# spec: 2.25 +# yaml: | +# # sets are represented as a +# # mapping where each key is +# # associated with the empty string +# --- !set +# ? Mark McGwire +# ? Sammy Sosa +# ? Ken Griff +--- +test: Ordered mappings +todo: true +spec: 2.26 +yaml: | + # ordered maps are represented as + # a sequence of mappings, with + # each mapping having one key + --- !omap + - Mark McGwire: 65 + - Sammy Sosa: 63 + - Ken Griffy: 58 +ruby: | + YAML::Omap[ + 'Mark McGwire', 65, + 'Sammy Sosa', 63, + 'Ken Griffy', 58 + ] +--- +test: Invoice +dump_skip: true +spec: 2.27 +yaml: | + --- !clarkevans.com,2002/^invoice + invoice: 34843 + date : 2001-01-23 + bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 + ship-to: *id001 + product: + - + sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - + sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 + tax : 251.42 + total: 4443.52 + comments: > + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338. +php: | + array( + 'invoice' => 34843, 'date' => mktime(0, 0, 0, 1, 23, 2001), + 'bill-to' => + array( 'given' => 'Chris', 'family' => 'Dumars', 'address' => array( 'lines' => "458 Walkman Dr.\nSuite #292\n", 'city' => 'Royal Oak', 'state' => 'MI', 'postal' => 48046 ) ) + , 'ship-to' => + array( 'given' => 'Chris', 'family' => 'Dumars', 'address' => array( 'lines' => "458 Walkman Dr.\nSuite #292\n", 'city' => 'Royal Oak', 'state' => 'MI', 'postal' => 48046 ) ) + , 'product' => + array( + array( 'sku' => 'BL394D', 'quantity' => 4, 'description' => 'Basketball', 'price' => 450.00 ), + array( 'sku' => 'BL4438H', 'quantity' => 1, 'description' => 'Super Hoop', 'price' => 2392.00 ) + ), + 'tax' => 251.42, 'total' => 4443.52, + 'comments' => "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.\n" + ) +--- +test: Log file +todo: true +spec: 2.28 +yaml: | + --- + Time: 2001-11-23 15:01:42 -05:00 + User: ed + Warning: > + This is an error message + for the log file + --- + Time: 2001-11-23 15:02:31 -05:00 + User: ed + Warning: > + A slightly different error + message. + --- + Date: 2001-11-23 15:03:17 -05:00 + User: ed + Fatal: > + Unknown variable "bar" + Stack: + - file: TopClass.py + line: 23 + code: | + x = MoreObject("345\n") + - file: MoreClass.py + line: 58 + code: |- + foo = bar +ruby: | + y = YAML::Stream.new + y.add( { 'Time' => YAML::mktime( 2001, 11, 23, 15, 01, 42, 00, "-05:00" ), + 'User' => 'ed', 'Warning' => "This is an error message for the log file\n" } ) + y.add( { 'Time' => YAML::mktime( 2001, 11, 23, 15, 02, 31, 00, "-05:00" ), + 'User' => 'ed', 'Warning' => "A slightly different error message.\n" } ) + y.add( { 'Date' => YAML::mktime( 2001, 11, 23, 15, 03, 17, 00, "-05:00" ), + 'User' => 'ed', 'Fatal' => "Unknown variable \"bar\"\n", + 'Stack' => [ + { 'file' => 'TopClass.py', 'line' => 23, 'code' => "x = MoreObject(\"345\\n\")\n" }, + { 'file' => 'MoreClass.py', 'line' => 58, 'code' => "foo = bar" } ] } ) +documents: 3 + +--- +test: Throwaway comments +yaml: | + ### These are four throwaway comment ### + + ### lines (the second line is empty). ### + this: | # Comments may trail lines. + contains three lines of text. + The third one starts with a + # character. This isn't a comment. + + # These are three throwaway comment + # lines (the first line is empty). +php: | + array( + 'this' => "contains three lines of text.\nThe third one starts with a\n# character. This isn't a comment.\n" + ) +--- +test: Document with a single value +todo: true +yaml: | + --- > + This YAML stream contains a single text value. + The next stream is a log file - a sequence of + log entries. Adding an entry to the log is a + simple matter of appending it at the end. +ruby: | + "This YAML stream contains a single text value. The next stream is a log file - a sequence of log entries. Adding an entry to the log is a simple matter of appending it at the end.\n" +--- +test: Document stream +todo: true +yaml: | + --- + at: 2001-08-12 09:25:00.00 Z + type: GET + HTTP: '1.0' + url: '/index.html' + --- + at: 2001-08-12 09:25:10.00 Z + type: GET + HTTP: '1.0' + url: '/toc.html' +ruby: | + y = YAML::Stream.new + y.add( { + 'at' => Time::utc( 2001, 8, 12, 9, 25, 00 ), + 'type' => 'GET', + 'HTTP' => '1.0', + 'url' => '/index.html' + } ) + y.add( { + 'at' => Time::utc( 2001, 8, 12, 9, 25, 10 ), + 'type' => 'GET', + 'HTTP' => '1.0', + 'url' => '/toc.html' + } ) +documents: 2 + +--- +test: Top level mapping +yaml: | + # This stream is an example of a top-level mapping. + invoice : 34843 + date : 2001-01-23 + total : 4443.52 +php: | + array( + 'invoice' => 34843, + 'date' => mktime(0, 0, 0, 1, 23, 2001), + 'total' => 4443.52 + ) +--- +test: Single-line documents +todo: true +yaml: | + # The following is a sequence of three documents. + # The first contains an empty mapping, the second + # an empty sequence, and the last an empty string. + --- {} + --- [ ] + --- '' +ruby: | + y = YAML::Stream.new + y.add( {} ) + y.add( [] ) + y.add( '' ) +documents: 3 + +--- +test: Document with pause +todo: true +yaml: | + # A communication channel based on a YAML stream. + --- + sent at: 2002-06-06 11:46:25.10 Z + payload: Whatever + # Receiver can process this as soon as the following is sent: + ... + # Even if the next message is sent long after: + --- + sent at: 2002-06-06 12:05:53.47 Z + payload: Whatever + ... +ruby: | + y = YAML::Stream.new + y.add( + { 'sent at' => YAML::mktime( 2002, 6, 6, 11, 46, 25, 0.10 ), + 'payload' => 'Whatever' } + ) + y.add( + { "payload" => "Whatever", "sent at" => YAML::mktime( 2002, 6, 6, 12, 5, 53, 0.47 ) } + ) +documents: 2 + +--- +test: Explicit typing +yaml: | + integer: 12 + also int: ! "12" + string: !str 12 +php: | + array( 'integer' => 12, 'also int' => 12, 'string' => '12' ) +--- +test: Private types +todo: true +yaml: | + # Both examples below make use of the 'x-private:ball' + # type family URI, but with different semantics. + --- + pool: !!ball + number: 8 + color: black + --- + bearing: !!ball + material: steel +ruby: | + y = YAML::Stream.new + y.add( { 'pool' => + YAML::PrivateType.new( 'ball', + { 'number' => 8, 'color' => 'black' } ) } + ) + y.add( { 'bearing' => + YAML::PrivateType.new( 'ball', + { 'material' => 'steel' } ) } + ) +documents: 2 + +--- +test: Type family under yaml.org +yaml: | + # The URI is 'tag:yaml.org,2002:str' + - !str a Unicode string +php: | + array( 'a Unicode string' ) +--- +test: Type family under perl.yaml.org +todo: true +yaml: | + # The URI is 'tag:perl.yaml.org,2002:Text::Tabs' + - !perl/Text::Tabs {} +ruby: | + [ YAML::DomainType.new( 'perl.yaml.org,2002', 'Text::Tabs', {} ) ] +--- +test: Type family under clarkevans.com +todo: true +yaml: | + # The URI is 'tag:clarkevans.com,2003-02:timesheet' + - !clarkevans.com,2003-02/timesheet {} +ruby: | + [ YAML::DomainType.new( 'clarkevans.com,2003-02', 'timesheet', {} ) ] +--- +test: URI Escaping +todo: true +yaml: | + same: + - !domain.tld,2002/type\x30 value + - !domain.tld,2002/type0 value + different: # As far as the YAML parser is concerned + - !domain.tld,2002/type%30 value + - !domain.tld,2002/type0 value +ruby-setup: | + YAML.add_domain_type( "domain.tld,2002", "type0" ) { |type, val| + "ONE: #{val}" + } + YAML.add_domain_type( "domain.tld,2002", "type%30" ) { |type, val| + "TWO: #{val}" + } +ruby: | + { 'same' => [ 'ONE: value', 'ONE: value' ], 'different' => [ 'TWO: value', 'ONE: value' ] } +--- +test: URI Prefixing +todo: true +yaml: | + # 'tag:domain.tld,2002:invoice' is some type family. + invoice: !domain.tld,2002/^invoice + # 'seq' is shorthand for 'tag:yaml.org,2002:seq'. + # This does not effect '^customer' below + # because it is does not specify a prefix. + customers: !seq + # '^customer' is shorthand for the full + # notation 'tag:domain.tld,2002:customer'. + - !^customer + given : Chris + family : Dumars +ruby-setup: | + YAML.add_domain_type( "domain.tld,2002", /(invoice|customer)/ ) { |type, val| + if val.is_a? ::Hash + scheme, domain, type = type.split( /:/, 3 ) + val['type'] = "domain #{type}" + val + else + raise YAML::Error, "Not a Hash in domain.tld/invoice: " + val.inspect + end + } +ruby: | + { "invoice"=> { "customers"=> [ { "given"=>"Chris", "type"=>"domain customer", "family"=>"Dumars" } ], "type"=>"domain invoice" } } + +--- +test: Overriding anchors +yaml: | + anchor : &A001 This scalar has an anchor. + override : &A001 > + The alias node below is a + repeated use of this value. + alias : *A001 +php: | + array( 'anchor' => 'This scalar has an anchor.', + 'override' => "The alias node below is a repeated use of this value.\n", + 'alias' => "The alias node below is a repeated use of this value.\n" ) +--- +test: Flow and block formatting +todo: true +yaml: | + empty: [] + flow: [ one, two, three # May span lines, + , four, # indentation is + five ] # mostly ignored. + block: + - First item in top sequence + - + - Subordinate sequence entry + - > + A folded sequence entry + - Sixth item in top sequence +ruby: | + { 'empty' => [], 'flow' => [ 'one', 'two', 'three', 'four', 'five' ], + 'block' => [ 'First item in top sequence', [ 'Subordinate sequence entry' ], + "A folded sequence entry\n", 'Sixth item in top sequence' ] } +--- +test: Complete mapping test +todo: true +yaml: | + empty: {} + flow: { one: 1, two: 2 } + spanning: { one: 1, + two: 2 } + block: + first : First entry + second: + key: Subordinate mapping + third: + - Subordinate sequence + - { } + - Previous mapping is empty. + - A key: value pair in a sequence. + A second: key:value pair. + - The previous entry is equal to the following one. + - + A key: value pair in a sequence. + A second: key:value pair. + !float 12 : This key is a float. + ? > + ? + : This key had to be protected. + "\a" : This key had to be escaped. + ? > + This is a + multi-line + folded key + : Whose value is + also multi-line. + ? this also works as a key + : with a value at the next line. + ? + - This key + - is a sequence + : + - With a sequence value. + ? + This: key + is a: mapping + : + with a: mapping value. +ruby: | + { 'empty' => {}, 'flow' => { 'one' => 1, 'two' => 2 }, + 'spanning' => { 'one' => 1, 'two' => 2 }, + 'block' => { 'first' => 'First entry', 'second' => + { 'key' => 'Subordinate mapping' }, 'third' => + [ 'Subordinate sequence', {}, 'Previous mapping is empty.', + { 'A key' => 'value pair in a sequence.', 'A second' => 'key:value pair.' }, + 'The previous entry is equal to the following one.', + { 'A key' => 'value pair in a sequence.', 'A second' => 'key:value pair.' } ], + 12.0 => 'This key is a float.', "?\n" => 'This key had to be protected.', + "\a" => 'This key had to be escaped.', + "This is a multi-line folded key\n" => "Whose value is also multi-line.", + 'this also works as a key' => 'with a value at the next line.', + [ 'This key', 'is a sequence' ] => [ 'With a sequence value.' ] } } + # Couldn't recreate map exactly, so we'll do a detailed check to be sure it's entact + obj_y['block'].keys.each { |k| + if Hash === k + v = obj_y['block'][k] + if k['This'] == 'key' and k['is a'] == 'mapping' and v['with a'] == 'mapping value.' + obj_r['block'][k] = v + end + end + } +--- +test: Literal explicit indentation +yaml: | + # Explicit indentation must + # be given in all the three + # following cases. + leading spaces: |2 + This value starts with four spaces. + + leading line break: |2 + + This value starts with a line break. + + leading comment indicator: |2 + # first line starts with a + # character. + + # Explicit indentation may + # also be given when it is + # not required. + redundant: |2 + This value is indented 2 spaces. +php: | + array( + 'leading spaces' => " This value starts with four spaces.\n", + 'leading line break' => "\nThis value starts with a line break.\n", + 'leading comment indicator' => "# first line starts with a\n# character.\n", + 'redundant' => "This value is indented 2 spaces.\n" + ) +--- +test: Chomping and keep modifiers +yaml: | + clipped: | + This has one newline. + + same as "clipped" above: "This has one newline.\n" + + stripped: |- + This has no newline. + + same as "stripped" above: "This has no newline." + + kept: |+ + This has two newlines. + + same as "kept" above: "This has two newlines.\n\n" +php: | + array( + 'clipped' => "This has one newline.\n", + 'same as "clipped" above' => "This has one newline.\n", + 'stripped' => 'This has no newline.', + 'same as "stripped" above' => 'This has no newline.', + 'kept' => "This has two newlines.\n\n", + 'same as "kept" above' => "This has two newlines.\n\n" + ) +--- +test: Literal combinations +todo: true +yaml: | + empty: | + + literal: | + The \ ' " characters may be + freely used. Leading white + space is significant. + + Line breaks are significant. + Thus this value contains one + empty line and ends with a + single line break, but does + not start with one. + + is equal to: "The \\ ' \" characters may \ + be\nfreely used. Leading white\n space \ + is significant.\n\nLine breaks are \ + significant.\nThus this value contains \ + one\nempty line and ends with a\nsingle \ + line break, but does\nnot start with one.\n" + + # Comments may follow a block + # scalar value. They must be + # less indented. + + # Modifiers may be combined in any order. + indented and chomped: |2- + This has no newline. + + also written as: |-2 + This has no newline. + + both are equal to: " This has no newline." +php: | + array( + 'empty' => '', + 'literal' => "The \\ ' \" characters may be\nfreely used. Leading white\n space " + + "is significant.\n\nLine breaks are significant.\nThus this value contains one\n" + + "empty line and ends with a\nsingle line break, but does\nnot start with one.\n", + 'is equal to' => "The \\ ' \" characters may be\nfreely used. Leading white\n space " + + "is significant.\n\nLine breaks are significant.\nThus this value contains one\n" + + "empty line and ends with a\nsingle line break, but does\nnot start with one.\n", + 'indented and chomped' => ' This has no newline.', + 'also written as' => ' This has no newline.', + 'both are equal to' => ' This has no newline.' + ) +--- +test: Folded combinations +todo: true +yaml: | + empty: > + + one paragraph: > + Line feeds are converted + to spaces, so this value + contains no line breaks + except for the final one. + + multiple paragraphs: >2 + + An empty line, either + at the start or in + the value: + + Is interpreted as a + line break. Thus this + value contains three + line breaks. + + indented text: > + This is a folded + paragraph followed + by a list: + * first entry + * second entry + Followed by another + folded paragraph, + another list: + + * first entry + + * second entry + + And a final folded + paragraph. + + above is equal to: | + This is a folded paragraph followed by a list: + * first entry + * second entry + Followed by another folded paragraph, another list: + + * first entry + + * second entry + + And a final folded paragraph. + + # Explicit comments may follow + # but must be less indented. +php: | + array( + 'empty' => '', + 'one paragraph' => 'Line feeds are converted to spaces, so this value'. + " contains no line breaks except for the final one.\n", + 'multiple paragraphs' => "\nAn empty line, either at the start or in the value:\n". + "Is interpreted as a line break. Thus this value contains three line breaks.\n", + 'indented text' => "This is a folded paragraph followed by a list:\n". + " * first entry\n * second entry\nFollowed by another folded paragraph, ". + "another list:\n\n * first entry\n\n * second entry\n\nAnd a final folded paragraph.\n", + 'above is equal to' => "This is a folded paragraph followed by a list:\n". + " * first entry\n * second entry\nFollowed by another folded paragraph, ". + "another list:\n\n * first entry\n\n * second entry\n\nAnd a final folded paragraph.\n" + ) +--- +test: Single quotes +todo: true +yaml: | + empty: '' + second: '! : \ etc. can be used freely.' + third: 'a single quote '' must be escaped.' + span: 'this contains + six spaces + + and one + line break' + is same as: "this contains six spaces\nand one line break" +php: | + array( + 'empty' => '', + 'second' => '! : \\ etc. can be used freely.', + 'third' => "a single quote ' must be escaped.", + 'span' => "this contains six spaces\nand one line break", + 'is same as' => "this contains six spaces\nand one line break" + ) +--- +test: Double quotes +todo: true +yaml: | + empty: "" + second: "! : etc. can be used freely." + third: "a \" or a \\ must be escaped." + fourth: "this value ends with an LF.\n" + span: "this contains + four \ + spaces" + is equal to: "this contains four spaces" +php: | + array( + 'empty' => '', + 'second' => '! : etc. can be used freely.', + 'third' => 'a " or a \\ must be escaped.', + 'fourth' => "this value ends with an LF.\n", + 'span' => "this contains four spaces", + 'is equal to' => "this contains four spaces" + ) +--- +test: Unquoted strings +todo: true +yaml: | + first: There is no unquoted empty string. + + second: 12 ## This is an integer. + + third: !str 12 ## This is a string. + + span: this contains + six spaces + + and one + line break + + indicators: this has no comments. + #:foo and bar# are + both text. + + flow: [ can span + lines, # comment + like + this ] + + note: { one-line keys: but multi-line values } + +php: | + array( + 'first' => 'There is no unquoted empty string.', + 'second' => 12, + 'third' => '12', + 'span' => "this contains six spaces\nand one line break", + 'indicators' => "this has no comments. #:foo and bar# are both text.", + 'flow' => [ 'can span lines', 'like this' ], + 'note' => { 'one-line keys' => 'but multi-line values' } + ) +--- +test: Spanning sequences +todo: true +yaml: | + # The following are equal seqs + # with different identities. + flow: [ one, two ] + spanning: [ one, + two ] + block: + - one + - two +php: | + array( + 'flow' => [ 'one', 'two' ], + 'spanning' => [ 'one', 'two' ], + 'block' => [ 'one', 'two' ] + ) +--- +test: Flow mappings +yaml: | + # The following are equal maps + # with different identities. + flow: { one: 1, two: 2 } + block: + one: 1 + two: 2 +php: | + array( + 'flow' => array( 'one' => 1, 'two' => 2 ), + 'block' => array( 'one' => 1, 'two' => 2 ) + ) +--- +test: Representations of 12 +todo: true +yaml: | + - 12 # An integer + # The following scalars + # are loaded to the + # string value '1' '2'. + - !str 12 + - '12' + - "12" + - "\ + 1\ + 2\ + " + # Strings containing paths and regexps can be unquoted: + - /foo/bar + - d:/foo/bar + - foo/bar + - /a.*b/ +php: | + array( 12, '12', '12', '12', '12', '/foo/bar', 'd:/foo/bar', 'foo/bar', '/a.*b/' ) +--- +test: "Null" +todo: true +yaml: | + canonical: ~ + + english: null + + # This sequence has five + # entries, two with values. + sparse: + - ~ + - 2nd entry + - Null + - 4th entry + - + + four: This mapping has five keys, + only two with values. + +php: | + array ( + 'canonical' => null, + 'english' => null, + 'sparse' => array( null, '2nd entry', null, '4th entry', null ]), + 'four' => 'This mapping has five keys, only two with values.' + ) +--- +test: Omap +todo: true +yaml: | + # Explicitly typed dictionary. + Bestiary: !omap + - aardvark: African pig-like ant eater. Ugly. + - anteater: South-American ant eater. Two species. + - anaconda: South-American constrictor snake. Scary. + # Etc. +ruby: | + { + 'Bestiary' => YAML::Omap[ + 'aardvark', 'African pig-like ant eater. Ugly.', + 'anteater', 'South-American ant eater. Two species.', + 'anaconda', 'South-American constrictor snake. Scary.' + ] + } + +--- +test: Pairs +todo: true +yaml: | + # Explicitly typed pairs. + tasks: !pairs + - meeting: with team. + - meeting: with boss. + - break: lunch. + - meeting: with client. +ruby: | + { + 'tasks' => YAML::Pairs[ + 'meeting', 'with team.', + 'meeting', 'with boss.', + 'break', 'lunch.', + 'meeting', 'with client.' + ] + } + +--- +test: Set +todo: true +yaml: | + # Explicitly typed set. + baseball players: !set + Mark McGwire: + Sammy Sosa: + Ken Griffey: +ruby: | + { + 'baseball players' => YAML::Set[ + 'Mark McGwire', nil, + 'Sammy Sosa', nil, + 'Ken Griffey', nil + ] + } + +--- +test: Boolean +yaml: | + false: used as key + logical: true + answer: false +php: | + array( + false => 'used as key', + 'logical' => true, + 'answer' => false + ) +--- +test: Integer +yaml: | + canonical: 12345 + decimal: +12,345 + octal: 014 + hexadecimal: 0xC +php: | + array( + 'canonical' => 12345, + 'decimal' => 12345, + 'octal' => 12, + 'hexadecimal' => 12 + ) +--- +test: Float +yaml: | + canonical: 1.23015e+3 + exponential: 12.3015e+02 + fixed: 1,230.15 + negative infinity: -.inf + not a number: .NaN +php: | + array( + 'canonical' => 1230.15, + 'exponential' => 1230.15, + 'fixed' => 1230.15, + 'negative infinity' => log(0), + 'not a number' => -log(0) + ) +--- +test: Timestamp +todo: true +yaml: | + canonical: 2001-12-15T02:59:43.1Z + valid iso8601: 2001-12-14t21:59:43.10-05:00 + space separated: 2001-12-14 21:59:43.10 -05:00 + date (noon UTC): 2002-12-14 +ruby: | + array( + 'canonical' => YAML::mktime( 2001, 12, 15, 2, 59, 43, 0.10 ), + 'valid iso8601' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'space separated' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'date (noon UTC)' => Date.new( 2002, 12, 14 ) + ) +--- +test: Binary +todo: true +yaml: | + canonical: !binary "\ + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" + base64: !binary | + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= + description: > + The binary value above is a tiny arrow + encoded as a gif image. +ruby-setup: | + arrow_gif = "GIF89a\f\000\f\000\204\000\000\377\377\367\365\365\356\351\351\345fff\000\000\000\347\347\347^^^\363\363\355\216\216\216\340\340\340\237\237\237\223\223\223\247\247\247\236\236\236iiiccc\243\243\243\204\204\204\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371\377\376\371!\376\016Made with GIMP\000,\000\000\000\000\f\000\f\000\000\005, \216\2010\236\343@\024\350i\020\304\321\212\010\034\317\200M$z\357\3770\205p\270\2601f\r\e\316\001\303\001\036\020' \202\n\001\000;" +ruby: | + { + 'canonical' => arrow_gif, + 'base64' => arrow_gif, + 'description' => "The binary value above is a tiny arrow encoded as a gif image.\n" + } + +--- +test: Merge key +todo: true +yaml: | + --- + - &CENTER { x: 1, y: 2 } + - &LEFT { x: 0, y: 2 } + - &BIG { r: 10 } + - &SMALL { r: 1 } + + # All the following maps are equal: + + - # Explicit keys + x: 1 + y: 2 + r: 10 + label: center/big + + - # Merge one map + << : *CENTER + r: 10 + label: center/big + + - # Merge multiple maps + << : [ *CENTER, *BIG ] + label: center/big + + - # Override + << : [ *BIG, *LEFT, *SMALL ] + x: 1 + label: center/big + +ruby-setup: | + center = { 'x' => 1, 'y' => 2 } + left = { 'x' => 0, 'y' => 2 } + big = { 'r' => 10 } + small = { 'r' => 1 } + node1 = { 'x' => 1, 'y' => 2, 'r' => 10, 'label' => 'center/big' } + node2 = center.dup + node2.update( { 'r' => 10, 'label' => 'center/big' } ) + node3 = big.dup + node3.update( center ) + node3.update( { 'label' => 'center/big' } ) + node4 = small.dup + node4.update( left ) + node4.update( big ) + node4.update( { 'x' => 1, 'label' => 'center/big' } ) + +ruby: | + [ + center, left, big, small, node1, node2, node3, node4 + ] + +--- +test: Default key +todo: true +yaml: | + --- # Old schema + link with: + - library1.dll + - library2.dll + --- # New schema + link with: + - = : library1.dll + version: 1.2 + - = : library2.dll + version: 2.3 +ruby: | + y = YAML::Stream.new + y.add( { 'link with' => [ 'library1.dll', 'library2.dll' ] } ) + obj_h = Hash[ 'version' => 1.2 ] + obj_h.default = 'library1.dll' + obj_h2 = Hash[ 'version' => 2.3 ] + obj_h2.default = 'library2.dll' + y.add( { 'link with' => [ obj_h, obj_h2 ] } ) +documents: 2 + +--- +test: Special keys +todo: true +yaml: | + "!": These three keys + "&": had to be quoted + "=": and are normal strings. + # NOTE: the following node should NOT be serialized this way. + encoded node : + !special '!' : '!type' + !special|canonical '&' : 12 + = : value + # The proper way to serialize the above node is as follows: + node : !!type &12 value +ruby: | + { '!' => 'These three keys', '&' => 'had to be quoted', + '=' => 'and are normal strings.', + 'encoded node' => YAML::PrivateType.new( 'type', 'value' ), + 'node' => YAML::PrivateType.new( 'type', 'value' ) } diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml new file mode 100644 index 0000000000000000000000000000000000000000..9972c1f0d9d528f090ddee99dc206d35c1826a22 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml @@ -0,0 +1,244 @@ +--- %YAML:1.0 +test: Strings +brief: > + Any group of characters beginning with an + alphabetic or numeric character is a string, + unless it belongs to one of the groups below + (such as an Integer or Time). +yaml: | + String +php: | + 'String' +--- +test: String characters +brief: > + A string can contain any alphabetic or + numeric character, along with many + punctuation characters, including the + period, dash, space, quotes, exclamation, and + question mark. +yaml: | + - What's Yaml? + - It's for writing data structures in plain text. + - And? + - And what? That's not good enough for you? + - No, I mean, "And what about Yaml?" + - Oh, oh yeah. Uh.. Yaml for Ruby. +php: | + array( + "What's Yaml?", + "It's for writing data structures in plain text.", + "And?", + "And what? That's not good enough for you?", + "No, I mean, \"And what about Yaml?\"", + "Oh, oh yeah. Uh.. Yaml for Ruby." + ) +--- +test: Indicators in Strings +brief: > + Be careful using indicators in strings. In particular, + the comma, colon, and pound sign must be used carefully. +yaml: | + the colon followed by space is an indicator: but is a string:right here + same for the pound sign: here we have it#in a string + the comma can, honestly, be used in most cases: [ but not in, inline collections ] +php: | + array( + 'the colon followed by space is an indicator' => 'but is a string:right here', + 'same for the pound sign' => 'here we have it#in a string', + 'the comma can, honestly, be used in most cases' => array('but not in', 'inline collections') + ) +--- +test: Forcing Strings +brief: > + Any YAML type can be forced into a string using the + explicit !str method. +yaml: | + date string: !str 2001-08-01 + number string: !str 192 +php: | + array( + 'date string' => '2001-08-01', + 'number string' => '192' + ) +--- +test: Single-quoted Strings +brief: > + You can also enclose your strings within single quotes, + which allows use of slashes, colons, and other indicators + freely. Inside single quotes, you can represent a single + quote in your string by using two single quotes next to + each other. +yaml: | + all my favorite symbols: '#:!/%.)' + a few i hate: '&(*' + why do i hate them?: 'it''s very hard to explain' + entities: '£ me' +php: | + array( + 'all my favorite symbols' => '#:!/%.)', + 'a few i hate' => '&(*', + 'why do i hate them?' => 'it\'s very hard to explain', + 'entities' => '£ me' + ) +--- +test: Double-quoted Strings +brief: > + Enclosing strings in double quotes allows you + to use escapings to represent ASCII and + Unicode characters. +yaml: | + i know where i want my line breaks: "one here\nand another here\n" +php: | + array( + 'i know where i want my line breaks' => "one here\nand another here\n" + ) +--- +test: Multi-line Quoted Strings +todo: true +brief: > + Both single- and double-quoted strings may be + carried on to new lines in your YAML document. + They must be indented a step and indentation + is interpreted as a single space. +yaml: | + i want a long string: "so i'm going to + let it go on and on to other lines + until i end it with a quote." +php: | + array('i want a long string' => "so i'm going to ". + "let it go on and on to other lines ". + "until i end it with a quote." + ) + +--- +test: Plain scalars +todo: true +brief: > + Unquoted strings may also span multiple lines, if they + are free of YAML space indicators and indented. +yaml: | + - My little toe is broken in two places; + - I'm crazy to have skied this way; + - I'm not the craziest he's seen, since there was always the German guy + who skied for 3 hours on a broken shin bone (just below the kneecap); + - Nevertheless, second place is respectable, and he doesn't + recommend going for the record; + - He's going to put my foot in plaster for a month; + - This would impair my skiing ability somewhat for the + duration, as can be imagined. +php: | + array( + "My little toe is broken in two places;", + "I'm crazy to have skied this way;", + "I'm not the craziest he's seen, since there was always ". + "the German guy who skied for 3 hours on a broken shin ". + "bone (just below the kneecap);", + "Nevertheless, second place is respectable, and he doesn't ". + "recommend going for the record;", + "He's going to put my foot in plaster for a month;", + "This would impair my skiing ability somewhat for the duration, ". + "as can be imagined." + ) +--- +test: 'Null' +brief: > + You can use the tilde '~' character for a null value. +yaml: | + name: Mr. Show + hosted by: Bob and David + date of next season: ~ +php: | + array( + 'name' => 'Mr. Show', + 'hosted by' => 'Bob and David', + 'date of next season' => null + ) +--- +test: Boolean +brief: > + You can use 'true' and 'false' for Boolean values. +yaml: | + Is Gus a Liar?: true + Do I rely on Gus for Sustenance?: false +php: | + array( + 'Is Gus a Liar?' => true, + 'Do I rely on Gus for Sustenance?' => false + ) +--- +test: Integers +dump_skip: true +brief: > + An integer is a series of numbers, optionally + starting with a positive or negative sign. Integers + may also contain commas for readability. +yaml: | + zero: 0 + simple: 12 + one-thousand: 1,000 + negative one-thousand: -1,000 +php: | + array( + 'zero' => 0, + 'simple' => 12, + 'one-thousand' => 1000, + 'negative one-thousand' => -1000 + ) +--- +test: Integers as Map Keys +brief: > + An integer can be used a dictionary key. +yaml: | + 1: one + 2: two + 3: three +php: | + array( + 1 => 'one', + 2 => 'two', + 3 => 'three' + ) +--- +test: Floats +dump_skip: true +brief: > + Floats are represented by numbers with decimals, + allowing for scientific notation, as well as + positive and negative infinity and "not a number." +yaml: | + a simple float: 2.00 + larger float: 1,000.09 + scientific notation: 1.00009e+3 +php: | + array( + 'a simple float' => 2.0, + 'larger float' => 1000.09, + 'scientific notation' => 1000.09 + ) +--- +test: Time +todo: true +brief: > + You can represent timestamps by using + ISO8601 format, or a variation which + allows spaces between the date, time and + time zone. +yaml: | + iso8601: 2001-12-14t21:59:43.10-05:00 + space seperated: 2001-12-14 21:59:43.10 -05:00 +php: | + array( + 'iso8601' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ), + 'space seperated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ) + ) +--- +test: Date +todo: true +brief: > + A date can be represented by its year, + month and day in ISO8601 order. +yaml: | + 1976-07-31 +php: | + date( 1976, 7, 31 ) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/embededPhp.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/embededPhp.yml new file mode 100644 index 0000000000000000000000000000000000000000..ec456ed09fb38097b0fa6e0a7d9fdd61c37637f3 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/embededPhp.yml @@ -0,0 +1 @@ +value: <?php echo 1 + 2 + 3 ?> diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml new file mode 100644 index 0000000000000000000000000000000000000000..09bf86e79027d00926ca1902acd4921dd16953b8 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml @@ -0,0 +1,147 @@ +test: outside double quotes +yaml: | + \0 \ \a \b \n +php: | + "\\0 \\ \\a \\b \\n" +--- +test: null +yaml: | + "\0" +php: | + "\x00" +--- +test: bell +yaml: | + "\a" +php: | + "\x07" +--- +test: backspace +yaml: | + "\b" +php: | + "\x08" +--- +test: horizontal tab (1) +yaml: | + "\t" +php: | + "\x09" +--- +test: horizontal tab (2) +yaml: | + "\ " +php: | + "\x09" +--- +test: line feed +yaml: | + "\n" +php: | + "\x0a" +--- +test: vertical tab +yaml: | + "\v" +php: | + "\x0b" +--- +test: form feed +yaml: | + "\f" +php: | + "\x0c" +--- +test: carriage return +yaml: | + "\r" +php: | + "\x0d" +--- +test: escape +yaml: | + "\e" +php: | + "\x1b" +--- +test: space +yaml: | + "\ " +php: | + "\x20" +--- +test: slash +yaml: | + "\/" +php: | + "\x2f" +--- +test: backslash +yaml: | + "\\" +php: | + "\\" +--- +test: Unicode next line +yaml: | + "\N" +php: | + "\xc2\x85" +--- +test: Unicode non-breaking space +yaml: | + "\_" +php: | + "\xc2\xa0" +--- +test: Unicode line separator +yaml: | + "\L" +php: | + "\xe2\x80\xa8" +--- +test: Unicode paragraph separator +yaml: | + "\P" +php: | + "\xe2\x80\xa9" +--- +test: Escaped 8-bit Unicode +yaml: | + "\x42" +php: | + "B" +--- +test: Escaped 16-bit Unicode +yaml: | + "\u20ac" +php: | + "\xe2\x82\xac" +--- +test: Escaped 32-bit Unicode +yaml: | + "\U00000043" +php: | + "C" +--- +test: Example 5.13 Escaped Characters +note: | + Currently throws an error parsing first line. Maybe Symfony Yaml doesn't support + continuation of string across multiple lines? Keeping test here but disabled. +todo: true +yaml: | + "Fun with \\ + \" \a \b \e \f \ + \n \r \t \v \0 \ + \ \_ \N \L \P \ + \x41 \u0041 \U00000041" +php: | + "Fun with \x5C\n\x22 \x07 \x08 \x1B \x0C\n\x0A \x0D \x09 \x0B \x00\n\x20 \xA0 \x85 \xe2\x80\xa8 \xe2\x80\xa9\nA A A" +--- +test: Double quotes with a line feed +yaml: | + { double: "some value\n \"some quoted string\" and 'some single quotes one'" } +php: | + array( + 'double' => "some value\n \"some quoted string\" and 'some single quotes one'" + ) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/index.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/index.yml new file mode 100644 index 0000000000000000000000000000000000000000..3216a89ebbc392af1fc2e86ac5aae4bfa3e3e864 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/index.yml @@ -0,0 +1,18 @@ +- escapedCharacters +- sfComments +- sfCompact +- sfTests +- sfObjects +- sfMergeKey +- sfQuotes +- YtsAnchorAlias +- YtsBasicTests +- YtsBlockMapping +- YtsDocumentSeparator +- YtsErrorTests +- YtsFlowCollections +- YtsFoldedScalars +- YtsNullsAndEmpties +- YtsSpecificationExamples +- YtsTypeTransfers +- unindentedCollections diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml new file mode 100644 index 0000000000000000000000000000000000000000..34225e11e0a9f44c856eb863ed849cd56fa9484f --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml @@ -0,0 +1,51 @@ +--- %YAML:1.0 +test: Comments at the end of a line +brief: > + Comments at the end of a line +yaml: | + ex1: "foo # bar" + ex2: "foo # bar" # comment + ex3: 'foo # bar' # comment + ex4: foo # comment +php: | + array('ex1' => 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar', 'ex4' => 'foo') +--- +test: Comments in the middle +brief: > + Comments in the middle +yaml: | + foo: + # some comment + # some comment + bar: foo + # some comment + # some comment +php: | + array('foo' => array('bar' => 'foo')) +--- +test: Comments on a hash line +brief: > + Comments on a hash line +yaml: | + foo: # a comment + foo: bar # a comment +php: | + array('foo' => array('foo' => 'bar')) +--- +test: 'Value starting with a #' +brief: > + 'Value starting with a #' +yaml: | + foo: '#bar' +php: | + array('foo' => '#bar') +--- +test: Document starting with a comment and a separator +brief: > + Commenting before document start is allowed +yaml: | + # document comment + --- + foo: bar # a comment +php: | + array('foo' => 'bar') diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml new file mode 100644 index 0000000000000000000000000000000000000000..1339d23a6305c8471b52556bb120cf4d35f58c93 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfCompact.yml @@ -0,0 +1,159 @@ +--- %YAML:1.0 +test: Compact notation +brief: | + Compact notation for sets of mappings with single element +yaml: | + --- + # products purchased + - item : Super Hoop + - item : Basketball + quantity: 1 + - item: + name: Big Shoes + nick: Biggies + quantity: 1 +php: | + array ( + array ( + 'item' => 'Super Hoop', + ), + array ( + 'item' => 'Basketball', + 'quantity' => 1, + ), + array ( + 'item' => array( + 'name' => 'Big Shoes', + 'nick' => 'Biggies' + ), + 'quantity' => 1 + ) + ) +--- +test: Compact notation combined with inline notation +brief: | + Combinations of compact and inline notation are allowed +yaml: | + --- + items: + - { item: Super Hoop, quantity: 1 } + - [ Basketball, Big Shoes ] +php: | + array ( + 'items' => array ( + array ( + 'item' => 'Super Hoop', + 'quantity' => 1, + ), + array ( + 'Basketball', + 'Big Shoes' + ) + ) + ) +--- %YAML:1.0 +test: Compact notation +brief: | + Compact notation for sets of mappings with single element +yaml: | + --- + # products purchased + - item : Super Hoop + - item : Basketball + quantity: 1 + - item: + name: Big Shoes + nick: Biggies + quantity: 1 +php: | + array ( + array ( + 'item' => 'Super Hoop', + ), + array ( + 'item' => 'Basketball', + 'quantity' => 1, + ), + array ( + 'item' => array( + 'name' => 'Big Shoes', + 'nick' => 'Biggies' + ), + 'quantity' => 1 + ) + ) +--- +test: Compact notation combined with inline notation +brief: | + Combinations of compact and inline notation are allowed +yaml: | + --- + items: + - { item: Super Hoop, quantity: 1 } + - [ Basketball, Big Shoes ] +php: | + array ( + 'items' => array ( + array ( + 'item' => 'Super Hoop', + 'quantity' => 1, + ), + array ( + 'Basketball', + 'Big Shoes' + ) + ) + ) +--- %YAML:1.0 +test: Compact notation +brief: | + Compact notation for sets of mappings with single element +yaml: | + --- + # products purchased + - item : Super Hoop + - item : Basketball + quantity: 1 + - item: + name: Big Shoes + nick: Biggies + quantity: 1 +php: | + array ( + array ( + 'item' => 'Super Hoop', + ), + array ( + 'item' => 'Basketball', + 'quantity' => 1, + ), + array ( + 'item' => array( + 'name' => 'Big Shoes', + 'nick' => 'Biggies' + ), + 'quantity' => 1 + ) + ) +--- +test: Compact notation combined with inline notation +brief: | + Combinations of compact and inline notation are allowed +yaml: | + --- + items: + - { item: Super Hoop, quantity: 1 } + - [ Basketball, Big Shoes ] +php: | + array ( + 'items' => array ( + array ( + 'item' => 'Super Hoop', + 'quantity' => 1, + ), + array ( + 'Basketball', + 'Big Shoes' + ) + ) + ) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml new file mode 100644 index 0000000000000000000000000000000000000000..3eec4f877daacadc07c9eb068d9c448152d40b47 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfMergeKey.yml @@ -0,0 +1,27 @@ +--- %YAML:1.0 +test: Simple In Place Substitution +brief: > + If you want to reuse an entire alias, only overwriting what is different + you can use a << in place substitution. This is not part of the official + YAML spec, but a widely implemented extension. See the following URL for + details: http://yaml.org/type/merge.html +yaml: | + foo: &foo + a: Steve + b: Clark + c: Brian + bar: &bar + <<: *foo + x: Oren + foo2: &foo2 + a: Ballmer + ding: &dong [ fi, fei, fo, fam] + check: + <<: + - *foo + - *dong + isit: tested + head: + <<: [ *foo , *dong , *foo2 ] +php: | + array('foo' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian'), 'bar' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'x' => 'Oren'), 'foo2' => array('a' => 'Ballmer'), 'ding' => array('fi', 'fei', 'fo', 'fam'), 'check' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'fi', 'fei', 'fo', 'fam', 'isit' => 'tested'), 'head' => array('a' => 'Ballmer', 'b' => 'Clark', 'c' => 'Brian', 'fi', 'fei', 'fo', 'fam')) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml new file mode 100644 index 0000000000000000000000000000000000000000..ee124b2446eb9ba04b63fb6c2c68708f4b04822f --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfObjects.yml @@ -0,0 +1,11 @@ +--- %YAML:1.0 +test: Objects +brief: > + Comments at the end of a line +yaml: | + ex1: "foo # bar" + ex2: "foo # bar" # comment + ex3: 'foo # bar' # comment + ex4: foo # comment +php: | + array('ex1' => 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar', 'ex4' => 'foo') diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml new file mode 100644 index 0000000000000000000000000000000000000000..741f1befeb8e7aa48d6f338708434d0e51fc5306 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfQuotes.yml @@ -0,0 +1,33 @@ +--- %YAML:1.0 +test: Some characters at the beginning of a string must be escaped +brief: > + Some characters at the beginning of a string must be escaped +yaml: | + foo: | bar +php: | + array('foo' => '| bar') +--- +test: A key can be a quoted string +brief: > + A key can be a quoted string +yaml: | + "foo1": bar + 'foo2': bar + "foo \" bar": bar + 'foo '' bar': bar + 'foo3: ': bar + "foo4: ": bar + foo5: { "foo \" bar: ": bar, 'foo '' bar: ': bar } +php: | + array( + 'foo1' => 'bar', + 'foo2' => 'bar', + 'foo " bar' => 'bar', + 'foo \' bar' => 'bar', + 'foo3: ' => 'bar', + 'foo4: ' => 'bar', + 'foo5' => array( + 'foo " bar: ' => 'bar', + 'foo \' bar: ' => 'bar', + ), + ) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml new file mode 100644 index 0000000000000000000000000000000000000000..7a54f1639b117417f27d1ce72bbfa7414d0e50e2 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml @@ -0,0 +1,135 @@ +--- %YAML:1.0 +test: Multiple quoted string on one line +brief: > + Multiple quoted string on one line +yaml: | + stripped_title: { name: "foo bar", help: "bar foo" } +php: | + array('stripped_title' => array('name' => 'foo bar', 'help' => 'bar foo')) +--- +test: Empty sequence +yaml: | + foo: [ ] +php: | + array('foo' => array()) +--- +test: Empty value +yaml: | + foo: +php: | + array('foo' => null) +--- +test: Inline string parsing +brief: > + Inline string parsing +yaml: | + test: ['complex: string', 'another [string]'] +php: | + array('test' => array('complex: string', 'another [string]')) +--- +test: Boolean +brief: > + Boolean +yaml: | + - false + - true + - null + - ~ + - 'false' + - 'true' + - 'null' + - '~' +php: | + array( + false, + true, + null, + null, + 'false', + 'true', + 'null', + '~', + ) +--- +test: Empty lines in folded blocks +brief: > + Empty lines in folded blocks +yaml: | + foo: + bar: | + foo + + + + bar +php: | + array('foo' => array('bar' => "foo\n\n\n \nbar\n")) +--- +test: IP addresses +brief: > + IP addresses +yaml: | + foo: 10.0.0.2 +php: | + array('foo' => '10.0.0.2') +--- +test: A sequence with an embedded mapping +brief: > + A sequence with an embedded mapping +yaml: | + - foo + - bar: { bar: foo } +php: | + array('foo', array('bar' => array('bar' => 'foo'))) +--- +test: A sequence with an unordered array +brief: > + A sequence with an unordered array +yaml: | + 1: foo + 0: bar +php: | + array(1 => 'foo', 0 => 'bar') +--- +test: Octal +brief: as in spec example 2.19, octal value is converted +yaml: | + foo: 0123 +php: | + array('foo' => 83) +--- +test: Octal strings +brief: Octal notation in a string must remain a string +yaml: | + foo: "0123" +php: | + array('foo' => '0123') +--- +test: Octal strings +brief: Octal notation in a string must remain a string +yaml: | + foo: '0123' +php: | + array('foo' => '0123') +--- +test: Octal strings +brief: Octal notation in a string must remain a string +yaml: | + foo: | + 0123 +php: | + array('foo' => "0123\n") +--- +test: Document as a simple hash +brief: Document as a simple hash +yaml: | + { foo: bar } +php: | + array('foo' => 'bar') +--- +test: Document as a simple array +brief: Document as a simple array +yaml: | + [ foo, bar ] +php: | + array('foo', 'bar') diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml new file mode 100644 index 0000000000000000000000000000000000000000..fd8ad7ed448db42ed328ec36c86be10f53f33858 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml @@ -0,0 +1,62 @@ +--- %YAML:1.0 +test: Unindented collection +brief: > + Unindented collection +yaml: | + collection: + - item1 + - item2 + - item3 +php: | + array('collection' => array('item1', 'item2', 'item3')) +--- +test: Nested unindented collection (two levels) +brief: > + Nested unindented collection +yaml: | + collection: + key: + - a + - b + - c +php: | + array('collection' => array('key' => array('a', 'b', 'c'))) +--- +test: Nested unindented collection (three levels) +brief: > + Nested unindented collection +yaml: | + collection: + key: + subkey: + - one + - two + - three +php: | + array('collection' => array('key' => array('subkey' => array('one', 'two', 'three')))) +--- +test: Key/value after unindented collection (1) +brief: > + Key/value after unindented collection (1) +yaml: | + collection: + key: + - a + - b + - c + foo: bar +php: | + array('collection' => array('key' => array('a', 'b', 'c')), 'foo' => 'bar') +--- +test: Key/value after unindented collection (at the same level) +brief: > + Key/value after unindented collection +yaml: | + collection: + key: + - a + - b + - c + foo: bar +php: | + array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar')) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php new file mode 100644 index 0000000000000000000000000000000000000000..2684fa557eb8197a9ba78ac6477175884d2082ab --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php @@ -0,0 +1,211 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Yaml\Inline; + +class InlineTest extends \PHPUnit_Framework_TestCase +{ + public function testParse() + { + foreach ($this->getTestsForParse() as $yaml => $value) { + $this->assertEquals($value, Inline::parse($yaml), sprintf('::parse() converts an inline YAML to a PHP structure (%s)', $yaml)); + } + } + + public function testDump() + { + $testsForDump = $this->getTestsForDump(); + + foreach ($testsForDump as $yaml => $value) { + $this->assertEquals($yaml, Inline::dump($value), sprintf('::dump() converts a PHP structure to an inline YAML (%s)', $yaml)); + } + + foreach ($this->getTestsForParse() as $yaml => $value) { + $this->assertEquals($value, Inline::parse(Inline::dump($value)), 'check consistency'); + } + + foreach ($testsForDump as $yaml => $value) { + $this->assertEquals($value, Inline::parse(Inline::dump($value)), 'check consistency'); + } + } + + public function testDumpNumericValueWithLocale() + { + $locale = setlocale(LC_NUMERIC, 0); + if (false === $locale) { + $this->markTestSkipped('Your platform does not support locales.'); + } + + $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); + if (false === setlocale(LC_ALL, $required_locales)) { + $this->markTestSkipped('Could not set any of required locales: ' . implode(", ", $required_locales)); + } + + $this->assertEquals('1.2', Inline::dump(1.2)); + $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); + + setlocale(LC_ALL, $locale); + } + + public function testHashStringsResemblingExponentialNumericsShouldNotBeChangedToINF() + { + $value = '686e444'; + + $this->assertSame($value, Inline::parse(Inline::dump($value))); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseScalarWithIncorrectlyQuotedStringShouldThrowException() + { + $value = "'don't do somthin' like that'"; + Inline::parse($value); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseScalarWithIncorrectlyDoubleQuotedStringShouldThrowException() + { + $value = '"don"t do somthin" like that"'; + Inline::parse($value); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testParseInvalidMappingKeyShouldThrowException() + { + $value = '{ "foo " bar": "bar" }'; + Inline::parse($value); + } + + public function testParseScalarWithCorrectlyQuotedStringShouldReturnString() + { + $value = "'don''t do somthin'' like that'"; + $expect = "don't do somthin' like that"; + + $this->assertSame($expect, Inline::parseScalar($value)); + } + + protected function getTestsForParse() + { + return array( + '' => '', + 'null' => null, + 'false' => false, + 'true' => true, + '12' => 12, + '"quoted string"' => 'quoted string', + "'quoted string'" => 'quoted string', + '12.30e+02' => 12.30e+02, + '0x4D2' => 0x4D2, + '02333' => 02333, + '.Inf' => -log(0), + '-.Inf' => log(0), + "'686e444'" => '686e444', + '686e444' => 646e444, + '123456789123456789' => '123456789123456789', + '"foo\r\nbar"' => "foo\r\nbar", + "'foo#bar'" => 'foo#bar', + "'foo # bar'" => 'foo # bar', + "'#cfcfcf'" => '#cfcfcf', + '::form_base.html.twig' => '::form_base.html.twig', + + '2007-10-30' => mktime(0, 0, 0, 10, 30, 2007), + '2007-10-30T02:59:43Z' => gmmktime(2, 59, 43, 10, 30, 2007), + '2007-10-30 02:59:43 Z' => gmmktime(2, 59, 43, 10, 30, 2007), + + '"a \\"string\\" with \'quoted strings inside\'"' => 'a "string" with \'quoted strings inside\'', + "'a \"string\" with ''quoted strings inside'''" => 'a "string" with \'quoted strings inside\'', + + // sequences + // urls are no key value mapping. see #3609. Valid yaml "key: value" mappings require a space after the colon + '[foo, http://urls.are/no/mappings, false, null, 12]' => array('foo', 'http://urls.are/no/mappings', false, null, 12), + '[ foo , bar , false , null , 12 ]' => array('foo', 'bar', false, null, 12), + '[\'foo,bar\', \'foo bar\']' => array('foo,bar', 'foo bar'), + + // mappings + '{foo:bar,bar:foo,false:false,null:null,integer:12}' => array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12), + '{ foo : bar, bar : foo, false : false, null : null, integer : 12 }' => array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12), + '{foo: \'bar\', bar: \'foo: bar\'}' => array('foo' => 'bar', 'bar' => 'foo: bar'), + '{\'foo\': \'bar\', "bar": \'foo: bar\'}' => array('foo' => 'bar', 'bar' => 'foo: bar'), + '{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}' => array('foo\'' => 'bar', "bar\"" => 'foo: bar'), + '{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}' => array('foo: ' => 'bar', "bar: " => 'foo: bar'), + + // nested sequences and mappings + '[foo, [bar, foo]]' => array('foo', array('bar', 'foo')), + '[foo, {bar: foo}]' => array('foo', array('bar' => 'foo')), + '{ foo: {bar: foo} }' => array('foo' => array('bar' => 'foo')), + '{ foo: [bar, foo] }' => array('foo' => array('bar', 'foo')), + + '[ foo, [ bar, foo ] ]' => array('foo', array('bar', 'foo')), + + '[{ foo: {bar: foo} }]' => array(array('foo' => array('bar' => 'foo'))), + + '[foo, [bar, [foo, [bar, foo]], foo]]' => array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo')), + + '[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), + + '[foo, bar: { foo: bar }]' => array('foo', '1' => array('bar' => array('foo' => 'bar'))), + '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%',), true, '@service_container',), + ); + } + + protected function getTestsForDump() + { + return array( + 'null' => null, + 'false' => false, + 'true' => true, + '12' => 12, + "'quoted string'" => 'quoted string', + '12.30e+02' => 12.30e+02, + '1234' => 0x4D2, + '1243' => 02333, + '.Inf' => -log(0), + '-.Inf' => log(0), + "'686e444'" => '686e444', + '.Inf' => 646e444, + '"foo\r\nbar"' => "foo\r\nbar", + "'foo#bar'" => 'foo#bar', + "'foo # bar'" => 'foo # bar', + "'#cfcfcf'" => '#cfcfcf', + + "'a \"string\" with ''quoted strings inside'''" => 'a "string" with \'quoted strings inside\'', + + // sequences + '[foo, bar, false, null, 12]' => array('foo', 'bar', false, null, 12), + '[\'foo,bar\', \'foo bar\']' => array('foo,bar', 'foo bar'), + + // mappings + '{ foo: bar, bar: foo, \'false\': false, \'null\': null, integer: 12 }' => array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12), + '{ foo: bar, bar: \'foo: bar\' }' => array('foo' => 'bar', 'bar' => 'foo: bar'), + + // nested sequences and mappings + '[foo, [bar, foo]]' => array('foo', array('bar', 'foo')), + + '[foo, [bar, [foo, [bar, foo]], foo]]' => array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo')), + + '{ foo: { bar: foo } }' => array('foo' => array('bar' => 'foo')), + + '[foo, { bar: foo }]' => array('foo', array('bar' => 'foo')), + + '[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), + + '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%',), true, '@service_container',), + ); + } +} diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php new file mode 100644 index 0000000000000000000000000000000000000000..6980523018c53c942c4481583f3abbc8c5fd066c --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php @@ -0,0 +1,209 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Yaml\Parser; + +class ParserTest extends \PHPUnit_Framework_TestCase +{ + protected $parser; + + protected function setUp() + { + $this->parser = new Parser(); + } + + protected function tearDown() + { + $this->parser = null; + } + + /** + * @dataProvider getDataFormSpecifications + */ + public function testSpecifications($file, $expected, $yaml, $comment) + { + if ('escapedCharacters' == $file) { + if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { + $this->markTestSkipped('The iconv and mbstring extensions are not available.'); + } + } + + $this->assertEquals($expected, var_export($this->parser->parse($yaml), true), $comment); + } + + public function getDataFormSpecifications() + { + $parser = new Parser(); + $path = __DIR__.'/Fixtures'; + + $tests = array(); + $files = $parser->parse(file_get_contents($path.'/index.yml')); + foreach ($files as $file) { + $yamls = file_get_contents($path.'/'.$file.'.yml'); + + // split YAMLs documents + foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) { + if (!$yaml) { + continue; + } + + $test = $parser->parse($yaml); + if (isset($test['todo']) && $test['todo']) { + // TODO + } else { + $expected = var_export(eval('return '.trim($test['php']).';'), true); + + $tests[] = array($file, $expected, $test['yaml'], $test['test']); + } + } + } + + return $tests; + } + + public function testTabsInYaml() + { + // test tabs in YAML + $yamls = array( + "foo:\n bar", + "foo:\n bar", + "foo:\n bar", + "foo:\n bar", + ); + + foreach ($yamls as $yaml) { + try { + $content = $this->parser->parse($yaml); + + $this->fail('YAML files must not contain tabs'); + } catch (\Exception $e) { + $this->assertInstanceOf('\Exception', $e, 'YAML files must not contain tabs'); + $this->assertEquals('A YAML file cannot contain tabs as indentation at line 2 (near "'.strpbrk($yaml, "\t").'").', $e->getMessage(), 'YAML files must not contain tabs'); + } + } + } + + public function testEndOfTheDocumentMarker() + { + $yaml = <<<EOF +--- %YAML:1.0 +foo +... +EOF; + + $this->assertEquals('foo', $this->parser->parse($yaml)); + } + + public function testObjectSupportEnabled() + { + $input = <<<EOF +foo: !!php/object:O:30:"Symfony\Component\Yaml\Tests\B":1:{s:1:"b";s:3:"foo";} +bar: 1 +EOF; + $this->assertEquals(array('foo' => new B(), 'bar' => 1), $this->parser->parse($input, false, true), '->parse() is able to parse objects'); + } + + public function testObjectSupportDisabledButNoExceptions() + { + $input = <<<EOF +foo: !!php/object:O:30:"Symfony\Tests\Component\Yaml\B":1:{s:1:"b";s:3:"foo";} +bar: 1 +EOF; + + $this->assertEquals(array('foo' => null, 'bar' => 1), $this->parser->parse($input), '->parse() does not parse objects'); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testObjectsSupportDisabledWithExceptions() + { + $this->parser->parse('foo: !!php/object:O:30:"Symfony\Tests\Component\Yaml\B":1:{s:1:"b";s:3:"foo";}', true, false); + } + + public function testNonUtf8Exception() + { + if (!function_exists('mb_detect_encoding') || !function_exists('iconv')) { + $this->markTestSkipped('Exceptions for non-utf8 charsets require the mb_detect_encoding() and iconv() functions.'); + + return; + } + + $yamls = array( + iconv("UTF-8", "ISO-8859-1", "foo: 'äöüß'"), + iconv("UTF-8", "ISO-8859-15", "euro: '€'"), + iconv("UTF-8", "CP1252", "cp1252: '©ÉÇáñ'") + ); + + foreach ($yamls as $yaml) { + try { + $this->parser->parse($yaml); + + $this->fail('charsets other than UTF-8 are rejected.'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other than UTF-8 are rejected.'); + } + } + } + + /** + * + * @expectedException Symfony\Component\Yaml\Exception\ParseException + * + */ + public function testUnindentedCollectionException() + { + $yaml = <<<EOF + +collection: +-item1 +-item2 +-item3 + +EOF; + + $this->parser->parse($yaml); + } + + /** + * @expectedException Symfony\Component\Yaml\Exception\ParseException + */ + public function testSequenceInAMapping() + { + Yaml::parse(<<<EOF +yaml: + hash: me + - array stuff +EOF + ); + } + + /** + * @expectedException Symfony\Component\Yaml\Exception\ParseException + */ + public function testMappingInASequence() + { + Yaml::parse(<<<EOF +yaml: + - array stuff + hash: me +EOF + ); + } +} + +class B +{ + public $b = 'foo'; +} diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/YamlTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/YamlTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b1a9ba08c1f69590146a5bc73064b5a30d5e6574 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/YamlTest.php @@ -0,0 +1,41 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Yaml\Tests; + +use Symfony\Component\Yaml\Yaml; + +class YamlTest extends \PHPUnit_Framework_TestCase +{ + + public function testParseAndDump() + { + $data = array('lorem' => 'ipsum', 'dolor' => 'sit'); + $yml = Yaml::dump($data); + $parsed = Yaml::parse($yml); + $this->assertEquals($data, $parsed); + + $filename = __DIR__.'/Fixtures/index.yml'; + $contents = file_get_contents($filename); + $parsedByFilename = Yaml::parse($filename); + $parsedByContents = Yaml::parse($contents); + $this->assertEquals($parsedByFilename, $parsedByContents); + } + + public function testEmbededPhp() + { + $filename = __DIR__.'/Fixtures/embededPhp.yml'; + Yaml::enablePhpParsing(); + $parsed = Yaml::parse($filename); + $this->assertEquals(array('value' => 6), $parsed); + } + +} diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/bootstrap.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..985f1f22e2c6a490226da0b20ee6d9bd5c8dbb15 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/bootstrap.php @@ -0,0 +1,18 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +spl_autoload_register(function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Yaml')) { + if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Yaml')).'.php')) { + require_once $file; + } + } +}); diff --git a/vendor/Symfony/Component/Yaml/Unescaper.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php similarity index 100% rename from vendor/Symfony/Component/Yaml/Unescaper.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php diff --git a/vendor/Symfony/Component/Yaml/Yaml.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php similarity index 56% rename from vendor/Symfony/Component/Yaml/Yaml.php rename to vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php index 85cdf3db66ec9183d6a48db052600591c9f1f287..f16184188ef4702513993aa2cfd5bbf1c309aeb3 100644 --- a/vendor/Symfony/Component/Yaml/Yaml.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php @@ -22,13 +22,53 @@ use Symfony\Component\Yaml\Exception\ParseException; */ class Yaml { + /** + * Be warned that PHP support will be removed in Symfony 2.3. + * + * @deprecated Deprecated since version 2.0, to be removed in 2.3. + */ public static $enablePhpParsing = false; + /** + * Enables PHP support when parsing YAML files. + * + * Be warned that PHP support will be removed in Symfony 2.3. + * + * @deprecated Deprecated since version 2.0, to be removed in 2.3. + */ public static function enablePhpParsing() { self::$enablePhpParsing = true; } + /** + * Sets the PHP support flag when parsing YAML files. + * + * Be warned that PHP support will be removed in Symfony 2.3. + * + * @param Boolean $boolean true if PHP parsing support is enabled, false otherwise + * + * @deprecated Deprecated since version 2.0, to be removed in 2.3. + */ + public static function setPhpParsing($boolean) + { + self::$enablePhpParsing = (Boolean) $boolean; + } + + /** + * Checks if PHP support is enabled when parsing YAML files. + * + * Be warned that PHP support will be removed in Symfony 2.3. + * + * @return Boolean true if PHP parsing support is enabled, false otherwise + * + * @deprecated Deprecated since version 2.0, to be removed in 2.3. + */ + public static function supportsPhpParsing() + { + return self::$enablePhpParsing; + } + /** * Parses YAML into a PHP array. * @@ -49,7 +89,7 @@ class Yaml * * @api */ - public static function parse($input) + public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false) { // if input is a file, process it $file = ''; @@ -79,7 +119,7 @@ class Yaml $yaml = new Parser(); try { - return $yaml->parse($input); + return $yaml->parse($input, $exceptionOnInvalidType, $objectSupport); } catch (ParseException $e) { if ($file) { $e->setParsedFile($file); @@ -95,19 +135,21 @@ class Yaml * The dump method, when supplied with an array, will do its best * to convert the array into friendly YAML. * - * @param array $array PHP array - * @param integer $inline The level where you switch to inline YAML - * @param integer $indent The amount of spaces to use for indentation of nested nodes. + * @param array $array PHP array + * @param integer $inline The level where you switch to inline YAML + * @param integer $indent The amount of spaces to use for indentation of nested nodes. + * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param Boolean $objectSupport true if object support is enabled, false otherwise * * @return string A YAML string representing the original PHP array * * @api */ - public static function dump($array, $inline = 2, $indent = 4) + public static function dump($array, $inline = 2, $indent = 2, $exceptionOnInvalidType = false, $objectSupport = false) { $yaml = new Dumper(); $yaml->setIndentation($indent); - return $yaml->dump($array, $inline); + return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport); } } diff --git a/vendor/Symfony/Component/Yaml/composer.json b/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json similarity index 82% rename from vendor/Symfony/Component/Yaml/composer.json rename to vendor/symfony/yaml/Symfony/Component/Yaml/composer.json index 88460ce34b70d61fdaac152010ed55bf55840868..dfabb51881fa9b2cffc91f2ac4488cee5acd2195 100644 --- a/vendor/Symfony/Component/Yaml/composer.json +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json @@ -22,10 +22,5 @@ "psr-0": { "Symfony\\Component\\Yaml": "" } }, "target-dir": "Symfony/Component/Yaml", - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - } + "minimum-stability": "dev" } diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist b/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..d025f9e49a7e63c18f36e28020aa9232ae10e7a7 --- /dev/null +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + backupStaticAttributes="false" + colors="true" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + stopOnFailure="false" + syntaxCheck="false" + bootstrap="Tests/bootstrap.php" +> + <testsuites> + <testsuite name="Symfony Yaml Component Test Suite"> + <directory>./Tests/</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist> + <directory>./</directory> + <exclude> + <directory>./vendor</directory> + <directory>./Tests</directory> + </exclude> + </whitelist> + </filter> +</phpunit> diff --git a/vendor/ZF2/LICENSE.txt b/vendor/zendframework/zendframework/LICENSE.txt similarity index 100% rename from vendor/ZF2/LICENSE.txt rename to vendor/zendframework/zendframework/LICENSE.txt diff --git a/vendor/zendframework/zendframework/README.md b/vendor/zendframework/zendframework/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1ace0bca960743a199bef5710db38200aac3ba6b --- /dev/null +++ b/vendor/zendframework/zendframework/README.md @@ -0,0 +1,59 @@ +### Welcome to the *Zend Framework 2.1* Release! + +Master: [](http://travis-ci.org/zendframework/zf2) +Develop: [](http://travis-ci.org/zendframework/zf2) + +## RELEASE INFORMATION + +*Zend Framework 2.1.2* + +This is the second maintenance release for the version 2.1 series. + +20 Feb 2013 + +### UPDATES IN 2.1.2 + +Please see [CHANGELOG.md](CHANGELOG.md). + +### SYSTEM REQUIREMENTS + +Zend Framework 2 requires PHP 5.3.3 or later; we recommend using the +latest PHP version whenever possible. + +### INSTALLATION + +Please see [INSTALL.md](INSTALL.md). + +### CONTRIBUTING + +If you wish to contribute to Zend Framework, please read both the +[CONTRIBUTING.md](CONTRIBUTING.md) and [README-GIT.md](README-GIT.md) file. + +### QUESTIONS AND FEEDBACK + +Online documentation can be found at http://framework.zend.com/manual. +Questions that are not addressed in the manual should be directed to the +appropriate mailing list: + +http://framework.zend.com/archives/subscribe/ + +If you find code in this release behaving in an unexpected manner or +contrary to its documented behavior, please create an issue in our GitHub +issue tracker: + +https://github.com/zendframework/zf2/issues + +If you would like to be notified of new releases, you can subscribe to +the fw-announce mailing list by sending a blank message to +<fw-announce-subscribe@lists.zend.com>. + +### LICENSE + +The files in this archive are released under the Zend Framework license. +You can find a copy of this license in [LICENSE.txt](LICENSE.txt). + +### ACKNOWLEDGEMENTS + +The Zend Framework team would like to thank all the [contributors](https://github.com/zendframework/zf2/contributors) to the Zend +Framework project, our corporate sponsor, and you, the Zend Framework user. +Please visit us sometime soon at http://framework.zend.com. diff --git a/vendor/ZF2/bin/autoload_example.php b/vendor/zendframework/zendframework/bin/autoload_example.php similarity index 100% rename from vendor/ZF2/bin/autoload_example.php rename to vendor/zendframework/zendframework/bin/autoload_example.php diff --git a/vendor/ZF2/bin/autoload_examples.php b/vendor/zendframework/zendframework/bin/autoload_examples.php similarity index 100% rename from vendor/ZF2/bin/autoload_examples.php rename to vendor/zendframework/zendframework/bin/autoload_examples.php diff --git a/vendor/ZF2/bin/check-cs.sh b/vendor/zendframework/zendframework/bin/check-cs.sh similarity index 100% rename from vendor/ZF2/bin/check-cs.sh rename to vendor/zendframework/zendframework/bin/check-cs.sh diff --git a/vendor/ZF2/bin/classmap_generator.php b/vendor/zendframework/zendframework/bin/classmap_generator.php similarity index 100% rename from vendor/ZF2/bin/classmap_generator.php rename to vendor/zendframework/zendframework/bin/classmap_generator.php diff --git a/vendor/ZF2/bin/createAutoloadTestClasses.php b/vendor/zendframework/zendframework/bin/createAutoloadTestClasses.php similarity index 100% rename from vendor/ZF2/bin/createAutoloadTestClasses.php rename to vendor/zendframework/zendframework/bin/createAutoloadTestClasses.php diff --git a/vendor/ZF2/bin/pluginmap_generator.php b/vendor/zendframework/zendframework/bin/pluginmap_generator.php similarity index 100% rename from vendor/ZF2/bin/pluginmap_generator.php rename to vendor/zendframework/zendframework/bin/pluginmap_generator.php diff --git a/vendor/ZF2/bin/templatemap_generator.php b/vendor/zendframework/zendframework/bin/templatemap_generator.php similarity index 100% rename from vendor/ZF2/bin/templatemap_generator.php rename to vendor/zendframework/zendframework/bin/templatemap_generator.php diff --git a/vendor/zendframework/zendframework/composer.json b/vendor/zendframework/zendframework/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..77f70e1271aa896d5fea375b5723dc15cf805cbb --- /dev/null +++ b/vendor/zendframework/zendframework/composer.json @@ -0,0 +1,96 @@ +{ + "name": "zendframework/zendframework", + "description": "Zend Framework 2", + "type": "library", + "keywords": [ + "framework", + "zf2" + ], + "homepage": "http://framework.zend.com/", + "license": "BSD-3-Clause", + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "doctrine/common": ">=2.1", + "phpunit/PHPUnit": "3.7.*" + }, + "suggest": { + "doctrine/common": "Doctrine\\Common >=2.1 for annotation features", + "ext-intl": "ext/intl for i18n features", + "pecl-weakref": "Implementation of weak references for Zend\\Stdlib\\CallbackHandler", + "zendframework/zendpdf": "ZendPdf for creating PDF representations of barcodes", + "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha for rendering ReCaptchas in Zend\\Captcha and/or Zend\\Form" + }, + "autoload": { + "psr-0": { + "Zend\\": "library/", + "ZendTest\\": "tests/" + }, + "files": [ + "library/Zend/Stdlib/compatibility/autoload.php", + "library/Zend/Session/compatibility/autoload.php" + ] + }, + "bin": [ + "bin/classmap_generator.php" + ], + "replace": { + "zendframework/zend-authentication": "self.version", + "zendframework/zend-barcode": "self.version", + "zendframework/zend-cache": "self.version", + "zendframework/zend-captcha": "self.version", + "zendframework/zend-code": "self.version", + "zendframework/zend-config": "self.version", + "zendframework/zend-console": "self.version", + "zendframework/zend-crypt": "self.version", + "zendframework/zend-db": "self.version", + "zendframework/zend-debug": "self.version", + "zendframework/zend-di": "self.version", + "zendframework/zend-dom": "self.version", + "zendframework/zend-escaper": "self.version", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-feed": "self.version", + "zendframework/zend-file": "self.version", + "zendframework/zend-filter": "self.version", + "zendframework/zend-form": "self.version", + "zendframework/zend-http": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-inputfilter": "self.version", + "zendframework/zend-json": "self.version", + "zendframework/zend-ldap": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-log": "self.version", + "zendframework/zend-mail": "self.version", + "zendframework/zend-math": "self.version", + "zendframework/zend-memory": "self.version", + "zendframework/zend-mime": "self.version", + "zendframework/zend-modulemanager": "self.version", + "zendframework/zend-mvc": "self.version", + "zendframework/zend-navigation": "self.version", + "zendframework/zend-paginator": "self.version", + "zendframework/zend-permissions-acl": "self.version", + "zendframework/zend-permissions-rbac": "self.version", + "zendframework/zend-progressbar": "self.version", + "zendframework/zend-serializer": "self.version", + "zendframework/zend-server": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-session": "self.version", + "zendframework/zend-soap": "self.version", + "zendframework/zend-stdlib": "self.version", + "zendframework/zend-tag": "self.version", + "zendframework/zend-test": "self.version", + "zendframework/zend-text": "self.version", + "zendframework/zend-uri": "self.version", + "zendframework/zend-validator": "self.version", + "zendframework/zend-version": "self.version", + "zendframework/zend-view": "self.version", + "zendframework/zend-xmlrpc": "self.version" + }, + "extra": { + "branch-alias": { + "dev-master": "2.1-dev", + "dev-develop": "2.2-dev" + } + } +} diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/AbstractAdapter.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/AbstractAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/AbstractAdapter.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/AbstractAdapter.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/DbTable.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/DbTable.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/DbTable.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/DbTable.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Digest.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Digest.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Digest.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Digest.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Http.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Http.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Http/ApacheResolver.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/ApacheResolver.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Http/ApacheResolver.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/ApacheResolver.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Http/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Http/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Http/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Http/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Http/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Http/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Http/FileResolver.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/FileResolver.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Http/FileResolver.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/FileResolver.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Http/ResolverInterface.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/ResolverInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Http/ResolverInterface.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Http/ResolverInterface.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/Ldap.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Ldap.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/Ldap.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/Ldap.php diff --git a/vendor/ZF2/library/Zend/Authentication/Adapter/ValidatableAdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/ValidatableAdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Adapter/ValidatableAdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Adapter/ValidatableAdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Authentication/AuthenticationService.php b/vendor/zendframework/zendframework/library/Zend/Authentication/AuthenticationService.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/AuthenticationService.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/AuthenticationService.php diff --git a/vendor/ZF2/library/Zend/Authentication/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Authentication/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Authentication/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Authentication/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Authentication/README.md b/vendor/zendframework/zendframework/library/Zend/Authentication/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/README.md rename to vendor/zendframework/zendframework/library/Zend/Authentication/README.md diff --git a/vendor/ZF2/library/Zend/Authentication/Result.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Result.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Result.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Result.php diff --git a/vendor/ZF2/library/Zend/Authentication/Storage/Chain.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Storage/Chain.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Storage/Chain.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Storage/Chain.php diff --git a/vendor/ZF2/library/Zend/Authentication/Storage/NonPersistent.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Storage/NonPersistent.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Storage/NonPersistent.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Storage/NonPersistent.php diff --git a/vendor/ZF2/library/Zend/Authentication/Storage/Session.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Storage/Session.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Storage/Session.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Storage/Session.php diff --git a/vendor/ZF2/library/Zend/Authentication/Storage/StorageInterface.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Storage/StorageInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Storage/StorageInterface.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Storage/StorageInterface.php diff --git a/vendor/ZF2/library/Zend/Authentication/Validator/Authentication.php b/vendor/zendframework/zendframework/library/Zend/Authentication/Validator/Authentication.php similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/Validator/Authentication.php rename to vendor/zendframework/zendframework/library/Zend/Authentication/Validator/Authentication.php diff --git a/vendor/ZF2/library/Zend/Authentication/composer.json b/vendor/zendframework/zendframework/library/Zend/Authentication/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Authentication/composer.json rename to vendor/zendframework/zendframework/library/Zend/Authentication/composer.json diff --git a/vendor/ZF2/library/Zend/Barcode/Barcode.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Barcode.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Barcode.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Barcode.php diff --git a/vendor/ZF2/library/Zend/Barcode/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Barcode/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Exception/OutOfRangeException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Exception/OutOfRangeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Exception/OutOfRangeException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Exception/OutOfRangeException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Exception/RendererCreationException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Exception/RendererCreationException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Exception/RendererCreationException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Exception/RendererCreationException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/AbstractObject.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/AbstractObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/AbstractObject.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/AbstractObject.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Codabar.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Codabar.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Codabar.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Codabar.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Code128.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Code128.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Code128.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Code128.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Code25.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Code25.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Code25.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Code25.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Code25interleaved.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Code25interleaved.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Code25interleaved.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Code25interleaved.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Code39.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Code39.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Code39.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Code39.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Ean13.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Ean13.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Ean13.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Ean13.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Ean2.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Ean2.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Ean2.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Ean2.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Ean5.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Ean5.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Ean5.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Ean5.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Ean8.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Ean8.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Ean8.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Ean8.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Error.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Error.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Error.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Error.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Exception/BarcodeValidationException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/BarcodeValidationException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Exception/BarcodeValidationException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/BarcodeValidationException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/ExtensionNotLoadedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Exception/ExtensionNotLoadedException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/ExtensionNotLoadedException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Exception/OutOfRangeException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/OutOfRangeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Exception/OutOfRangeException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/OutOfRangeException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Identcode.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Identcode.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Identcode.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Identcode.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Itf14.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Itf14.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Itf14.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Itf14.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Leitcode.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Leitcode.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Leitcode.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Leitcode.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/ObjectInterface.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/ObjectInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/ObjectInterface.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/ObjectInterface.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Planet.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Planet.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Planet.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Planet.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Postnet.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Postnet.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Postnet.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Postnet.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Royalmail.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Royalmail.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Royalmail.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Royalmail.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Upca.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Upca.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Upca.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Upca.php diff --git a/vendor/ZF2/library/Zend/Barcode/Object/Upce.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Object/Upce.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Object/Upce.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Object/Upce.php diff --git a/vendor/ZF2/library/Zend/Barcode/ObjectPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Barcode/ObjectPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/ObjectPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/ObjectPluginManager.php diff --git a/vendor/ZF2/library/Zend/Barcode/README.md b/vendor/zendframework/zendframework/library/Zend/Barcode/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/README.md rename to vendor/zendframework/zendframework/library/Zend/Barcode/README.md diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/AbstractRenderer.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/AbstractRenderer.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/AbstractRenderer.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/AbstractRenderer.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/Exception/OutOfRangeException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/OutOfRangeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/Exception/OutOfRangeException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/OutOfRangeException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/Image.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Image.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/Image.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Image.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/Pdf.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Pdf.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/Pdf.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Pdf.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/RendererInterface.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/RendererInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/RendererInterface.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/RendererInterface.php diff --git a/vendor/ZF2/library/Zend/Barcode/Renderer/Svg.php b/vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Svg.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/Renderer/Svg.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/Renderer/Svg.php diff --git a/vendor/ZF2/library/Zend/Barcode/RendererPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Barcode/RendererPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/RendererPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Barcode/RendererPluginManager.php diff --git a/vendor/ZF2/library/Zend/Barcode/composer.json b/vendor/zendframework/zendframework/library/Zend/Barcode/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Barcode/composer.json rename to vendor/zendframework/zendframework/library/Zend/Barcode/composer.json diff --git a/vendor/ZF2/library/Zend/Cache/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/ExtensionNotLoadedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/ExtensionNotLoadedException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/ExtensionNotLoadedException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/LogicException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/LogicException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/LogicException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/LogicException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/MissingDependencyException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/MissingDependencyException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/MissingDependencyException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/MissingDependencyException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/MissingKeyException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/MissingKeyException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/MissingKeyException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/MissingKeyException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/OutOfSpaceException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/OutOfSpaceException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/OutOfSpaceException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/OutOfSpaceException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Cache/Exception/UnsupportedMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Cache/Exception/UnsupportedMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Exception/UnsupportedMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Exception/UnsupportedMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/AbstractPattern.php b/vendor/zendframework/zendframework/library/Zend/Cache/Pattern/AbstractPattern.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Pattern/AbstractPattern.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Pattern/AbstractPattern.php diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/CallbackCache.php b/vendor/zendframework/zendframework/library/Zend/Cache/Pattern/CallbackCache.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Pattern/CallbackCache.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Pattern/CallbackCache.php diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/CaptureCache.php b/vendor/zendframework/zendframework/library/Zend/Cache/Pattern/CaptureCache.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Pattern/CaptureCache.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Pattern/CaptureCache.php diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/ClassCache.php b/vendor/zendframework/zendframework/library/Zend/Cache/Pattern/ClassCache.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Pattern/ClassCache.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Pattern/ClassCache.php diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/ObjectCache.php b/vendor/zendframework/zendframework/library/Zend/Cache/Pattern/ObjectCache.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Pattern/ObjectCache.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Pattern/ObjectCache.php diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/OutputCache.php b/vendor/zendframework/zendframework/library/Zend/Cache/Pattern/OutputCache.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Pattern/OutputCache.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Pattern/OutputCache.php diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/PatternInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Pattern/PatternInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Pattern/PatternInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Pattern/PatternInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Pattern/PatternOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Pattern/PatternOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Pattern/PatternOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Pattern/PatternOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/PatternFactory.php b/vendor/zendframework/zendframework/library/Zend/Cache/PatternFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/PatternFactory.php rename to vendor/zendframework/zendframework/library/Zend/Cache/PatternFactory.php diff --git a/vendor/ZF2/library/Zend/Cache/PatternPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Cache/PatternPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/PatternPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Cache/PatternPluginManager.php diff --git a/vendor/ZF2/library/Zend/Cache/README.md b/vendor/zendframework/zendframework/library/Zend/Cache/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Cache/README.md rename to vendor/zendframework/zendframework/library/Zend/Cache/README.md diff --git a/vendor/ZF2/library/Zend/Cache/Service/StorageCacheFactory.php b/vendor/zendframework/zendframework/library/Zend/Cache/Service/StorageCacheFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Service/StorageCacheFactory.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Service/StorageCacheFactory.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/AbstractAdapter.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/AbstractAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/AbstractAdapter.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/AbstractAdapter.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/AbstractZendServer.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/AbstractZendServer.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/AbstractZendServer.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/AbstractZendServer.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/AdapterOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/AdapterOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/AdapterOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/AdapterOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/Apc.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Apc.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/Apc.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Apc.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/ApcIterator.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/ApcIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/ApcIterator.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/ApcIterator.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/ApcOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/ApcOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/ApcOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/ApcOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/Dba.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Dba.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/Dba.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Dba.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/DbaIterator.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/DbaIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/DbaIterator.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/DbaIterator.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/DbaOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/DbaOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/DbaOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/DbaOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/Filesystem.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Filesystem.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/Filesystem.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Filesystem.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/FilesystemIterator.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/FilesystemIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/FilesystemIterator.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/FilesystemIterator.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/FilesystemOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/FilesystemOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/FilesystemOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/FilesystemOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/KeyListIterator.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/KeyListIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/KeyListIterator.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/KeyListIterator.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/Memcached.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Memcached.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/Memcached.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Memcached.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/MemcachedOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/MemcachedOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/MemcachedOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/MemcachedOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/MemcachedResourceManager.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/MemcachedResourceManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/MemcachedResourceManager.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/MemcachedResourceManager.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/Memory.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Memory.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/Memory.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Memory.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/MemoryOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/MemoryOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/MemoryOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/MemoryOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/Session.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Session.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/Session.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/Session.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/SessionOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/SessionOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/SessionOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/SessionOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/WinCache.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/WinCache.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/WinCache.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/WinCache.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/WinCacheOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/WinCacheOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/WinCacheOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/WinCacheOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/XCache.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/XCache.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/XCache.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/XCache.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/XCacheOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/XCacheOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/XCacheOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/XCacheOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/ZendServerDisk.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/ZendServerDisk.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/ZendServerDisk.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/ZendServerDisk.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Adapter/ZendServerShm.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/ZendServerShm.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Adapter/ZendServerShm.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Adapter/ZendServerShm.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/AdapterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/AdapterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/AdapterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/AdapterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/AvailableSpaceCapableInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/AvailableSpaceCapableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/AvailableSpaceCapableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/AvailableSpaceCapableInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Capabilities.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Capabilities.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Capabilities.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Capabilities.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/ClearByNamespaceInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/ClearByNamespaceInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/ClearByNamespaceInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/ClearByNamespaceInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/ClearByPrefixInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/ClearByPrefixInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/ClearByPrefixInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/ClearByPrefixInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/ClearExpiredInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/ClearExpiredInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/ClearExpiredInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/ClearExpiredInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Event.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Event.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Event.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Event.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/ExceptionEvent.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/ExceptionEvent.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/ExceptionEvent.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/ExceptionEvent.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/FlushableInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/FlushableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/FlushableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/FlushableInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/IterableInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/IterableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/IterableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/IterableInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/IteratorInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/IteratorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/IteratorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/IteratorInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/OptimizableInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/OptimizableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/OptimizableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/OptimizableInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/AbstractPlugin.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/AbstractPlugin.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Plugin/AbstractPlugin.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/AbstractPlugin.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/ClearExpiredByFactor.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/ClearExpiredByFactor.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Plugin/ClearExpiredByFactor.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/ClearExpiredByFactor.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/ExceptionHandler.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/ExceptionHandler.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Plugin/ExceptionHandler.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/ExceptionHandler.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/IgnoreUserAbort.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/IgnoreUserAbort.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Plugin/IgnoreUserAbort.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/IgnoreUserAbort.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/PluginInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/PluginInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Plugin/PluginInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/PluginInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/PluginOptions.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/PluginOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Plugin/PluginOptions.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/PluginOptions.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/Plugin/Serializer.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/Serializer.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/Plugin/Serializer.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/Plugin/Serializer.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/PluginManager.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/PluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/PluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/PluginManager.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/PostEvent.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/PostEvent.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/PostEvent.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/PostEvent.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/StorageInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/StorageInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/StorageInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/StorageInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/TaggableInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/TaggableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/TaggableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/TaggableInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/Storage/TotalSpaceCapableInterface.php b/vendor/zendframework/zendframework/library/Zend/Cache/Storage/TotalSpaceCapableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/Storage/TotalSpaceCapableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Cache/Storage/TotalSpaceCapableInterface.php diff --git a/vendor/ZF2/library/Zend/Cache/StorageFactory.php b/vendor/zendframework/zendframework/library/Zend/Cache/StorageFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Cache/StorageFactory.php rename to vendor/zendframework/zendframework/library/Zend/Cache/StorageFactory.php diff --git a/vendor/ZF2/library/Zend/Cache/composer.json b/vendor/zendframework/zendframework/library/Zend/Cache/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Cache/composer.json rename to vendor/zendframework/zendframework/library/Zend/Cache/composer.json diff --git a/vendor/ZF2/library/Zend/Captcha/AbstractAdapter.php b/vendor/zendframework/zendframework/library/Zend/Captcha/AbstractAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/AbstractAdapter.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/AbstractAdapter.php diff --git a/vendor/ZF2/library/Zend/Captcha/AbstractWord.php b/vendor/zendframework/zendframework/library/Zend/Captcha/AbstractWord.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/AbstractWord.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/AbstractWord.php diff --git a/vendor/ZF2/library/Zend/Captcha/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Captcha/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Captcha/Dumb.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Dumb.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Dumb.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Dumb.php diff --git a/vendor/ZF2/library/Zend/Captcha/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Captcha/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Captcha/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Exception/ExtensionNotLoadedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Exception/ExtensionNotLoadedException.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Exception/ExtensionNotLoadedException.php diff --git a/vendor/ZF2/library/Zend/Captcha/Exception/ImageNotLoadableException.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Exception/ImageNotLoadableException.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Exception/ImageNotLoadableException.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Exception/ImageNotLoadableException.php diff --git a/vendor/ZF2/library/Zend/Captcha/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Captcha/Exception/NoFontProvidedException.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Exception/NoFontProvidedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Exception/NoFontProvidedException.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Exception/NoFontProvidedException.php diff --git a/vendor/ZF2/library/Zend/Captcha/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Captcha/Factory.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Factory.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Factory.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Factory.php diff --git a/vendor/ZF2/library/Zend/Captcha/Figlet.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Figlet.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Figlet.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Figlet.php diff --git a/vendor/ZF2/library/Zend/Captcha/Image.php b/vendor/zendframework/zendframework/library/Zend/Captcha/Image.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/Image.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/Image.php diff --git a/vendor/ZF2/library/Zend/Captcha/README.md b/vendor/zendframework/zendframework/library/Zend/Captcha/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/README.md rename to vendor/zendframework/zendframework/library/Zend/Captcha/README.md diff --git a/vendor/ZF2/library/Zend/Captcha/ReCaptcha.php b/vendor/zendframework/zendframework/library/Zend/Captcha/ReCaptcha.php similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/ReCaptcha.php rename to vendor/zendframework/zendframework/library/Zend/Captcha/ReCaptcha.php diff --git a/vendor/ZF2/library/Zend/Captcha/composer.json b/vendor/zendframework/zendframework/library/Zend/Captcha/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Captcha/composer.json rename to vendor/zendframework/zendframework/library/Zend/Captcha/composer.json diff --git a/vendor/ZF2/library/Zend/Code/Annotation/AnnotationCollection.php b/vendor/zendframework/zendframework/library/Zend/Code/Annotation/AnnotationCollection.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Annotation/AnnotationCollection.php rename to vendor/zendframework/zendframework/library/Zend/Code/Annotation/AnnotationCollection.php diff --git a/vendor/ZF2/library/Zend/Code/Annotation/AnnotationInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Annotation/AnnotationInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Annotation/AnnotationInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Annotation/AnnotationInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Annotation/AnnotationManager.php b/vendor/zendframework/zendframework/library/Zend/Code/Annotation/AnnotationManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Annotation/AnnotationManager.php rename to vendor/zendframework/zendframework/library/Zend/Code/Annotation/AnnotationManager.php diff --git a/vendor/ZF2/library/Zend/Code/Annotation/Parser/DoctrineAnnotationParser.php b/vendor/zendframework/zendframework/library/Zend/Code/Annotation/Parser/DoctrineAnnotationParser.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Annotation/Parser/DoctrineAnnotationParser.php rename to vendor/zendframework/zendframework/library/Zend/Code/Annotation/Parser/DoctrineAnnotationParser.php diff --git a/vendor/ZF2/library/Zend/Code/Annotation/Parser/GenericAnnotationParser.php b/vendor/zendframework/zendframework/library/Zend/Code/Annotation/Parser/GenericAnnotationParser.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Annotation/Parser/GenericAnnotationParser.php rename to vendor/zendframework/zendframework/library/Zend/Code/Annotation/Parser/GenericAnnotationParser.php diff --git a/vendor/ZF2/library/Zend/Code/Annotation/Parser/ParserInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Annotation/Parser/ParserInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Annotation/Parser/ParserInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Annotation/Parser/ParserInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Code/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Code/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Code/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Code/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Code/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Code/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Code/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Code/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/AbstractGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/AbstractGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/AbstractGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/AbstractGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/AbstractMemberGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/AbstractMemberGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/AbstractMemberGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/AbstractMemberGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/BodyGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/BodyGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/BodyGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/BodyGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/ClassGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/ClassGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/ClassGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/ClassGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag/AuthorTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag/AuthorTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag/AuthorTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag/AuthorTag.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/DocBlockGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlockGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/DocBlockGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/DocBlockGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/FileGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/FileGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/FileGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/FileGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/FileGeneratorRegistry.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/FileGeneratorRegistry.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/FileGeneratorRegistry.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/FileGeneratorRegistry.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/GeneratorInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/GeneratorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/GeneratorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/GeneratorInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/MethodGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/MethodGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/MethodGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/MethodGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/ParameterGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/ParameterGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/ParameterGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/ParameterGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/PropertyGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/PropertyGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/PropertyGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/PropertyGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/PropertyValueGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/PropertyValueGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/PropertyValueGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/PropertyValueGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/Generator/ValueGenerator.php b/vendor/zendframework/zendframework/library/Zend/Code/Generator/ValueGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Generator/ValueGenerator.php rename to vendor/zendframework/zendframework/library/Zend/Code/Generator/ValueGenerator.php diff --git a/vendor/ZF2/library/Zend/Code/NameInformation.php b/vendor/zendframework/zendframework/library/Zend/Code/NameInformation.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/NameInformation.php rename to vendor/zendframework/zendframework/library/Zend/Code/NameInformation.php diff --git a/vendor/ZF2/library/Zend/Code/README.md b/vendor/zendframework/zendframework/library/Zend/Code/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Code/README.md rename to vendor/zendframework/zendframework/library/Zend/Code/README.md diff --git a/vendor/ZF2/library/Zend/Code/Reflection/ClassReflection.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/ClassReflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/ClassReflection.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/ClassReflection.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/AuthorTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/AuthorTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/AuthorTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/AuthorTag.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/GenericTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/GenericTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/GenericTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/GenericTag.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/LicenseTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/LicenseTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/LicenseTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/LicenseTag.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/MethodTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/MethodTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/MethodTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/MethodTag.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/ParamTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/ParamTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/ParamTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/ParamTag.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/PhpDocTypedTagInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/PhpDocTypedTagInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/PhpDocTypedTagInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/PhpDocTypedTagInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/PropertyTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/PropertyTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/PropertyTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/PropertyTag.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/ReturnTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/ReturnTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/ReturnTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/ReturnTag.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/TagInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/TagInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/TagInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/TagInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/ThrowsTag.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/ThrowsTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/Tag/ThrowsTag.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/Tag/ThrowsTag.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlock/TagManager.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/TagManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlock/TagManager.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlock/TagManager.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/DocBlockReflection.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlockReflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/DocBlockReflection.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/DocBlockReflection.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/FileReflection.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/FileReflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/FileReflection.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/FileReflection.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/FunctionReflection.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/FunctionReflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/FunctionReflection.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/FunctionReflection.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/MethodReflection.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/MethodReflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/MethodReflection.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/MethodReflection.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/ParameterReflection.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/ParameterReflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/ParameterReflection.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/ParameterReflection.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/PropertyReflection.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/PropertyReflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/PropertyReflection.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/PropertyReflection.php diff --git a/vendor/ZF2/library/Zend/Code/Reflection/ReflectionInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Reflection/ReflectionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Reflection/ReflectionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Reflection/ReflectionInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/AggregateDirectoryScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/AggregateDirectoryScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/AggregateDirectoryScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/AggregateDirectoryScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/AnnotationScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/AnnotationScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/AnnotationScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/AnnotationScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/CachingFileScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/CachingFileScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/CachingFileScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/CachingFileScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/ClassScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/ClassScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/ClassScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/ClassScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/DerivedClassScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/DerivedClassScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/DerivedClassScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/DerivedClassScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/DirectoryScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/DirectoryScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/DirectoryScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/DirectoryScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/DocBlockScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/DocBlockScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/DocBlockScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/DocBlockScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/FileScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/FileScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/FileScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/FileScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/FunctionScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/FunctionScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/FunctionScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/FunctionScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/MethodScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/MethodScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/MethodScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/MethodScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/ParameterScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/ParameterScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/ParameterScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/ParameterScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/PropertyScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/PropertyScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/PropertyScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/PropertyScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/ScannerInterface.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/ScannerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/ScannerInterface.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/ScannerInterface.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/TokenArrayScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/TokenArrayScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/TokenArrayScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/TokenArrayScanner.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/Util.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/Util.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/Util.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/Util.php diff --git a/vendor/ZF2/library/Zend/Code/Scanner/ValueScanner.php b/vendor/zendframework/zendframework/library/Zend/Code/Scanner/ValueScanner.php similarity index 100% rename from vendor/ZF2/library/Zend/Code/Scanner/ValueScanner.php rename to vendor/zendframework/zendframework/library/Zend/Code/Scanner/ValueScanner.php diff --git a/vendor/ZF2/library/Zend/Code/composer.json b/vendor/zendframework/zendframework/library/Zend/Code/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Code/composer.json rename to vendor/zendframework/zendframework/library/Zend/Code/composer.json diff --git a/vendor/ZF2/library/Zend/Config/Config.php b/vendor/zendframework/zendframework/library/Zend/Config/Config.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Config.php rename to vendor/zendframework/zendframework/library/Zend/Config/Config.php diff --git a/vendor/ZF2/library/Zend/Config/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Config/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Config/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Config/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Config/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Config/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Config/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Config/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Config/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Config/Factory.php b/vendor/zendframework/zendframework/library/Zend/Config/Factory.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Factory.php rename to vendor/zendframework/zendframework/library/Zend/Config/Factory.php diff --git a/vendor/ZF2/library/Zend/Config/Processor/Constant.php b/vendor/zendframework/zendframework/library/Zend/Config/Processor/Constant.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Processor/Constant.php rename to vendor/zendframework/zendframework/library/Zend/Config/Processor/Constant.php diff --git a/vendor/ZF2/library/Zend/Config/Processor/Filter.php b/vendor/zendframework/zendframework/library/Zend/Config/Processor/Filter.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Processor/Filter.php rename to vendor/zendframework/zendframework/library/Zend/Config/Processor/Filter.php diff --git a/vendor/ZF2/library/Zend/Config/Processor/ProcessorInterface.php b/vendor/zendframework/zendframework/library/Zend/Config/Processor/ProcessorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Processor/ProcessorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Config/Processor/ProcessorInterface.php diff --git a/vendor/ZF2/library/Zend/Config/Processor/Queue.php b/vendor/zendframework/zendframework/library/Zend/Config/Processor/Queue.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Processor/Queue.php rename to vendor/zendframework/zendframework/library/Zend/Config/Processor/Queue.php diff --git a/vendor/ZF2/library/Zend/Config/Processor/Token.php b/vendor/zendframework/zendframework/library/Zend/Config/Processor/Token.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Processor/Token.php rename to vendor/zendframework/zendframework/library/Zend/Config/Processor/Token.php diff --git a/vendor/ZF2/library/Zend/Config/Processor/Translator.php b/vendor/zendframework/zendframework/library/Zend/Config/Processor/Translator.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Processor/Translator.php rename to vendor/zendframework/zendframework/library/Zend/Config/Processor/Translator.php diff --git a/vendor/ZF2/library/Zend/Config/README.md b/vendor/zendframework/zendframework/library/Zend/Config/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Config/README.md rename to vendor/zendframework/zendframework/library/Zend/Config/README.md diff --git a/vendor/ZF2/library/Zend/Config/Reader/Ini.php b/vendor/zendframework/zendframework/library/Zend/Config/Reader/Ini.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Reader/Ini.php rename to vendor/zendframework/zendframework/library/Zend/Config/Reader/Ini.php diff --git a/vendor/ZF2/library/Zend/Config/Reader/Json.php b/vendor/zendframework/zendframework/library/Zend/Config/Reader/Json.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Reader/Json.php rename to vendor/zendframework/zendframework/library/Zend/Config/Reader/Json.php diff --git a/vendor/ZF2/library/Zend/Config/Reader/ReaderInterface.php b/vendor/zendframework/zendframework/library/Zend/Config/Reader/ReaderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Reader/ReaderInterface.php rename to vendor/zendframework/zendframework/library/Zend/Config/Reader/ReaderInterface.php diff --git a/vendor/ZF2/library/Zend/Config/Reader/Xml.php b/vendor/zendframework/zendframework/library/Zend/Config/Reader/Xml.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Reader/Xml.php rename to vendor/zendframework/zendframework/library/Zend/Config/Reader/Xml.php diff --git a/vendor/ZF2/library/Zend/Config/Reader/Yaml.php b/vendor/zendframework/zendframework/library/Zend/Config/Reader/Yaml.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Reader/Yaml.php rename to vendor/zendframework/zendframework/library/Zend/Config/Reader/Yaml.php diff --git a/vendor/ZF2/library/Zend/Config/ReaderPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Config/ReaderPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/ReaderPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Config/ReaderPluginManager.php diff --git a/vendor/ZF2/library/Zend/Config/Writer/AbstractWriter.php b/vendor/zendframework/zendframework/library/Zend/Config/Writer/AbstractWriter.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Writer/AbstractWriter.php rename to vendor/zendframework/zendframework/library/Zend/Config/Writer/AbstractWriter.php diff --git a/vendor/ZF2/library/Zend/Config/Writer/Ini.php b/vendor/zendframework/zendframework/library/Zend/Config/Writer/Ini.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Writer/Ini.php rename to vendor/zendframework/zendframework/library/Zend/Config/Writer/Ini.php diff --git a/vendor/ZF2/library/Zend/Config/Writer/Json.php b/vendor/zendframework/zendframework/library/Zend/Config/Writer/Json.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Writer/Json.php rename to vendor/zendframework/zendframework/library/Zend/Config/Writer/Json.php diff --git a/vendor/ZF2/library/Zend/Config/Writer/PhpArray.php b/vendor/zendframework/zendframework/library/Zend/Config/Writer/PhpArray.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Writer/PhpArray.php rename to vendor/zendframework/zendframework/library/Zend/Config/Writer/PhpArray.php diff --git a/vendor/ZF2/library/Zend/Config/Writer/WriterInterface.php b/vendor/zendframework/zendframework/library/Zend/Config/Writer/WriterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Writer/WriterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Config/Writer/WriterInterface.php diff --git a/vendor/ZF2/library/Zend/Config/Writer/Xml.php b/vendor/zendframework/zendframework/library/Zend/Config/Writer/Xml.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Writer/Xml.php rename to vendor/zendframework/zendframework/library/Zend/Config/Writer/Xml.php diff --git a/vendor/ZF2/library/Zend/Config/Writer/Yaml.php b/vendor/zendframework/zendframework/library/Zend/Config/Writer/Yaml.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/Writer/Yaml.php rename to vendor/zendframework/zendframework/library/Zend/Config/Writer/Yaml.php diff --git a/vendor/ZF2/library/Zend/Config/WriterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Config/WriterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Config/WriterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Config/WriterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Config/composer.json b/vendor/zendframework/zendframework/library/Zend/Config/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Config/composer.json rename to vendor/zendframework/zendframework/library/Zend/Config/composer.json diff --git a/vendor/ZF2/library/Zend/Console/Adapter/AbstractAdapter.php b/vendor/zendframework/zendframework/library/Zend/Console/Adapter/AbstractAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Adapter/AbstractAdapter.php rename to vendor/zendframework/zendframework/library/Zend/Console/Adapter/AbstractAdapter.php diff --git a/vendor/ZF2/library/Zend/Console/Adapter/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Console/Adapter/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Adapter/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Console/Adapter/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Console/Adapter/Posix.php b/vendor/zendframework/zendframework/library/Zend/Console/Adapter/Posix.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Adapter/Posix.php rename to vendor/zendframework/zendframework/library/Zend/Console/Adapter/Posix.php diff --git a/vendor/ZF2/library/Zend/Console/Adapter/Virtual.php b/vendor/zendframework/zendframework/library/Zend/Console/Adapter/Virtual.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Adapter/Virtual.php rename to vendor/zendframework/zendframework/library/Zend/Console/Adapter/Virtual.php diff --git a/vendor/ZF2/library/Zend/Console/Adapter/Windows.php b/vendor/zendframework/zendframework/library/Zend/Console/Adapter/Windows.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Adapter/Windows.php rename to vendor/zendframework/zendframework/library/Zend/Console/Adapter/Windows.php diff --git a/vendor/ZF2/library/Zend/Console/Adapter/WindowsAnsicon.php b/vendor/zendframework/zendframework/library/Zend/Console/Adapter/WindowsAnsicon.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Adapter/WindowsAnsicon.php rename to vendor/zendframework/zendframework/library/Zend/Console/Adapter/WindowsAnsicon.php diff --git a/vendor/ZF2/library/Zend/Console/Charset/Ascii.php b/vendor/zendframework/zendframework/library/Zend/Console/Charset/Ascii.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Charset/Ascii.php rename to vendor/zendframework/zendframework/library/Zend/Console/Charset/Ascii.php diff --git a/vendor/ZF2/library/Zend/Console/Charset/AsciiExtended.php b/vendor/zendframework/zendframework/library/Zend/Console/Charset/AsciiExtended.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Charset/AsciiExtended.php rename to vendor/zendframework/zendframework/library/Zend/Console/Charset/AsciiExtended.php diff --git a/vendor/ZF2/library/Zend/Console/Charset/CharsetInterface.php b/vendor/zendframework/zendframework/library/Zend/Console/Charset/CharsetInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Charset/CharsetInterface.php rename to vendor/zendframework/zendframework/library/Zend/Console/Charset/CharsetInterface.php diff --git a/vendor/ZF2/library/Zend/Console/Charset/DECSG.php b/vendor/zendframework/zendframework/library/Zend/Console/Charset/DECSG.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Charset/DECSG.php rename to vendor/zendframework/zendframework/library/Zend/Console/Charset/DECSG.php diff --git a/vendor/ZF2/library/Zend/Console/Charset/Utf8.php b/vendor/zendframework/zendframework/library/Zend/Console/Charset/Utf8.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Charset/Utf8.php rename to vendor/zendframework/zendframework/library/Zend/Console/Charset/Utf8.php diff --git a/vendor/ZF2/library/Zend/Console/Charset/Utf8Heavy.php b/vendor/zendframework/zendframework/library/Zend/Console/Charset/Utf8Heavy.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Charset/Utf8Heavy.php rename to vendor/zendframework/zendframework/library/Zend/Console/Charset/Utf8Heavy.php diff --git a/vendor/ZF2/library/Zend/Console/Color/Xterm256.php b/vendor/zendframework/zendframework/library/Zend/Console/Color/Xterm256.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Color/Xterm256.php rename to vendor/zendframework/zendframework/library/Zend/Console/Color/Xterm256.php diff --git a/vendor/ZF2/library/Zend/Console/ColorInterface.php b/vendor/zendframework/zendframework/library/Zend/Console/ColorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/ColorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Console/ColorInterface.php diff --git a/vendor/ZF2/library/Zend/Console/Console.php b/vendor/zendframework/zendframework/library/Zend/Console/Console.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Console.php rename to vendor/zendframework/zendframework/library/Zend/Console/Console.php diff --git a/vendor/ZF2/library/Zend/Console/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Console/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Console/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Console/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Console/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Console/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Console/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Console/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Console/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Console/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Console/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Console/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Console/Getopt.php b/vendor/zendframework/zendframework/library/Zend/Console/Getopt.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Getopt.php rename to vendor/zendframework/zendframework/library/Zend/Console/Getopt.php diff --git a/vendor/ZF2/library/Zend/Console/Prompt/AbstractPrompt.php b/vendor/zendframework/zendframework/library/Zend/Console/Prompt/AbstractPrompt.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Prompt/AbstractPrompt.php rename to vendor/zendframework/zendframework/library/Zend/Console/Prompt/AbstractPrompt.php diff --git a/vendor/ZF2/library/Zend/Console/Prompt/Char.php b/vendor/zendframework/zendframework/library/Zend/Console/Prompt/Char.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Prompt/Char.php rename to vendor/zendframework/zendframework/library/Zend/Console/Prompt/Char.php diff --git a/vendor/ZF2/library/Zend/Console/Prompt/Confirm.php b/vendor/zendframework/zendframework/library/Zend/Console/Prompt/Confirm.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Prompt/Confirm.php rename to vendor/zendframework/zendframework/library/Zend/Console/Prompt/Confirm.php diff --git a/vendor/ZF2/library/Zend/Console/Prompt/Line.php b/vendor/zendframework/zendframework/library/Zend/Console/Prompt/Line.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Prompt/Line.php rename to vendor/zendframework/zendframework/library/Zend/Console/Prompt/Line.php diff --git a/vendor/ZF2/library/Zend/Console/Prompt/Number.php b/vendor/zendframework/zendframework/library/Zend/Console/Prompt/Number.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Prompt/Number.php rename to vendor/zendframework/zendframework/library/Zend/Console/Prompt/Number.php diff --git a/vendor/ZF2/library/Zend/Console/Prompt/PromptInterface.php b/vendor/zendframework/zendframework/library/Zend/Console/Prompt/PromptInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Prompt/PromptInterface.php rename to vendor/zendframework/zendframework/library/Zend/Console/Prompt/PromptInterface.php diff --git a/vendor/ZF2/library/Zend/Console/Prompt/Select.php b/vendor/zendframework/zendframework/library/Zend/Console/Prompt/Select.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Prompt/Select.php rename to vendor/zendframework/zendframework/library/Zend/Console/Prompt/Select.php diff --git a/vendor/ZF2/library/Zend/Console/README.md b/vendor/zendframework/zendframework/library/Zend/Console/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Console/README.md rename to vendor/zendframework/zendframework/library/Zend/Console/README.md diff --git a/vendor/ZF2/library/Zend/Console/Request.php b/vendor/zendframework/zendframework/library/Zend/Console/Request.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Request.php rename to vendor/zendframework/zendframework/library/Zend/Console/Request.php diff --git a/vendor/ZF2/library/Zend/Console/Response.php b/vendor/zendframework/zendframework/library/Zend/Console/Response.php similarity index 100% rename from vendor/ZF2/library/Zend/Console/Response.php rename to vendor/zendframework/zendframework/library/Zend/Console/Response.php diff --git a/vendor/ZF2/library/Zend/Console/composer.json b/vendor/zendframework/zendframework/library/Zend/Console/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Console/composer.json rename to vendor/zendframework/zendframework/library/Zend/Console/composer.json diff --git a/vendor/ZF2/library/Zend/Crypt/BlockCipher.php b/vendor/zendframework/zendframework/library/Zend/Crypt/BlockCipher.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/BlockCipher.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/BlockCipher.php diff --git a/vendor/ZF2/library/Zend/Crypt/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Crypt/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Crypt/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Crypt/Hash.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Hash.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Hash.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Hash.php diff --git a/vendor/ZF2/library/Zend/Crypt/Hmac.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Hmac.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Hmac.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Hmac.php diff --git a/vendor/ZF2/library/Zend/Crypt/Key/Derivation/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Key/Derivation/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Crypt/Key/Derivation/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Key/Derivation/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Crypt/Key/Derivation/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Key/Derivation/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Crypt/Key/Derivation/Pbkdf2.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Pbkdf2.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Key/Derivation/Pbkdf2.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Pbkdf2.php diff --git a/vendor/ZF2/library/Zend/Crypt/Key/Derivation/SaltedS2k.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/SaltedS2k.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Key/Derivation/SaltedS2k.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/SaltedS2k.php diff --git a/vendor/ZF2/library/Zend/Crypt/Key/Derivation/Scrypt.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Scrypt.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Key/Derivation/Scrypt.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Key/Derivation/Scrypt.php diff --git a/vendor/ZF2/library/Zend/Crypt/Password/Apache.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Password/Apache.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Password/Apache.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Password/Apache.php diff --git a/vendor/ZF2/library/Zend/Crypt/Password/Bcrypt.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Password/Bcrypt.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Password/Bcrypt.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Password/Bcrypt.php diff --git a/vendor/ZF2/library/Zend/Crypt/Password/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Password/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Password/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Password/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Crypt/Password/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Password/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Password/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Password/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Crypt/Password/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Password/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Password/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Password/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Crypt/Password/PasswordInterface.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Password/PasswordInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Password/PasswordInterface.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Password/PasswordInterface.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/DiffieHellman.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/DiffieHellman.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/DiffieHellman.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/DiffieHellman.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/AbstractKey.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/AbstractKey.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/AbstractKey.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/AbstractKey.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/PrivateKey.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/PrivateKey.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/PrivateKey.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/PrivateKey.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/PublicKey.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/PublicKey.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/Rsa/PublicKey.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/Rsa/PublicKey.php diff --git a/vendor/ZF2/library/Zend/Crypt/PublicKey/RsaOptions.php b/vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/RsaOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/PublicKey/RsaOptions.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/PublicKey/RsaOptions.php diff --git a/vendor/ZF2/library/Zend/Crypt/README.md b/vendor/zendframework/zendframework/library/Zend/Crypt/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/README.md rename to vendor/zendframework/zendframework/library/Zend/Crypt/README.md diff --git a/vendor/ZF2/library/Zend/Crypt/Symmetric/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Symmetric/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Crypt/Symmetric/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Symmetric/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Crypt/Symmetric/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Symmetric/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Crypt/Symmetric/Mcrypt.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Mcrypt.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Symmetric/Mcrypt.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Mcrypt.php diff --git a/vendor/ZF2/library/Zend/Crypt/Symmetric/Padding/PaddingInterface.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Padding/PaddingInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Symmetric/Padding/PaddingInterface.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Padding/PaddingInterface.php diff --git a/vendor/ZF2/library/Zend/Crypt/Symmetric/Padding/Pkcs7.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Padding/Pkcs7.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Symmetric/Padding/Pkcs7.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/Padding/Pkcs7.php diff --git a/vendor/ZF2/library/Zend/Crypt/Symmetric/PaddingPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/PaddingPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Symmetric/PaddingPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/PaddingPluginManager.php diff --git a/vendor/ZF2/library/Zend/Crypt/Symmetric/SymmetricInterface.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/SymmetricInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Symmetric/SymmetricInterface.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Symmetric/SymmetricInterface.php diff --git a/vendor/ZF2/library/Zend/Crypt/SymmetricPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Crypt/SymmetricPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/SymmetricPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/SymmetricPluginManager.php diff --git a/vendor/ZF2/library/Zend/Crypt/Utils.php b/vendor/zendframework/zendframework/library/Zend/Crypt/Utils.php similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/Utils.php rename to vendor/zendframework/zendframework/library/Zend/Crypt/Utils.php diff --git a/vendor/ZF2/library/Zend/Crypt/composer.json b/vendor/zendframework/zendframework/library/Zend/Crypt/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Crypt/composer.json rename to vendor/zendframework/zendframework/library/Zend/Crypt/composer.json diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Adapter.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Adapter.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Adapter.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Adapter.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/AdapterAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/AdapterAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/AdapterAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/AdapterAwareInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/AdapterAwareTrait.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/AdapterAwareTrait.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/AdapterAwareTrait.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/AdapterAwareTrait.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/AdapterServiceFactory.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/AdapterServiceFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/AdapterServiceFactory.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/AdapterServiceFactory.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/ConnectionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/ConnectionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/ConnectionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/ConnectionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/DriverInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/DriverInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/DriverInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/DriverInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Feature/DriverFeatureInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Feature/DriverFeatureInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Feature/DriverFeatureInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Feature/DriverFeatureInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/IbmDb2/Connection.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/IbmDb2/Connection.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/IbmDb2/Connection.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/IbmDb2/Connection.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/IbmDb2/IbmDb2.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/IbmDb2/IbmDb2.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/IbmDb2/IbmDb2.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/IbmDb2/IbmDb2.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/IbmDb2/Result.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/IbmDb2/Result.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/IbmDb2/Result.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/IbmDb2/Result.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/IbmDb2/Statement.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/IbmDb2/Statement.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/IbmDb2/Statement.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/IbmDb2/Statement.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Connection.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Mysqli/Connection.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Connection.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Mysqli/Connection.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Result.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Mysqli/Result.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Result.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Mysqli/Result.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Statement.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Mysqli/Statement.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Mysqli/Statement.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Mysqli/Statement.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Oci8/Connection.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Oci8/Connection.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Oci8/Connection.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Oci8/Connection.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Oci8/Oci8.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Oci8/Oci8.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Oci8/Oci8.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Oci8/Oci8.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Oci8/Result.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Oci8/Result.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Oci8/Result.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Oci8/Result.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Oci8/Statement.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Oci8/Statement.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Oci8/Statement.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Oci8/Statement.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Connection.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Connection.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Connection.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Connection.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Feature/OracleRowCounter.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Feature/OracleRowCounter.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Feature/OracleRowCounter.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Feature/OracleRowCounter.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Feature/SqliteRowCounter.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Feature/SqliteRowCounter.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Feature/SqliteRowCounter.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Feature/SqliteRowCounter.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Result.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Result.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Result.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Result.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Statement.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Statement.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Connection.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pgsql/Connection.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Connection.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pgsql/Connection.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Result.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pgsql/Result.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Result.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pgsql/Result.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Statement.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pgsql/Statement.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Pgsql/Statement.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pgsql/Statement.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/ResultInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/ResultInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/ResultInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/ResultInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Exception/ErrorException.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Exception/ErrorException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Exception/ErrorException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Exception/ErrorException.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Driver/StatementInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/StatementInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Driver/StatementInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/StatementInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Exception/ErrorException.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/ErrorException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Exception/ErrorException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/ErrorException.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Exception/InvalidConnectionParametersException.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/InvalidConnectionParametersException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Exception/InvalidConnectionParametersException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/InvalidConnectionParametersException.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Exception/InvalidQueryException.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/InvalidQueryException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Exception/InvalidQueryException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/InvalidQueryException.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/ParameterContainer.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/ParameterContainer.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/ParameterContainer.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/ParameterContainer.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Platform/IbmDb2.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/IbmDb2.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Platform/IbmDb2.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/IbmDb2.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Platform/Mysql.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Mysql.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Platform/Mysql.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Mysql.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Platform/Oracle.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Oracle.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Platform/Oracle.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Oracle.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Platform/PlatformInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/PlatformInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Platform/PlatformInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/PlatformInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Platform/Postgresql.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Postgresql.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Platform/Postgresql.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Postgresql.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Platform/Sql92.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Sql92.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Platform/Sql92.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Sql92.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Platform/SqlServer.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/SqlServer.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Platform/SqlServer.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/SqlServer.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Platform/Sqlite.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Sqlite.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Platform/Sqlite.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Platform/Sqlite.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Profiler/Profiler.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Profiler/Profiler.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Profiler/Profiler.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Profiler/Profiler.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Profiler/ProfilerAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Profiler/ProfilerAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Profiler/ProfilerAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Profiler/ProfilerAwareInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/Profiler/ProfilerInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Profiler/ProfilerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/Profiler/ProfilerInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/Profiler/ProfilerInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/StatementContainer.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/StatementContainer.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/StatementContainer.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/StatementContainer.php diff --git a/vendor/ZF2/library/Zend/Db/Adapter/StatementContainerInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Adapter/StatementContainerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Adapter/StatementContainerInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Adapter/StatementContainerInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Exception/ErrorException.php b/vendor/zendframework/zendframework/library/Zend/Db/Exception/ErrorException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Exception/ErrorException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Exception/ErrorException.php diff --git a/vendor/ZF2/library/Zend/Db/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Db/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Db/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Db/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Db/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Db/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Metadata.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Metadata.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Metadata.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Metadata.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/MetadataInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/MetadataInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/MetadataInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/MetadataInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Object/AbstractTableObject.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/AbstractTableObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Object/AbstractTableObject.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/AbstractTableObject.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Object/ColumnObject.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/ColumnObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Object/ColumnObject.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/ColumnObject.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Object/ConstraintObject.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/ConstraintObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Object/ConstraintObject.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/ConstraintObject.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Object/TableObject.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/TableObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Object/TableObject.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/TableObject.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Object/TriggerObject.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/TriggerObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Object/TriggerObject.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/TriggerObject.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Object/ViewObject.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/ViewObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Object/ViewObject.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Object/ViewObject.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Source/AbstractSource.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/AbstractSource.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Source/AbstractSource.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/AbstractSource.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Source/MysqlMetadata.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/MysqlMetadata.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Source/MysqlMetadata.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/MysqlMetadata.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Source/PostgresqlMetadata.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/PostgresqlMetadata.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Source/PostgresqlMetadata.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/PostgresqlMetadata.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Source/SqlServerMetadata.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/SqlServerMetadata.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Source/SqlServerMetadata.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/SqlServerMetadata.php diff --git a/vendor/ZF2/library/Zend/Db/Metadata/Source/SqliteMetadata.php b/vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/SqliteMetadata.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Metadata/Source/SqliteMetadata.php rename to vendor/zendframework/zendframework/library/Zend/Db/Metadata/Source/SqliteMetadata.php diff --git a/vendor/ZF2/library/Zend/Db/README.md b/vendor/zendframework/zendframework/library/Zend/Db/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Db/README.md rename to vendor/zendframework/zendframework/library/Zend/Db/README.md diff --git a/vendor/ZF2/library/Zend/Db/ResultSet/AbstractResultSet.php b/vendor/zendframework/zendframework/library/Zend/Db/ResultSet/AbstractResultSet.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/ResultSet/AbstractResultSet.php rename to vendor/zendframework/zendframework/library/Zend/Db/ResultSet/AbstractResultSet.php diff --git a/vendor/ZF2/library/Zend/Db/ResultSet/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/ResultSet/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/ResultSet/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/ResultSet/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/ResultSet/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Db/ResultSet/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/ResultSet/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Db/ResultSet/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Db/ResultSet/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Db/ResultSet/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/ResultSet/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Db/ResultSet/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Db/ResultSet/HydratingResultSet.php b/vendor/zendframework/zendframework/library/Zend/Db/ResultSet/HydratingResultSet.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/ResultSet/HydratingResultSet.php rename to vendor/zendframework/zendframework/library/Zend/Db/ResultSet/HydratingResultSet.php diff --git a/vendor/ZF2/library/Zend/Db/ResultSet/ResultSet.php b/vendor/zendframework/zendframework/library/Zend/Db/ResultSet/ResultSet.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/ResultSet/ResultSet.php rename to vendor/zendframework/zendframework/library/Zend/Db/ResultSet/ResultSet.php diff --git a/vendor/ZF2/library/Zend/Db/ResultSet/ResultSetInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/ResultSet/ResultSetInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/ResultSet/ResultSetInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/ResultSet/ResultSetInterface.php diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/AbstractRowGateway.php b/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/AbstractRowGateway.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/RowGateway/AbstractRowGateway.php rename to vendor/zendframework/zendframework/library/Zend/Db/RowGateway/AbstractRowGateway.php diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/RowGateway/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/RowGateway/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/RowGateway/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/Feature/AbstractFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Feature/AbstractFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/RowGateway/Feature/AbstractFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Feature/AbstractFeature.php diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/Feature/FeatureSet.php b/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Feature/FeatureSet.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/RowGateway/Feature/FeatureSet.php rename to vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Feature/FeatureSet.php diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/RowGateway.php b/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/RowGateway.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/RowGateway/RowGateway.php rename to vendor/zendframework/zendframework/library/Zend/Db/RowGateway/RowGateway.php diff --git a/vendor/ZF2/library/Zend/Db/RowGateway/RowGatewayInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/RowGatewayInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/RowGateway/RowGatewayInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/RowGateway/RowGatewayInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/AbstractSql.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/AbstractSql.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/AbstractSql.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/AbstractSql.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Delete.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Delete.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Delete.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Delete.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Expression.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Expression.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Expression.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Expression.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/ExpressionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/ExpressionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/ExpressionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/ExpressionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Having.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Having.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Having.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Having.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Insert.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Insert.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Insert.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Insert.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Literal.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Literal.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Literal.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Literal.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/AbstractPlatform.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/AbstractPlatform.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/AbstractPlatform.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/AbstractPlatform.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/Mysql/Mysql.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Mysql/Mysql.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/Mysql/Mysql.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Mysql/Mysql.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/Mysql/SelectDecorator.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Mysql/SelectDecorator.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/Mysql/SelectDecorator.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Mysql/SelectDecorator.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/Oracle/Oracle.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Oracle/Oracle.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/Oracle/Oracle.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Oracle/Oracle.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/Oracle/SelectDecorator.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Oracle/SelectDecorator.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/Oracle/SelectDecorator.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Oracle/SelectDecorator.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/Platform.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Platform.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/Platform.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/Platform.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/PlatformDecoratorInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/PlatformDecoratorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/PlatformDecoratorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/PlatformDecoratorInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/SqlServer/SelectDecorator.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/SqlServer/SelectDecorator.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/SqlServer/SelectDecorator.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/SqlServer/SelectDecorator.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Platform/SqlServer/SqlServer.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/SqlServer/SqlServer.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Platform/SqlServer/SqlServer.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Platform/SqlServer/SqlServer.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Between.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Between.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/Between.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Between.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Expression.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Expression.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/Expression.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Expression.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/In.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/In.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/In.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/In.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/IsNotNull.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/IsNotNull.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/IsNotNull.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/IsNotNull.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/IsNull.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/IsNull.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/IsNull.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/IsNull.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Like.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Like.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/Like.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Like.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Literal.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Literal.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/Literal.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Literal.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/NotIn.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/NotIn.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/NotIn.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/NotIn.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Operator.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Operator.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/Operator.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Operator.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/Predicate.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Predicate.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/Predicate.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/Predicate.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/PredicateInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/PredicateInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/PredicateInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/PredicateInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Predicate/PredicateSet.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/PredicateSet.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Predicate/PredicateSet.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Predicate/PredicateSet.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/PreparableSqlInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/PreparableSqlInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/PreparableSqlInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/PreparableSqlInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Select.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Select.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Select.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Select.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Sql.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Sql.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Sql.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Sql.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/SqlInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/SqlInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/SqlInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/SqlInterface.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/TableIdentifier.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/TableIdentifier.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/TableIdentifier.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/TableIdentifier.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Update.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Update.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Update.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Update.php diff --git a/vendor/ZF2/library/Zend/Db/Sql/Where.php b/vendor/zendframework/zendframework/library/Zend/Db/Sql/Where.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/Sql/Where.php rename to vendor/zendframework/zendframework/library/Zend/Db/Sql/Where.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/AbstractTableGateway.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/AbstractTableGateway.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/AbstractFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/AbstractFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/AbstractFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/AbstractFeature.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/EventFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/EventFeature.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/FeatureSet.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/FeatureSet.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/FeatureSet.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/FeatureSet.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/GlobalAdapterFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/GlobalAdapterFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/GlobalAdapterFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/GlobalAdapterFeature.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/MasterSlaveFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/MasterSlaveFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/MasterSlaveFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/MasterSlaveFeature.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/MetadataFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/MetadataFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/MetadataFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/MetadataFeature.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/RowGatewayFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/RowGatewayFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/RowGatewayFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/RowGatewayFeature.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/Feature/SequenceFeature.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/SequenceFeature.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/Feature/SequenceFeature.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/SequenceFeature.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/TableGateway.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/TableGateway.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/TableGateway.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/TableGateway.php diff --git a/vendor/ZF2/library/Zend/Db/TableGateway/TableGatewayInterface.php b/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/TableGatewayInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Db/TableGateway/TableGatewayInterface.php rename to vendor/zendframework/zendframework/library/Zend/Db/TableGateway/TableGatewayInterface.php diff --git a/vendor/ZF2/library/Zend/Db/composer.json b/vendor/zendframework/zendframework/library/Zend/Db/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Db/composer.json rename to vendor/zendframework/zendframework/library/Zend/Db/composer.json diff --git a/vendor/ZF2/library/Zend/Debug/Debug.php b/vendor/zendframework/zendframework/library/Zend/Debug/Debug.php similarity index 100% rename from vendor/ZF2/library/Zend/Debug/Debug.php rename to vendor/zendframework/zendframework/library/Zend/Debug/Debug.php diff --git a/vendor/ZF2/library/Zend/Debug/README.md b/vendor/zendframework/zendframework/library/Zend/Debug/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Debug/README.md rename to vendor/zendframework/zendframework/library/Zend/Debug/README.md diff --git a/vendor/ZF2/library/Zend/Debug/composer.json b/vendor/zendframework/zendframework/library/Zend/Debug/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Debug/composer.json rename to vendor/zendframework/zendframework/library/Zend/Debug/composer.json diff --git a/vendor/ZF2/library/Zend/Di/Config.php b/vendor/zendframework/zendframework/library/Zend/Di/Config.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Config.php rename to vendor/zendframework/zendframework/library/Zend/Di/Config.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/Annotation/Inject.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/Annotation/Inject.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/Annotation/Inject.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/Annotation/Inject.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/Annotation/Instantiator.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/Annotation/Instantiator.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/Annotation/Instantiator.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/Annotation/Instantiator.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/ArrayDefinition.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/ArrayDefinition.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/ArrayDefinition.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/ArrayDefinition.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/Builder/InjectionMethod.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/Builder/InjectionMethod.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/Builder/InjectionMethod.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/Builder/InjectionMethod.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/Builder/PhpClass.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/Builder/PhpClass.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/Builder/PhpClass.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/Builder/PhpClass.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/BuilderDefinition.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/BuilderDefinition.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/BuilderDefinition.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/BuilderDefinition.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/ClassDefinition.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/ClassDefinition.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/ClassDefinition.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/ClassDefinition.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/CompilerDefinition.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/CompilerDefinition.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/CompilerDefinition.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/CompilerDefinition.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/DefinitionInterface.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/DefinitionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/DefinitionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/DefinitionInterface.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/IntrospectionStrategy.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/IntrospectionStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/IntrospectionStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/IntrospectionStrategy.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/PartialMarker.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/PartialMarker.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/PartialMarker.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/PartialMarker.php diff --git a/vendor/ZF2/library/Zend/Di/Definition/RuntimeDefinition.php b/vendor/zendframework/zendframework/library/Zend/Di/Definition/RuntimeDefinition.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Definition/RuntimeDefinition.php rename to vendor/zendframework/zendframework/library/Zend/Di/Definition/RuntimeDefinition.php diff --git a/vendor/ZF2/library/Zend/Di/DefinitionList.php b/vendor/zendframework/zendframework/library/Zend/Di/DefinitionList.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/DefinitionList.php rename to vendor/zendframework/zendframework/library/Zend/Di/DefinitionList.php diff --git a/vendor/ZF2/library/Zend/Di/DependencyInjectionInterface.php b/vendor/zendframework/zendframework/library/Zend/Di/DependencyInjectionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/DependencyInjectionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Di/DependencyInjectionInterface.php diff --git a/vendor/ZF2/library/Zend/Di/Di.php b/vendor/zendframework/zendframework/library/Zend/Di/Di.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Di.php rename to vendor/zendframework/zendframework/library/Zend/Di/Di.php diff --git a/vendor/ZF2/library/Zend/Di/Display/Console.php b/vendor/zendframework/zendframework/library/Zend/Di/Display/Console.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Display/Console.php rename to vendor/zendframework/zendframework/library/Zend/Di/Display/Console.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/CircularDependencyException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/CircularDependencyException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/CircularDependencyException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/CircularDependencyException.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/ClassNotFoundException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/ClassNotFoundException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/ClassNotFoundException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/ClassNotFoundException.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/InvalidCallbackException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/InvalidCallbackException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/InvalidCallbackException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/InvalidCallbackException.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/InvalidParamNameException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/InvalidParamNameException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/InvalidParamNameException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/InvalidParamNameException.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/InvalidPositionException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/InvalidPositionException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/InvalidPositionException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/InvalidPositionException.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/MissingPropertyException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/MissingPropertyException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/MissingPropertyException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/MissingPropertyException.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Di/Exception/UndefinedReferenceException.php b/vendor/zendframework/zendframework/library/Zend/Di/Exception/UndefinedReferenceException.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/Exception/UndefinedReferenceException.php rename to vendor/zendframework/zendframework/library/Zend/Di/Exception/UndefinedReferenceException.php diff --git a/vendor/ZF2/library/Zend/Di/InstanceManager.php b/vendor/zendframework/zendframework/library/Zend/Di/InstanceManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/InstanceManager.php rename to vendor/zendframework/zendframework/library/Zend/Di/InstanceManager.php diff --git a/vendor/ZF2/library/Zend/Di/LocatorInterface.php b/vendor/zendframework/zendframework/library/Zend/Di/LocatorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/LocatorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Di/LocatorInterface.php diff --git a/vendor/ZF2/library/Zend/Di/README.md b/vendor/zendframework/zendframework/library/Zend/Di/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Di/README.md rename to vendor/zendframework/zendframework/library/Zend/Di/README.md diff --git a/vendor/ZF2/library/Zend/Di/ServiceLocator.php b/vendor/zendframework/zendframework/library/Zend/Di/ServiceLocator.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/ServiceLocator.php rename to vendor/zendframework/zendframework/library/Zend/Di/ServiceLocator.php diff --git a/vendor/ZF2/library/Zend/Di/ServiceLocator/DependencyInjectorProxy.php b/vendor/zendframework/zendframework/library/Zend/Di/ServiceLocator/DependencyInjectorProxy.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/ServiceLocator/DependencyInjectorProxy.php rename to vendor/zendframework/zendframework/library/Zend/Di/ServiceLocator/DependencyInjectorProxy.php diff --git a/vendor/ZF2/library/Zend/Di/ServiceLocator/Generator.php b/vendor/zendframework/zendframework/library/Zend/Di/ServiceLocator/Generator.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/ServiceLocator/Generator.php rename to vendor/zendframework/zendframework/library/Zend/Di/ServiceLocator/Generator.php diff --git a/vendor/ZF2/library/Zend/Di/ServiceLocator/GeneratorInstance.php b/vendor/zendframework/zendframework/library/Zend/Di/ServiceLocator/GeneratorInstance.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/ServiceLocator/GeneratorInstance.php rename to vendor/zendframework/zendframework/library/Zend/Di/ServiceLocator/GeneratorInstance.php diff --git a/vendor/ZF2/library/Zend/Di/ServiceLocatorInterface.php b/vendor/zendframework/zendframework/library/Zend/Di/ServiceLocatorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Di/ServiceLocatorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Di/ServiceLocatorInterface.php diff --git a/vendor/ZF2/library/Zend/Di/TODO b/vendor/zendframework/zendframework/library/Zend/Di/TODO similarity index 100% rename from vendor/ZF2/library/Zend/Di/TODO rename to vendor/zendframework/zendframework/library/Zend/Di/TODO diff --git a/vendor/ZF2/library/Zend/Di/composer.json b/vendor/zendframework/zendframework/library/Zend/Di/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Di/composer.json rename to vendor/zendframework/zendframework/library/Zend/Di/composer.json diff --git a/vendor/ZF2/library/Zend/Dom/Css2Xpath.php b/vendor/zendframework/zendframework/library/Zend/Dom/Css2Xpath.php similarity index 100% rename from vendor/ZF2/library/Zend/Dom/Css2Xpath.php rename to vendor/zendframework/zendframework/library/Zend/Dom/Css2Xpath.php diff --git a/vendor/ZF2/library/Zend/Dom/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Dom/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Dom/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Dom/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Dom/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Dom/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Dom/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Dom/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Dom/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Dom/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Dom/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Dom/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Dom/NodeList.php b/vendor/zendframework/zendframework/library/Zend/Dom/NodeList.php similarity index 100% rename from vendor/ZF2/library/Zend/Dom/NodeList.php rename to vendor/zendframework/zendframework/library/Zend/Dom/NodeList.php diff --git a/vendor/ZF2/library/Zend/Dom/Query.php b/vendor/zendframework/zendframework/library/Zend/Dom/Query.php similarity index 100% rename from vendor/ZF2/library/Zend/Dom/Query.php rename to vendor/zendframework/zendframework/library/Zend/Dom/Query.php diff --git a/vendor/ZF2/library/Zend/Dom/README.md b/vendor/zendframework/zendframework/library/Zend/Dom/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Dom/README.md rename to vendor/zendframework/zendframework/library/Zend/Dom/README.md diff --git a/vendor/ZF2/library/Zend/Dom/composer.json b/vendor/zendframework/zendframework/library/Zend/Dom/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Dom/composer.json rename to vendor/zendframework/zendframework/library/Zend/Dom/composer.json diff --git a/vendor/ZF2/library/Zend/Escaper/Escaper.php b/vendor/zendframework/zendframework/library/Zend/Escaper/Escaper.php similarity index 100% rename from vendor/ZF2/library/Zend/Escaper/Escaper.php rename to vendor/zendframework/zendframework/library/Zend/Escaper/Escaper.php diff --git a/vendor/ZF2/library/Zend/Escaper/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Escaper/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Escaper/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Escaper/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Escaper/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Escaper/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Escaper/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Escaper/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Escaper/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Escaper/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Escaper/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Escaper/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Escaper/README.md b/vendor/zendframework/zendframework/library/Zend/Escaper/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Escaper/README.md rename to vendor/zendframework/zendframework/library/Zend/Escaper/README.md diff --git a/vendor/ZF2/library/Zend/Escaper/composer.json b/vendor/zendframework/zendframework/library/Zend/Escaper/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Escaper/composer.json rename to vendor/zendframework/zendframework/library/Zend/Escaper/composer.json diff --git a/vendor/ZF2/library/Zend/EventManager/Event.php b/vendor/zendframework/zendframework/library/Zend/EventManager/Event.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/Event.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/Event.php diff --git a/vendor/ZF2/library/Zend/EventManager/EventInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/EventInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/EventInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/EventInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/EventManager.php b/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/EventManager.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php diff --git a/vendor/ZF2/library/Zend/EventManager/EventManagerAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/EventManagerAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/EventManagerAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/EventManagerAwareInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/EventManagerAwareTrait.php b/vendor/zendframework/zendframework/library/Zend/EventManager/EventManagerAwareTrait.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/EventManagerAwareTrait.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/EventManagerAwareTrait.php diff --git a/vendor/ZF2/library/Zend/EventManager/EventManagerInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/EventManagerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/EventManagerInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/EventManagerInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/EventsCapableInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/EventsCapableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/EventsCapableInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/EventsCapableInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/EventManager/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/EventManager/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/EventManager/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/EventManager/Exception/InvalidCallbackException.php b/vendor/zendframework/zendframework/library/Zend/EventManager/Exception/InvalidCallbackException.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/Exception/InvalidCallbackException.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/Exception/InvalidCallbackException.php diff --git a/vendor/ZF2/library/Zend/EventManager/Filter/FilterInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/Filter/FilterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/Filter/FilterInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/Filter/FilterInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/Filter/FilterIterator.php b/vendor/zendframework/zendframework/library/Zend/EventManager/Filter/FilterIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/Filter/FilterIterator.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/Filter/FilterIterator.php diff --git a/vendor/ZF2/library/Zend/EventManager/FilterChain.php b/vendor/zendframework/zendframework/library/Zend/EventManager/FilterChain.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/FilterChain.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/FilterChain.php diff --git a/vendor/ZF2/library/Zend/EventManager/GlobalEventManager.php b/vendor/zendframework/zendframework/library/Zend/EventManager/GlobalEventManager.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/GlobalEventManager.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/GlobalEventManager.php diff --git a/vendor/ZF2/library/Zend/EventManager/ListenerAggregateInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/ListenerAggregateInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/ListenerAggregateInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/ListenerAggregateInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/ProvidesEvents.php b/vendor/zendframework/zendframework/library/Zend/EventManager/ProvidesEvents.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/ProvidesEvents.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/ProvidesEvents.php diff --git a/vendor/ZF2/library/Zend/EventManager/README.md b/vendor/zendframework/zendframework/library/Zend/EventManager/README.md similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/README.md rename to vendor/zendframework/zendframework/library/Zend/EventManager/README.md diff --git a/vendor/ZF2/library/Zend/EventManager/ResponseCollection.php b/vendor/zendframework/zendframework/library/Zend/EventManager/ResponseCollection.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/ResponseCollection.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/ResponseCollection.php diff --git a/vendor/ZF2/library/Zend/EventManager/SharedEventAggregateAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/SharedEventAggregateAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/SharedEventAggregateAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/SharedEventAggregateAwareInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/SharedEventManager.php b/vendor/zendframework/zendframework/library/Zend/EventManager/SharedEventManager.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/SharedEventManager.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/SharedEventManager.php diff --git a/vendor/ZF2/library/Zend/EventManager/SharedEventManagerAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/SharedEventManagerAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/SharedEventManagerAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/SharedEventManagerAwareInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/SharedEventManagerInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/SharedEventManagerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/SharedEventManagerInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/SharedEventManagerInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/SharedListenerAggregateInterface.php b/vendor/zendframework/zendframework/library/Zend/EventManager/SharedListenerAggregateInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/SharedListenerAggregateInterface.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/SharedListenerAggregateInterface.php diff --git a/vendor/ZF2/library/Zend/EventManager/StaticEventManager.php b/vendor/zendframework/zendframework/library/Zend/EventManager/StaticEventManager.php similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/StaticEventManager.php rename to vendor/zendframework/zendframework/library/Zend/EventManager/StaticEventManager.php diff --git a/vendor/ZF2/library/Zend/EventManager/composer.json b/vendor/zendframework/zendframework/library/Zend/EventManager/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/EventManager/composer.json rename to vendor/zendframework/zendframework/library/Zend/EventManager/composer.json diff --git a/vendor/ZF2/library/Zend/Feed/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Feed/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Feed/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/AbstractCallback.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/AbstractCallback.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/AbstractCallback.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/AbstractCallback.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/CallbackInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/CallbackInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/CallbackInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/CallbackInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/HttpResponse.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/HttpResponse.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/HttpResponse.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/HttpResponse.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Model/AbstractModel.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Model/AbstractModel.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Model/AbstractModel.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Model/AbstractModel.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Model/Subscription.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Model/Subscription.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Model/Subscription.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Model/Subscription.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Model/SubscriptionPersistenceInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Model/SubscriptionPersistenceInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Model/SubscriptionPersistenceInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Model/SubscriptionPersistenceInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/PubSubHubbub.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/PubSubHubbub.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/PubSubHubbub.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/PubSubHubbub.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Publisher.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Publisher.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Publisher.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Publisher.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Subscriber.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Subscriber.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Subscriber.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Subscriber.php diff --git a/vendor/ZF2/library/Zend/Feed/PubSubHubbub/Subscriber/Callback.php b/vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Subscriber/Callback.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/PubSubHubbub/Subscriber/Callback.php rename to vendor/zendframework/zendframework/library/Zend/Feed/PubSubHubbub/Subscriber/Callback.php diff --git a/vendor/ZF2/library/Zend/Feed/README.md b/vendor/zendframework/zendframework/library/Zend/Feed/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Feed/README.md rename to vendor/zendframework/zendframework/library/Zend/Feed/README.md diff --git a/vendor/ZF2/library/Zend/Feed/Reader/AbstractEntry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/AbstractEntry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/AbstractEntry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/AbstractEntry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/AbstractFeed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/AbstractFeed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/AbstractFeed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/AbstractFeed.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Collection.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Collection.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Collection/AbstractCollection.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection/AbstractCollection.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Collection/AbstractCollection.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection/AbstractCollection.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Collection/Author.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection/Author.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Collection/Author.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection/Author.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Collection/Category.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection/Category.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Collection/Category.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection/Category.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Collection/Collection.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection/Collection.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Collection/Collection.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Collection/Collection.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Entry/AbstractEntry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Entry/AbstractEntry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Entry/AbstractEntry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Entry/AbstractEntry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Entry/Atom.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Entry/Atom.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Entry/Atom.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Entry/Atom.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Entry/EntryInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Entry/EntryInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Entry/EntryInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Entry/EntryInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Entry/Rss.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Entry/Rss.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Entry/Rss.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Entry/Rss.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/AbstractEntry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/AbstractEntry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/AbstractEntry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/AbstractEntry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/AbstractFeed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/AbstractFeed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/AbstractFeed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/AbstractFeed.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/Atom/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Atom/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/Atom/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Atom/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/Atom/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Atom/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/Atom/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Atom/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/Content/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Content/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/Content/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Content/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/DublinCore/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/DublinCore/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/DublinCore/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/DublinCore/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/DublinCore/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/DublinCore/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/DublinCore/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/DublinCore/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/Podcast/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Podcast/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/Podcast/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Podcast/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/Podcast/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Podcast/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/Podcast/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Podcast/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/Slash/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Slash/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/Slash/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Slash/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/Syndication/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Syndication/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/Syndication/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Syndication/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/Thread/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Thread/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/Thread/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/Thread/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/ExtensionManager.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/ExtensionManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/ExtensionManager.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/ExtensionManager.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Feed/AbstractFeed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/AbstractFeed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Feed/AbstractFeed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/AbstractFeed.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Feed/Atom.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/Atom.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Feed/Atom.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/Atom.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Feed/Atom/Source.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/Atom/Source.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Feed/Atom/Source.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/Atom/Source.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Feed/FeedInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/FeedInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Feed/FeedInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/FeedInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Feed/Rss.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/Rss.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Feed/Rss.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Feed/Rss.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/FeedSet.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/FeedSet.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/FeedSet.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/FeedSet.php diff --git a/vendor/ZF2/library/Zend/Feed/Reader/Reader.php b/vendor/zendframework/zendframework/library/Zend/Feed/Reader/Reader.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Reader/Reader.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Reader/Reader.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/AbstractFeed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/AbstractFeed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/AbstractFeed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/AbstractFeed.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Deleted.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Deleted.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Deleted.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Deleted.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/AbstractRenderer.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/AbstractRenderer.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/AbstractRenderer.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/AbstractRenderer.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/Atom/Renderer/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/Atom/Renderer/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/Atom/Renderer/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/Atom/Renderer/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/ITunes/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/ITunes/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/ITunes/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/ITunes/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/ITunes/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/ITunes/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/ITunes/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/ITunes/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/RendererInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/RendererInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/RendererInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/RendererInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/Slash/Renderer/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/Slash/Renderer/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/Slash/Renderer/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/Slash/Renderer/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/ExtensionManager.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/ExtensionManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/ExtensionManager.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/ExtensionManager.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Feed.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Feed.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Feed.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Feed.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/FeedFactory.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/FeedFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/FeedFactory.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/FeedFactory.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/AbstractRenderer.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/AbstractRenderer.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/AbstractRenderer.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/AbstractRenderer.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Entry/Atom.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Entry/Atom.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Entry/Atom.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Entry/Atom.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Entry/AtomDeleted.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Entry/AtomDeleted.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Entry/AtomDeleted.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Entry/AtomDeleted.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Entry/Rss.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Entry/Rss.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Entry/Rss.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Entry/Rss.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/AbstractAtom.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/AbstractAtom.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/AbstractAtom.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/AbstractAtom.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/Atom.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/Atom.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/Atom.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/Atom.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/Atom/AbstractAtom.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/Atom/AbstractAtom.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/Atom/AbstractAtom.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/Atom/AbstractAtom.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/AtomSource.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/AtomSource.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/AtomSource.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/AtomSource.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/Rss.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/Rss.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/Feed/Rss.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/Feed/Rss.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Renderer/RendererInterface.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/RendererInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Renderer/RendererInterface.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Renderer/RendererInterface.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Source.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Source.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Source.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Source.php diff --git a/vendor/ZF2/library/Zend/Feed/Writer/Writer.php b/vendor/zendframework/zendframework/library/Zend/Feed/Writer/Writer.php similarity index 100% rename from vendor/ZF2/library/Zend/Feed/Writer/Writer.php rename to vendor/zendframework/zendframework/library/Zend/Feed/Writer/Writer.php diff --git a/vendor/ZF2/library/Zend/Feed/composer.json b/vendor/zendframework/zendframework/library/Zend/Feed/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Feed/composer.json rename to vendor/zendframework/zendframework/library/Zend/Feed/composer.json diff --git a/vendor/ZF2/library/Zend/File/ClassFileLocator.php b/vendor/zendframework/zendframework/library/Zend/File/ClassFileLocator.php similarity index 100% rename from vendor/ZF2/library/Zend/File/ClassFileLocator.php rename to vendor/zendframework/zendframework/library/Zend/File/ClassFileLocator.php diff --git a/vendor/ZF2/library/Zend/File/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/File/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/File/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/File/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/File/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/File/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/File/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/File/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/File/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/File/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/File/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/File/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/File/PhpClassFile.php b/vendor/zendframework/zendframework/library/Zend/File/PhpClassFile.php similarity index 100% rename from vendor/ZF2/library/Zend/File/PhpClassFile.php rename to vendor/zendframework/zendframework/library/Zend/File/PhpClassFile.php diff --git a/vendor/ZF2/library/Zend/File/README.md b/vendor/zendframework/zendframework/library/Zend/File/README.md similarity index 100% rename from vendor/ZF2/library/Zend/File/README.md rename to vendor/zendframework/zendframework/library/Zend/File/README.md diff --git a/vendor/ZF2/library/Zend/File/Transfer/Adapter/AbstractAdapter.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Adapter/AbstractAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Adapter/AbstractAdapter.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Adapter/AbstractAdapter.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Adapter/FilterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Adapter/FilterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Adapter/FilterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Adapter/FilterPluginManager.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Adapter/Http.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Adapter/Http.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Adapter/Http.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Adapter/Http.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Adapter/ValidatorPluginManager.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Adapter/ValidatorPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Adapter/ValidatorPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Adapter/ValidatorPluginManager.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Exception/PhpEnvironmentException.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/PhpEnvironmentException.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Exception/PhpEnvironmentException.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/PhpEnvironmentException.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/File/Transfer/Transfer.php b/vendor/zendframework/zendframework/library/Zend/File/Transfer/Transfer.php similarity index 100% rename from vendor/ZF2/library/Zend/File/Transfer/Transfer.php rename to vendor/zendframework/zendframework/library/Zend/File/Transfer/Transfer.php diff --git a/vendor/ZF2/library/Zend/File/composer.json b/vendor/zendframework/zendframework/library/Zend/File/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/File/composer.json rename to vendor/zendframework/zendframework/library/Zend/File/composer.json diff --git a/vendor/ZF2/library/Zend/Filter/AbstractFilter.php b/vendor/zendframework/zendframework/library/Zend/Filter/AbstractFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/AbstractFilter.php rename to vendor/zendframework/zendframework/library/Zend/Filter/AbstractFilter.php diff --git a/vendor/ZF2/library/Zend/Filter/AbstractUnicode.php b/vendor/zendframework/zendframework/library/Zend/Filter/AbstractUnicode.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/AbstractUnicode.php rename to vendor/zendframework/zendframework/library/Zend/Filter/AbstractUnicode.php diff --git a/vendor/ZF2/library/Zend/Filter/BaseName.php b/vendor/zendframework/zendframework/library/Zend/Filter/BaseName.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/BaseName.php rename to vendor/zendframework/zendframework/library/Zend/Filter/BaseName.php diff --git a/vendor/ZF2/library/Zend/Filter/Boolean.php b/vendor/zendframework/zendframework/library/Zend/Filter/Boolean.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Boolean.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Boolean.php diff --git a/vendor/ZF2/library/Zend/Filter/Callback.php b/vendor/zendframework/zendframework/library/Zend/Filter/Callback.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Callback.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Callback.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/AbstractCompressionAlgorithm.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/AbstractCompressionAlgorithm.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/AbstractCompressionAlgorithm.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/AbstractCompressionAlgorithm.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/Bz2.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/Bz2.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/Bz2.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/Bz2.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/CompressionAlgorithmInterface.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/CompressionAlgorithmInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/CompressionAlgorithmInterface.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/CompressionAlgorithmInterface.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/Gz.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/Gz.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/Gz.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/Gz.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/Lzf.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/Lzf.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/Lzf.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/Lzf.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/Rar.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/Rar.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/Rar.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/Rar.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/Snappy.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/Snappy.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/Snappy.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/Snappy.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/Tar.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/Tar.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/Tar.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/Tar.php diff --git a/vendor/ZF2/library/Zend/Filter/Compress/Zip.php b/vendor/zendframework/zendframework/library/Zend/Filter/Compress/Zip.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Compress/Zip.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Compress/Zip.php diff --git a/vendor/ZF2/library/Zend/Filter/Decompress.php b/vendor/zendframework/zendframework/library/Zend/Filter/Decompress.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Decompress.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Decompress.php diff --git a/vendor/ZF2/library/Zend/Filter/Decrypt.php b/vendor/zendframework/zendframework/library/Zend/Filter/Decrypt.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Decrypt.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Decrypt.php diff --git a/vendor/ZF2/library/Zend/Filter/Digits.php b/vendor/zendframework/zendframework/library/Zend/Filter/Digits.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Digits.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Digits.php diff --git a/vendor/ZF2/library/Zend/Filter/Dir.php b/vendor/zendframework/zendframework/library/Zend/Filter/Dir.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Dir.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Dir.php diff --git a/vendor/ZF2/library/Zend/Filter/Encrypt.php b/vendor/zendframework/zendframework/library/Zend/Filter/Encrypt.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Encrypt.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Encrypt.php diff --git a/vendor/ZF2/library/Zend/Filter/Encrypt/BlockCipher.php b/vendor/zendframework/zendframework/library/Zend/Filter/Encrypt/BlockCipher.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Encrypt/BlockCipher.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Encrypt/BlockCipher.php diff --git a/vendor/ZF2/library/Zend/Filter/Encrypt/EncryptionAlgorithmInterface.php b/vendor/zendframework/zendframework/library/Zend/Filter/Encrypt/EncryptionAlgorithmInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Encrypt/EncryptionAlgorithmInterface.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Encrypt/EncryptionAlgorithmInterface.php diff --git a/vendor/ZF2/library/Zend/Filter/Encrypt/Openssl.php b/vendor/zendframework/zendframework/library/Zend/Filter/Encrypt/Openssl.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Encrypt/Openssl.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Encrypt/Openssl.php diff --git a/vendor/ZF2/library/Zend/Filter/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Filter/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Filter/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Filter/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Filter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Filter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Filter/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zendframework/library/Zend/Filter/Exception/ExtensionNotLoadedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Exception/ExtensionNotLoadedException.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Exception/ExtensionNotLoadedException.php diff --git a/vendor/ZF2/library/Zend/Filter/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Filter/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Filter/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Filter/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Filter/File/Decrypt.php b/vendor/zendframework/zendframework/library/Zend/Filter/File/Decrypt.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/File/Decrypt.php rename to vendor/zendframework/zendframework/library/Zend/Filter/File/Decrypt.php diff --git a/vendor/ZF2/library/Zend/Filter/File/Encrypt.php b/vendor/zendframework/zendframework/library/Zend/Filter/File/Encrypt.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/File/Encrypt.php rename to vendor/zendframework/zendframework/library/Zend/Filter/File/Encrypt.php diff --git a/vendor/ZF2/library/Zend/Filter/File/LowerCase.php b/vendor/zendframework/zendframework/library/Zend/Filter/File/LowerCase.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/File/LowerCase.php rename to vendor/zendframework/zendframework/library/Zend/Filter/File/LowerCase.php diff --git a/vendor/ZF2/library/Zend/Filter/File/Rename.php b/vendor/zendframework/zendframework/library/Zend/Filter/File/Rename.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/File/Rename.php rename to vendor/zendframework/zendframework/library/Zend/Filter/File/Rename.php diff --git a/vendor/ZF2/library/Zend/Filter/File/RenameUpload.php b/vendor/zendframework/zendframework/library/Zend/Filter/File/RenameUpload.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/File/RenameUpload.php rename to vendor/zendframework/zendframework/library/Zend/Filter/File/RenameUpload.php diff --git a/vendor/ZF2/library/Zend/Filter/File/UpperCase.php b/vendor/zendframework/zendframework/library/Zend/Filter/File/UpperCase.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/File/UpperCase.php rename to vendor/zendframework/zendframework/library/Zend/Filter/File/UpperCase.php diff --git a/vendor/ZF2/library/Zend/Filter/FilterChain.php b/vendor/zendframework/zendframework/library/Zend/Filter/FilterChain.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/FilterChain.php rename to vendor/zendframework/zendframework/library/Zend/Filter/FilterChain.php diff --git a/vendor/ZF2/library/Zend/Filter/FilterInterface.php b/vendor/zendframework/zendframework/library/Zend/Filter/FilterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/FilterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Filter/FilterInterface.php diff --git a/vendor/ZF2/library/Zend/Filter/FilterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Filter/FilterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/FilterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Filter/FilterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Filter/HtmlEntities.php b/vendor/zendframework/zendframework/library/Zend/Filter/HtmlEntities.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/HtmlEntities.php rename to vendor/zendframework/zendframework/library/Zend/Filter/HtmlEntities.php diff --git a/vendor/ZF2/library/Zend/Filter/Inflector.php b/vendor/zendframework/zendframework/library/Zend/Filter/Inflector.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Inflector.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Inflector.php diff --git a/vendor/ZF2/library/Zend/Filter/Int.php b/vendor/zendframework/zendframework/library/Zend/Filter/Int.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Int.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Int.php diff --git a/vendor/ZF2/library/Zend/Filter/Null.php b/vendor/zendframework/zendframework/library/Zend/Filter/Null.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Null.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Null.php diff --git a/vendor/ZF2/library/Zend/Filter/PregReplace.php b/vendor/zendframework/zendframework/library/Zend/Filter/PregReplace.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/PregReplace.php rename to vendor/zendframework/zendframework/library/Zend/Filter/PregReplace.php diff --git a/vendor/ZF2/library/Zend/Filter/README.md b/vendor/zendframework/zendframework/library/Zend/Filter/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Filter/README.md rename to vendor/zendframework/zendframework/library/Zend/Filter/README.md diff --git a/vendor/ZF2/library/Zend/Filter/RealPath.php b/vendor/zendframework/zendframework/library/Zend/Filter/RealPath.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/RealPath.php rename to vendor/zendframework/zendframework/library/Zend/Filter/RealPath.php diff --git a/vendor/ZF2/library/Zend/Filter/StaticFilter.php b/vendor/zendframework/zendframework/library/Zend/Filter/StaticFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/StaticFilter.php rename to vendor/zendframework/zendframework/library/Zend/Filter/StaticFilter.php diff --git a/vendor/ZF2/library/Zend/Filter/StringToLower.php b/vendor/zendframework/zendframework/library/Zend/Filter/StringToLower.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/StringToLower.php rename to vendor/zendframework/zendframework/library/Zend/Filter/StringToLower.php diff --git a/vendor/ZF2/library/Zend/Filter/StringToUpper.php b/vendor/zendframework/zendframework/library/Zend/Filter/StringToUpper.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/StringToUpper.php rename to vendor/zendframework/zendframework/library/Zend/Filter/StringToUpper.php diff --git a/vendor/ZF2/library/Zend/Filter/StringTrim.php b/vendor/zendframework/zendframework/library/Zend/Filter/StringTrim.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/StringTrim.php rename to vendor/zendframework/zendframework/library/Zend/Filter/StringTrim.php diff --git a/vendor/ZF2/library/Zend/Filter/StripNewlines.php b/vendor/zendframework/zendframework/library/Zend/Filter/StripNewlines.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/StripNewlines.php rename to vendor/zendframework/zendframework/library/Zend/Filter/StripNewlines.php diff --git a/vendor/ZF2/library/Zend/Filter/StripTags.php b/vendor/zendframework/zendframework/library/Zend/Filter/StripTags.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/StripTags.php rename to vendor/zendframework/zendframework/library/Zend/Filter/StripTags.php diff --git a/vendor/ZF2/library/Zend/Filter/UriNormalize.php b/vendor/zendframework/zendframework/library/Zend/Filter/UriNormalize.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/UriNormalize.php rename to vendor/zendframework/zendframework/library/Zend/Filter/UriNormalize.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/AbstractSeparator.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/AbstractSeparator.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/AbstractSeparator.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/AbstractSeparator.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/CamelCaseToDash.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/CamelCaseToDash.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/CamelCaseToDash.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/CamelCaseToDash.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/CamelCaseToSeparator.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/CamelCaseToSeparator.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/CamelCaseToSeparator.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/CamelCaseToSeparator.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/CamelCaseToUnderscore.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/CamelCaseToUnderscore.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/CamelCaseToUnderscore.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/CamelCaseToUnderscore.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/DashToCamelCase.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/DashToCamelCase.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/DashToCamelCase.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/DashToCamelCase.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/DashToSeparator.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/DashToSeparator.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/DashToSeparator.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/DashToSeparator.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/DashToUnderscore.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/DashToUnderscore.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/DashToUnderscore.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/DashToUnderscore.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/SeparatorToCamelCase.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/SeparatorToCamelCase.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/SeparatorToCamelCase.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/SeparatorToCamelCase.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/SeparatorToDash.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/SeparatorToDash.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/SeparatorToDash.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/SeparatorToDash.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/SeparatorToSeparator.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/SeparatorToSeparator.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/SeparatorToSeparator.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/SeparatorToSeparator.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/UnderscoreToCamelCase.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/UnderscoreToCamelCase.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/UnderscoreToCamelCase.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/UnderscoreToCamelCase.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/UnderscoreToDash.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/UnderscoreToDash.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/UnderscoreToDash.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/UnderscoreToDash.php diff --git a/vendor/ZF2/library/Zend/Filter/Word/UnderscoreToSeparator.php b/vendor/zendframework/zendframework/library/Zend/Filter/Word/UnderscoreToSeparator.php similarity index 100% rename from vendor/ZF2/library/Zend/Filter/Word/UnderscoreToSeparator.php rename to vendor/zendframework/zendframework/library/Zend/Filter/Word/UnderscoreToSeparator.php diff --git a/vendor/ZF2/library/Zend/Filter/composer.json b/vendor/zendframework/zendframework/library/Zend/Filter/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Filter/composer.json rename to vendor/zendframework/zendframework/library/Zend/Filter/composer.json diff --git a/vendor/ZF2/library/Zend/Form/Annotation/AbstractAnnotationsListener.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/AbstractAnnotationsListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/AbstractAnnotationsListener.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/AbstractAnnotationsListener.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/AbstractArrayAnnotation.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/AbstractArrayAnnotation.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/AbstractArrayAnnotation.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/AbstractArrayAnnotation.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/AbstractArrayOrStringAnnotation.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/AbstractArrayOrStringAnnotation.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/AbstractArrayOrStringAnnotation.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/AbstractArrayOrStringAnnotation.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/AbstractStringAnnotation.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/AbstractStringAnnotation.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/AbstractStringAnnotation.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/AbstractStringAnnotation.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/AllowEmpty.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/AllowEmpty.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/AllowEmpty.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/AllowEmpty.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/AnnotationBuilder.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/AnnotationBuilder.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/AnnotationBuilder.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/AnnotationBuilder.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Attributes.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Attributes.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Attributes.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Attributes.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/ComposedObject.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/ComposedObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/ComposedObject.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/ComposedObject.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/ElementAnnotationsListener.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/ElementAnnotationsListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/ElementAnnotationsListener.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/ElementAnnotationsListener.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/ErrorMessage.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/ErrorMessage.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/ErrorMessage.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/ErrorMessage.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Exclude.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Exclude.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Exclude.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Exclude.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Filter.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Filter.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Filter.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Filter.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Flags.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Flags.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Flags.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Flags.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/FormAnnotationsListener.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/FormAnnotationsListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/FormAnnotationsListener.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/FormAnnotationsListener.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Hydrator.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Hydrator.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Hydrator.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Hydrator.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Input.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Input.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Input.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Input.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/InputFilter.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/InputFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/InputFilter.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/InputFilter.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Name.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Name.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Name.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Name.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Object.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Object.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Object.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Object.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Options.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Options.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Options.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Options.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Required.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Required.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Required.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Required.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Type.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Type.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Type.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Type.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/ValidationGroup.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/ValidationGroup.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/ValidationGroup.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/ValidationGroup.php diff --git a/vendor/ZF2/library/Zend/Form/Annotation/Validator.php b/vendor/zendframework/zendframework/library/Zend/Form/Annotation/Validator.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Annotation/Validator.php rename to vendor/zendframework/zendframework/library/Zend/Form/Annotation/Validator.php diff --git a/vendor/ZF2/library/Zend/Form/Element.php b/vendor/zendframework/zendframework/library/Zend/Form/Element.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Button.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Button.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Button.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Button.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Captcha.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Captcha.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Captcha.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Captcha.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Checkbox.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Checkbox.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Checkbox.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Checkbox.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Collection.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Collection.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Collection.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Collection.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Color.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Color.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Color.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Color.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Csrf.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Csrf.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Csrf.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Csrf.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Date.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Date.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Date.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Date.php diff --git a/vendor/ZF2/library/Zend/Form/Element/DateSelect.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/DateSelect.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/DateSelect.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/DateSelect.php diff --git a/vendor/ZF2/library/Zend/Form/Element/DateTime.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/DateTime.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/DateTime.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/DateTime.php diff --git a/vendor/ZF2/library/Zend/Form/Element/DateTimeLocal.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/DateTimeLocal.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/DateTimeLocal.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/DateTimeLocal.php diff --git a/vendor/ZF2/library/Zend/Form/Element/DateTimeSelect.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/DateTimeSelect.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/DateTimeSelect.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/DateTimeSelect.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Email.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Email.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Email.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Email.php diff --git a/vendor/ZF2/library/Zend/Form/Element/File.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/File.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/File.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/File.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Hidden.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Hidden.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Hidden.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Hidden.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Image.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Image.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Image.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Image.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Month.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Month.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Month.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Month.php diff --git a/vendor/ZF2/library/Zend/Form/Element/MonthSelect.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/MonthSelect.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/MonthSelect.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/MonthSelect.php diff --git a/vendor/ZF2/library/Zend/Form/Element/MultiCheckbox.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/MultiCheckbox.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/MultiCheckbox.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/MultiCheckbox.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Number.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Number.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Number.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Number.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Password.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Password.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Password.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Password.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Radio.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Radio.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Radio.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Radio.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Range.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Range.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Range.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Range.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Select.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Select.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Select.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Select.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Submit.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Submit.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Submit.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Submit.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Text.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Text.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Text.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Text.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Textarea.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Textarea.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Textarea.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Textarea.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Time.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Time.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Time.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Time.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Url.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Url.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Url.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Url.php diff --git a/vendor/ZF2/library/Zend/Form/Element/Week.php b/vendor/zendframework/zendframework/library/Zend/Form/Element/Week.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Element/Week.php rename to vendor/zendframework/zendframework/library/Zend/Form/Element/Week.php diff --git a/vendor/ZF2/library/Zend/Form/ElementAttributeRemovalInterface.php b/vendor/zendframework/zendframework/library/Zend/Form/ElementAttributeRemovalInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/ElementAttributeRemovalInterface.php rename to vendor/zendframework/zendframework/library/Zend/Form/ElementAttributeRemovalInterface.php diff --git a/vendor/ZF2/library/Zend/Form/ElementInterface.php b/vendor/zendframework/zendframework/library/Zend/Form/ElementInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/ElementInterface.php rename to vendor/zendframework/zendframework/library/Zend/Form/ElementInterface.php diff --git a/vendor/ZF2/library/Zend/Form/ElementPrepareAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/Form/ElementPrepareAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/ElementPrepareAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/Form/ElementPrepareAwareInterface.php diff --git a/vendor/ZF2/library/Zend/Form/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Form/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Form/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Form/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Form/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Form/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Form/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Form/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Form/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Form/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Form/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Form/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Form/Exception/InvalidElementException.php b/vendor/zendframework/zendframework/library/Zend/Form/Exception/InvalidElementException.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Exception/InvalidElementException.php rename to vendor/zendframework/zendframework/library/Zend/Form/Exception/InvalidElementException.php diff --git a/vendor/ZF2/library/Zend/Form/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Form/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Form/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Form/Factory.php b/vendor/zendframework/zendframework/library/Zend/Form/Factory.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Factory.php rename to vendor/zendframework/zendframework/library/Zend/Form/Factory.php diff --git a/vendor/ZF2/library/Zend/Form/Fieldset.php b/vendor/zendframework/zendframework/library/Zend/Form/Fieldset.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Fieldset.php rename to vendor/zendframework/zendframework/library/Zend/Form/Fieldset.php diff --git a/vendor/ZF2/library/Zend/Form/FieldsetInterface.php b/vendor/zendframework/zendframework/library/Zend/Form/FieldsetInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/FieldsetInterface.php rename to vendor/zendframework/zendframework/library/Zend/Form/FieldsetInterface.php diff --git a/vendor/ZF2/library/Zend/Form/FieldsetPrepareAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/Form/FieldsetPrepareAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/FieldsetPrepareAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/Form/FieldsetPrepareAwareInterface.php diff --git a/vendor/ZF2/library/Zend/Form/Form.php b/vendor/zendframework/zendframework/library/Zend/Form/Form.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/Form.php rename to vendor/zendframework/zendframework/library/Zend/Form/Form.php diff --git a/vendor/ZF2/library/Zend/Form/FormElementManager.php b/vendor/zendframework/zendframework/library/Zend/Form/FormElementManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/FormElementManager.php rename to vendor/zendframework/zendframework/library/Zend/Form/FormElementManager.php diff --git a/vendor/ZF2/library/Zend/Form/FormFactoryAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/Form/FormFactoryAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/FormFactoryAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/Form/FormFactoryAwareInterface.php diff --git a/vendor/ZF2/library/Zend/Form/FormFactoryAwareTrait.php b/vendor/zendframework/zendframework/library/Zend/Form/FormFactoryAwareTrait.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/FormFactoryAwareTrait.php rename to vendor/zendframework/zendframework/library/Zend/Form/FormFactoryAwareTrait.php diff --git a/vendor/ZF2/library/Zend/Form/FormInterface.php b/vendor/zendframework/zendframework/library/Zend/Form/FormInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/FormInterface.php rename to vendor/zendframework/zendframework/library/Zend/Form/FormInterface.php diff --git a/vendor/ZF2/library/Zend/Form/README.md b/vendor/zendframework/zendframework/library/Zend/Form/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Form/README.md rename to vendor/zendframework/zendframework/library/Zend/Form/README.md diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/AbstractHelper.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/AbstractHelper.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/AbstractHelper.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/AbstractHelper.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/Captcha/AbstractWord.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/AbstractWord.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/Captcha/AbstractWord.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/AbstractWord.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/Captcha/Dumb.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/Dumb.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/Captcha/Dumb.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/Dumb.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/Captcha/Figlet.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/Figlet.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/Captcha/Figlet.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/Figlet.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/Captcha/Image.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/Image.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/Captcha/Image.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/Image.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/Captcha/ReCaptcha.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/ReCaptcha.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/Captcha/ReCaptcha.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Captcha/ReCaptcha.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/File/FormFileApcProgress.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/File/FormFileApcProgress.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/File/FormFileApcProgress.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/File/FormFileApcProgress.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/File/FormFileSessionProgress.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/File/FormFileSessionProgress.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/File/FormFileSessionProgress.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/File/FormFileSessionProgress.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/File/FormFileUploadProgress.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/File/FormFileUploadProgress.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/File/FormFileUploadProgress.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/File/FormFileUploadProgress.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/Form.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Form.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/Form.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/Form.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormButton.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormButton.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormButton.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormButton.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormCaptcha.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormCaptcha.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormCaptcha.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormCaptcha.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormCheckbox.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormCheckbox.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormCheckbox.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormCheckbox.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormCollection.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormCollection.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormCollection.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormCollection.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormColor.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormColor.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormColor.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormColor.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormDate.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDate.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormDate.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDate.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormDateSelect.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDateSelect.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormDateSelect.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDateSelect.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormDateTime.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDateTime.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormDateTime.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDateTime.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormDateTimeLocal.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDateTimeLocal.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormDateTimeLocal.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDateTimeLocal.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormDateTimeSelect.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDateTimeSelect.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormDateTimeSelect.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormDateTimeSelect.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormElement.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormElement.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormElement.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormElement.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormElementErrors.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormElementErrors.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormElementErrors.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormElementErrors.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormEmail.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormEmail.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormEmail.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormEmail.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormFile.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormFile.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormFile.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormFile.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormHidden.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormHidden.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormHidden.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormHidden.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormImage.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormImage.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormImage.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormImage.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormInput.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormInput.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormInput.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormInput.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormLabel.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormLabel.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormLabel.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormLabel.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormMonth.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormMonth.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormMonth.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormMonth.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormMonthSelect.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormMonthSelect.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormMonthSelect.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormMonthSelect.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormMultiCheckbox.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormMultiCheckbox.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormMultiCheckbox.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormMultiCheckbox.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormNumber.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormNumber.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormNumber.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormNumber.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormPassword.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormPassword.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormPassword.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormPassword.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormRadio.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormRadio.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormRadio.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormRadio.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormRange.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormRange.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormRange.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormRange.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormReset.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormReset.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormReset.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormReset.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormRow.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormRow.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormRow.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormRow.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormSearch.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormSearch.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormSearch.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormSearch.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormSelect.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormSelect.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormSelect.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormSelect.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormSubmit.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormSubmit.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormSubmit.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormSubmit.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormTel.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormTel.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormTel.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormTel.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormText.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormText.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormText.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormText.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormTextarea.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormTextarea.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormTextarea.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormTextarea.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormTime.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormTime.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormTime.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormTime.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormUrl.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormUrl.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormUrl.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormUrl.php diff --git a/vendor/ZF2/library/Zend/Form/View/Helper/FormWeek.php b/vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormWeek.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/Helper/FormWeek.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/Helper/FormWeek.php diff --git a/vendor/ZF2/library/Zend/Form/View/HelperConfig.php b/vendor/zendframework/zendframework/library/Zend/Form/View/HelperConfig.php similarity index 100% rename from vendor/ZF2/library/Zend/Form/View/HelperConfig.php rename to vendor/zendframework/zendframework/library/Zend/Form/View/HelperConfig.php diff --git a/vendor/ZF2/library/Zend/Form/composer.json b/vendor/zendframework/zendframework/library/Zend/Form/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Form/composer.json rename to vendor/zendframework/zendframework/library/Zend/Form/composer.json diff --git a/vendor/ZF2/library/Zend/Http/AbstractMessage.php b/vendor/zendframework/zendframework/library/Zend/Http/AbstractMessage.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/AbstractMessage.php rename to vendor/zendframework/zendframework/library/Zend/Http/AbstractMessage.php diff --git a/vendor/ZF2/library/Zend/Http/Client.php b/vendor/zendframework/zendframework/library/Zend/Http/Client.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Curl.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Curl.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Curl.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Curl.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/InitializationException.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/InitializationException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/InitializationException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/InitializationException.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/OutOfRangeException.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/OutOfRangeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/OutOfRangeException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/OutOfRangeException.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/TimeoutException.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/TimeoutException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Exception/TimeoutException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Exception/TimeoutException.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Proxy.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Proxy.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Proxy.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Proxy.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Socket.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Socket.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Socket.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Socket.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/StreamInterface.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/StreamInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/StreamInterface.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/StreamInterface.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Adapter/Test.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Test.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Adapter/Test.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Adapter/Test.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Cookies.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Cookies.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Cookies.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Cookies.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Exception/OutOfRangeException.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Exception/OutOfRangeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Exception/OutOfRangeException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Exception/OutOfRangeException.php diff --git a/vendor/ZF2/library/Zend/Http/Client/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Http/Client/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Client/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Client/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Http/ClientStatic.php b/vendor/zendframework/zendframework/library/Zend/Http/ClientStatic.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/ClientStatic.php rename to vendor/zendframework/zendframework/library/Zend/Http/ClientStatic.php diff --git a/vendor/ZF2/library/Zend/Http/Cookies.php b/vendor/zendframework/zendframework/library/Zend/Http/Cookies.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Cookies.php rename to vendor/zendframework/zendframework/library/Zend/Http/Cookies.php diff --git a/vendor/ZF2/library/Zend/Http/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Http/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Http/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Http/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Http/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Http/Exception/OutOfRangeException.php b/vendor/zendframework/zendframework/library/Zend/Http/Exception/OutOfRangeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Exception/OutOfRangeException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Exception/OutOfRangeException.php diff --git a/vendor/ZF2/library/Zend/Http/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Http/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Http/Header/AbstractAccept.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/AbstractAccept.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/AbstractAccept.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/AbstractAccept.php diff --git a/vendor/ZF2/library/Zend/Http/Header/AbstractDate.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/AbstractDate.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/AbstractDate.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/AbstractDate.php diff --git a/vendor/ZF2/library/Zend/Http/Header/AbstractLocation.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/AbstractLocation.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/AbstractLocation.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/AbstractLocation.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Accept.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Accept.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Accept.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Accept.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/AbstractFieldValuePart.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/AbstractFieldValuePart.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/AbstractFieldValuePart.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/AbstractFieldValuePart.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/AcceptFieldValuePart.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/AcceptFieldValuePart.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/AcceptFieldValuePart.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/AcceptFieldValuePart.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/CharsetFieldValuePart.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/CharsetFieldValuePart.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/CharsetFieldValuePart.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/CharsetFieldValuePart.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/EncodingFieldValuePart.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/EncodingFieldValuePart.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/EncodingFieldValuePart.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/EncodingFieldValuePart.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/LanguageFieldValuePart.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/LanguageFieldValuePart.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Accept/FieldValuePart/LanguageFieldValuePart.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Accept/FieldValuePart/LanguageFieldValuePart.php diff --git a/vendor/ZF2/library/Zend/Http/Header/AcceptCharset.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/AcceptCharset.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/AcceptCharset.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/AcceptCharset.php diff --git a/vendor/ZF2/library/Zend/Http/Header/AcceptEncoding.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/AcceptEncoding.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/AcceptEncoding.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/AcceptEncoding.php diff --git a/vendor/ZF2/library/Zend/Http/Header/AcceptLanguage.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/AcceptLanguage.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/AcceptLanguage.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/AcceptLanguage.php diff --git a/vendor/ZF2/library/Zend/Http/Header/AcceptRanges.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/AcceptRanges.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/AcceptRanges.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/AcceptRanges.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Age.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Age.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Age.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Age.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Allow.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Allow.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Allow.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Allow.php diff --git a/vendor/ZF2/library/Zend/Http/Header/AuthenticationInfo.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/AuthenticationInfo.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/AuthenticationInfo.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/AuthenticationInfo.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Authorization.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Authorization.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Authorization.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Authorization.php diff --git a/vendor/ZF2/library/Zend/Http/Header/CacheControl.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/CacheControl.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/CacheControl.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/CacheControl.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Connection.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Connection.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Connection.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Connection.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentDisposition.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentDisposition.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentDisposition.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentDisposition.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentEncoding.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentEncoding.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentEncoding.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentEncoding.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentLanguage.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentLanguage.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentLanguage.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentLanguage.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentLength.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentLength.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentLength.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentLength.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentLocation.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentLocation.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentLocation.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentLocation.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentMD5.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentMD5.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentMD5.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentMD5.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentRange.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentRange.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentRange.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentRange.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentTransferEncoding.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentTransferEncoding.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentTransferEncoding.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentTransferEncoding.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ContentType.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ContentType.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ContentType.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ContentType.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Cookie.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Cookie.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Cookie.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Cookie.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Date.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Date.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Date.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Date.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Etag.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Etag.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Etag.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Etag.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Expect.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Expect.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Expect.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Expect.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Expires.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Expires.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Expires.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Expires.php diff --git a/vendor/ZF2/library/Zend/Http/Header/From.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/From.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/From.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/From.php diff --git a/vendor/ZF2/library/Zend/Http/Header/GenericHeader.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/GenericHeader.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/GenericHeader.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/GenericHeader.php diff --git a/vendor/ZF2/library/Zend/Http/Header/GenericMultiHeader.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/GenericMultiHeader.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/GenericMultiHeader.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/GenericMultiHeader.php diff --git a/vendor/ZF2/library/Zend/Http/Header/HeaderInterface.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/HeaderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/HeaderInterface.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/HeaderInterface.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Host.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Host.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Host.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Host.php diff --git a/vendor/ZF2/library/Zend/Http/Header/IfMatch.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/IfMatch.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/IfMatch.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/IfMatch.php diff --git a/vendor/ZF2/library/Zend/Http/Header/IfModifiedSince.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/IfModifiedSince.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/IfModifiedSince.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/IfModifiedSince.php diff --git a/vendor/ZF2/library/Zend/Http/Header/IfNoneMatch.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/IfNoneMatch.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/IfNoneMatch.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/IfNoneMatch.php diff --git a/vendor/ZF2/library/Zend/Http/Header/IfRange.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/IfRange.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/IfRange.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/IfRange.php diff --git a/vendor/ZF2/library/Zend/Http/Header/IfUnmodifiedSince.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/IfUnmodifiedSince.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/IfUnmodifiedSince.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/IfUnmodifiedSince.php diff --git a/vendor/ZF2/library/Zend/Http/Header/KeepAlive.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/KeepAlive.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/KeepAlive.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/KeepAlive.php diff --git a/vendor/ZF2/library/Zend/Http/Header/LastModified.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/LastModified.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/LastModified.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/LastModified.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Location.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Location.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Location.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Location.php diff --git a/vendor/ZF2/library/Zend/Http/Header/MaxForwards.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/MaxForwards.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/MaxForwards.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/MaxForwards.php diff --git a/vendor/ZF2/library/Zend/Http/Header/MultipleHeaderInterface.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/MultipleHeaderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/MultipleHeaderInterface.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/MultipleHeaderInterface.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Pragma.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Pragma.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Pragma.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Pragma.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ProxyAuthenticate.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ProxyAuthenticate.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ProxyAuthenticate.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ProxyAuthenticate.php diff --git a/vendor/ZF2/library/Zend/Http/Header/ProxyAuthorization.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/ProxyAuthorization.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/ProxyAuthorization.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/ProxyAuthorization.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Range.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Range.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Range.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Range.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Referer.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Referer.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Referer.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Referer.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Refresh.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Refresh.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Refresh.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Refresh.php diff --git a/vendor/ZF2/library/Zend/Http/Header/RetryAfter.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/RetryAfter.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/RetryAfter.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/RetryAfter.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Server.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Server.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Server.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Server.php diff --git a/vendor/ZF2/library/Zend/Http/Header/SetCookie.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/SetCookie.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/SetCookie.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/SetCookie.php diff --git a/vendor/ZF2/library/Zend/Http/Header/TE.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/TE.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/TE.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/TE.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Trailer.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Trailer.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Trailer.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Trailer.php diff --git a/vendor/ZF2/library/Zend/Http/Header/TransferEncoding.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/TransferEncoding.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/TransferEncoding.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/TransferEncoding.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Upgrade.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Upgrade.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Upgrade.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Upgrade.php diff --git a/vendor/ZF2/library/Zend/Http/Header/UserAgent.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/UserAgent.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/UserAgent.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/UserAgent.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Vary.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Vary.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Vary.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Vary.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Via.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Via.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Via.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Via.php diff --git a/vendor/ZF2/library/Zend/Http/Header/WWWAuthenticate.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/WWWAuthenticate.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/WWWAuthenticate.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/WWWAuthenticate.php diff --git a/vendor/ZF2/library/Zend/Http/Header/Warning.php b/vendor/zendframework/zendframework/library/Zend/Http/Header/Warning.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Header/Warning.php rename to vendor/zendframework/zendframework/library/Zend/Http/Header/Warning.php diff --git a/vendor/ZF2/library/Zend/Http/HeaderLoader.php b/vendor/zendframework/zendframework/library/Zend/Http/HeaderLoader.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/HeaderLoader.php rename to vendor/zendframework/zendframework/library/Zend/Http/HeaderLoader.php diff --git a/vendor/ZF2/library/Zend/Http/Headers.php b/vendor/zendframework/zendframework/library/Zend/Http/Headers.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Headers.php rename to vendor/zendframework/zendframework/library/Zend/Http/Headers.php diff --git a/vendor/ZF2/library/Zend/Http/PhpEnvironment/RemoteAddress.php b/vendor/zendframework/zendframework/library/Zend/Http/PhpEnvironment/RemoteAddress.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/PhpEnvironment/RemoteAddress.php rename to vendor/zendframework/zendframework/library/Zend/Http/PhpEnvironment/RemoteAddress.php diff --git a/vendor/ZF2/library/Zend/Http/PhpEnvironment/Request.php b/vendor/zendframework/zendframework/library/Zend/Http/PhpEnvironment/Request.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/PhpEnvironment/Request.php rename to vendor/zendframework/zendframework/library/Zend/Http/PhpEnvironment/Request.php diff --git a/vendor/ZF2/library/Zend/Http/PhpEnvironment/Response.php b/vendor/zendframework/zendframework/library/Zend/Http/PhpEnvironment/Response.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/PhpEnvironment/Response.php rename to vendor/zendframework/zendframework/library/Zend/Http/PhpEnvironment/Response.php diff --git a/vendor/ZF2/library/Zend/Http/README.md b/vendor/zendframework/zendframework/library/Zend/Http/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Http/README.md rename to vendor/zendframework/zendframework/library/Zend/Http/README.md diff --git a/vendor/ZF2/library/Zend/Http/Request.php b/vendor/zendframework/zendframework/library/Zend/Http/Request.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Request.php rename to vendor/zendframework/zendframework/library/Zend/Http/Request.php diff --git a/vendor/ZF2/library/Zend/Http/Response.php b/vendor/zendframework/zendframework/library/Zend/Http/Response.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Response.php rename to vendor/zendframework/zendframework/library/Zend/Http/Response.php diff --git a/vendor/ZF2/library/Zend/Http/Response/Stream.php b/vendor/zendframework/zendframework/library/Zend/Http/Response/Stream.php similarity index 100% rename from vendor/ZF2/library/Zend/Http/Response/Stream.php rename to vendor/zendframework/zendframework/library/Zend/Http/Response/Stream.php diff --git a/vendor/ZF2/library/Zend/Http/composer.json b/vendor/zendframework/zendframework/library/Zend/Http/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Http/composer.json rename to vendor/zendframework/zendframework/library/Zend/Http/composer.json diff --git a/vendor/ZF2/library/Zend/I18n/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/I18n/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/I18n/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/I18n/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/I18n/Exception/OutOfBoundsException.php b/vendor/zendframework/zendframework/library/Zend/I18n/Exception/OutOfBoundsException.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Exception/OutOfBoundsException.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Exception/OutOfBoundsException.php diff --git a/vendor/ZF2/library/Zend/I18n/Exception/ParseException.php b/vendor/zendframework/zendframework/library/Zend/I18n/Exception/ParseException.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Exception/ParseException.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Exception/ParseException.php diff --git a/vendor/ZF2/library/Zend/I18n/Exception/RangeException.php b/vendor/zendframework/zendframework/library/Zend/I18n/Exception/RangeException.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Exception/RangeException.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Exception/RangeException.php diff --git a/vendor/ZF2/library/Zend/I18n/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/I18n/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/I18n/Filter/AbstractLocale.php b/vendor/zendframework/zendframework/library/Zend/I18n/Filter/AbstractLocale.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Filter/AbstractLocale.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Filter/AbstractLocale.php diff --git a/vendor/ZF2/library/Zend/I18n/Filter/Alnum.php b/vendor/zendframework/zendframework/library/Zend/I18n/Filter/Alnum.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Filter/Alnum.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Filter/Alnum.php diff --git a/vendor/ZF2/library/Zend/I18n/Filter/Alpha.php b/vendor/zendframework/zendframework/library/Zend/I18n/Filter/Alpha.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Filter/Alpha.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Filter/Alpha.php diff --git a/vendor/ZF2/library/Zend/I18n/Filter/NumberFormat.php b/vendor/zendframework/zendframework/library/Zend/I18n/Filter/NumberFormat.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Filter/NumberFormat.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Filter/NumberFormat.php diff --git a/vendor/ZF2/library/Zend/I18n/README.md b/vendor/zendframework/zendframework/library/Zend/I18n/README.md similarity index 100% rename from vendor/ZF2/library/Zend/I18n/README.md rename to vendor/zendframework/zendframework/library/Zend/I18n/README.md diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Loader/FileLoaderInterface.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/FileLoaderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Loader/FileLoaderInterface.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/FileLoaderInterface.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Loader/Gettext.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/Gettext.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Loader/Gettext.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/Gettext.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Loader/Ini.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/Ini.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Loader/Ini.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/Ini.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Loader/PhpArray.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/PhpArray.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Loader/PhpArray.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/PhpArray.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Loader/RemoteLoaderInterface.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/RemoteLoaderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Loader/RemoteLoaderInterface.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Loader/RemoteLoaderInterface.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/LoaderPluginManager.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/LoaderPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/LoaderPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/LoaderPluginManager.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Plural/Parser.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Plural/Parser.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Plural/Parser.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Plural/Parser.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Plural/Rule.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Plural/Rule.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Plural/Rule.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Plural/Rule.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Plural/Symbol.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Plural/Symbol.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Plural/Symbol.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Plural/Symbol.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/TextDomain.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/TextDomain.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/TextDomain.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/TextDomain.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/Translator.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/Translator.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/TranslatorAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/TranslatorAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/TranslatorAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/TranslatorAwareInterface.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/TranslatorAwareTrait.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/TranslatorAwareTrait.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/TranslatorAwareTrait.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/TranslatorAwareTrait.php diff --git a/vendor/ZF2/library/Zend/I18n/Translator/TranslatorServiceFactory.php b/vendor/zendframework/zendframework/library/Zend/I18n/Translator/TranslatorServiceFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Translator/TranslatorServiceFactory.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Translator/TranslatorServiceFactory.php diff --git a/vendor/ZF2/library/Zend/I18n/Validator/Alnum.php b/vendor/zendframework/zendframework/library/Zend/I18n/Validator/Alnum.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Validator/Alnum.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Validator/Alnum.php diff --git a/vendor/ZF2/library/Zend/I18n/Validator/Alpha.php b/vendor/zendframework/zendframework/library/Zend/I18n/Validator/Alpha.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Validator/Alpha.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Validator/Alpha.php diff --git a/vendor/ZF2/library/Zend/I18n/Validator/Float.php b/vendor/zendframework/zendframework/library/Zend/I18n/Validator/Float.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Validator/Float.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Validator/Float.php diff --git a/vendor/ZF2/library/Zend/I18n/Validator/Int.php b/vendor/zendframework/zendframework/library/Zend/I18n/Validator/Int.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Validator/Int.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Validator/Int.php diff --git a/vendor/ZF2/library/Zend/I18n/Validator/PostCode.php b/vendor/zendframework/zendframework/library/Zend/I18n/Validator/PostCode.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/Validator/PostCode.php rename to vendor/zendframework/zendframework/library/Zend/I18n/Validator/PostCode.php diff --git a/vendor/ZF2/library/Zend/I18n/View/Helper/AbstractTranslatorHelper.php b/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/AbstractTranslatorHelper.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/View/Helper/AbstractTranslatorHelper.php rename to vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/AbstractTranslatorHelper.php diff --git a/vendor/ZF2/library/Zend/I18n/View/Helper/CurrencyFormat.php b/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/CurrencyFormat.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/View/Helper/CurrencyFormat.php rename to vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/CurrencyFormat.php diff --git a/vendor/ZF2/library/Zend/I18n/View/Helper/DateFormat.php b/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/DateFormat.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/View/Helper/DateFormat.php rename to vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/DateFormat.php diff --git a/vendor/ZF2/library/Zend/I18n/View/Helper/NumberFormat.php b/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/NumberFormat.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/View/Helper/NumberFormat.php rename to vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/NumberFormat.php diff --git a/vendor/ZF2/library/Zend/I18n/View/Helper/Plural.php b/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/Plural.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/View/Helper/Plural.php rename to vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/Plural.php diff --git a/vendor/ZF2/library/Zend/I18n/View/Helper/Translate.php b/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/Translate.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/View/Helper/Translate.php rename to vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/Translate.php diff --git a/vendor/ZF2/library/Zend/I18n/View/Helper/TranslatePlural.php b/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/TranslatePlural.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/View/Helper/TranslatePlural.php rename to vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/TranslatePlural.php diff --git a/vendor/ZF2/library/Zend/I18n/View/HelperConfig.php b/vendor/zendframework/zendframework/library/Zend/I18n/View/HelperConfig.php similarity index 100% rename from vendor/ZF2/library/Zend/I18n/View/HelperConfig.php rename to vendor/zendframework/zendframework/library/Zend/I18n/View/HelperConfig.php diff --git a/vendor/ZF2/library/Zend/I18n/composer.json b/vendor/zendframework/zendframework/library/Zend/I18n/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/I18n/composer.json rename to vendor/zendframework/zendframework/library/Zend/I18n/composer.json diff --git a/vendor/ZF2/library/Zend/InputFilter/BaseInputFilter.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/BaseInputFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/BaseInputFilter.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/BaseInputFilter.php diff --git a/vendor/ZF2/library/Zend/InputFilter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/InputFilter/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/InputFilter/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/InputFilter/Factory.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/Factory.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/Factory.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/Factory.php diff --git a/vendor/ZF2/library/Zend/InputFilter/FileInput.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/FileInput.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/FileInput.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/FileInput.php diff --git a/vendor/ZF2/library/Zend/InputFilter/Input.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/Input.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/Input.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/Input.php diff --git a/vendor/ZF2/library/Zend/InputFilter/InputFilter.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/InputFilter.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilter.php diff --git a/vendor/ZF2/library/Zend/InputFilter/InputFilterAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilterAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/InputFilterAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilterAwareInterface.php diff --git a/vendor/ZF2/library/Zend/InputFilter/InputFilterAwareTrait.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilterAwareTrait.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/InputFilterAwareTrait.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilterAwareTrait.php diff --git a/vendor/ZF2/library/Zend/InputFilter/InputFilterInterface.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/InputFilterInterface.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilterInterface.php diff --git a/vendor/ZF2/library/Zend/InputFilter/InputFilterProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilterProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/InputFilterProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/InputFilterProviderInterface.php diff --git a/vendor/ZF2/library/Zend/InputFilter/InputInterface.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/InputInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/InputInterface.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/InputInterface.php diff --git a/vendor/ZF2/library/Zend/InputFilter/InputProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/InputProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/InputProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/InputProviderInterface.php diff --git a/vendor/ZF2/library/Zend/InputFilter/README.md b/vendor/zendframework/zendframework/library/Zend/InputFilter/README.md similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/README.md rename to vendor/zendframework/zendframework/library/Zend/InputFilter/README.md diff --git a/vendor/ZF2/library/Zend/InputFilter/UnknownInputsCapableInterface.php b/vendor/zendframework/zendframework/library/Zend/InputFilter/UnknownInputsCapableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/UnknownInputsCapableInterface.php rename to vendor/zendframework/zendframework/library/Zend/InputFilter/UnknownInputsCapableInterface.php diff --git a/vendor/ZF2/library/Zend/InputFilter/composer.json b/vendor/zendframework/zendframework/library/Zend/InputFilter/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/InputFilter/composer.json rename to vendor/zendframework/zendframework/library/Zend/InputFilter/composer.json diff --git a/vendor/ZF2/library/Zend/Json/Decoder.php b/vendor/zendframework/zendframework/library/Zend/Json/Decoder.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Decoder.php rename to vendor/zendframework/zendframework/library/Zend/Json/Decoder.php diff --git a/vendor/ZF2/library/Zend/Json/Encoder.php b/vendor/zendframework/zendframework/library/Zend/Json/Encoder.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Encoder.php rename to vendor/zendframework/zendframework/library/Zend/Json/Encoder.php diff --git a/vendor/ZF2/library/Zend/Json/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Json/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Json/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Json/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Json/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Json/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Json/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Json/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Json/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Json/Exception/RecursionException.php b/vendor/zendframework/zendframework/library/Zend/Json/Exception/RecursionException.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Exception/RecursionException.php rename to vendor/zendframework/zendframework/library/Zend/Json/Exception/RecursionException.php diff --git a/vendor/ZF2/library/Zend/Json/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Json/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Json/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Json/Expr.php b/vendor/zendframework/zendframework/library/Zend/Json/Expr.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Expr.php rename to vendor/zendframework/zendframework/library/Zend/Json/Expr.php diff --git a/vendor/ZF2/library/Zend/Json/Json.php b/vendor/zendframework/zendframework/library/Zend/Json/Json.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Json.php rename to vendor/zendframework/zendframework/library/Zend/Json/Json.php diff --git a/vendor/ZF2/library/Zend/Json/README.md b/vendor/zendframework/zendframework/library/Zend/Json/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Json/README.md rename to vendor/zendframework/zendframework/library/Zend/Json/README.md diff --git a/vendor/ZF2/library/Zend/Json/Server/Cache.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Cache.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Cache.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Cache.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Client.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Client.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Client.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Client.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Error.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Error.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Error.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Error.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Exception/ErrorException.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/ErrorException.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Exception/ErrorException.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/ErrorException.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Exception/HttpException.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/HttpException.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Exception/HttpException.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/HttpException.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Request.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Request.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Request.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Request.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Request/Http.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Request/Http.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Request/Http.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Request/Http.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Response.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Response.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Response.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Response.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Response/Http.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Response/Http.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Response/Http.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Response/Http.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Server.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Server.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Server.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Server.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Smd.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Smd.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Smd.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Smd.php diff --git a/vendor/ZF2/library/Zend/Json/Server/Smd/Service.php b/vendor/zendframework/zendframework/library/Zend/Json/Server/Smd/Service.php similarity index 100% rename from vendor/ZF2/library/Zend/Json/Server/Smd/Service.php rename to vendor/zendframework/zendframework/library/Zend/Json/Server/Smd/Service.php diff --git a/vendor/ZF2/library/Zend/Json/composer.json b/vendor/zendframework/zendframework/library/Zend/Json/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Json/composer.json rename to vendor/zendframework/zendframework/library/Zend/Json/composer.json diff --git a/vendor/ZF2/library/Zend/Ldap/Attribute.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Attribute.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Attribute.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Attribute.php diff --git a/vendor/ZF2/library/Zend/Ldap/Collection.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Collection.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Collection.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Collection.php diff --git a/vendor/ZF2/library/Zend/Ldap/Collection/DefaultIterator.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Collection/DefaultIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Collection/DefaultIterator.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Collection/DefaultIterator.php diff --git a/vendor/ZF2/library/Zend/Ldap/Converter/Converter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Converter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Converter/Converter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Converter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Converter/Exception/ConverterException.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Exception/ConverterException.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Converter/Exception/ConverterException.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Exception/ConverterException.php diff --git a/vendor/ZF2/library/Zend/Ldap/Converter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Converter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Ldap/Converter/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Converter/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Ldap/Converter/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Converter/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Converter/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Ldap/Dn.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Dn.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Dn.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Dn.php diff --git a/vendor/ZF2/library/Zend/Ldap/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Ldap/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Ldap/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Ldap/Exception/LdapException.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Exception/LdapException.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Exception/LdapException.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Exception/LdapException.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/AbstractFilter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/AbstractFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/AbstractFilter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/AbstractFilter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/AbstractLogicalFilter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/AbstractLogicalFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/AbstractLogicalFilter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/AbstractLogicalFilter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/AndFilter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/AndFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/AndFilter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/AndFilter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/Exception/FilterException.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/Exception/FilterException.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/Exception/FilterException.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/Exception/FilterException.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/MaskFilter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/MaskFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/MaskFilter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/MaskFilter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/NotFilter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/NotFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/NotFilter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/NotFilter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/OrFilter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/OrFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/OrFilter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/OrFilter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Filter/StringFilter.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Filter/StringFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Filter/StringFilter.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Filter/StringFilter.php diff --git a/vendor/ZF2/library/Zend/Ldap/Ldap.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Ldap.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Ldap.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Ldap.php diff --git a/vendor/ZF2/library/Zend/Ldap/Ldif/Encoder.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Ldif/Encoder.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Ldif/Encoder.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Ldif/Encoder.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/AbstractNode.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/AbstractNode.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/AbstractNode.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/AbstractNode.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/ChildrenIterator.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/ChildrenIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/ChildrenIterator.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/ChildrenIterator.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Collection.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Collection.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Collection.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Collection.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/RootDse.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/RootDse.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/RootDse.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/RootDse.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/RootDse/ActiveDirectory.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/RootDse/ActiveDirectory.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/RootDse/ActiveDirectory.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/RootDse/ActiveDirectory.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/RootDse/OpenLdap.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/RootDse/OpenLdap.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/RootDse/OpenLdap.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/RootDse/OpenLdap.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/RootDse/eDirectory.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/RootDse/eDirectory.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/RootDse/eDirectory.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/RootDse/eDirectory.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/AbstractItem.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/AbstractItem.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/AbstractItem.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/AbstractItem.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/ActiveDirectory.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/ActiveDirectory.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/ActiveDirectory.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/ActiveDirectory.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/AttributeType/AttributeTypeInterface.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/AttributeType/AttributeTypeInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/AttributeType/AttributeTypeInterface.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/AttributeType/AttributeTypeInterface.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/AttributeType/OpenLdap.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/AttributeType/OpenLdap.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/AttributeType/OpenLdap.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/AttributeType/OpenLdap.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/ObjectClass/ObjectClassInterface.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/ObjectClass/ObjectClassInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/ObjectClass/ObjectClassInterface.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/ObjectClass/ObjectClassInterface.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/ObjectClass/OpenLdap.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/ObjectClass/OpenLdap.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/ObjectClass/OpenLdap.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/ObjectClass/OpenLdap.php diff --git a/vendor/ZF2/library/Zend/Ldap/Node/Schema/OpenLdap.php b/vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/OpenLdap.php similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/Node/Schema/OpenLdap.php rename to vendor/zendframework/zendframework/library/Zend/Ldap/Node/Schema/OpenLdap.php diff --git a/vendor/ZF2/library/Zend/Ldap/README.md b/vendor/zendframework/zendframework/library/Zend/Ldap/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/README.md rename to vendor/zendframework/zendframework/library/Zend/Ldap/README.md diff --git a/vendor/ZF2/library/Zend/Ldap/composer.json b/vendor/zendframework/zendframework/library/Zend/Ldap/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Ldap/composer.json rename to vendor/zendframework/zendframework/library/Zend/Ldap/composer.json diff --git a/vendor/ZF2/library/Zend/Loader/AutoloaderFactory.php b/vendor/zendframework/zendframework/library/Zend/Loader/AutoloaderFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/AutoloaderFactory.php rename to vendor/zendframework/zendframework/library/Zend/Loader/AutoloaderFactory.php diff --git a/vendor/ZF2/library/Zend/Loader/ClassMapAutoloader.php b/vendor/zendframework/zendframework/library/Zend/Loader/ClassMapAutoloader.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/ClassMapAutoloader.php rename to vendor/zendframework/zendframework/library/Zend/Loader/ClassMapAutoloader.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/InvalidPathException.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/InvalidPathException.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/InvalidPathException.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/InvalidPathException.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/MissingResourceNamespaceException.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/MissingResourceNamespaceException.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/MissingResourceNamespaceException.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/MissingResourceNamespaceException.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/PluginLoaderException.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/PluginLoaderException.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/PluginLoaderException.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/PluginLoaderException.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Loader/Exception/SecurityException.php b/vendor/zendframework/zendframework/library/Zend/Loader/Exception/SecurityException.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/Exception/SecurityException.php rename to vendor/zendframework/zendframework/library/Zend/Loader/Exception/SecurityException.php diff --git a/vendor/ZF2/library/Zend/Loader/ModuleAutoloader.php b/vendor/zendframework/zendframework/library/Zend/Loader/ModuleAutoloader.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/ModuleAutoloader.php rename to vendor/zendframework/zendframework/library/Zend/Loader/ModuleAutoloader.php diff --git a/vendor/ZF2/library/Zend/Loader/PluginClassLoader.php b/vendor/zendframework/zendframework/library/Zend/Loader/PluginClassLoader.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/PluginClassLoader.php rename to vendor/zendframework/zendframework/library/Zend/Loader/PluginClassLoader.php diff --git a/vendor/ZF2/library/Zend/Loader/PluginClassLocator.php b/vendor/zendframework/zendframework/library/Zend/Loader/PluginClassLocator.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/PluginClassLocator.php rename to vendor/zendframework/zendframework/library/Zend/Loader/PluginClassLocator.php diff --git a/vendor/ZF2/library/Zend/Loader/README.md b/vendor/zendframework/zendframework/library/Zend/Loader/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Loader/README.md rename to vendor/zendframework/zendframework/library/Zend/Loader/README.md diff --git a/vendor/ZF2/library/Zend/Loader/ShortNameLocator.php b/vendor/zendframework/zendframework/library/Zend/Loader/ShortNameLocator.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/ShortNameLocator.php rename to vendor/zendframework/zendframework/library/Zend/Loader/ShortNameLocator.php diff --git a/vendor/ZF2/library/Zend/Loader/SplAutoloader.php b/vendor/zendframework/zendframework/library/Zend/Loader/SplAutoloader.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/SplAutoloader.php rename to vendor/zendframework/zendframework/library/Zend/Loader/SplAutoloader.php diff --git a/vendor/ZF2/library/Zend/Loader/StandardAutoloader.php b/vendor/zendframework/zendframework/library/Zend/Loader/StandardAutoloader.php similarity index 100% rename from vendor/ZF2/library/Zend/Loader/StandardAutoloader.php rename to vendor/zendframework/zendframework/library/Zend/Loader/StandardAutoloader.php diff --git a/vendor/ZF2/library/Zend/Loader/composer.json b/vendor/zendframework/zendframework/library/Zend/Loader/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Loader/composer.json rename to vendor/zendframework/zendframework/library/Zend/Loader/composer.json diff --git a/vendor/ZF2/library/Zend/Log/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Log/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Log/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Log/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Log/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Log/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Log/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Log/Filter/FilterInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/Filter/FilterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Filter/FilterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/Filter/FilterInterface.php diff --git a/vendor/ZF2/library/Zend/Log/Filter/Mock.php b/vendor/zendframework/zendframework/library/Zend/Log/Filter/Mock.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Filter/Mock.php rename to vendor/zendframework/zendframework/library/Zend/Log/Filter/Mock.php diff --git a/vendor/ZF2/library/Zend/Log/Filter/Priority.php b/vendor/zendframework/zendframework/library/Zend/Log/Filter/Priority.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Filter/Priority.php rename to vendor/zendframework/zendframework/library/Zend/Log/Filter/Priority.php diff --git a/vendor/ZF2/library/Zend/Log/Filter/Regex.php b/vendor/zendframework/zendframework/library/Zend/Log/Filter/Regex.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Filter/Regex.php rename to vendor/zendframework/zendframework/library/Zend/Log/Filter/Regex.php diff --git a/vendor/ZF2/library/Zend/Log/Filter/SuppressFilter.php b/vendor/zendframework/zendframework/library/Zend/Log/Filter/SuppressFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Filter/SuppressFilter.php rename to vendor/zendframework/zendframework/library/Zend/Log/Filter/SuppressFilter.php diff --git a/vendor/ZF2/library/Zend/Log/Filter/Validator.php b/vendor/zendframework/zendframework/library/Zend/Log/Filter/Validator.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Filter/Validator.php rename to vendor/zendframework/zendframework/library/Zend/Log/Filter/Validator.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/Base.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/Base.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/Base.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/Base.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/ChromePhp.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/ChromePhp.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/ChromePhp.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/ChromePhp.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/Db.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/Db.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/Db.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/Db.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/ErrorHandler.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/ErrorHandler.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/ErrorHandler.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/ErrorHandler.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/ExceptionHandler.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/ExceptionHandler.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/ExceptionHandler.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/ExceptionHandler.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/FirePhp.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/FirePhp.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/FirePhp.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/FirePhp.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/FormatterInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/FormatterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/FormatterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/FormatterInterface.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/Simple.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/Simple.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/Simple.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/Simple.php diff --git a/vendor/ZF2/library/Zend/Log/Formatter/Xml.php b/vendor/zendframework/zendframework/library/Zend/Log/Formatter/Xml.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Formatter/Xml.php rename to vendor/zendframework/zendframework/library/Zend/Log/Formatter/Xml.php diff --git a/vendor/ZF2/library/Zend/Log/Logger.php b/vendor/zendframework/zendframework/library/Zend/Log/Logger.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Logger.php rename to vendor/zendframework/zendframework/library/Zend/Log/Logger.php diff --git a/vendor/ZF2/library/Zend/Log/LoggerAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/LoggerAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/LoggerAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/LoggerAwareInterface.php diff --git a/vendor/ZF2/library/Zend/Log/LoggerAwareTrait.php b/vendor/zendframework/zendframework/library/Zend/Log/LoggerAwareTrait.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/LoggerAwareTrait.php rename to vendor/zendframework/zendframework/library/Zend/Log/LoggerAwareTrait.php diff --git a/vendor/ZF2/library/Zend/Log/LoggerInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/LoggerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/LoggerInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/LoggerInterface.php diff --git a/vendor/ZF2/library/Zend/Log/LoggerServiceFactory.php b/vendor/zendframework/zendframework/library/Zend/Log/LoggerServiceFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/LoggerServiceFactory.php rename to vendor/zendframework/zendframework/library/Zend/Log/LoggerServiceFactory.php diff --git a/vendor/ZF2/library/Zend/Log/Processor/Backtrace.php b/vendor/zendframework/zendframework/library/Zend/Log/Processor/Backtrace.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Processor/Backtrace.php rename to vendor/zendframework/zendframework/library/Zend/Log/Processor/Backtrace.php diff --git a/vendor/ZF2/library/Zend/Log/Processor/ProcessorInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/Processor/ProcessorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Processor/ProcessorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/Processor/ProcessorInterface.php diff --git a/vendor/ZF2/library/Zend/Log/Processor/RequestId.php b/vendor/zendframework/zendframework/library/Zend/Log/Processor/RequestId.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Processor/RequestId.php rename to vendor/zendframework/zendframework/library/Zend/Log/Processor/RequestId.php diff --git a/vendor/ZF2/library/Zend/Log/ProcessorPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Log/ProcessorPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/ProcessorPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Log/ProcessorPluginManager.php diff --git a/vendor/ZF2/library/Zend/Log/README.md b/vendor/zendframework/zendframework/library/Zend/Log/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Log/README.md rename to vendor/zendframework/zendframework/library/Zend/Log/README.md diff --git a/vendor/ZF2/library/Zend/Log/Writer/AbstractWriter.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/AbstractWriter.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/AbstractWriter.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/AbstractWriter.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/ChromePhp.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/ChromePhp.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/ChromePhp.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/ChromePhp.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/ChromePhp/ChromePhpBridge.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/ChromePhp/ChromePhpBridge.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/ChromePhp/ChromePhpBridge.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/ChromePhp/ChromePhpBridge.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/ChromePhp/ChromePhpInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/ChromePhp/ChromePhpInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/ChromePhp/ChromePhpInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/ChromePhp/ChromePhpInterface.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/Db.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/Db.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/Db.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/Db.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/FilterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/FilterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/FilterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/FilterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/FingersCrossed.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/FingersCrossed.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/FingersCrossed.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/FingersCrossed.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/FirePhp.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/FirePhp.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/FirePhp.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/FirePhp.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/FirePhp/FirePhpBridge.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/FirePhp/FirePhpBridge.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/FirePhp/FirePhpBridge.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/FirePhp/FirePhpBridge.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/FirePhp/FirePhpInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/FirePhp/FirePhpInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/FirePhp/FirePhpInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/FirePhp/FirePhpInterface.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/FormatterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/FormatterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/FormatterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/FormatterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/Mail.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/Mail.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/Mail.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/Mail.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/Mock.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/Mock.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/Mock.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/Mock.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/MongoDB.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/MongoDB.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/MongoDB.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/MongoDB.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/Null.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/Null.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/Null.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/Null.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/Stream.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/Stream.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/Stream.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/Stream.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/Syslog.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/Syslog.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/Syslog.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/Syslog.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/WriterInterface.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/WriterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/WriterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/WriterInterface.php diff --git a/vendor/ZF2/library/Zend/Log/Writer/ZendMonitor.php b/vendor/zendframework/zendframework/library/Zend/Log/Writer/ZendMonitor.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/Writer/ZendMonitor.php rename to vendor/zendframework/zendframework/library/Zend/Log/Writer/ZendMonitor.php diff --git a/vendor/ZF2/library/Zend/Log/WriterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Log/WriterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Log/WriterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Log/WriterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Log/composer.json b/vendor/zendframework/zendframework/library/Zend/Log/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Log/composer.json rename to vendor/zendframework/zendframework/library/Zend/Log/composer.json diff --git a/vendor/ZF2/library/Zend/Mail/Address.php b/vendor/zendframework/zendframework/library/Zend/Mail/Address.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Address.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Address.php diff --git a/vendor/ZF2/library/Zend/Mail/Address/AddressInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Address/AddressInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Address/AddressInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Address/AddressInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/AddressList.php b/vendor/zendframework/zendframework/library/Zend/Mail/AddressList.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/AddressList.php rename to vendor/zendframework/zendframework/library/Zend/Mail/AddressList.php diff --git a/vendor/ZF2/library/Zend/Mail/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Mail/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Mail/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Mail/Exception/OutOfBoundsException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Exception/OutOfBoundsException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Exception/OutOfBoundsException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Exception/OutOfBoundsException.php diff --git a/vendor/ZF2/library/Zend/Mail/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/AbstractAddressList.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/AbstractAddressList.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/AbstractAddressList.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/AbstractAddressList.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Bcc.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Bcc.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Bcc.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Bcc.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Cc.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Cc.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Cc.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Cc.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/ContentType.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/ContentType.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/ContentType.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/ContentType.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Date.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Date.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Date.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Date.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/From.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/From.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/From.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/From.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/GenericHeader.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/GenericHeader.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/GenericHeader.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/GenericHeader.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/GenericMultiHeader.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/GenericMultiHeader.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/GenericMultiHeader.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/GenericMultiHeader.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/HeaderInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/HeaderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/HeaderInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/HeaderInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/HeaderLoader.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/HeaderLoader.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/HeaderLoader.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/HeaderLoader.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/HeaderWrap.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/HeaderWrap.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/HeaderWrap.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/HeaderWrap.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/MessageId.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/MessageId.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/MessageId.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/MessageId.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/MimeVersion.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/MimeVersion.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/MimeVersion.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/MimeVersion.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/MultipleHeadersInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/MultipleHeadersInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/MultipleHeadersInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/MultipleHeadersInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Received.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Received.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Received.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Received.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/ReplyTo.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/ReplyTo.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/ReplyTo.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/ReplyTo.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Sender.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Sender.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Sender.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Sender.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/StructuredInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/StructuredInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/StructuredInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/StructuredInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/Subject.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/Subject.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/Subject.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/Subject.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/To.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/To.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/To.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/To.php diff --git a/vendor/ZF2/library/Zend/Mail/Header/UnstructuredInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Header/UnstructuredInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Header/UnstructuredInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Header/UnstructuredInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Headers.php b/vendor/zendframework/zendframework/library/Zend/Mail/Headers.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Headers.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Headers.php diff --git a/vendor/ZF2/library/Zend/Mail/Message.php b/vendor/zendframework/zendframework/library/Zend/Mail/Message.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Message.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Message.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/AbstractProtocol.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/AbstractProtocol.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/AbstractProtocol.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/AbstractProtocol.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Imap.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Imap.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Imap.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Imap.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Pop3.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Pop3.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Pop3.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Pop3.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Smtp.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Smtp.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Smtp.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Smtp.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Smtp/Auth/Login.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Smtp/Auth/Login.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Smtp/Auth/Login.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Smtp/Auth/Login.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/Smtp/Auth/Plain.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Smtp/Auth/Plain.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/Smtp/Auth/Plain.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/Smtp/Auth/Plain.php diff --git a/vendor/ZF2/library/Zend/Mail/Protocol/SmtpPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Mail/Protocol/SmtpPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Protocol/SmtpPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Protocol/SmtpPluginManager.php diff --git a/vendor/ZF2/library/Zend/Mail/README.md b/vendor/zendframework/zendframework/library/Zend/Mail/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Mail/README.md rename to vendor/zendframework/zendframework/library/Zend/Mail/README.md diff --git a/vendor/ZF2/library/Zend/Mail/Storage.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/AbstractStorage.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/AbstractStorage.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/AbstractStorage.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/AbstractStorage.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Exception/OutOfBoundsException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Exception/OutOfBoundsException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Exception/OutOfBoundsException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Exception/OutOfBoundsException.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Folder.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Folder.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Folder.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Folder.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Folder/FolderInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Folder/FolderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Folder/FolderInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Folder/FolderInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Folder/Maildir.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Folder/Maildir.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Folder/Maildir.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Folder/Maildir.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Folder/Mbox.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Folder/Mbox.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Folder/Mbox.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Folder/Mbox.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Imap.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Imap.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Imap.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Imap.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Maildir.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Maildir.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Maildir.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Maildir.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Mbox.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Mbox.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Mbox.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Mbox.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Message.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Message.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Message.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Message.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Message/File.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Message/File.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Message/File.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Message/File.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Message/MessageInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Message/MessageInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Message/MessageInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Message/MessageInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Part.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Part.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Part/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Part/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Part/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Part/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Part/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Part/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Part/File.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/File.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Part/File.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/File.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Part/PartInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/PartInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Part/PartInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Part/PartInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Pop3.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Pop3.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Pop3.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Pop3.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Writable/Maildir.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Writable/Maildir.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Writable/Maildir.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Writable/Maildir.php diff --git a/vendor/ZF2/library/Zend/Mail/Storage/Writable/WritableInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Storage/Writable/WritableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Storage/Writable/WritableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Storage/Writable/WritableInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/File.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/File.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/File.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/File.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/FileOptions.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/FileOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/FileOptions.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/FileOptions.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/Sendmail.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/Sendmail.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/Sendmail.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/Sendmail.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/Smtp.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/Smtp.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/Smtp.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/Smtp.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/SmtpOptions.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/SmtpOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/SmtpOptions.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/SmtpOptions.php diff --git a/vendor/ZF2/library/Zend/Mail/Transport/TransportInterface.php b/vendor/zendframework/zendframework/library/Zend/Mail/Transport/TransportInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mail/Transport/TransportInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mail/Transport/TransportInterface.php diff --git a/vendor/ZF2/library/Zend/Mail/composer.json b/vendor/zendframework/zendframework/library/Zend/Mail/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Mail/composer.json rename to vendor/zendframework/zendframework/library/Zend/Mail/composer.json diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/Adapter/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Adapter/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/Adapter/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Adapter/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/Adapter/Bcmath.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Adapter/Bcmath.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/Adapter/Bcmath.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Adapter/Bcmath.php diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/Adapter/Gmp.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Adapter/Gmp.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/Adapter/Gmp.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Adapter/Gmp.php diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/AdapterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/AdapterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/AdapterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/AdapterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/BigInteger.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/BigInteger.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/BigInteger.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/BigInteger.php diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/Exception/DivisionByZeroException.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Exception/DivisionByZeroException.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/Exception/DivisionByZeroException.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Exception/DivisionByZeroException.php diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Math/BigInteger/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/BigInteger/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Math/BigInteger/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Math/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Math/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Math/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Math/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Math/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Math/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Math/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Math/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Math/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Math/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Math/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Math/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Math/README.md b/vendor/zendframework/zendframework/library/Zend/Math/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Math/README.md rename to vendor/zendframework/zendframework/library/Zend/Math/README.md diff --git a/vendor/ZF2/library/Zend/Math/Rand.php b/vendor/zendframework/zendframework/library/Zend/Math/Rand.php similarity index 100% rename from vendor/ZF2/library/Zend/Math/Rand.php rename to vendor/zendframework/zendframework/library/Zend/Math/Rand.php diff --git a/vendor/ZF2/library/Zend/Math/composer.json b/vendor/zendframework/zendframework/library/Zend/Math/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Math/composer.json rename to vendor/zendframework/zendframework/library/Zend/Math/composer.json diff --git a/vendor/ZF2/library/Zend/Memory/Container/AbstractContainer.php b/vendor/zendframework/zendframework/library/Zend/Memory/Container/AbstractContainer.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Container/AbstractContainer.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Container/AbstractContainer.php diff --git a/vendor/ZF2/library/Zend/Memory/Container/AccessController.php b/vendor/zendframework/zendframework/library/Zend/Memory/Container/AccessController.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Container/AccessController.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Container/AccessController.php diff --git a/vendor/ZF2/library/Zend/Memory/Container/ContainerInterface.php b/vendor/zendframework/zendframework/library/Zend/Memory/Container/ContainerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Container/ContainerInterface.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Container/ContainerInterface.php diff --git a/vendor/ZF2/library/Zend/Memory/Container/Locked.php b/vendor/zendframework/zendframework/library/Zend/Memory/Container/Locked.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Container/Locked.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Container/Locked.php diff --git a/vendor/ZF2/library/Zend/Memory/Container/Movable.php b/vendor/zendframework/zendframework/library/Zend/Memory/Container/Movable.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Container/Movable.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Container/Movable.php diff --git a/vendor/ZF2/library/Zend/Memory/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Memory/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Memory/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Memory/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Memory/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Memory/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Memory/MemoryManager.php b/vendor/zendframework/zendframework/library/Zend/Memory/MemoryManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/MemoryManager.php rename to vendor/zendframework/zendframework/library/Zend/Memory/MemoryManager.php diff --git a/vendor/ZF2/library/Zend/Memory/README.md b/vendor/zendframework/zendframework/library/Zend/Memory/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Memory/README.md rename to vendor/zendframework/zendframework/library/Zend/Memory/README.md diff --git a/vendor/ZF2/library/Zend/Memory/Value.php b/vendor/zendframework/zendframework/library/Zend/Memory/Value.php similarity index 100% rename from vendor/ZF2/library/Zend/Memory/Value.php rename to vendor/zendframework/zendframework/library/Zend/Memory/Value.php diff --git a/vendor/ZF2/library/Zend/Memory/composer.json b/vendor/zendframework/zendframework/library/Zend/Memory/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Memory/composer.json rename to vendor/zendframework/zendframework/library/Zend/Memory/composer.json diff --git a/vendor/ZF2/library/Zend/Mime/Decode.php b/vendor/zendframework/zendframework/library/Zend/Mime/Decode.php similarity index 100% rename from vendor/ZF2/library/Zend/Mime/Decode.php rename to vendor/zendframework/zendframework/library/Zend/Mime/Decode.php diff --git a/vendor/ZF2/library/Zend/Mime/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mime/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mime/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mime/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mime/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mime/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mime/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mime/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mime/Message.php b/vendor/zendframework/zendframework/library/Zend/Mime/Message.php similarity index 100% rename from vendor/ZF2/library/Zend/Mime/Message.php rename to vendor/zendframework/zendframework/library/Zend/Mime/Message.php diff --git a/vendor/ZF2/library/Zend/Mime/Mime.php b/vendor/zendframework/zendframework/library/Zend/Mime/Mime.php similarity index 100% rename from vendor/ZF2/library/Zend/Mime/Mime.php rename to vendor/zendframework/zendframework/library/Zend/Mime/Mime.php diff --git a/vendor/ZF2/library/Zend/Mime/Part.php b/vendor/zendframework/zendframework/library/Zend/Mime/Part.php similarity index 100% rename from vendor/ZF2/library/Zend/Mime/Part.php rename to vendor/zendframework/zendframework/library/Zend/Mime/Part.php diff --git a/vendor/ZF2/library/Zend/Mime/README.md b/vendor/zendframework/zendframework/library/Zend/Mime/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Mime/README.md rename to vendor/zendframework/zendframework/library/Zend/Mime/README.md diff --git a/vendor/ZF2/library/Zend/Mime/composer.json b/vendor/zendframework/zendframework/library/Zend/Mime/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Mime/composer.json rename to vendor/zendframework/zendframework/library/Zend/Mime/composer.json diff --git a/vendor/ZF2/library/Zend/ModuleManager/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Exception/MissingDependencyModuleException.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Exception/MissingDependencyModuleException.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Exception/MissingDependencyModuleException.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Exception/MissingDependencyModuleException.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/AutoloaderProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/AutoloaderProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/AutoloaderProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/AutoloaderProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/BootstrapListenerInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/BootstrapListenerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/BootstrapListenerInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/BootstrapListenerInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/ConfigProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ConfigProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/ConfigProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ConfigProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/ConsoleBannerProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ConsoleBannerProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/ConsoleBannerProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ConsoleBannerProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/ConsoleUsageProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ConsoleUsageProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/ConsoleUsageProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ConsoleUsageProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/ControllerPluginProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ControllerPluginProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/ControllerPluginProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ControllerPluginProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/ControllerProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ControllerProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/ControllerProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ControllerProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/DependencyIndicatorInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/DependencyIndicatorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/DependencyIndicatorInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/DependencyIndicatorInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/FilterProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/FilterProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/FilterProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/FilterProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/FormElementProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/FormElementProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/FormElementProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/FormElementProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/InitProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/InitProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/InitProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/InitProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/LocatorRegisteredInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/LocatorRegisteredInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/LocatorRegisteredInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/LocatorRegisteredInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/RouteProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/RouteProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/RouteProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/RouteProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/SerializerProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/SerializerProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/SerializerProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/SerializerProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/ServiceProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ServiceProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/ServiceProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ServiceProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/ValidatorProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ValidatorProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/ValidatorProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ValidatorProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Feature/ViewHelperProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ViewHelperProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Feature/ViewHelperProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Feature/ViewHelperProviderInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/AbstractListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/AbstractListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/AbstractListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/AbstractListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/AutoloaderListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/AutoloaderListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/AutoloaderListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/AutoloaderListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/ConfigListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ConfigListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/ConfigListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ConfigListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/ConfigMergerInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ConfigMergerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/ConfigMergerInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ConfigMergerInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/DefaultListenerAggregate.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/DefaultListenerAggregate.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/DefaultListenerAggregate.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/DefaultListenerAggregate.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/InitTrigger.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/InitTrigger.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/InitTrigger.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/InitTrigger.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/ListenerOptions.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ListenerOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/ListenerOptions.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ListenerOptions.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/LocatorRegistrationListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/LocatorRegistrationListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/LocatorRegistrationListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/LocatorRegistrationListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleDependencyCheckerListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ModuleDependencyCheckerListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleDependencyCheckerListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ModuleDependencyCheckerListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleLoaderListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ModuleLoaderListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleLoaderListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ModuleLoaderListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleResolverListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ModuleResolverListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/ModuleResolverListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ModuleResolverListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/OnBootstrapListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/OnBootstrapListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/OnBootstrapListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/OnBootstrapListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/ServiceListener.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListener.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/ServiceListener.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListener.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/Listener/ServiceListenerInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListenerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/Listener/ServiceListenerInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListenerInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/ModuleEvent.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleEvent.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/ModuleEvent.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleEvent.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/ModuleManager.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/ModuleManagerInterface.php b/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManagerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/ModuleManagerInterface.php rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManagerInterface.php diff --git a/vendor/ZF2/library/Zend/ModuleManager/README.md b/vendor/zendframework/zendframework/library/Zend/ModuleManager/README.md similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/README.md rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/README.md diff --git a/vendor/ZF2/library/Zend/ModuleManager/composer.json b/vendor/zendframework/zendframework/library/Zend/ModuleManager/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/ModuleManager/composer.json rename to vendor/zendframework/zendframework/library/Zend/ModuleManager/composer.json diff --git a/vendor/ZF2/library/Zend/Mvc/Application.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Application.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Application.php diff --git a/vendor/ZF2/library/Zend/Mvc/ApplicationInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/ApplicationInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/ApplicationInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/ApplicationInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/AbstractActionController.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/AbstractActionController.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/AbstractController.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/AbstractController.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/AbstractRestfulController.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractRestfulController.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/AbstractRestfulController.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractRestfulController.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/ControllerManager.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/ControllerManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/ControllerManager.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/ControllerManager.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/AbstractPlugin.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/AbstractPlugin.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/AbstractPlugin.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/AbstractPlugin.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/AcceptableViewModelSelector.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/AcceptableViewModelSelector.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/AcceptableViewModelSelector.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/AcceptableViewModelSelector.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/FlashMessenger.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/FlashMessenger.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/FlashMessenger.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/FlashMessenger.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Forward.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Forward.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Forward.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Forward.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Identity.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Identity.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Identity.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Identity.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Layout.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Layout.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Layout.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Layout.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Params.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Params.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Params.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Params.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/PluginInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/PluginInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/PluginInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/PluginInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/PostRedirectGet.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/PostRedirectGet.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/PostRedirectGet.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/PostRedirectGet.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Redirect.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Redirect.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Redirect.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Redirect.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Url.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Url.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/Plugin/Url.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/Plugin/Url.php diff --git a/vendor/ZF2/library/Zend/Mvc/Controller/PluginManager.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/PluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Controller/PluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Controller/PluginManager.php diff --git a/vendor/ZF2/library/Zend/Mvc/DispatchListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/DispatchListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Mvc/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Mvc/Exception/InvalidControllerException.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Exception/InvalidControllerException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Exception/InvalidControllerException.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Exception/InvalidControllerException.php diff --git a/vendor/ZF2/library/Zend/Mvc/Exception/InvalidPluginException.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Exception/InvalidPluginException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Exception/InvalidPluginException.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Exception/InvalidPluginException.php diff --git a/vendor/ZF2/library/Zend/Mvc/Exception/MissingLocatorException.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Exception/MissingLocatorException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Exception/MissingLocatorException.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Exception/MissingLocatorException.php diff --git a/vendor/ZF2/library/Zend/Mvc/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mvc/InjectApplicationEventInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/InjectApplicationEventInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/InjectApplicationEventInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/InjectApplicationEventInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/ModuleRouteListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/ModuleRouteListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/ModuleRouteListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/ModuleRouteListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/MvcEvent.php b/vendor/zendframework/zendframework/library/Zend/Mvc/MvcEvent.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/MvcEvent.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/MvcEvent.php diff --git a/vendor/ZF2/library/Zend/Mvc/README.md b/vendor/zendframework/zendframework/library/Zend/Mvc/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/README.md rename to vendor/zendframework/zendframework/library/Zend/Mvc/README.md diff --git a/vendor/ZF2/library/Zend/Mvc/ResponseSender/AbstractResponseSender.php b/vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/AbstractResponseSender.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/ResponseSender/AbstractResponseSender.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/AbstractResponseSender.php diff --git a/vendor/ZF2/library/Zend/Mvc/ResponseSender/ConsoleResponseSender.php b/vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/ConsoleResponseSender.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/ResponseSender/ConsoleResponseSender.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/ConsoleResponseSender.php diff --git a/vendor/ZF2/library/Zend/Mvc/ResponseSender/PhpEnvironmentResponseSender.php b/vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/PhpEnvironmentResponseSender.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/ResponseSender/PhpEnvironmentResponseSender.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/PhpEnvironmentResponseSender.php diff --git a/vendor/ZF2/library/Zend/Mvc/ResponseSender/ResponseSenderInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/ResponseSenderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/ResponseSender/ResponseSenderInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/ResponseSenderInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/ResponseSender/SendResponseEvent.php b/vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/SendResponseEvent.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/ResponseSender/SendResponseEvent.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/SendResponseEvent.php diff --git a/vendor/ZF2/library/Zend/Mvc/ResponseSender/SimpleStreamResponseSender.php b/vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/SimpleStreamResponseSender.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/ResponseSender/SimpleStreamResponseSender.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/ResponseSender/SimpleStreamResponseSender.php diff --git a/vendor/ZF2/library/Zend/Mvc/RouteListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/RouteListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/RouteListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/RouteListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Console/Catchall.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/Catchall.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Console/Catchall.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/Catchall.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Console/RouteInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/RouteInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Console/RouteInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/RouteInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Console/RouteMatch.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/RouteMatch.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Console/RouteMatch.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/RouteMatch.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Console/Simple.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/Simple.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Console/Simple.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/Simple.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Console/SimpleRouteStack.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/SimpleRouteStack.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Console/SimpleRouteStack.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Console/SimpleRouteStack.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Hostname.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Hostname.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Hostname.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Hostname.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Literal.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Literal.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Literal.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Literal.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Method.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Method.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Method.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Method.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Part.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Part.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Part.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Part.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Query.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Query.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Query.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Query.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Regex.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Regex.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Regex.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Regex.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/RouteInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/RouteInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/RouteInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/RouteInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/RouteMatch.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/RouteMatch.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/RouteMatch.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/RouteMatch.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Scheme.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Scheme.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Scheme.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Scheme.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Segment.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Segment.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Segment.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Segment.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/TreeRouteStack.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/TreeRouteStack.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/TreeRouteStack.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/TreeRouteStack.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/Http/Wildcard.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Wildcard.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/Http/Wildcard.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/Http/Wildcard.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/PriorityList.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/PriorityList.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/PriorityList.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/PriorityList.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/RouteInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/RouteInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/RouteInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/RouteInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/RouteMatch.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/RouteMatch.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/RouteMatch.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/RouteMatch.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/RoutePluginManager.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/RoutePluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/RoutePluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/RoutePluginManager.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/RouteStackInterface.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/RouteStackInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/RouteStackInterface.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/RouteStackInterface.php diff --git a/vendor/ZF2/library/Zend/Mvc/Router/SimpleRouteStack.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Router/SimpleRouteStack.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Router/SimpleRouteStack.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Router/SimpleRouteStack.php diff --git a/vendor/ZF2/library/Zend/Mvc/SendResponseListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/SendResponseListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/SendResponseListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/SendResponseListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/AbstractPluginManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/AbstractPluginManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/AbstractPluginManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/AbstractPluginManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ApplicationFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ApplicationFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ApplicationFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ApplicationFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ConfigFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ConfigFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ConfigFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ConfigFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ConsoleAdapterFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ConsoleAdapterFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ConsoleAdapterFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ConsoleAdapterFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ControllerLoaderFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ControllerLoaderFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ControllerLoaderFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ControllerLoaderFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ControllerPluginManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ControllerPluginManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ControllerPluginManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ControllerPluginManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/DiAbstractServiceFactoryFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiAbstractServiceFactoryFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/DiAbstractServiceFactoryFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiAbstractServiceFactoryFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/DiFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/DiFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/DiServiceInitializerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiServiceInitializerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/DiServiceInitializerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiServiceInitializerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/DiStrictAbstractServiceFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiStrictAbstractServiceFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/DiStrictAbstractServiceFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiStrictAbstractServiceFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/DiStrictAbstractServiceFactoryFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiStrictAbstractServiceFactoryFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/DiStrictAbstractServiceFactoryFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/DiStrictAbstractServiceFactoryFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/EventManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/EventManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/EventManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/EventManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/FilterManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/FilterManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/FilterManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/FilterManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/FormElementManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/FormElementManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/FormElementManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/FormElementManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ModuleManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ModuleManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ModuleManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ModuleManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/PaginatorPluginManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/PaginatorPluginManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/PaginatorPluginManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/PaginatorPluginManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/RequestFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/RequestFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/RequestFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/RequestFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ResponseFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ResponseFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ResponseFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ResponseFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/RoutePluginManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/RoutePluginManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/RoutePluginManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/RoutePluginManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/RouterFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/RouterFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/RouterFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/RouterFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/SerializerAdapterPluginManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/SerializerAdapterPluginManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/SerializerAdapterPluginManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/SerializerAdapterPluginManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ServiceListenerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ServiceListenerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ServiceListenerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ServiceListenerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ServiceManagerConfig.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ServiceManagerConfig.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ServiceManagerConfig.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ServiceManagerConfig.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ValidatorManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ValidatorManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ValidatorManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ValidatorManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewFeedRendererFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewFeedRendererFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewFeedRendererFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewFeedRendererFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewFeedStrategyFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewFeedStrategyFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewFeedStrategyFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewFeedStrategyFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewHelperManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewHelperManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewHelperManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewHelperManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewJsonRendererFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewJsonRendererFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewJsonRendererFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewJsonRendererFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewJsonStrategyFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewJsonStrategyFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewJsonStrategyFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewJsonStrategyFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewManagerFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewManagerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewManagerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewManagerFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewResolverFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewResolverFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewResolverFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewResolverFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewTemplateMapResolverFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewTemplateMapResolverFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewTemplateMapResolverFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewTemplateMapResolverFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/Service/ViewTemplatePathStackFactory.php b/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewTemplatePathStackFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/Service/ViewTemplatePathStackFactory.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewTemplatePathStackFactory.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Console/CreateViewModelListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/CreateViewModelListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Console/CreateViewModelListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/CreateViewModelListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Console/DefaultRenderingStrategy.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/DefaultRenderingStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Console/DefaultRenderingStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/DefaultRenderingStrategy.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Console/ExceptionStrategy.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/ExceptionStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Console/ExceptionStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/ExceptionStrategy.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Console/InjectNamedConsoleParamsListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/InjectNamedConsoleParamsListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Console/InjectNamedConsoleParamsListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/InjectNamedConsoleParamsListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Console/InjectViewModelListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/InjectViewModelListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Console/InjectViewModelListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/InjectViewModelListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Console/ViewManager.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/ViewManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Console/ViewManager.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Console/ViewManager.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Http/CreateViewModelListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/CreateViewModelListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Http/CreateViewModelListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/CreateViewModelListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Http/DefaultRenderingStrategy.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/DefaultRenderingStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Http/DefaultRenderingStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/DefaultRenderingStrategy.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Http/ExceptionStrategy.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/ExceptionStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Http/ExceptionStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/ExceptionStrategy.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Http/InjectRoutematchParamsListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/InjectRoutematchParamsListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Http/InjectRoutematchParamsListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/InjectRoutematchParamsListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Http/InjectTemplateListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/InjectTemplateListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Http/InjectTemplateListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/InjectTemplateListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Http/InjectViewModelListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/InjectViewModelListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Http/InjectViewModelListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/InjectViewModelListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/RouteNotFoundStrategy.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/Http/ViewManager.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/ViewManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/Http/ViewManager.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/Http/ViewManager.php diff --git a/vendor/ZF2/library/Zend/Mvc/View/SendResponseListener.php b/vendor/zendframework/zendframework/library/Zend/Mvc/View/SendResponseListener.php similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/View/SendResponseListener.php rename to vendor/zendframework/zendframework/library/Zend/Mvc/View/SendResponseListener.php diff --git a/vendor/ZF2/library/Zend/Mvc/composer.json b/vendor/zendframework/zendframework/library/Zend/Mvc/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Mvc/composer.json rename to vendor/zendframework/zendframework/library/Zend/Mvc/composer.json diff --git a/vendor/ZF2/library/Zend/Navigation/AbstractContainer.php b/vendor/zendframework/zendframework/library/Zend/Navigation/AbstractContainer.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/AbstractContainer.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/AbstractContainer.php diff --git a/vendor/ZF2/library/Zend/Navigation/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Navigation/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Navigation/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Navigation/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Navigation/Exception/OutOfBoundsException.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Exception/OutOfBoundsException.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Exception/OutOfBoundsException.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Exception/OutOfBoundsException.php diff --git a/vendor/ZF2/library/Zend/Navigation/Navigation.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Navigation.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Navigation.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Navigation.php diff --git a/vendor/ZF2/library/Zend/Navigation/Page/AbstractPage.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Page/AbstractPage.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Page/AbstractPage.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Page/AbstractPage.php diff --git a/vendor/ZF2/library/Zend/Navigation/Page/Mvc.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Page/Mvc.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Page/Mvc.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Page/Mvc.php diff --git a/vendor/ZF2/library/Zend/Navigation/Page/Uri.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Page/Uri.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Page/Uri.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Page/Uri.php diff --git a/vendor/ZF2/library/Zend/Navigation/README.md b/vendor/zendframework/zendframework/library/Zend/Navigation/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/README.md rename to vendor/zendframework/zendframework/library/Zend/Navigation/README.md diff --git a/vendor/ZF2/library/Zend/Navigation/Service/AbstractNavigationFactory.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Service/AbstractNavigationFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Service/AbstractNavigationFactory.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Service/AbstractNavigationFactory.php diff --git a/vendor/ZF2/library/Zend/Navigation/Service/ConstructedNavigationFactory.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Service/ConstructedNavigationFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Service/ConstructedNavigationFactory.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Service/ConstructedNavigationFactory.php diff --git a/vendor/ZF2/library/Zend/Navigation/Service/DefaultNavigationFactory.php b/vendor/zendframework/zendframework/library/Zend/Navigation/Service/DefaultNavigationFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/Service/DefaultNavigationFactory.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/Service/DefaultNavigationFactory.php diff --git a/vendor/ZF2/library/Zend/Navigation/View/HelperConfig.php b/vendor/zendframework/zendframework/library/Zend/Navigation/View/HelperConfig.php similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/View/HelperConfig.php rename to vendor/zendframework/zendframework/library/Zend/Navigation/View/HelperConfig.php diff --git a/vendor/ZF2/library/Zend/Navigation/composer.json b/vendor/zendframework/zendframework/library/Zend/Navigation/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Navigation/composer.json rename to vendor/zendframework/zendframework/library/Zend/Navigation/composer.json diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/ArrayAdapter.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/ArrayAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/ArrayAdapter.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/ArrayAdapter.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/DbSelect.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/DbSelect.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/Iterator.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Iterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/Iterator.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Iterator.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/Null.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Null.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/Null.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Null.php diff --git a/vendor/ZF2/library/Zend/Paginator/Adapter/Service/DbSelectFactory.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Service/DbSelectFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Adapter/Service/DbSelectFactory.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/Service/DbSelectFactory.php diff --git a/vendor/ZF2/library/Zend/Paginator/AdapterAggregateInterface.php b/vendor/zendframework/zendframework/library/Zend/Paginator/AdapterAggregateInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/AdapterAggregateInterface.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/AdapterAggregateInterface.php diff --git a/vendor/ZF2/library/Zend/Paginator/AdapterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Paginator/AdapterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/AdapterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/AdapterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Paginator/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Paginator/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Paginator/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Paginator/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Paginator/Factory.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Factory.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Factory.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Factory.php diff --git a/vendor/ZF2/library/Zend/Paginator/Paginator.php b/vendor/zendframework/zendframework/library/Zend/Paginator/Paginator.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/Paginator.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/Paginator.php diff --git a/vendor/ZF2/library/Zend/Paginator/README.md b/vendor/zendframework/zendframework/library/Zend/Paginator/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/README.md rename to vendor/zendframework/zendframework/library/Zend/Paginator/README.md diff --git a/vendor/ZF2/library/Zend/Paginator/ScrollingStyle/All.php b/vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/All.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/ScrollingStyle/All.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/All.php diff --git a/vendor/ZF2/library/Zend/Paginator/ScrollingStyle/Elastic.php b/vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/Elastic.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/ScrollingStyle/Elastic.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/Elastic.php diff --git a/vendor/ZF2/library/Zend/Paginator/ScrollingStyle/Jumping.php b/vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/Jumping.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/ScrollingStyle/Jumping.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/Jumping.php diff --git a/vendor/ZF2/library/Zend/Paginator/ScrollingStyle/ScrollingStyleInterface.php b/vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/ScrollingStyleInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/ScrollingStyle/ScrollingStyleInterface.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/ScrollingStyleInterface.php diff --git a/vendor/ZF2/library/Zend/Paginator/ScrollingStyle/Sliding.php b/vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/Sliding.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/ScrollingStyle/Sliding.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStyle/Sliding.php diff --git a/vendor/ZF2/library/Zend/Paginator/ScrollingStylePluginManager.php b/vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStylePluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/ScrollingStylePluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/ScrollingStylePluginManager.php diff --git a/vendor/ZF2/library/Zend/Paginator/SerializableLimitIterator.php b/vendor/zendframework/zendframework/library/Zend/Paginator/SerializableLimitIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/SerializableLimitIterator.php rename to vendor/zendframework/zendframework/library/Zend/Paginator/SerializableLimitIterator.php diff --git a/vendor/ZF2/library/Zend/Paginator/composer.json b/vendor/zendframework/zendframework/library/Zend/Paginator/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Paginator/composer.json rename to vendor/zendframework/zendframework/library/Zend/Paginator/composer.json diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Acl.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Acl.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Acl.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Acl.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/AclInterface.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/AclInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/AclInterface.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/AclInterface.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Assertion/AssertionInterface.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Assertion/AssertionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Assertion/AssertionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Assertion/AssertionInterface.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/README.md b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/README.md rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/README.md diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Resource/GenericResource.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Resource/GenericResource.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Resource/GenericResource.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Resource/GenericResource.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Resource/ResourceInterface.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Resource/ResourceInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Resource/ResourceInterface.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Resource/ResourceInterface.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Role/GenericRole.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Role/GenericRole.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Role/GenericRole.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Role/GenericRole.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Role/Registry.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Role/Registry.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Role/Registry.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Role/Registry.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/Role/RoleInterface.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Role/RoleInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/Role/RoleInterface.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/Role/RoleInterface.php diff --git a/vendor/ZF2/library/Zend/Permissions/Acl/composer.json b/vendor/zendframework/zendframework/library/Zend/Permissions/Acl/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Acl/composer.json rename to vendor/zendframework/zendframework/library/Zend/Permissions/Acl/composer.json diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/AbstractIterator.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/AbstractIterator.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/AbstractIterator.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/AbstractIterator.php diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/AbstractRole.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/AbstractRole.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/AbstractRole.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/AbstractRole.php diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/AssertionInterface.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/AssertionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/AssertionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/AssertionInterface.php diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/README.md b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/README.md rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/README.md diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/Rbac.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/Rbac.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/Rbac.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/Rbac.php diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/Role.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/Role.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/Role.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/Role.php diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/RoleInterface.php b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/RoleInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/RoleInterface.php rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/RoleInterface.php diff --git a/vendor/ZF2/library/Zend/Permissions/Rbac/composer.json b/vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Permissions/Rbac/composer.json rename to vendor/zendframework/zendframework/library/Zend/Permissions/Rbac/composer.json diff --git a/vendor/ZF2/library/Zend/ProgressBar/Adapter/AbstractAdapter.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/AbstractAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Adapter/AbstractAdapter.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/AbstractAdapter.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Adapter/Console.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/Console.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Adapter/Console.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/Console.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Adapter/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Adapter/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Adapter/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Adapter/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Adapter/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Adapter/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Adapter/JsPull.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/JsPull.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Adapter/JsPull.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/JsPull.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Adapter/JsPush.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/JsPush.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Adapter/JsPush.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Adapter/JsPush.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Exception/OutOfRangeException.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/OutOfRangeException.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Exception/OutOfRangeException.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/OutOfRangeException.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Exception/PhpEnvironmentException.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/PhpEnvironmentException.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Exception/PhpEnvironmentException.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/PhpEnvironmentException.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/ProgressBar.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/ProgressBar.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/ProgressBar.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/ProgressBar.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/README.md b/vendor/zendframework/zendframework/library/Zend/ProgressBar/README.md similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/README.md rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/README.md diff --git a/vendor/ZF2/library/Zend/ProgressBar/Upload/AbstractUploadHandler.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/AbstractUploadHandler.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Upload/AbstractUploadHandler.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/AbstractUploadHandler.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Upload/ApcProgress.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/ApcProgress.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Upload/ApcProgress.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/ApcProgress.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Upload/SessionProgress.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/SessionProgress.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Upload/SessionProgress.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/SessionProgress.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Upload/UploadHandlerInterface.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/UploadHandlerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Upload/UploadHandlerInterface.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/UploadHandlerInterface.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/Upload/UploadProgress.php b/vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/UploadProgress.php similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/Upload/UploadProgress.php rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/Upload/UploadProgress.php diff --git a/vendor/ZF2/library/Zend/ProgressBar/composer.json b/vendor/zendframework/zendframework/library/Zend/ProgressBar/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/ProgressBar/composer.json rename to vendor/zendframework/zendframework/library/Zend/ProgressBar/composer.json diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/AbstractAdapter.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/AbstractAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/AbstractAdapter.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/AbstractAdapter.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/AdapterOptions.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/AdapterOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/AdapterOptions.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/AdapterOptions.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/IgBinary.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/IgBinary.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/IgBinary.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/IgBinary.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/Json.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/Json.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/Json.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/Json.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/JsonOptions.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/JsonOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/JsonOptions.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/JsonOptions.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/MsgPack.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/MsgPack.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/MsgPack.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/MsgPack.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/PhpCode.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/PhpCode.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/PhpCode.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/PhpCode.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/PhpSerialize.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/PhpSerialize.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/PhpSerialize.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/PhpSerialize.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/PythonPickle.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/PythonPickle.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/PythonPickle.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/PythonPickle.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/PythonPickleOptions.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/PythonPickleOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/PythonPickleOptions.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/PythonPickleOptions.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/Wddx.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/Wddx.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/Wddx.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/Wddx.php diff --git a/vendor/ZF2/library/Zend/Serializer/Adapter/WddxOptions.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/WddxOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Adapter/WddxOptions.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Adapter/WddxOptions.php diff --git a/vendor/ZF2/library/Zend/Serializer/AdapterPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Serializer/AdapterPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/AdapterPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/AdapterPluginManager.php diff --git a/vendor/ZF2/library/Zend/Serializer/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Serializer/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Exception/ExtensionNotLoadedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Exception/ExtensionNotLoadedException.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Exception/ExtensionNotLoadedException.php diff --git a/vendor/ZF2/library/Zend/Serializer/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Serializer/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Serializer/README.md b/vendor/zendframework/zendframework/library/Zend/Serializer/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/README.md rename to vendor/zendframework/zendframework/library/Zend/Serializer/README.md diff --git a/vendor/ZF2/library/Zend/Serializer/Serializer.php b/vendor/zendframework/zendframework/library/Zend/Serializer/Serializer.php similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/Serializer.php rename to vendor/zendframework/zendframework/library/Zend/Serializer/Serializer.php diff --git a/vendor/ZF2/library/Zend/Serializer/composer.json b/vendor/zendframework/zendframework/library/Zend/Serializer/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Serializer/composer.json rename to vendor/zendframework/zendframework/library/Zend/Serializer/composer.json diff --git a/vendor/ZF2/library/Zend/Server/AbstractServer.php b/vendor/zendframework/zendframework/library/Zend/Server/AbstractServer.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/AbstractServer.php rename to vendor/zendframework/zendframework/library/Zend/Server/AbstractServer.php diff --git a/vendor/ZF2/library/Zend/Server/Cache.php b/vendor/zendframework/zendframework/library/Zend/Server/Cache.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Cache.php rename to vendor/zendframework/zendframework/library/Zend/Server/Cache.php diff --git a/vendor/ZF2/library/Zend/Server/Client.php b/vendor/zendframework/zendframework/library/Zend/Server/Client.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Client.php rename to vendor/zendframework/zendframework/library/Zend/Server/Client.php diff --git a/vendor/ZF2/library/Zend/Server/Definition.php b/vendor/zendframework/zendframework/library/Zend/Server/Definition.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Definition.php rename to vendor/zendframework/zendframework/library/Zend/Server/Definition.php diff --git a/vendor/ZF2/library/Zend/Server/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Server/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Server/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Server/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Server/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Server/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Server/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Server/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Server/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Server/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Server/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Server/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Server/Method/Callback.php b/vendor/zendframework/zendframework/library/Zend/Server/Method/Callback.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Method/Callback.php rename to vendor/zendframework/zendframework/library/Zend/Server/Method/Callback.php diff --git a/vendor/ZF2/library/Zend/Server/Method/Definition.php b/vendor/zendframework/zendframework/library/Zend/Server/Method/Definition.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Method/Definition.php rename to vendor/zendframework/zendframework/library/Zend/Server/Method/Definition.php diff --git a/vendor/ZF2/library/Zend/Server/Method/Parameter.php b/vendor/zendframework/zendframework/library/Zend/Server/Method/Parameter.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Method/Parameter.php rename to vendor/zendframework/zendframework/library/Zend/Server/Method/Parameter.php diff --git a/vendor/ZF2/library/Zend/Server/Method/Prototype.php b/vendor/zendframework/zendframework/library/Zend/Server/Method/Prototype.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Method/Prototype.php rename to vendor/zendframework/zendframework/library/Zend/Server/Method/Prototype.php diff --git a/vendor/ZF2/library/Zend/Server/README.md b/vendor/zendframework/zendframework/library/Zend/Server/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Server/README.md rename to vendor/zendframework/zendframework/library/Zend/Server/README.md diff --git a/vendor/ZF2/library/Zend/Server/Reflection.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/AbstractFunction.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/AbstractFunction.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/AbstractFunction.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/AbstractFunction.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/Node.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/Node.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/Node.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/Node.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/Prototype.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/Prototype.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/Prototype.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/Prototype.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/ReflectionClass.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionClass.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/ReflectionClass.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionClass.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/ReflectionFunction.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionFunction.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/ReflectionFunction.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionFunction.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/ReflectionMethod.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionMethod.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/ReflectionMethod.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionMethod.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/ReflectionParameter.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionParameter.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/ReflectionParameter.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionParameter.php diff --git a/vendor/ZF2/library/Zend/Server/Reflection/ReflectionReturnValue.php b/vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionReturnValue.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Reflection/ReflectionReturnValue.php rename to vendor/zendframework/zendframework/library/Zend/Server/Reflection/ReflectionReturnValue.php diff --git a/vendor/ZF2/library/Zend/Server/Server.php b/vendor/zendframework/zendframework/library/Zend/Server/Server.php similarity index 100% rename from vendor/ZF2/library/Zend/Server/Server.php rename to vendor/zendframework/zendframework/library/Zend/Server/Server.php diff --git a/vendor/ZF2/library/Zend/Server/composer.json b/vendor/zendframework/zendframework/library/Zend/Server/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Server/composer.json rename to vendor/zendframework/zendframework/library/Zend/Server/composer.json diff --git a/vendor/ZF2/library/Zend/ServiceManager/AbstractFactoryInterface.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/AbstractFactoryInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/AbstractFactoryInterface.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/AbstractFactoryInterface.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/AbstractPluginManager.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/AbstractPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/AbstractPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/AbstractPluginManager.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Config.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Config.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Config.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Config.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/ConfigInterface.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/ConfigInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/ConfigInterface.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/ConfigInterface.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Di/DiAbstractServiceFactory.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Di/DiAbstractServiceFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Di/DiAbstractServiceFactory.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Di/DiAbstractServiceFactory.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Di/DiInstanceManagerProxy.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Di/DiInstanceManagerProxy.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Di/DiInstanceManagerProxy.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Di/DiInstanceManagerProxy.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Di/DiServiceFactory.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Di/DiServiceFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Di/DiServiceFactory.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Di/DiServiceFactory.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Di/DiServiceInitializer.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Di/DiServiceInitializer.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Di/DiServiceInitializer.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Di/DiServiceInitializer.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Exception/CircularDependencyFoundException.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/CircularDependencyFoundException.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Exception/CircularDependencyFoundException.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/CircularDependencyFoundException.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Exception/InvalidServiceNameException.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/InvalidServiceNameException.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Exception/InvalidServiceNameException.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/InvalidServiceNameException.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Exception/ServiceNotCreatedException.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/ServiceNotCreatedException.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Exception/ServiceNotCreatedException.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/ServiceNotCreatedException.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/Exception/ServiceNotFoundException.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/ServiceNotFoundException.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/Exception/ServiceNotFoundException.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/Exception/ServiceNotFoundException.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/FactoryInterface.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/FactoryInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/FactoryInterface.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/FactoryInterface.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/InitializerInterface.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/InitializerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/InitializerInterface.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/InitializerInterface.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/README.md b/vendor/zendframework/zendframework/library/Zend/ServiceManager/README.md similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/README.md rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/README.md diff --git a/vendor/ZF2/library/Zend/ServiceManager/ServiceLocatorAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceLocatorAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/ServiceLocatorAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceLocatorAwareInterface.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/ServiceLocatorAwareTrait.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceLocatorAwareTrait.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/ServiceLocatorAwareTrait.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceLocatorAwareTrait.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/ServiceLocatorInterface.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceLocatorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/ServiceLocatorInterface.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceLocatorInterface.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/ServiceManager.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/ServiceManager.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/ServiceManagerAwareInterface.php b/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManagerAwareInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/ServiceManagerAwareInterface.php rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManagerAwareInterface.php diff --git a/vendor/ZF2/library/Zend/ServiceManager/composer.json b/vendor/zendframework/zendframework/library/Zend/ServiceManager/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/ServiceManager/composer.json rename to vendor/zendframework/zendframework/library/Zend/ServiceManager/composer.json diff --git a/vendor/ZF2/library/Zend/Session/AbstractContainer.php b/vendor/zendframework/zendframework/library/Zend/Session/AbstractContainer.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/AbstractContainer.php rename to vendor/zendframework/zendframework/library/Zend/Session/AbstractContainer.php diff --git a/vendor/ZF2/library/Zend/Session/AbstractManager.php b/vendor/zendframework/zendframework/library/Zend/Session/AbstractManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/AbstractManager.php rename to vendor/zendframework/zendframework/library/Zend/Session/AbstractManager.php diff --git a/vendor/ZF2/library/Zend/Session/Config/ConfigInterface.php b/vendor/zendframework/zendframework/library/Zend/Session/Config/ConfigInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Config/ConfigInterface.php rename to vendor/zendframework/zendframework/library/Zend/Session/Config/ConfigInterface.php diff --git a/vendor/ZF2/library/Zend/Session/Config/SessionConfig.php b/vendor/zendframework/zendframework/library/Zend/Session/Config/SessionConfig.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Config/SessionConfig.php rename to vendor/zendframework/zendframework/library/Zend/Session/Config/SessionConfig.php diff --git a/vendor/ZF2/library/Zend/Session/Config/StandardConfig.php b/vendor/zendframework/zendframework/library/Zend/Session/Config/StandardConfig.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Config/StandardConfig.php rename to vendor/zendframework/zendframework/library/Zend/Session/Config/StandardConfig.php diff --git a/vendor/ZF2/library/Zend/Session/Container.php b/vendor/zendframework/zendframework/library/Zend/Session/Container.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Container.php rename to vendor/zendframework/zendframework/library/Zend/Session/Container.php diff --git a/vendor/ZF2/library/Zend/Session/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Session/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Session/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Session/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Session/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Session/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Session/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Session/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Session/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Session/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Session/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Session/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Session/ManagerInterface.php b/vendor/zendframework/zendframework/library/Zend/Session/ManagerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/ManagerInterface.php rename to vendor/zendframework/zendframework/library/Zend/Session/ManagerInterface.php diff --git a/vendor/ZF2/library/Zend/Session/README.md b/vendor/zendframework/zendframework/library/Zend/Session/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Session/README.md rename to vendor/zendframework/zendframework/library/Zend/Session/README.md diff --git a/vendor/ZF2/library/Zend/Session/SaveHandler/Cache.php b/vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/Cache.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/SaveHandler/Cache.php rename to vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/Cache.php diff --git a/vendor/ZF2/library/Zend/Session/SaveHandler/DbTableGateway.php b/vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/DbTableGateway.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/SaveHandler/DbTableGateway.php rename to vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/DbTableGateway.php diff --git a/vendor/ZF2/library/Zend/Session/SaveHandler/DbTableGatewayOptions.php b/vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/DbTableGatewayOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/SaveHandler/DbTableGatewayOptions.php rename to vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/DbTableGatewayOptions.php diff --git a/vendor/ZF2/library/Zend/Session/SaveHandler/MongoDB.php b/vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/MongoDB.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/SaveHandler/MongoDB.php rename to vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/MongoDB.php diff --git a/vendor/ZF2/library/Zend/Session/SaveHandler/MongoDBOptions.php b/vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/MongoDBOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/SaveHandler/MongoDBOptions.php rename to vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/MongoDBOptions.php diff --git a/vendor/ZF2/library/Zend/Session/SaveHandler/SaveHandlerInterface.php b/vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/SaveHandlerInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/SaveHandler/SaveHandlerInterface.php rename to vendor/zendframework/zendframework/library/Zend/Session/SaveHandler/SaveHandlerInterface.php diff --git a/vendor/ZF2/library/Zend/Session/SessionManager.php b/vendor/zendframework/zendframework/library/Zend/Session/SessionManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/SessionManager.php rename to vendor/zendframework/zendframework/library/Zend/Session/SessionManager.php diff --git a/vendor/ZF2/library/Zend/Session/Storage/AbstractSessionArrayStorage.php b/vendor/zendframework/zendframework/library/Zend/Session/Storage/AbstractSessionArrayStorage.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Storage/AbstractSessionArrayStorage.php rename to vendor/zendframework/zendframework/library/Zend/Session/Storage/AbstractSessionArrayStorage.php diff --git a/vendor/ZF2/library/Zend/Session/Storage/ArrayStorage.php b/vendor/zendframework/zendframework/library/Zend/Session/Storage/ArrayStorage.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Storage/ArrayStorage.php rename to vendor/zendframework/zendframework/library/Zend/Session/Storage/ArrayStorage.php diff --git a/vendor/ZF2/library/Zend/Session/Storage/SessionArrayStorage.php b/vendor/zendframework/zendframework/library/Zend/Session/Storage/SessionArrayStorage.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Storage/SessionArrayStorage.php rename to vendor/zendframework/zendframework/library/Zend/Session/Storage/SessionArrayStorage.php diff --git a/vendor/ZF2/library/Zend/Session/Storage/SessionStorage.php b/vendor/zendframework/zendframework/library/Zend/Session/Storage/SessionStorage.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Storage/SessionStorage.php rename to vendor/zendframework/zendframework/library/Zend/Session/Storage/SessionStorage.php diff --git a/vendor/ZF2/library/Zend/Session/Storage/StorageInterface.php b/vendor/zendframework/zendframework/library/Zend/Session/Storage/StorageInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Storage/StorageInterface.php rename to vendor/zendframework/zendframework/library/Zend/Session/Storage/StorageInterface.php diff --git a/vendor/ZF2/library/Zend/Session/Validator/HttpUserAgent.php b/vendor/zendframework/zendframework/library/Zend/Session/Validator/HttpUserAgent.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Validator/HttpUserAgent.php rename to vendor/zendframework/zendframework/library/Zend/Session/Validator/HttpUserAgent.php diff --git a/vendor/ZF2/library/Zend/Session/Validator/RemoteAddr.php b/vendor/zendframework/zendframework/library/Zend/Session/Validator/RemoteAddr.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Validator/RemoteAddr.php rename to vendor/zendframework/zendframework/library/Zend/Session/Validator/RemoteAddr.php diff --git a/vendor/ZF2/library/Zend/Session/Validator/ValidatorInterface.php b/vendor/zendframework/zendframework/library/Zend/Session/Validator/ValidatorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/Validator/ValidatorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Session/Validator/ValidatorInterface.php diff --git a/vendor/ZF2/library/Zend/Session/ValidatorChain.php b/vendor/zendframework/zendframework/library/Zend/Session/ValidatorChain.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/ValidatorChain.php rename to vendor/zendframework/zendframework/library/Zend/Session/ValidatorChain.php diff --git a/vendor/ZF2/library/Zend/Session/compatibility/Container.php b/vendor/zendframework/zendframework/library/Zend/Session/compatibility/Container.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/compatibility/Container.php rename to vendor/zendframework/zendframework/library/Zend/Session/compatibility/Container.php diff --git a/vendor/ZF2/library/Zend/Session/compatibility/Storage/SessionArrayStorage.php b/vendor/zendframework/zendframework/library/Zend/Session/compatibility/Storage/SessionArrayStorage.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/compatibility/Storage/SessionArrayStorage.php rename to vendor/zendframework/zendframework/library/Zend/Session/compatibility/Storage/SessionArrayStorage.php diff --git a/vendor/ZF2/library/Zend/Session/compatibility/autoload.php b/vendor/zendframework/zendframework/library/Zend/Session/compatibility/autoload.php similarity index 100% rename from vendor/ZF2/library/Zend/Session/compatibility/autoload.php rename to vendor/zendframework/zendframework/library/Zend/Session/compatibility/autoload.php diff --git a/vendor/ZF2/library/Zend/Session/composer.json b/vendor/zendframework/zendframework/library/Zend/Session/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Session/composer.json rename to vendor/zendframework/zendframework/library/Zend/Session/composer.json diff --git a/vendor/ZF2/library/Zend/Soap/AutoDiscover.php b/vendor/zendframework/zendframework/library/Zend/Soap/AutoDiscover.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/AutoDiscover.php rename to vendor/zendframework/zendframework/library/Zend/Soap/AutoDiscover.php diff --git a/vendor/ZF2/library/Zend/Soap/AutoDiscover/DiscoveryStrategy/DiscoveryStrategyInterface.php b/vendor/zendframework/zendframework/library/Zend/Soap/AutoDiscover/DiscoveryStrategy/DiscoveryStrategyInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/AutoDiscover/DiscoveryStrategy/DiscoveryStrategyInterface.php rename to vendor/zendframework/zendframework/library/Zend/Soap/AutoDiscover/DiscoveryStrategy/DiscoveryStrategyInterface.php diff --git a/vendor/ZF2/library/Zend/Soap/AutoDiscover/DiscoveryStrategy/ReflectionDiscovery.php b/vendor/zendframework/zendframework/library/Zend/Soap/AutoDiscover/DiscoveryStrategy/ReflectionDiscovery.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/AutoDiscover/DiscoveryStrategy/ReflectionDiscovery.php rename to vendor/zendframework/zendframework/library/Zend/Soap/AutoDiscover/DiscoveryStrategy/ReflectionDiscovery.php diff --git a/vendor/ZF2/library/Zend/Soap/Client.php b/vendor/zendframework/zendframework/library/Zend/Soap/Client.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Client.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Client.php diff --git a/vendor/ZF2/library/Zend/Soap/Client/Common.php b/vendor/zendframework/zendframework/library/Zend/Soap/Client/Common.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Client/Common.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Client/Common.php diff --git a/vendor/ZF2/library/Zend/Soap/Client/DotNet.php b/vendor/zendframework/zendframework/library/Zend/Soap/Client/DotNet.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Client/DotNet.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Client/DotNet.php diff --git a/vendor/ZF2/library/Zend/Soap/Client/Local.php b/vendor/zendframework/zendframework/library/Zend/Soap/Client/Local.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Client/Local.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Client/Local.php diff --git a/vendor/ZF2/library/Zend/Soap/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Soap/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Soap/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Soap/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Soap/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zendframework/library/Zend/Soap/Exception/ExtensionNotLoadedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Exception/ExtensionNotLoadedException.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Exception/ExtensionNotLoadedException.php diff --git a/vendor/ZF2/library/Zend/Soap/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Soap/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Soap/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Soap/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Soap/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Soap/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Soap/README.md b/vendor/zendframework/zendframework/library/Zend/Soap/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Soap/README.md rename to vendor/zendframework/zendframework/library/Zend/Soap/README.md diff --git a/vendor/ZF2/library/Zend/Soap/Server.php b/vendor/zendframework/zendframework/library/Zend/Soap/Server.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Server.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Server.php diff --git a/vendor/ZF2/library/Zend/Soap/Server/DocumentLiteralWrapper.php b/vendor/zendframework/zendframework/library/Zend/Soap/Server/DocumentLiteralWrapper.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Server/DocumentLiteralWrapper.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Server/DocumentLiteralWrapper.php diff --git a/vendor/ZF2/library/Zend/Soap/Wsdl.php b/vendor/zendframework/zendframework/library/Zend/Soap/Wsdl.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Wsdl.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Wsdl.php diff --git a/vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/AbstractComplexTypeStrategy.php b/vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/AbstractComplexTypeStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/AbstractComplexTypeStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/AbstractComplexTypeStrategy.php diff --git a/vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/AnyType.php b/vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/AnyType.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/AnyType.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/AnyType.php diff --git a/vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeComplex.php b/vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeComplex.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeComplex.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeComplex.php diff --git a/vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php b/vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php diff --git a/vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ComplexTypeStrategyInterface.php b/vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ComplexTypeStrategyInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ComplexTypeStrategyInterface.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/ComplexTypeStrategyInterface.php diff --git a/vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/Composite.php b/vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/Composite.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/Composite.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/Composite.php diff --git a/vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/DefaultComplexType.php b/vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/DefaultComplexType.php similarity index 100% rename from vendor/ZF2/library/Zend/Soap/Wsdl/ComplexTypeStrategy/DefaultComplexType.php rename to vendor/zendframework/zendframework/library/Zend/Soap/Wsdl/ComplexTypeStrategy/DefaultComplexType.php diff --git a/vendor/ZF2/library/Zend/Soap/composer.json b/vendor/zendframework/zendframework/library/Zend/Soap/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Soap/composer.json rename to vendor/zendframework/zendframework/library/Zend/Soap/composer.json diff --git a/vendor/ZF2/library/Zend/Stdlib/AbstractOptions.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/AbstractOptions.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/AbstractOptions.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/AbstractOptions.php diff --git a/vendor/ZF2/library/Zend/Stdlib/ArrayObject.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/ArrayObject.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayObject.php diff --git a/vendor/ZF2/library/Zend/Stdlib/ArraySerializableInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/ArraySerializableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/ArraySerializableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/ArraySerializableInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/ArrayStack.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayStack.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/ArrayStack.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayStack.php diff --git a/vendor/ZF2/library/Zend/Stdlib/ArrayUtils.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayUtils.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/ArrayUtils.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayUtils.php diff --git a/vendor/ZF2/library/Zend/Stdlib/CallbackHandler.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/CallbackHandler.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/CallbackHandler.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/CallbackHandler.php diff --git a/vendor/ZF2/library/Zend/Stdlib/DateTime.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/DateTime.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/DateTime.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/DateTime.php diff --git a/vendor/ZF2/library/Zend/Stdlib/DispatchableInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/DispatchableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/DispatchableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/DispatchableInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/ErrorHandler.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/ErrorHandler.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/ErrorHandler.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/ErrorHandler.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/ExtensionNotLoadedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Exception/ExtensionNotLoadedException.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/ExtensionNotLoadedException.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Exception/InvalidCallbackException.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/InvalidCallbackException.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Exception/InvalidCallbackException.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/InvalidCallbackException.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Exception/LogicException.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/LogicException.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Exception/LogicException.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/LogicException.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Glob.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Glob.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Glob.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Glob.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/AbstractHydrator.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/AbstractHydrator.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/AbstractHydrator.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/AbstractHydrator.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/ArraySerializable.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/ArraySerializable.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/ArraySerializable.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/ArraySerializable.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/ClassMethods.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/ClassMethods.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/ClassMethods.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/ClassMethods.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/FilterComposite.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/FilterComposite.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/FilterComposite.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/FilterComposite.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/FilterInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/FilterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/FilterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/FilterInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/FilterProviderInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/FilterProviderInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/FilterProviderInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/FilterProviderInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/GetFilter.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/GetFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/GetFilter.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/GetFilter.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/HasFilter.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/HasFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/HasFilter.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/HasFilter.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/IsFilter.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/IsFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/IsFilter.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/IsFilter.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/MethodMatchFilter.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/MethodMatchFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/MethodMatchFilter.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/MethodMatchFilter.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/HydratorInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/HydratorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/HydratorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/HydratorInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/HydratorOptionsInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/HydratorOptionsInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/HydratorOptionsInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/HydratorOptionsInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/ObjectProperty.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/ObjectProperty.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/ObjectProperty.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/ObjectProperty.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Reflection.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Reflection.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Reflection.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Reflection.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Strategy/SerializableStrategy.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Strategy/SerializableStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Strategy/SerializableStrategy.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Strategy/SerializableStrategy.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Hydrator/StrategyEnabledInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/StrategyEnabledInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Hydrator/StrategyEnabledInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Hydrator/StrategyEnabledInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/InitializableInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/InitializableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/InitializableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/InitializableInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Message.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Message.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Message.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Message.php diff --git a/vendor/ZF2/library/Zend/Stdlib/MessageInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/MessageInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/MessageInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/MessageInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/ParameterObjectInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/ParameterObjectInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/ParameterObjectInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/ParameterObjectInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Parameters.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Parameters.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Parameters.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Parameters.php diff --git a/vendor/ZF2/library/Zend/Stdlib/ParametersInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/ParametersInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/ParametersInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/ParametersInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/PriorityQueue.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/PriorityQueue.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/PriorityQueue.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/PriorityQueue.php diff --git a/vendor/ZF2/library/Zend/Stdlib/README.md b/vendor/zendframework/zendframework/library/Zend/Stdlib/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/README.md rename to vendor/zendframework/zendframework/library/Zend/Stdlib/README.md diff --git a/vendor/ZF2/library/Zend/Stdlib/Request.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Request.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Request.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Request.php diff --git a/vendor/ZF2/library/Zend/Stdlib/RequestInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/RequestInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/RequestInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/RequestInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/Response.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/Response.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/Response.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/Response.php diff --git a/vendor/ZF2/library/Zend/Stdlib/ResponseInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/ResponseInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/ResponseInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/ResponseInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/SplPriorityQueue.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/SplPriorityQueue.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/SplPriorityQueue.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/SplPriorityQueue.php diff --git a/vendor/ZF2/library/Zend/Stdlib/SplQueue.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/SplQueue.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/SplQueue.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/SplQueue.php diff --git a/vendor/ZF2/library/Zend/Stdlib/SplStack.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/SplStack.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/SplStack.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/SplStack.php diff --git a/vendor/ZF2/library/Zend/Stdlib/StringUtils.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/StringUtils.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/StringUtils.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/StringUtils.php diff --git a/vendor/ZF2/library/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php diff --git a/vendor/ZF2/library/Zend/Stdlib/StringWrapper/Iconv.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/Iconv.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/StringWrapper/Iconv.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/Iconv.php diff --git a/vendor/ZF2/library/Zend/Stdlib/StringWrapper/Intl.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/Intl.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/StringWrapper/Intl.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/Intl.php diff --git a/vendor/ZF2/library/Zend/Stdlib/StringWrapper/MbString.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/MbString.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/StringWrapper/MbString.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/MbString.php diff --git a/vendor/ZF2/library/Zend/Stdlib/StringWrapper/Native.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/Native.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/StringWrapper/Native.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/Native.php diff --git a/vendor/ZF2/library/Zend/Stdlib/StringWrapper/StringWrapperInterface.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/StringWrapperInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/StringWrapper/StringWrapperInterface.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/StringWrapper/StringWrapperInterface.php diff --git a/vendor/ZF2/library/Zend/Stdlib/compatibility/ArrayObject.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/compatibility/ArrayObject.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/compatibility/ArrayObject.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/compatibility/ArrayObject.php diff --git a/vendor/ZF2/library/Zend/Stdlib/compatibility/autoload.php b/vendor/zendframework/zendframework/library/Zend/Stdlib/compatibility/autoload.php similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/compatibility/autoload.php rename to vendor/zendframework/zendframework/library/Zend/Stdlib/compatibility/autoload.php diff --git a/vendor/ZF2/library/Zend/Stdlib/composer.json b/vendor/zendframework/zendframework/library/Zend/Stdlib/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Stdlib/composer.json rename to vendor/zendframework/zendframework/library/Zend/Stdlib/composer.json diff --git a/vendor/ZF2/library/Zend/Tag/Cloud.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/Decorator/AbstractCloud.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/AbstractCloud.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/Decorator/AbstractCloud.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/AbstractCloud.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/Decorator/AbstractDecorator.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/AbstractDecorator.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/Decorator/AbstractDecorator.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/AbstractDecorator.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/Decorator/AbstractTag.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/AbstractTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/Decorator/AbstractTag.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/AbstractTag.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/Decorator/DecoratorInterface.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/DecoratorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/Decorator/DecoratorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/DecoratorInterface.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/Decorator/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/Decorator/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/Decorator/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/Decorator/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/Decorator/HtmlCloud.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/HtmlCloud.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/Decorator/HtmlCloud.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/HtmlCloud.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/Decorator/HtmlTag.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/HtmlTag.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/Decorator/HtmlTag.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/Decorator/HtmlTag.php diff --git a/vendor/ZF2/library/Zend/Tag/Cloud/DecoratorPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Tag/Cloud/DecoratorPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Cloud/DecoratorPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Cloud/DecoratorPluginManager.php diff --git a/vendor/ZF2/library/Zend/Tag/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Tag/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Tag/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Tag/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Tag/Exception/InvalidAttributeNameException.php b/vendor/zendframework/zendframework/library/Zend/Tag/Exception/InvalidAttributeNameException.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Exception/InvalidAttributeNameException.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Exception/InvalidAttributeNameException.php diff --git a/vendor/ZF2/library/Zend/Tag/Exception/InvalidElementNameException.php b/vendor/zendframework/zendframework/library/Zend/Tag/Exception/InvalidElementNameException.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Exception/InvalidElementNameException.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Exception/InvalidElementNameException.php diff --git a/vendor/ZF2/library/Zend/Tag/Exception/OutOfBoundsException.php b/vendor/zendframework/zendframework/library/Zend/Tag/Exception/OutOfBoundsException.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Exception/OutOfBoundsException.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Exception/OutOfBoundsException.php diff --git a/vendor/ZF2/library/Zend/Tag/Item.php b/vendor/zendframework/zendframework/library/Zend/Tag/Item.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/Item.php rename to vendor/zendframework/zendframework/library/Zend/Tag/Item.php diff --git a/vendor/ZF2/library/Zend/Tag/ItemList.php b/vendor/zendframework/zendframework/library/Zend/Tag/ItemList.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/ItemList.php rename to vendor/zendframework/zendframework/library/Zend/Tag/ItemList.php diff --git a/vendor/ZF2/library/Zend/Tag/README.md b/vendor/zendframework/zendframework/library/Zend/Tag/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Tag/README.md rename to vendor/zendframework/zendframework/library/Zend/Tag/README.md diff --git a/vendor/ZF2/library/Zend/Tag/TaggableInterface.php b/vendor/zendframework/zendframework/library/Zend/Tag/TaggableInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Tag/TaggableInterface.php rename to vendor/zendframework/zendframework/library/Zend/Tag/TaggableInterface.php diff --git a/vendor/ZF2/library/Zend/Tag/composer.json b/vendor/zendframework/zendframework/library/Zend/Tag/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Tag/composer.json rename to vendor/zendframework/zendframework/library/Zend/Tag/composer.json diff --git a/vendor/ZF2/library/Zend/Test/PHPUnit/Controller/AbstractConsoleControllerTestCase.php b/vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Controller/AbstractConsoleControllerTestCase.php similarity index 100% rename from vendor/ZF2/library/Zend/Test/PHPUnit/Controller/AbstractConsoleControllerTestCase.php rename to vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Controller/AbstractConsoleControllerTestCase.php diff --git a/vendor/ZF2/library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php b/vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php similarity index 100% rename from vendor/ZF2/library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php rename to vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php diff --git a/vendor/ZF2/library/Zend/Test/PHPUnit/Controller/AbstractHttpControllerTestCase.php b/vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Controller/AbstractHttpControllerTestCase.php similarity index 100% rename from vendor/ZF2/library/Zend/Test/PHPUnit/Controller/AbstractHttpControllerTestCase.php rename to vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Controller/AbstractHttpControllerTestCase.php diff --git a/vendor/ZF2/library/Zend/Test/PHPUnit/Mvc/Service/RouterFactory.php b/vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Mvc/Service/RouterFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Test/PHPUnit/Mvc/Service/RouterFactory.php rename to vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Mvc/Service/RouterFactory.php diff --git a/vendor/ZF2/library/Zend/Test/PHPUnit/Mvc/Service/ServiceListenerFactory.php b/vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Mvc/Service/ServiceListenerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Test/PHPUnit/Mvc/Service/ServiceListenerFactory.php rename to vendor/zendframework/zendframework/library/Zend/Test/PHPUnit/Mvc/Service/ServiceListenerFactory.php diff --git a/vendor/ZF2/library/Zend/Test/README.md b/vendor/zendframework/zendframework/library/Zend/Test/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Test/README.md rename to vendor/zendframework/zendframework/library/Zend/Test/README.md diff --git a/vendor/ZF2/library/Zend/Test/composer.json b/vendor/zendframework/zendframework/library/Zend/Test/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Test/composer.json rename to vendor/zendframework/zendframework/library/Zend/Test/composer.json diff --git a/vendor/ZF2/library/Zend/Text/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Text/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Text/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Text/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Text/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Text/Exception/OutOfBoundsException.php b/vendor/zendframework/zendframework/library/Zend/Text/Exception/OutOfBoundsException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Exception/OutOfBoundsException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Exception/OutOfBoundsException.php diff --git a/vendor/ZF2/library/Zend/Text/Exception/OverflowException.php b/vendor/zendframework/zendframework/library/Zend/Text/Exception/OverflowException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Exception/OverflowException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Exception/OverflowException.php diff --git a/vendor/ZF2/library/Zend/Text/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Text/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Text/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Text/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Text/Figlet/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Text/Figlet/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Figlet/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Text/Figlet/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Text/Figlet/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Text/Figlet/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Figlet/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Figlet/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Text/Figlet/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Text/Figlet/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Figlet/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Figlet/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Text/Figlet/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Text/Figlet/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Figlet/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Figlet/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Text/Figlet/Figlet.php b/vendor/zendframework/zendframework/library/Zend/Text/Figlet/Figlet.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Figlet/Figlet.php rename to vendor/zendframework/zendframework/library/Zend/Text/Figlet/Figlet.php diff --git a/vendor/ZF2/library/Zend/Text/Figlet/zend-framework.flf b/vendor/zendframework/zendframework/library/Zend/Text/Figlet/zend-framework.flf similarity index 100% rename from vendor/ZF2/library/Zend/Text/Figlet/zend-framework.flf rename to vendor/zendframework/zendframework/library/Zend/Text/Figlet/zend-framework.flf diff --git a/vendor/ZF2/library/Zend/Text/MultiByte.php b/vendor/zendframework/zendframework/library/Zend/Text/MultiByte.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/MultiByte.php rename to vendor/zendframework/zendframework/library/Zend/Text/MultiByte.php diff --git a/vendor/ZF2/library/Zend/Text/README.md b/vendor/zendframework/zendframework/library/Zend/Text/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Text/README.md rename to vendor/zendframework/zendframework/library/Zend/Text/README.md diff --git a/vendor/ZF2/library/Zend/Text/Table/Column.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Column.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Column.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Column.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Decorator/Ascii.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Decorator/Ascii.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Decorator/Ascii.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Decorator/Ascii.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Decorator/Blank.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Decorator/Blank.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Decorator/Blank.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Decorator/Blank.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Decorator/DecoratorInterface.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Decorator/DecoratorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Decorator/DecoratorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Decorator/DecoratorInterface.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Decorator/Unicode.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Decorator/Unicode.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Decorator/Unicode.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Decorator/Unicode.php diff --git a/vendor/ZF2/library/Zend/Text/Table/DecoratorManager.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/DecoratorManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/DecoratorManager.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/DecoratorManager.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Exception/InvalidDecoratorException.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/InvalidDecoratorException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Exception/InvalidDecoratorException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/InvalidDecoratorException.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Exception/OutOfBoundsException.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/OutOfBoundsException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Exception/OutOfBoundsException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/OutOfBoundsException.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Exception/OverflowException.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/OverflowException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Exception/OverflowException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/OverflowException.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Exception/UnexpectedValueException.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Exception/UnexpectedValueException.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Row.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Row.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Row.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Row.php diff --git a/vendor/ZF2/library/Zend/Text/Table/Table.php b/vendor/zendframework/zendframework/library/Zend/Text/Table/Table.php similarity index 100% rename from vendor/ZF2/library/Zend/Text/Table/Table.php rename to vendor/zendframework/zendframework/library/Zend/Text/Table/Table.php diff --git a/vendor/ZF2/library/Zend/Text/composer.json b/vendor/zendframework/zendframework/library/Zend/Text/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Text/composer.json rename to vendor/zendframework/zendframework/library/Zend/Text/composer.json diff --git a/vendor/ZF2/library/Zend/Uri/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Uri/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Uri/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Uri/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Uri/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Uri/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Uri/Exception/InvalidUriException.php b/vendor/zendframework/zendframework/library/Zend/Uri/Exception/InvalidUriException.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/Exception/InvalidUriException.php rename to vendor/zendframework/zendframework/library/Zend/Uri/Exception/InvalidUriException.php diff --git a/vendor/ZF2/library/Zend/Uri/Exception/InvalidUriPartException.php b/vendor/zendframework/zendframework/library/Zend/Uri/Exception/InvalidUriPartException.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/Exception/InvalidUriPartException.php rename to vendor/zendframework/zendframework/library/Zend/Uri/Exception/InvalidUriPartException.php diff --git a/vendor/ZF2/library/Zend/Uri/File.php b/vendor/zendframework/zendframework/library/Zend/Uri/File.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/File.php rename to vendor/zendframework/zendframework/library/Zend/Uri/File.php diff --git a/vendor/ZF2/library/Zend/Uri/Http.php b/vendor/zendframework/zendframework/library/Zend/Uri/Http.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/Http.php rename to vendor/zendframework/zendframework/library/Zend/Uri/Http.php diff --git a/vendor/ZF2/library/Zend/Uri/Mailto.php b/vendor/zendframework/zendframework/library/Zend/Uri/Mailto.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/Mailto.php rename to vendor/zendframework/zendframework/library/Zend/Uri/Mailto.php diff --git a/vendor/ZF2/library/Zend/Uri/README.md b/vendor/zendframework/zendframework/library/Zend/Uri/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Uri/README.md rename to vendor/zendframework/zendframework/library/Zend/Uri/README.md diff --git a/vendor/ZF2/library/Zend/Uri/Uri.php b/vendor/zendframework/zendframework/library/Zend/Uri/Uri.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/Uri.php rename to vendor/zendframework/zendframework/library/Zend/Uri/Uri.php diff --git a/vendor/ZF2/library/Zend/Uri/UriFactory.php b/vendor/zendframework/zendframework/library/Zend/Uri/UriFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/UriFactory.php rename to vendor/zendframework/zendframework/library/Zend/Uri/UriFactory.php diff --git a/vendor/ZF2/library/Zend/Uri/UriInterface.php b/vendor/zendframework/zendframework/library/Zend/Uri/UriInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Uri/UriInterface.php rename to vendor/zendframework/zendframework/library/Zend/Uri/UriInterface.php diff --git a/vendor/ZF2/library/Zend/Uri/composer.json b/vendor/zendframework/zendframework/library/Zend/Uri/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Uri/composer.json rename to vendor/zendframework/zendframework/library/Zend/Uri/composer.json diff --git a/vendor/ZF2/library/Zend/Validator/AbstractValidator.php b/vendor/zendframework/zendframework/library/Zend/Validator/AbstractValidator.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/AbstractValidator.php rename to vendor/zendframework/zendframework/library/Zend/Validator/AbstractValidator.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/AbstractAdapter.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/AbstractAdapter.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/AbstractAdapter.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/AbstractAdapter.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/AdapterInterface.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/AdapterInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/AdapterInterface.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/AdapterInterface.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Codabar.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Codabar.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Codabar.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Codabar.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Code128.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code128.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Code128.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code128.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Code25.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code25.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Code25.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code25.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Code25interleaved.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code25interleaved.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Code25interleaved.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code25interleaved.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Code39.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code39.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Code39.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code39.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Code39ext.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code39ext.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Code39ext.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code39ext.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Code93.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code93.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Code93.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code93.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Code93ext.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code93ext.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Code93ext.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Code93ext.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Ean12.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean12.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Ean12.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean12.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Ean13.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean13.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Ean13.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean13.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Ean14.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean14.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Ean14.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean14.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Ean18.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean18.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Ean18.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean18.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Ean2.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean2.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Ean2.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean2.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Ean5.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean5.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Ean5.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean5.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Ean8.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean8.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Ean8.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Ean8.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Gtin12.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Gtin12.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Gtin12.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Gtin12.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Gtin13.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Gtin13.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Gtin13.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Gtin13.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Gtin14.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Gtin14.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Gtin14.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Gtin14.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Identcode.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Identcode.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Identcode.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Identcode.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Intelligentmail.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Intelligentmail.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Intelligentmail.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Intelligentmail.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Issn.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Issn.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Issn.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Issn.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Itf14.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Itf14.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Itf14.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Itf14.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Leitcode.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Leitcode.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Leitcode.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Leitcode.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Planet.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Planet.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Planet.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Planet.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Postnet.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Postnet.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Postnet.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Postnet.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Royalmail.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Royalmail.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Royalmail.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Royalmail.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Sscc.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Sscc.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Sscc.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Sscc.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Upca.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Upca.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Upca.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Upca.php diff --git a/vendor/ZF2/library/Zend/Validator/Barcode/Upce.php b/vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Upce.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Barcode/Upce.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Barcode/Upce.php diff --git a/vendor/ZF2/library/Zend/Validator/Between.php b/vendor/zendframework/zendframework/library/Zend/Validator/Between.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Between.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Between.php diff --git a/vendor/ZF2/library/Zend/Validator/Callback.php b/vendor/zendframework/zendframework/library/Zend/Validator/Callback.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Callback.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Callback.php diff --git a/vendor/ZF2/library/Zend/Validator/CreditCard.php b/vendor/zendframework/zendframework/library/Zend/Validator/CreditCard.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/CreditCard.php rename to vendor/zendframework/zendframework/library/Zend/Validator/CreditCard.php diff --git a/vendor/ZF2/library/Zend/Validator/Csrf.php b/vendor/zendframework/zendframework/library/Zend/Validator/Csrf.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Csrf.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Csrf.php diff --git a/vendor/ZF2/library/Zend/Validator/Date.php b/vendor/zendframework/zendframework/library/Zend/Validator/Date.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Date.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Date.php diff --git a/vendor/ZF2/library/Zend/Validator/DateStep.php b/vendor/zendframework/zendframework/library/Zend/Validator/DateStep.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/DateStep.php rename to vendor/zendframework/zendframework/library/Zend/Validator/DateStep.php diff --git a/vendor/ZF2/library/Zend/Validator/Db/AbstractDb.php b/vendor/zendframework/zendframework/library/Zend/Validator/Db/AbstractDb.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Db/AbstractDb.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Db/AbstractDb.php diff --git a/vendor/ZF2/library/Zend/Validator/Db/NoRecordExists.php b/vendor/zendframework/zendframework/library/Zend/Validator/Db/NoRecordExists.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Db/NoRecordExists.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Db/NoRecordExists.php diff --git a/vendor/ZF2/library/Zend/Validator/Db/RecordExists.php b/vendor/zendframework/zendframework/library/Zend/Validator/Db/RecordExists.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Db/RecordExists.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Db/RecordExists.php diff --git a/vendor/ZF2/library/Zend/Validator/Digits.php b/vendor/zendframework/zendframework/library/Zend/Validator/Digits.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Digits.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Digits.php diff --git a/vendor/ZF2/library/Zend/Validator/EmailAddress.php b/vendor/zendframework/zendframework/library/Zend/Validator/EmailAddress.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/EmailAddress.php rename to vendor/zendframework/zendframework/library/Zend/Validator/EmailAddress.php diff --git a/vendor/ZF2/library/Zend/Validator/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/Validator/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/Validator/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/Validator/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/Validator/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zendframework/library/Zend/Validator/Exception/ExtensionNotLoadedException.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Exception/ExtensionNotLoadedException.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Exception/ExtensionNotLoadedException.php diff --git a/vendor/ZF2/library/Zend/Validator/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/Validator/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/Validator/Exception/InvalidMagicMimeFileException.php b/vendor/zendframework/zendframework/library/Zend/Validator/Exception/InvalidMagicMimeFileException.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Exception/InvalidMagicMimeFileException.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Exception/InvalidMagicMimeFileException.php diff --git a/vendor/ZF2/library/Zend/Validator/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/Validator/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/Validator/Explode.php b/vendor/zendframework/zendframework/library/Zend/Validator/Explode.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Explode.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Explode.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Count.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Count.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Count.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Count.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Crc32.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Crc32.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Crc32.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Crc32.php diff --git a/vendor/ZF2/library/Zend/Validator/File/ExcludeExtension.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/ExcludeExtension.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/ExcludeExtension.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/ExcludeExtension.php diff --git a/vendor/ZF2/library/Zend/Validator/File/ExcludeMimeType.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/ExcludeMimeType.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/ExcludeMimeType.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/ExcludeMimeType.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Exists.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Exists.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Exists.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Exists.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Extension.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Extension.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Extension.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Extension.php diff --git a/vendor/ZF2/library/Zend/Validator/File/FilesSize.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/FilesSize.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/FilesSize.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/FilesSize.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Hash.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Hash.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Hash.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Hash.php diff --git a/vendor/ZF2/library/Zend/Validator/File/ImageSize.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/ImageSize.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/ImageSize.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/ImageSize.php diff --git a/vendor/ZF2/library/Zend/Validator/File/IsCompressed.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/IsCompressed.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/IsCompressed.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/IsCompressed.php diff --git a/vendor/ZF2/library/Zend/Validator/File/IsImage.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/IsImage.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/IsImage.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/IsImage.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Md5.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Md5.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Md5.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Md5.php diff --git a/vendor/ZF2/library/Zend/Validator/File/MimeType.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/MimeType.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/MimeType.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/MimeType.php diff --git a/vendor/ZF2/library/Zend/Validator/File/NotExists.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/NotExists.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/NotExists.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/NotExists.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Sha1.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Sha1.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Sha1.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Sha1.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Size.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Size.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Size.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Size.php diff --git a/vendor/ZF2/library/Zend/Validator/File/Upload.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/Upload.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/Upload.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/Upload.php diff --git a/vendor/ZF2/library/Zend/Validator/File/UploadFile.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/UploadFile.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/UploadFile.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/UploadFile.php diff --git a/vendor/ZF2/library/Zend/Validator/File/WordCount.php b/vendor/zendframework/zendframework/library/Zend/Validator/File/WordCount.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/File/WordCount.php rename to vendor/zendframework/zendframework/library/Zend/Validator/File/WordCount.php diff --git a/vendor/ZF2/library/Zend/Validator/GreaterThan.php b/vendor/zendframework/zendframework/library/Zend/Validator/GreaterThan.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/GreaterThan.php rename to vendor/zendframework/zendframework/library/Zend/Validator/GreaterThan.php diff --git a/vendor/ZF2/library/Zend/Validator/Hex.php b/vendor/zendframework/zendframework/library/Zend/Validator/Hex.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Hex.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Hex.php diff --git a/vendor/ZF2/library/Zend/Validator/Hostname.php b/vendor/zendframework/zendframework/library/Zend/Validator/Hostname.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Hostname.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Hostname.php diff --git a/vendor/ZF2/library/Zend/Validator/Hostname/Biz.php b/vendor/zendframework/zendframework/library/Zend/Validator/Hostname/Biz.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Hostname/Biz.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Hostname/Biz.php diff --git a/vendor/ZF2/library/Zend/Validator/Hostname/Cn.php b/vendor/zendframework/zendframework/library/Zend/Validator/Hostname/Cn.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Hostname/Cn.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Hostname/Cn.php diff --git a/vendor/ZF2/library/Zend/Validator/Hostname/Com.php b/vendor/zendframework/zendframework/library/Zend/Validator/Hostname/Com.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Hostname/Com.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Hostname/Com.php diff --git a/vendor/ZF2/library/Zend/Validator/Hostname/Jp.php b/vendor/zendframework/zendframework/library/Zend/Validator/Hostname/Jp.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Hostname/Jp.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Hostname/Jp.php diff --git a/vendor/ZF2/library/Zend/Validator/Iban.php b/vendor/zendframework/zendframework/library/Zend/Validator/Iban.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Iban.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Iban.php diff --git a/vendor/ZF2/library/Zend/Validator/Identical.php b/vendor/zendframework/zendframework/library/Zend/Validator/Identical.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Identical.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Identical.php diff --git a/vendor/ZF2/library/Zend/Validator/InArray.php b/vendor/zendframework/zendframework/library/Zend/Validator/InArray.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/InArray.php rename to vendor/zendframework/zendframework/library/Zend/Validator/InArray.php diff --git a/vendor/ZF2/library/Zend/Validator/Ip.php b/vendor/zendframework/zendframework/library/Zend/Validator/Ip.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Ip.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Ip.php diff --git a/vendor/ZF2/library/Zend/Validator/IsInstanceOf.php b/vendor/zendframework/zendframework/library/Zend/Validator/IsInstanceOf.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/IsInstanceOf.php rename to vendor/zendframework/zendframework/library/Zend/Validator/IsInstanceOf.php diff --git a/vendor/ZF2/library/Zend/Validator/Isbn.php b/vendor/zendframework/zendframework/library/Zend/Validator/Isbn.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Isbn.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Isbn.php diff --git a/vendor/ZF2/library/Zend/Validator/LessThan.php b/vendor/zendframework/zendframework/library/Zend/Validator/LessThan.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/LessThan.php rename to vendor/zendframework/zendframework/library/Zend/Validator/LessThan.php diff --git a/vendor/ZF2/library/Zend/Validator/NotEmpty.php b/vendor/zendframework/zendframework/library/Zend/Validator/NotEmpty.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/NotEmpty.php rename to vendor/zendframework/zendframework/library/Zend/Validator/NotEmpty.php diff --git a/vendor/ZF2/library/Zend/Validator/README.md b/vendor/zendframework/zendframework/library/Zend/Validator/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Validator/README.md rename to vendor/zendframework/zendframework/library/Zend/Validator/README.md diff --git a/vendor/ZF2/library/Zend/Validator/Regex.php b/vendor/zendframework/zendframework/library/Zend/Validator/Regex.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Regex.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Regex.php diff --git a/vendor/ZF2/library/Zend/Validator/Sitemap/Changefreq.php b/vendor/zendframework/zendframework/library/Zend/Validator/Sitemap/Changefreq.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Sitemap/Changefreq.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Sitemap/Changefreq.php diff --git a/vendor/ZF2/library/Zend/Validator/Sitemap/Lastmod.php b/vendor/zendframework/zendframework/library/Zend/Validator/Sitemap/Lastmod.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Sitemap/Lastmod.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Sitemap/Lastmod.php diff --git a/vendor/ZF2/library/Zend/Validator/Sitemap/Loc.php b/vendor/zendframework/zendframework/library/Zend/Validator/Sitemap/Loc.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Sitemap/Loc.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Sitemap/Loc.php diff --git a/vendor/ZF2/library/Zend/Validator/Sitemap/Priority.php b/vendor/zendframework/zendframework/library/Zend/Validator/Sitemap/Priority.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Sitemap/Priority.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Sitemap/Priority.php diff --git a/vendor/ZF2/library/Zend/Validator/StaticValidator.php b/vendor/zendframework/zendframework/library/Zend/Validator/StaticValidator.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/StaticValidator.php rename to vendor/zendframework/zendframework/library/Zend/Validator/StaticValidator.php diff --git a/vendor/ZF2/library/Zend/Validator/Step.php b/vendor/zendframework/zendframework/library/Zend/Validator/Step.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Step.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Step.php diff --git a/vendor/ZF2/library/Zend/Validator/StringLength.php b/vendor/zendframework/zendframework/library/Zend/Validator/StringLength.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/StringLength.php rename to vendor/zendframework/zendframework/library/Zend/Validator/StringLength.php diff --git a/vendor/ZF2/library/Zend/Validator/Uri.php b/vendor/zendframework/zendframework/library/Zend/Validator/Uri.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/Uri.php rename to vendor/zendframework/zendframework/library/Zend/Validator/Uri.php diff --git a/vendor/ZF2/library/Zend/Validator/ValidatorChain.php b/vendor/zendframework/zendframework/library/Zend/Validator/ValidatorChain.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/ValidatorChain.php rename to vendor/zendframework/zendframework/library/Zend/Validator/ValidatorChain.php diff --git a/vendor/ZF2/library/Zend/Validator/ValidatorInterface.php b/vendor/zendframework/zendframework/library/Zend/Validator/ValidatorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/ValidatorInterface.php rename to vendor/zendframework/zendframework/library/Zend/Validator/ValidatorInterface.php diff --git a/vendor/ZF2/library/Zend/Validator/ValidatorPluginManager.php b/vendor/zendframework/zendframework/library/Zend/Validator/ValidatorPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/Validator/ValidatorPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/Validator/ValidatorPluginManager.php diff --git a/vendor/ZF2/library/Zend/Validator/composer.json b/vendor/zendframework/zendframework/library/Zend/Validator/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Validator/composer.json rename to vendor/zendframework/zendframework/library/Zend/Validator/composer.json diff --git a/vendor/ZF2/library/Zend/Version/README.md b/vendor/zendframework/zendframework/library/Zend/Version/README.md similarity index 100% rename from vendor/ZF2/library/Zend/Version/README.md rename to vendor/zendframework/zendframework/library/Zend/Version/README.md diff --git a/vendor/ZF2/library/Zend/Version/Version.php b/vendor/zendframework/zendframework/library/Zend/Version/Version.php similarity index 100% rename from vendor/ZF2/library/Zend/Version/Version.php rename to vendor/zendframework/zendframework/library/Zend/Version/Version.php diff --git a/vendor/ZF2/library/Zend/Version/composer.json b/vendor/zendframework/zendframework/library/Zend/Version/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/Version/composer.json rename to vendor/zendframework/zendframework/library/Zend/Version/composer.json diff --git a/vendor/ZF2/library/Zend/View/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/View/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/View/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/View/Exception/DomainException.php b/vendor/zendframework/zendframework/library/Zend/View/Exception/DomainException.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Exception/DomainException.php rename to vendor/zendframework/zendframework/library/Zend/View/Exception/DomainException.php diff --git a/vendor/ZF2/library/Zend/View/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/View/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/View/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/View/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/View/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/View/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/View/Exception/InvalidHelperException.php b/vendor/zendframework/zendframework/library/Zend/View/Exception/InvalidHelperException.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Exception/InvalidHelperException.php rename to vendor/zendframework/zendframework/library/Zend/View/Exception/InvalidHelperException.php diff --git a/vendor/ZF2/library/Zend/View/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/View/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/View/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/View/Helper/AbstractHelper.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/AbstractHelper.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/AbstractHelper.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/AbstractHelper.php diff --git a/vendor/ZF2/library/Zend/View/Helper/AbstractHtmlElement.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/AbstractHtmlElement.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/AbstractHtmlElement.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/AbstractHtmlElement.php diff --git a/vendor/ZF2/library/Zend/View/Helper/BasePath.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/BasePath.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/BasePath.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/BasePath.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Cycle.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Cycle.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Cycle.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Cycle.php diff --git a/vendor/ZF2/library/Zend/View/Helper/DeclareVars.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/DeclareVars.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/DeclareVars.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/DeclareVars.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Doctype.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Doctype.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Doctype.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Doctype.php diff --git a/vendor/ZF2/library/Zend/View/Helper/EscapeCss.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeCss.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/EscapeCss.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeCss.php diff --git a/vendor/ZF2/library/Zend/View/Helper/EscapeHtml.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeHtml.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/EscapeHtml.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeHtml.php diff --git a/vendor/ZF2/library/Zend/View/Helper/EscapeHtmlAttr.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeHtmlAttr.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/EscapeHtmlAttr.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeHtmlAttr.php diff --git a/vendor/ZF2/library/Zend/View/Helper/EscapeJs.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeJs.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/EscapeJs.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeJs.php diff --git a/vendor/ZF2/library/Zend/View/Helper/EscapeUrl.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeUrl.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/EscapeUrl.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/EscapeUrl.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Escaper/AbstractHelper.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Escaper/AbstractHelper.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Escaper/AbstractHelper.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Escaper/AbstractHelper.php diff --git a/vendor/ZF2/library/Zend/View/Helper/FlashMessenger.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/FlashMessenger.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/FlashMessenger.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/FlashMessenger.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Gravatar.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Gravatar.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Gravatar.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Gravatar.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HeadLink.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HeadLink.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HeadLink.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HeadLink.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HeadMeta.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HeadMeta.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HeadMeta.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HeadMeta.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HeadScript.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HeadScript.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HeadScript.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HeadScript.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HeadStyle.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HeadStyle.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HeadStyle.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HeadStyle.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HeadTitle.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HeadTitle.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HeadTitle.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HeadTitle.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HelperInterface.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HelperInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HelperInterface.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HelperInterface.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HtmlFlash.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlFlash.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HtmlFlash.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlFlash.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HtmlList.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlList.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HtmlList.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlList.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HtmlObject.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlObject.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HtmlObject.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlObject.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HtmlPage.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlPage.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HtmlPage.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlPage.php diff --git a/vendor/ZF2/library/Zend/View/Helper/HtmlQuicktime.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlQuicktime.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/HtmlQuicktime.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/HtmlQuicktime.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Identity.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Identity.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Identity.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Identity.php diff --git a/vendor/ZF2/library/Zend/View/Helper/InlineScript.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/InlineScript.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/InlineScript.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/InlineScript.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Json.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Json.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Json.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Json.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Layout.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Layout.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Layout.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Layout.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Navigation.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation/AbstractHelper.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/AbstractHelper.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Navigation/AbstractHelper.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/AbstractHelper.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation/Breadcrumbs.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/Breadcrumbs.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Navigation/Breadcrumbs.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/Breadcrumbs.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation/HelperInterface.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/HelperInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Navigation/HelperInterface.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/HelperInterface.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation/Links.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/Links.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Navigation/Links.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/Links.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation/Menu.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/Menu.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Navigation/Menu.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/Menu.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation/PluginManager.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/PluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Navigation/PluginManager.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/PluginManager.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Navigation/Sitemap.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/Sitemap.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Navigation/Sitemap.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Navigation/Sitemap.php diff --git a/vendor/ZF2/library/Zend/View/Helper/PaginationControl.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/PaginationControl.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/PaginationControl.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/PaginationControl.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Partial.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Partial.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Partial.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Partial.php diff --git a/vendor/ZF2/library/Zend/View/Helper/PartialLoop.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/PartialLoop.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/PartialLoop.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/PartialLoop.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Placeholder.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Placeholder.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Placeholder/Container.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder/Container.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Placeholder/Container.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder/Container.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Placeholder/Container/AbstractContainer.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder/Container/AbstractContainer.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Placeholder/Container/AbstractContainer.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder/Container/AbstractContainer.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Placeholder/Container/AbstractStandalone.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder/Container/AbstractStandalone.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Placeholder/Container/AbstractStandalone.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder/Container/AbstractStandalone.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Placeholder/Registry.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder/Registry.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Placeholder/Registry.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Placeholder/Registry.php diff --git a/vendor/ZF2/library/Zend/View/Helper/RenderChildModel.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/RenderChildModel.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/RenderChildModel.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/RenderChildModel.php diff --git a/vendor/ZF2/library/Zend/View/Helper/RenderToPlaceholder.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/RenderToPlaceholder.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/RenderToPlaceholder.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/RenderToPlaceholder.php diff --git a/vendor/ZF2/library/Zend/View/Helper/ServerUrl.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/ServerUrl.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/ServerUrl.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/ServerUrl.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Service/FlashMessengerFactory.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Service/FlashMessengerFactory.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Service/FlashMessengerFactory.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Service/FlashMessengerFactory.php diff --git a/vendor/ZF2/library/Zend/View/Helper/Url.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/Url.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/Url.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/Url.php diff --git a/vendor/ZF2/library/Zend/View/Helper/ViewModel.php b/vendor/zendframework/zendframework/library/Zend/View/Helper/ViewModel.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Helper/ViewModel.php rename to vendor/zendframework/zendframework/library/Zend/View/Helper/ViewModel.php diff --git a/vendor/ZF2/library/Zend/View/HelperPluginManager.php b/vendor/zendframework/zendframework/library/Zend/View/HelperPluginManager.php similarity index 100% rename from vendor/ZF2/library/Zend/View/HelperPluginManager.php rename to vendor/zendframework/zendframework/library/Zend/View/HelperPluginManager.php diff --git a/vendor/ZF2/library/Zend/View/Model/ClearableModelInterface.php b/vendor/zendframework/zendframework/library/Zend/View/Model/ClearableModelInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Model/ClearableModelInterface.php rename to vendor/zendframework/zendframework/library/Zend/View/Model/ClearableModelInterface.php diff --git a/vendor/ZF2/library/Zend/View/Model/ConsoleModel.php b/vendor/zendframework/zendframework/library/Zend/View/Model/ConsoleModel.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Model/ConsoleModel.php rename to vendor/zendframework/zendframework/library/Zend/View/Model/ConsoleModel.php diff --git a/vendor/ZF2/library/Zend/View/Model/FeedModel.php b/vendor/zendframework/zendframework/library/Zend/View/Model/FeedModel.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Model/FeedModel.php rename to vendor/zendframework/zendframework/library/Zend/View/Model/FeedModel.php diff --git a/vendor/ZF2/library/Zend/View/Model/JsonModel.php b/vendor/zendframework/zendframework/library/Zend/View/Model/JsonModel.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Model/JsonModel.php rename to vendor/zendframework/zendframework/library/Zend/View/Model/JsonModel.php diff --git a/vendor/ZF2/library/Zend/View/Model/ModelInterface.php b/vendor/zendframework/zendframework/library/Zend/View/Model/ModelInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Model/ModelInterface.php rename to vendor/zendframework/zendframework/library/Zend/View/Model/ModelInterface.php diff --git a/vendor/ZF2/library/Zend/View/Model/ViewModel.php b/vendor/zendframework/zendframework/library/Zend/View/Model/ViewModel.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Model/ViewModel.php rename to vendor/zendframework/zendframework/library/Zend/View/Model/ViewModel.php diff --git a/vendor/ZF2/library/Zend/View/README.md b/vendor/zendframework/zendframework/library/Zend/View/README.md similarity index 100% rename from vendor/ZF2/library/Zend/View/README.md rename to vendor/zendframework/zendframework/library/Zend/View/README.md diff --git a/vendor/ZF2/library/Zend/View/Renderer/ConsoleRenderer.php b/vendor/zendframework/zendframework/library/Zend/View/Renderer/ConsoleRenderer.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Renderer/ConsoleRenderer.php rename to vendor/zendframework/zendframework/library/Zend/View/Renderer/ConsoleRenderer.php diff --git a/vendor/ZF2/library/Zend/View/Renderer/FeedRenderer.php b/vendor/zendframework/zendframework/library/Zend/View/Renderer/FeedRenderer.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Renderer/FeedRenderer.php rename to vendor/zendframework/zendframework/library/Zend/View/Renderer/FeedRenderer.php diff --git a/vendor/ZF2/library/Zend/View/Renderer/JsonRenderer.php b/vendor/zendframework/zendframework/library/Zend/View/Renderer/JsonRenderer.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Renderer/JsonRenderer.php rename to vendor/zendframework/zendframework/library/Zend/View/Renderer/JsonRenderer.php diff --git a/vendor/ZF2/library/Zend/View/Renderer/PhpRenderer.php b/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Renderer/PhpRenderer.php rename to vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php diff --git a/vendor/ZF2/library/Zend/View/Renderer/RendererInterface.php b/vendor/zendframework/zendframework/library/Zend/View/Renderer/RendererInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Renderer/RendererInterface.php rename to vendor/zendframework/zendframework/library/Zend/View/Renderer/RendererInterface.php diff --git a/vendor/ZF2/library/Zend/View/Renderer/TreeRendererInterface.php b/vendor/zendframework/zendframework/library/Zend/View/Renderer/TreeRendererInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Renderer/TreeRendererInterface.php rename to vendor/zendframework/zendframework/library/Zend/View/Renderer/TreeRendererInterface.php diff --git a/vendor/ZF2/library/Zend/View/Resolver/AggregateResolver.php b/vendor/zendframework/zendframework/library/Zend/View/Resolver/AggregateResolver.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Resolver/AggregateResolver.php rename to vendor/zendframework/zendframework/library/Zend/View/Resolver/AggregateResolver.php diff --git a/vendor/ZF2/library/Zend/View/Resolver/ResolverInterface.php b/vendor/zendframework/zendframework/library/Zend/View/Resolver/ResolverInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Resolver/ResolverInterface.php rename to vendor/zendframework/zendframework/library/Zend/View/Resolver/ResolverInterface.php diff --git a/vendor/ZF2/library/Zend/View/Resolver/TemplateMapResolver.php b/vendor/zendframework/zendframework/library/Zend/View/Resolver/TemplateMapResolver.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Resolver/TemplateMapResolver.php rename to vendor/zendframework/zendframework/library/Zend/View/Resolver/TemplateMapResolver.php diff --git a/vendor/ZF2/library/Zend/View/Resolver/TemplatePathStack.php b/vendor/zendframework/zendframework/library/Zend/View/Resolver/TemplatePathStack.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Resolver/TemplatePathStack.php rename to vendor/zendframework/zendframework/library/Zend/View/Resolver/TemplatePathStack.php diff --git a/vendor/ZF2/library/Zend/View/Strategy/FeedStrategy.php b/vendor/zendframework/zendframework/library/Zend/View/Strategy/FeedStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Strategy/FeedStrategy.php rename to vendor/zendframework/zendframework/library/Zend/View/Strategy/FeedStrategy.php diff --git a/vendor/ZF2/library/Zend/View/Strategy/JsonStrategy.php b/vendor/zendframework/zendframework/library/Zend/View/Strategy/JsonStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Strategy/JsonStrategy.php rename to vendor/zendframework/zendframework/library/Zend/View/Strategy/JsonStrategy.php diff --git a/vendor/ZF2/library/Zend/View/Strategy/PhpRendererStrategy.php b/vendor/zendframework/zendframework/library/Zend/View/Strategy/PhpRendererStrategy.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Strategy/PhpRendererStrategy.php rename to vendor/zendframework/zendframework/library/Zend/View/Strategy/PhpRendererStrategy.php diff --git a/vendor/ZF2/library/Zend/View/Stream.php b/vendor/zendframework/zendframework/library/Zend/View/Stream.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Stream.php rename to vendor/zendframework/zendframework/library/Zend/View/Stream.php diff --git a/vendor/ZF2/library/Zend/View/Variables.php b/vendor/zendframework/zendframework/library/Zend/View/Variables.php similarity index 100% rename from vendor/ZF2/library/Zend/View/Variables.php rename to vendor/zendframework/zendframework/library/Zend/View/Variables.php diff --git a/vendor/ZF2/library/Zend/View/View.php b/vendor/zendframework/zendframework/library/Zend/View/View.php similarity index 100% rename from vendor/ZF2/library/Zend/View/View.php rename to vendor/zendframework/zendframework/library/Zend/View/View.php diff --git a/vendor/ZF2/library/Zend/View/ViewEvent.php b/vendor/zendframework/zendframework/library/Zend/View/ViewEvent.php similarity index 100% rename from vendor/ZF2/library/Zend/View/ViewEvent.php rename to vendor/zendframework/zendframework/library/Zend/View/ViewEvent.php diff --git a/vendor/ZF2/library/Zend/View/composer.json b/vendor/zendframework/zendframework/library/Zend/View/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/View/composer.json rename to vendor/zendframework/zendframework/library/Zend/View/composer.json diff --git a/vendor/ZF2/library/Zend/XmlRpc/AbstractValue.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/AbstractValue.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/AbstractValue.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/AbstractValue.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client/Exception/FaultException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/FaultException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client/Exception/FaultException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/FaultException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client/Exception/HttpException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/HttpException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client/Exception/HttpException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/HttpException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client/Exception/IntrospectException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/IntrospectException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client/Exception/IntrospectException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/IntrospectException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client/ServerIntrospection.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/ServerIntrospection.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client/ServerIntrospection.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/ServerIntrospection.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Client/ServerProxy.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/ServerProxy.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Client/ServerProxy.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Client/ServerProxy.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Exception/ValueException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/ValueException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Exception/ValueException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Exception/ValueException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Fault.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Fault.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Fault.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Fault.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Generator/AbstractGenerator.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Generator/AbstractGenerator.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Generator/AbstractGenerator.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Generator/AbstractGenerator.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Generator/DomDocument.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Generator/DomDocument.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Generator/DomDocument.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Generator/DomDocument.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Generator/GeneratorInterface.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Generator/GeneratorInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Generator/GeneratorInterface.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Generator/GeneratorInterface.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Generator/XmlWriter.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Generator/XmlWriter.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Generator/XmlWriter.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Generator/XmlWriter.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/README.md b/vendor/zendframework/zendframework/library/Zend/XmlRpc/README.md similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/README.md rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/README.md diff --git a/vendor/ZF2/library/Zend/XmlRpc/Request.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Request.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Request.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Request.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Request/Http.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Request/Http.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Request/Http.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Request/Http.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Request/Stdin.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Request/Stdin.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Request/Stdin.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Request/Stdin.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Response.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Response.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Response.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Response.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Response/Http.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Response/Http.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Response/Http.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Response/Http.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Server.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Server.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Server.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Server.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Server/Cache.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Cache.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Server/Cache.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Cache.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Server/Exception/BadMethodCallException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Exception/BadMethodCallException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Server/Exception/BadMethodCallException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Exception/BadMethodCallException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Server/Exception/ExceptionInterface.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Server/Exception/ExceptionInterface.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Exception/ExceptionInterface.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Server/Exception/InvalidArgumentException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Server/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Exception/InvalidArgumentException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Server/Exception/RuntimeException.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Exception/RuntimeException.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Server/Exception/RuntimeException.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Exception/RuntimeException.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Server/Fault.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Fault.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Server/Fault.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/Fault.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Server/System.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/System.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Server/System.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Server/System.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/AbstractCollection.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/AbstractCollection.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/AbstractCollection.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/AbstractCollection.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/AbstractScalar.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/AbstractScalar.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/AbstractScalar.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/AbstractScalar.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/ArrayValue.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/ArrayValue.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/ArrayValue.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/ArrayValue.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/Base64.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Base64.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/Base64.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Base64.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/BigInteger.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/BigInteger.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/BigInteger.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/BigInteger.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/Boolean.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Boolean.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/Boolean.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Boolean.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/DateTime.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/DateTime.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/DateTime.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/DateTime.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/Double.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Double.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/Double.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Double.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/Integer.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Integer.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/Integer.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Integer.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/Nil.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Nil.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/Nil.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Nil.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/String.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/String.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/String.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/String.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/Value/Struct.php b/vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Struct.php similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/Value/Struct.php rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/Value/Struct.php diff --git a/vendor/ZF2/library/Zend/XmlRpc/composer.json b/vendor/zendframework/zendframework/library/Zend/XmlRpc/composer.json similarity index 100% rename from vendor/ZF2/library/Zend/XmlRpc/composer.json rename to vendor/zendframework/zendframework/library/Zend/XmlRpc/composer.json diff --git a/vendor/ZF2/resources/composer.json b/vendor/zendframework/zendframework/resources/composer.json similarity index 100% rename from vendor/ZF2/resources/composer.json rename to vendor/zendframework/zendframework/resources/composer.json diff --git a/vendor/ZF2/resources/languages/ar/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/ar/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/ar/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/ar/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/ar/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/ar/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/ar/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/ar/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/bg/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/bg/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/bg/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/bg/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/bg/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/bg/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/bg/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/bg/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/cs/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/cs/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/cs/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/cs/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/cs/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/cs/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/cs/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/cs/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/de/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/de/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/de/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/de/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/de/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/de/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/de/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/de/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/en/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/en/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/en/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/en/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/en/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/en/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/en/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/en/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/es/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/es/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/es/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/es/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/fi/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/fi/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/fi/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/fi/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/fr/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/fr/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/fr/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/fr/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/fr/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/fr/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/fr/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/fr/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/hr/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/hr/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/hr/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/hr/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/it/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/it/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/it/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/it/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/it/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/it/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/it/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/it/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/ja/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/ja/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/ja/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/ja/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/nl/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/nl/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/nl/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/nl/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/no/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/no/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/no/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/no/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/no/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/no/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/no/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/no/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/pl/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/pl/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/pl/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/pl/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/pt_BR/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/pt_BR/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/pt_BR/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/pt_BR/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/pt_BR/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/pt_BR/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/pt_BR/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/pt_BR/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/ru/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/ru/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/ru/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/ru/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/se/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/se/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/se/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/se/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/se/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/se/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/se/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/se/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/sk/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/sk/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/sk/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/sk/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/sk/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/sk/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/sk/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/sk/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/sl/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/sl/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/sl/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/sl/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/sl/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/sl/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/sl/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/sl/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/sr/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/sr/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/sr/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/sr/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/tr/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/tr/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/tr/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/tr/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/tr/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/tr/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/tr/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/tr/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/uk/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/uk/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/uk/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/uk/Zend_Validate.php diff --git a/vendor/ZF2/resources/languages/zh/Zend_Captcha.php b/vendor/zendframework/zendframework/resources/languages/zh/Zend_Captcha.php similarity index 100% rename from vendor/ZF2/resources/languages/zh/Zend_Captcha.php rename to vendor/zendframework/zendframework/resources/languages/zh/Zend_Captcha.php diff --git a/vendor/ZF2/resources/languages/zh/Zend_Validate.php b/vendor/zendframework/zendframework/resources/languages/zh/Zend_Validate.php similarity index 100% rename from vendor/ZF2/resources/languages/zh/Zend_Validate.php rename to vendor/zendframework/zendframework/resources/languages/zh/Zend_Validate.php diff --git a/vendor/ZendRest/LICENSE.txt b/vendor/zendframework/zendrest/LICENSE.txt similarity index 100% rename from vendor/ZendRest/LICENSE.txt rename to vendor/zendframework/zendrest/LICENSE.txt diff --git a/vendor/zendframework/zendrest/README.md b/vendor/zendframework/zendrest/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4ad2722d2246b87a4ae739fa93794559468c4a14 --- /dev/null +++ b/vendor/zendframework/zendrest/README.md @@ -0,0 +1,11 @@ +ZendRest component + +You can install using: + +``` +curl -s https://getcomposer.org/installer | php +php composer.phar install +``` + +At that point, follow the instructions in the documentation folder for actual +usage of the component. (Documentation is forthcoming.) diff --git a/vendor/zendframework/zendrest/README.txt b/vendor/zendframework/zendrest/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..4bdc26cc6aa823a9a0bcc9cb83a64b2d44b3f79f --- /dev/null +++ b/vendor/zendframework/zendrest/README.txt @@ -0,0 +1,12 @@ +This is a composer based component package from Zend Framework. +The Zend Framework source for this package is located here: + + https://github.com/zendframework/zf2/ + +You can install using: + + curl -s https://getcomposer.org/installer | php + php composer.phar install + +At that point, follow the instructions in the documentation folder for actual +usage of the component. (Documentation is forthcoming.) \ No newline at end of file diff --git a/vendor/zendframework/zendrest/composer.json b/vendor/zendframework/zendrest/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..aee41b72c8ba1c8892438d89008da1eeae9c83cc --- /dev/null +++ b/vendor/zendframework/zendrest/composer.json @@ -0,0 +1 @@ +{"name":"zendframework\/zendrest","description":" ","type":"library","license":"BSD-3-Clause","keywords":["zf2","rest"],"homepage":"http:\/\/packages.zendframework.com\/","autoload":{"psr-0":{"ZendRest":"library\/"}},"repositories":[{"type":"composer","url":"http:\/\/packages.zendframework.com\/"}],"require":{"php":">=5.3.3","zendframework\/zend-http":">=2.0.0","zendframework\/zend-uri":">=2.0.0"},"extra":{"branch-alias":{"dev-master":"2.0.x-dev"}},"version":"2.0.1","dist":{"url":"http:\/\/packages.zendframework.com\/composer\/ZendRest-2.0.1.zip","type":"zip"}} \ No newline at end of file diff --git a/vendor/ZendRest/library/ZendRest/Client/Exception/ExceptionInterface.php b/vendor/zendframework/zendrest/library/ZendRest/Client/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZendRest/library/ZendRest/Client/Exception/ExceptionInterface.php rename to vendor/zendframework/zendrest/library/ZendRest/Client/Exception/ExceptionInterface.php diff --git a/vendor/ZendRest/library/ZendRest/Client/Exception/ResultException.php b/vendor/zendframework/zendrest/library/ZendRest/Client/Exception/ResultException.php similarity index 100% rename from vendor/ZendRest/library/ZendRest/Client/Exception/ResultException.php rename to vendor/zendframework/zendrest/library/ZendRest/Client/Exception/ResultException.php diff --git a/vendor/ZendRest/library/ZendRest/Client/Exception/UnexpectedValueException.php b/vendor/zendframework/zendrest/library/ZendRest/Client/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZendRest/library/ZendRest/Client/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendrest/library/ZendRest/Client/Exception/UnexpectedValueException.php diff --git a/vendor/ZendRest/library/ZendRest/Client/RestClient.php b/vendor/zendframework/zendrest/library/ZendRest/Client/RestClient.php similarity index 100% rename from vendor/ZendRest/library/ZendRest/Client/RestClient.php rename to vendor/zendframework/zendrest/library/ZendRest/Client/RestClient.php diff --git a/vendor/ZendRest/library/ZendRest/Client/Result.php b/vendor/zendframework/zendrest/library/ZendRest/Client/Result.php similarity index 100% rename from vendor/ZendRest/library/ZendRest/Client/Result.php rename to vendor/zendframework/zendrest/library/ZendRest/Client/Result.php diff --git a/vendor/ZendRest/library/ZendRest/Exception/ExceptionInterface.php b/vendor/zendframework/zendrest/library/ZendRest/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZendRest/library/ZendRest/Exception/ExceptionInterface.php rename to vendor/zendframework/zendrest/library/ZendRest/Exception/ExceptionInterface.php diff --git a/vendor/ZendRest/library/ZendRest/Exception/UnexpectedValueException.php b/vendor/zendframework/zendrest/library/ZendRest/Exception/UnexpectedValueException.php similarity index 100% rename from vendor/ZendRest/library/ZendRest/Exception/UnexpectedValueException.php rename to vendor/zendframework/zendrest/library/ZendRest/Exception/UnexpectedValueException.php diff --git a/vendor/zendframework/zendrest/tests/Bootstrap.php b/vendor/zendframework/zendrest/tests/Bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..40a74517b848a4592d9cca7046bda48c1d8f059f --- /dev/null +++ b/vendor/zendframework/zendrest/tests/Bootstrap.php @@ -0,0 +1,92 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend + */ + +/* + * Set error reporting to the level to which Zend Framework code must comply. + */ +error_reporting( E_ALL | E_STRICT ); + +$phpUnitVersion = PHPUnit_Runner_Version::id(); +if ('@package_version@' !== $phpUnitVersion && version_compare($phpUnitVersion, '3.5.0', '<')) { + echo 'This version of PHPUnit (' . PHPUnit_Runner_Version::id() . ') is not supported in Zend Framework 2.x unit tests.' . PHP_EOL; + exit(1); +} +unset($phpUnitVersion); + +/* + * Determine the root, library, and tests directories of the framework + * distribution. + */ +$zfRoot = realpath(dirname(__DIR__)); +$zfCoreLibrary = "$zfRoot/library"; +$zfCoreTests = "$zfRoot/tests"; + +/* + * Prepend the Zend Framework library/ and tests/ directories to the + * include_path. This allows the tests to run out of the box and helps prevent + * loading other copies of the framework code and tests that would supersede + * this copy. + */ +$path = array( + $zfCoreLibrary, + $zfCoreTests, + get_include_path(), +); +set_include_path(implode(PATH_SEPARATOR, $path)); + +/** + * Setup autoloading + */ +include __DIR__ . '/_autoload.php'; + +/* + * Load the user-defined test configuration file, if it exists; otherwise, load + * the default configuration. + */ +if (is_readable($zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php')) { + require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php'; +} else { + require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php.dist'; +} + +if (defined('TESTS_GENERATE_REPORT') && TESTS_GENERATE_REPORT === true) { + $codeCoverageFilter = PHP_CodeCoverage_Filter::getInstance(); + + $lastArg = end($_SERVER['argv']); + if (is_dir($zfCoreTests . '/' . $lastArg)) { + $codeCoverageFilter->addDirectoryToWhitelist($zfCoreLibrary . '/' . $lastArg); + } else if (is_file($zfCoreTests . '/' . $lastArg)) { + $codeCoverageFilter->addDirectoryToWhitelist(dirname($zfCoreLibrary . '/' . $lastArg)); + } else { + $codeCoverageFilter->addDirectoryToWhitelist($zfCoreLibrary); + } + + /* + * Omit from code coverage reports the contents of the tests directory + */ + $codeCoverageFilter->addDirectoryToBlacklist($zfCoreTests, ''); + $codeCoverageFilter->addDirectoryToBlacklist(PEAR_INSTALL_DIR, ''); + $codeCoverageFilter->addDirectoryToBlacklist(PHP_LIBDIR, ''); + + unset($codeCoverageFilter); +} + + +/** + * Start output buffering, if enabled + */ +if (defined('TESTS_ZEND_OB_ENABLED') && constant('TESTS_ZEND_OB_ENABLED')) { + ob_start(); +} + +/* + * Unset global variables that are no longer needed. + */ +unset($zfRoot, $zfCoreLibrary, $zfCoreTests, $path); diff --git a/vendor/zendframework/zendrest/tests/TestConfiguration.php.dist b/vendor/zendframework/zendrest/tests/TestConfiguration.php.dist new file mode 100644 index 0000000000000000000000000000000000000000..837f7dd78cbbbebd27c99b70c5d2160503f48816 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/TestConfiguration.php.dist @@ -0,0 +1,45 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package UnitTests + */ + +/** + * This file defines configuration for running the unit tests for the Zend + * Framework. Some tests have dependencies to PHP extensions or databases + * which may not necessary installed on the target system. For these cases, + * the ability to disable or configure testing is provided below. Tests for + * components which should run universally are always run by the master + * suite and cannot be disabled. + * + * Do not edit this file. Instead, copy this file to TestConfiguration.php, + * and edit the new file. Never commit passwords to the source code repository. + */ + +/** + * Use the notation: + * + * defined(...) || define(...); + * + * This ensures that, when a test is marked to run in a separate process, + * PHP will not complain of a constant already being defined. + */ + +/** + * GENERAL SETTINGS + * + * OB_ENABLED should be enabled for some tests to check if all functionality + * works as expected. Such tests include those for Zend\Soap and Zend\Session, + * which require that headers not be sent in order to work. + */ +defined('TESTS_ZEND_OB_ENABLED') || define('TESTS_ZEND_OB_ENABLED', false); + +/** + * PHPUnit Code Coverage / Test Report + */ +defined('TESTS_GENERATE_REPORT') || define('TESTS_GENERATE_REPORT', false); +defined('TESTS_GENERATE_REPORT_TARGET') || define('TESTS_GENERATE_REPORT_TARGET', '/path/to/target'); diff --git a/vendor/zendframework/zendrest/tests/TestConfiguration.php.travis b/vendor/zendframework/zendrest/tests/TestConfiguration.php.travis new file mode 100644 index 0000000000000000000000000000000000000000..f49b94cdbf96f412c2a337652947a128c0749c89 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/TestConfiguration.php.travis @@ -0,0 +1,20 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package UnitTests + */ + +/** + * This file defines specific configuration that differs from the standard configuration + * for running the unit tests with Travis-CI (http://www.travis-ci.org) + * + * See TestConfiguration.php.dist to get more details. + * + * Never commit passwords to the source code repository. + */ + +require_once __DIR__ . '/TestConfiguration.php.dist'; diff --git a/vendor/zendframework/zendrest/tests/ZendRest/ClientTest.php b/vendor/zendframework/zendrest/tests/ZendRest/ClientTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d1828b72e312849f3ef719773d9dbbfb02cc09fb --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/ClientTest.php @@ -0,0 +1,279 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Rest + */ + +namespace ZendRestTest; + +use ZendRest\Client; +use Zend\Uri; +use Zend\Http\Response; + +/** + * Test cases for RESTClient + * + * @category Zend + * @package Zend_Rest + * @subpackage UnitTests + * @group Zend_Rest + * @group Zend_Rest_Client + */ +class ClientTest extends \PHPUnit_Framework_TestCase +{ + public function setUp() + { + $this->path = __DIR__ . '/TestAsset/responses/'; + + $this->adapter = new \Zend\Http\Client\Adapter\Test(); + $client = new \Zend\Http\Client(null, array( + 'adapter' => $this->adapter + )); + + $this->rest = new Client\RestClient('http://framework.zend.com/'); + $this->rest->setHttpClient($client); + } + + public function testUri() + { + $client = new Client\RestClient('http://framework.zend.com/rest/'); + $uri = $client->getUri(); + $this->assertTrue($uri instanceof Uri\Uri); + $this->assertEquals('http://framework.zend.com/rest/', $uri->toString()); + + $client->setUri(Uri\UriFactory::factory('http://framework.zend.com/soap/')); + $uri = $client->getUri(); + $this->assertTrue($uri instanceof Uri\Uri); + $this->assertEquals('http://framework.zend.com/soap/', $uri->toString()); + + $client->setUri('http://framework.zend.com/xmlrpc/'); + $uri = $client->getUri(); + $this->assertTrue($uri instanceof Uri\Uri); + $this->assertEquals('http://framework.zend.com/xmlrpc/', $uri->toString()); + } + + public function testRestGetThrowsExceptionWithNoUri() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $rest = new Client\RestClient(); + + $this->setExpectedException('ZendRest\Client\Exception\UnexpectedValueException', 'URI object must be set before performing call'); + $response = $rest->restGet('/rest/'); + } + + public function testRestFixesPathWithMissingSlashes() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $rest = new Client\RestClient('http://framework.zend.com'); + $rest->setHttpClient($this->rest->getHttpClient()); + + $response = $rest->restGet('rest'); + $this->assertTrue($response instanceof Response); + $this->assertContains($expXml, $response->getBody(), $response->getBody()); + } + + public function testRestGet() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $response = $this->rest->restGet('/rest/'); + $this->assertTrue($response instanceof Response); + $this->assertContains($expXml, $response->getBody()); + } + + public function testRestPost() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $reqXml = file_get_contents($this->path . 'returnInt.xml'); + $response = $this->rest->restPost('/rest/', $reqXml); + $this->assertTrue($response instanceof Response); + $body = $response->getBody(); + $this->assertContains($expXml, $response->getBody()); + + $request = $this->rest->getHttpClient()->getLastRawRequest(); + $this->assertContains($reqXml, $request, $request); + } + + public function testRestPostWithArrayData() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $response = $this->rest->restPost('/rest/', array('foo' => 'bar', 'baz' => 'bat')); + $this->assertTrue($response instanceof Response); + $body = $response->getBody(); + $this->assertContains($expXml, $response->getBody()); + + $request = $this->rest->getHttpClient()->getLastRawRequest(); + $this->assertContains('foo=bar&baz=bat', $request, $request); + } + + public function testRestPut() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $reqXml = file_get_contents($this->path . 'returnInt.xml'); + $response = $this->rest->restPut('/rest/', $reqXml); + $this->assertTrue($response instanceof Response); + $body = $response->getBody(); + $this->assertContains($expXml, $response->getBody()); + + $request = $this->rest->getHttpClient()->getLastRawRequest(); + $this->assertContains($reqXml, $request, $request); + } + + public function testRestDelete() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $reqXml = file_get_contents($this->path . 'returnInt.xml'); + $response = $this->rest->restDelete('/rest/'); + $this->assertTrue($response instanceof Response); + $body = $response->getBody(); + $this->assertContains($expXml, $response->getBody()); + } + + public function testCallWithHttpMethod() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $response = $this->rest->get('/rest/'); + $this->assertTrue($response instanceof Client\Result); + $this->assertTrue($response->isSuccess()); + $this->assertEquals('string', $response->response()); + } + + public function testCallAsObjectMethodReturnsClient() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $response = $this->rest->doStuff('why', 'not'); + $this->assertTrue($response instanceof Client\RestClient); + $this->assertSame($this->rest, $response); + } + + public function testCallAsObjectMethodChainPerformsRequest() + { + $expXml = file_get_contents($this->path . 'returnString.xml'); + $response = "HTTP/1.0 200 OK\r\n" + . "X-powered-by: PHP/5.2.0\r\n" + . "Content-type: text/xml\r\n" + . "Content-length: " . strlen($expXml) . "\r\n" + . "Server: Apache/1.3.34 (Unix) PHP/5.2.0)\r\n" + . "Date: Tue, 06 Feb 2007 15:01:47 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . $expXml; + $this->adapter->setResponse($response); + + $response = $this->rest->doStuff('why', 'not')->get(); + $this->assertTrue($response instanceof Client\Result); + $this->assertEquals('string', $response->response()); + } + + /** + * @group ZF-3705 + * @group ZF-3647 + */ + public function testInvalidXmlInClientResultLeadsToException() + { + $this->setExpectedException('ZendRest\Client\Exception\ResultException', 'REST Response Error'); + $result = new Client\Result("invalidxml"); + } +} diff --git a/vendor/zendframework/zendrest/tests/ZendRest/ResultTest.php b/vendor/zendframework/zendrest/tests/ZendRest/ResultTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8700525148f13367a555154a9118a63e6392ce07 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/ResultTest.php @@ -0,0 +1,167 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Rest + */ + +namespace ZendRestTest; + +use ZendRest\Client; + +/** + * Test cases for Zend_Rest_Server + * + * @category Zend + * @package Zend_Rest + * @subpackage UnitTests + * @group Zend_Rest + * @group Zend_Rest_Result + */ +class ResultTest extends \PHPUnit_Framework_TestCase +{ + public static $path; + + public function __construct($name = NULL, array $data = array(), $dataName = '') + { + self::$path = __DIR__ . '/TestAsset/responses/'; + parent::__construct($name, $data, $dataName); + } + + public function testResponseSuccess() + { + $xml = file_get_contents(self::$path ."returnString.xml"); + $client = new Client\Result($xml); + $this->assertTrue($client->isSuccess()); + } + + public function testResponseIsError() + { + $xml = file_get_contents(self::$path ."returnError.xml"); + $client = new Client\Result($xml); + $this->assertTrue($client->isError()); + } + + public function testResponseString() + { + $xml = file_get_contents(self::$path ."returnString.xml"); + $client = new Client\Result($xml); + $this->assertEquals("string", $client->__toString()); + } + + public function testResponseInt() + { + $xml = file_get_contents(self::$path ."returnInt.xml"); + $client = new Client\Result($xml); + $this->assertEquals("123", $client->__toString()); + } + + public function testResponseArray() + { + $xml = file_get_contents(self::$path ."returnArray.xml"); + // <foo>bar</foo><baz>1</baz><key_1>0</key_1><bat>123</bat> + $client = new Client\Result($xml); + foreach ($client as $key => $value) { + $result_array[$key] = (string) $value; + } + $this->assertEquals(array("foo" => "bar", "baz" => "1", "key_1" => "0", "bat" => "123", "status" => "success"), $result_array); + } + + public function testResponseObject() + { + $xml = file_get_contents(self::$path ."returnObject.xml"); + // <foo>bar</foo><baz>1</baz><bat>123</bat><qux>0</qux><status>success</status> + $client = new Client\Result($xml); + $this->assertEquals("bar", $client->foo()); + $this->assertEquals(1, $client->baz()); + $this->assertEquals(123, $client->bat()); + $this->assertEquals(0, $client->qux()); + $this->assertEquals("success", $client->status()); + } + + public function testResponseTrue() + { + $xml = file_get_contents(self::$path ."returnTrue.xml"); + $client = new Client\Result($xml); + $this->assertTrue((bool)$client->response); + } + + public function testResponseFalse() + { + $xml = file_get_contents(self::$path ."returnFalse.xml"); + $client = new Client\Result($xml); + $this->assertFalse((bool) $client->response()); + } + + public function testResponseVoid() + { + $xml = file_get_contents(self::$path . "returnVoid.xml"); + $client = new Client\Result($xml); + $this->assertEquals(null, $client->response()); + } + + public function testResponseException() + { + $xml = file_get_contents(self::$path . "returnError.xml"); + $client = new Client\Result($xml); + $this->assertTrue($client->isError()); + } + + public function testGetXpathValue() + { + $xml = file_get_contents(self::$path . DIRECTORY_SEPARATOR . 'returnNestedArray.xml'); + $result = new Client\Result($xml); + $key_1 = $result->key_1(); + $this->assertEquals(0, $key_1); + } + + public function testGetXpathValueMissing() + { + $xml = file_get_contents(self::$path . DIRECTORY_SEPARATOR . 'returnNestedArray.xml'); + $result = new Client\Result($xml); + $lola = $result->lola; + $this->assertNull($lola); + } + + public function testGetXpathValueArray() + { + $xml = file_get_contents(self::$path . DIRECTORY_SEPARATOR . 'returnNestedArray.xml'); + $result = new Client\Result($xml); + $baz = $result->baz; + $this->assertTrue(is_array($baz), var_export($baz, 1)); + $this->assertEquals('1', (string) $baz[0]); + $this->assertEquals('farama', (string) $baz[1]); + } + + public function testIsset() + { + $xml = file_get_contents(self::$path . DIRECTORY_SEPARATOR . 'returnNestedArray.xml'); + $result = new Client\Result($xml); + $this->assertTrue(isset($result->bar)); + } + + public function testIssetXpathValue() + { + $xml = file_get_contents(self::$path . DIRECTORY_SEPARATOR . 'returnNestedArray.xml'); + $result = new Client\Result($xml); + $this->assertTrue(isset($result->baz)); + } + + public function testIssetInvalidValue() + { + $xml = file_get_contents(self::$path . DIRECTORY_SEPARATOR . 'returnNestedArray.xml'); + $result = new Client\Result($xml); + $this->assertFalse(isset($result->lola)); + } + + public function testCall() + { + $xml = file_get_contents(self::$path . DIRECTORY_SEPARATOR . 'returnNestedArray.xml'); + $result = new Client\Result($xml); + $returned = $result->key_1(); + $this->assertEquals(0, $returned); + } +} diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnArray.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnArray.xml new file mode 100644 index 0000000000000000000000000000000000000000..2d9e1a4663b4bd90f5c26830f53f4eb8f1e2839c --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnArray.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc7 generator='zend'><foo>bar</foo><baz>1</baz><key_1>0</key_1><bat>123</bat><status>success</status></Zend_Rest_Server_TestFunc7> \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnError.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnError.xml new file mode 100644 index 0000000000000000000000000000000000000000..c95b71187ff6237d3005c4538ed908f5aa8330a2 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnError.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc10 generator='zend' version='1.0'><response><message>An error occurred.</message></response><status>failed</status></Zend_Rest_Server_TestFunc10> \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnFalse.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnFalse.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb66cd8c691e43e468743bd1143feed837c5dcd4 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnFalse.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc3 generator='zend' version='1.0'><response>0</response><status>success</status></Zend_Rest_Server_TestFunc3> \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnInt.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnInt.xml new file mode 100644 index 0000000000000000000000000000000000000000..62bfd93619ad4f603ce2be63fadf5325c7ecb8a8 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnInt.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc5 generator='zend' version='1.0'><response>123</response><status>success</status></Zend_Rest_Server_TestFunc5> \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnNestedArray.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnNestedArray.xml new file mode 100644 index 0000000000000000000000000000000000000000..39bee5d6f9fa2061a92f98e953c726d97365d5d1 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnNestedArray.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc7 generator='zend'><foo><baz>1</baz><key_1>0</key_1><bat><baz>farama</baz></bat></foo><bar>baz</bar><status>success</status></Zend_Rest_Server_TestFunc7> diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnObject.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnObject.xml new file mode 100644 index 0000000000000000000000000000000000000000..01d2acff3c23882c19129f574db24f5b48035903 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnObject.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc8 generator='zend'><foo>bar</foo><baz>1</baz><bat>123</bat><qux>0</qux><status>success</status></Zend_Rest_Server_TestFunc8> \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnString.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnString.xml new file mode 100644 index 0000000000000000000000000000000000000000..fb7127b0d33a45138e872764ad3d6ad429788211 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnString.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc6 generator='zend' version='1.0'><response>string</response><status>success</status></Zend_Rest_Server_TestFunc6> \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnTrue.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnTrue.xml new file mode 100644 index 0000000000000000000000000000000000000000..43c5763b82660eced49addba9295210a02dd0614 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnTrue.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc4 generator='zend' version='1.0'><response>1</response><status>success</status></Zend_Rest_Server_TestFunc4> \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnVoid.xml b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnVoid.xml new file mode 100644 index 0000000000000000000000000000000000000000..37a8fca1dc7110f96fe597946d0ed9d59d6986bd --- /dev/null +++ b/vendor/zendframework/zendrest/tests/ZendRest/TestAsset/responses/returnVoid.xml @@ -0,0 +1 @@ +<Zend_Rest_Server_TestFunc10 generator='zend' version='1.0'><response /><status>success</status></Zend_Rest_Server_TestFunc10> \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/_autoload.php b/vendor/zendframework/zendrest/tests/_autoload.php new file mode 100644 index 0000000000000000000000000000000000000000..c2f80b418a6655f5dccd518d306d6b6c3b0194f8 --- /dev/null +++ b/vendor/zendframework/zendrest/tests/_autoload.php @@ -0,0 +1,33 @@ +<?php +/** + * Setup autoloading + */ +if (!file_exists(__DIR__ . '/../vendor/autoload.php')) { + throw new RuntimeException('This component has dependencies that are unmet. + +Either build a vendor/autoloader.php that will load this components dependencies ... + +OR + +Install composer (http://getcomposer.org), and run the following +command in the root of this project: + + php /path/to/composer.phar install + +After that, you should be able to run tests.'); +} else { + include_once __DIR__ . '/../vendor/autoload.php'; +} + + +spl_autoload_register(function ($class) { + if (0 !== strpos($class, 'ZendRestTest\\')) { + return false; + } + $normalized = str_replace('ZendRestTest\\', '', $class); + $filename = __DIR__ . '/ZendRest/' . str_replace(array('\\', '_'), '/', $normalized) . '.php'; + if (!file_exists($filename)) { + return false; + } + return include_once $filename; +}); \ No newline at end of file diff --git a/vendor/zendframework/zendrest/tests/phpunit.xml.dist b/vendor/zendframework/zendrest/tests/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..fff1e35eeb32363fece05d84ded16bdc9327386a --- /dev/null +++ b/vendor/zendframework/zendrest/tests/phpunit.xml.dist @@ -0,0 +1,13 @@ +<phpunit bootstrap="./Bootstrap.php" colors="true"> + <testsuites> + <testsuite name="ZendRest Test Suite"> + <directory>./ZendRest</directory> + </testsuite> + </testsuites> + + <groups> + <exclude> + <group>disable</group> + </exclude> + </groups> +</phpunit> diff --git a/vendor/ZendService/LICENSE.txt b/vendor/zendframework/zendservice-amazon/LICENSE.txt similarity index 100% rename from vendor/ZendService/LICENSE.txt rename to vendor/zendframework/zendservice-amazon/LICENSE.txt diff --git a/vendor/zendframework/zendservice-amazon/README.md b/vendor/zendframework/zendservice-amazon/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5c622841b53d020ad1dd24c22918c16cd632c031 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/README.md @@ -0,0 +1,11 @@ +ZendService\Amazon component + +You can install using: + +``` +curl -s https://getcomposer.org/installer | php +php composer.phar install +``` + +At that point, follow the instructions in the documentation folder for actual +usage of the component. (Documentation is forthcoming.) diff --git a/vendor/zendframework/zendservice-amazon/README.txt b/vendor/zendframework/zendservice-amazon/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..4bdc26cc6aa823a9a0bcc9cb83a64b2d44b3f79f --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/README.txt @@ -0,0 +1,12 @@ +This is a composer based component package from Zend Framework. +The Zend Framework source for this package is located here: + + https://github.com/zendframework/zf2/ + +You can install using: + + curl -s https://getcomposer.org/installer | php + php composer.phar install + +At that point, follow the instructions in the documentation folder for actual +usage of the component. (Documentation is forthcoming.) \ No newline at end of file diff --git a/vendor/zendframework/zendservice-amazon/composer.json b/vendor/zendframework/zendservice-amazon/composer.json new file mode 100644 index 0000000000000000000000000000000000000000..a523d50c0a2a6c5634def39a4da181251252b7ce --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/composer.json @@ -0,0 +1 @@ +{"name":"zendframework\/zendservice-amazon","description":"OOP wrapper for the Amazon web service","type":"library","keywords":["zf2","amazon","ec2","s3","simpledb","sqs"],"homepage":"http:\/\/packages.zendframework.com\/","license":"BSD-3-Clause","autoload":{"psr-0":{"ZendService":"library\/"}},"repositories":[{"type":"composer","url":"http:\/\/packages.zendframework.com\/"}],"require":{"php":">=5.3.3","zendframework\/zend-http":">=2.0.0","zendframework\/zendrest":">=2.0.0","zendframework\/zend-crypt":">=2.0.0","zendframework\/zend-json":">=2.0.0"},"require-dev":{"zendframework\/zend-i18n":">=2.0.0"},"suggest":{"zendframework\/zend-uri":"Zend\\Uri component"},"extra":{"branch-alias":{"dev-master":"2.0.x-dev"}},"version":"2.0.2","dist":{"url":"http:\/\/packages.zendframework.com\/composer\/ZendService_Amazon-2.0.2.zip","type":"zip"}} \ No newline at end of file diff --git a/vendor/zendframework/zendservice-amazon/demos/ZendService/Amazon/_autoload.php b/vendor/zendframework/zendservice-amazon/demos/ZendService/Amazon/_autoload.php new file mode 100644 index 0000000000000000000000000000000000000000..96b8553fac2e546d0c8e595ad321c2c63a1d265a --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/demos/ZendService/Amazon/_autoload.php @@ -0,0 +1,9 @@ +<?php +$vendor = dirname(dirname(dirname(__DIR__))).'/vendor'; +// Composer autoloading +if (file_exists($vendor.'/autoload.php')) { + include $vendor.'/autoload.php'; +} else { + throw new RuntimeException('Unable to load vendors. Run `php composer.phar install`'); +} + diff --git a/vendor/zendframework/zendservice-amazon/demos/ZendService/Amazon/amazon-search.php b/vendor/zendframework/zendservice-amazon/demos/ZendService/Amazon/amazon-search.php new file mode 100644 index 0000000000000000000000000000000000000000..a03b9bd45a0a249f0624340334a4217e84f75164 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/demos/ZendService/Amazon/amazon-search.php @@ -0,0 +1,204 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +use ZendService\Amazon\Exception\ExceptionInterface as AmazonException; +use ZendService\Amazon\Query; + +/** + * Query Amazon's Product Database + */ + +error_reporting(E_ALL); + +include_once '_autoload.php'; + +$keywords = ''; +$searchFor = ''; + +if (isset($_POST) && strtolower($_SERVER['REQUEST_METHOD']) == 'post') { + if (isset($_POST['search_term'])) { + $keywords = strip_tags($_POST['search_term']); + } + + if (isset($_POST['search_type'])) { + $searchFor = strip_tags($_POST['search_type']); + } +} +?> +<!DOCTYPE html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <style type="text/css"> + html, body { + margin: 0px; + padding: 0px; + font-family: Tahoma, Verdana, sans-serif; + font-size: 10px; + } + + h1 { + margin-top: 0px; + background-color: darkblue; + color: white; + font-size: 16px; + } + + form { + text-align: center; + } + + label { + font-weight: bold; + } + + img { + border: 0px; + padding: 5px; + } + + #results { + margin-left: 30px; + } + + #results .thumb { + clear: left; + float: left; + } + + #results .details { + clear: right; + float: left; + } + + + h2 { + font-size: 14px; + color: grey; + } + + h3 { + clear: both; + font-size: 12px; + } + + #poweredby { + clear: both; + } + </style> +</head> +<body> + <h1>Amazon Product Search</h1> + <form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post"> + <p> + <label>Search For: <input type="text" name="search_term" value="<?php echo htmlspecialchars($keywords, ENT_QUOTES); ?>"></label> + <label> + in + <select name="search_type"> + <?php + $search_types = array ( + 0 => 'Apparel', + 1 => 'Baby', + 2 => 'Beauty', + 3 => 'Blended', + 4 => 'Books', + 5 => 'Classical', + 6 => 'DVD', + 7 => 'Digital Music', + 8 => 'Electronics', + 9 => 'Gourmet Food', + 10 => 'Health Personal Care', + 11 => 'Jewelry', + 12 => 'Kitchen', + 13 => 'Magazines', + 14 => 'Merchants', + 15 => 'Miscellaneous', + 16 => 'Music', + 17 => 'Music Tracks', + 18 => 'Musical Instruments', + 19 => 'Office Products', + 20 => 'Outdoor Living', + 21 => 'PC Hardware', + 22 => 'Pet Supplies', + 23 => 'Photo', + 24 => 'Restaurants', + 25 => 'Software', + 26 => 'Sporting Goods', + 27 => 'Tools', + 28 => 'Toys', + 29 => 'VHS', + 30 => 'Video', + 31 => 'Video Games', + 32 => 'Wireless', + 33 => 'Wireless Accessories', + ); + foreach ($search_types as $type) { + if ($searchFor == $type) { + ?> + <option value='<?php echo str_replace(" ", "", $type); ?>' selected="selected"><?php echo $type; ?></option> + <?php + } else { + ?> + <option value='<?php echo str_replace(" ", "", $type); ?>'><?php echo $type; ?></option> + <?php + } + } + ?> + </select> + </label> + <input type="submit" value="Search!"> + </p> + </form> +<?php +if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { + $amazon = new Query("1338XJTNFMTHK413WFR2"); + + try { + $amazon->category($searchFor)->ResponseGroup('Large')->Keywords($keywords); + + $results = $amazon->search(); + + if ($results->totalResults() > 0) { + echo '<div id="results">'; + echo '<h2>Search Results</h2>'; + foreach ($results as $result) { + echo "<div>"; + echo "<h3>$result->Title</h3>"; + if (isset($result->MediumImage)) { + ?> + <div class="thumb"> + <a href='<?php echo $result->DetailPageURL; ?>' title='<?php echo $result->Title; ?>'> + <img src='<?php echo $result->MediumImage->Url->getUri(); ?>' /> + </a> + </div> + <p class="details" style="height: <?php echo $result->MediumImage->Height; ?>px"> + Average Rating: <?php echo $result->AverageRating; ?> + <br /> + Total Reviews: <?php echo $result->TotalReviews; ?> + <br /> + Price: <?php echo (isset($result->FormattedPrice)) ? $result->FormattedPrice : "Not available"; ?> + <br /> + <a href='<?php echo $result->DetailPageURL; ?>'>More Details...</a> + </p> + <?php + } else { + echo "<a href='{$result->DetailPageURL}'>More Details...</a>"; + } + echo "</div>"; + } + echo '</div>'; + } + } catch (AmazonException $e) { + echo '<p style="color: red; font-weight: bold">An error occured, please try again later. (' .$e->getMessage(). ')</p>'; + } +} +?> +<p id="poweredby" style="text-align: center; font-size: 9px;">Powered by the <a href="http://framework.zend.com">Zend Framework</a></p> +</body> +</html> diff --git a/vendor/ZendService/library/ZendService/Amazon/AbstractAmazon.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/AbstractAmazon.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/AbstractAmazon.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/AbstractAmazon.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Accessories.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Accessories.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Accessories.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Accessories.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Amazon.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Amazon.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Amazon.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Amazon.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Authentication/AbstractAuthentication.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/AbstractAuthentication.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Authentication/AbstractAuthentication.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/AbstractAuthentication.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Authentication/Exception/ExceptionInterface.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Authentication/Exception/ExceptionInterface.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/Exception/ExceptionInterface.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Authentication/Exception/InvalidArgumentException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Authentication/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/Exception/InvalidArgumentException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Authentication/Exception/RuntimeException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/Exception/RuntimeException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Authentication/Exception/RuntimeException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/Exception/RuntimeException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Authentication/S3.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/S3.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Authentication/S3.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/S3.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Authentication/V1.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/V1.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Authentication/V1.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/V1.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Authentication/V2.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/V2.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Authentication/V2.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Authentication/V2.php diff --git a/vendor/ZendService/library/ZendService/Amazon/CustomerReview.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/CustomerReview.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/CustomerReview.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/CustomerReview.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/AbstractEc2.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/AbstractEc2.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/AbstractEc2.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/AbstractEc2.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/AvailabilityZones.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/AvailabilityZones.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/AvailabilityZones.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/AvailabilityZones.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/CloudWatch.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/CloudWatch.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/CloudWatch.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/CloudWatch.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Ebs.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Ebs.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Ebs.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Ebs.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Ec2.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Ec2.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Ec2.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Ec2.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/ElasticIp.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/ElasticIp.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/ElasticIp.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/ElasticIp.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Exception/ExceptionInterface.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Exception/ExceptionInterface.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Exception/ExceptionInterface.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Exception/InvalidArgumentException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Exception/InvalidArgumentException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Exception/RuntimeException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Exception/RuntimeException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Exception/RuntimeException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Exception/RuntimeException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Image.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Image.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Image.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Image.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Instance.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Instance.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Instance.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Instance.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Keypair.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Keypair.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Keypair.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Keypair.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Region.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Region.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Region.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Region.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/ReservedInstance.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/ReservedInstance.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/ReservedInstance.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/ReservedInstance.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/Response.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Response.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/Response.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/Response.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/SecurityGroups.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/SecurityGroups.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/SecurityGroups.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/SecurityGroups.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Ec2/WindowsInstance.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/WindowsInstance.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Ec2/WindowsInstance.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Ec2/WindowsInstance.php diff --git a/vendor/ZendService/library/ZendService/Amazon/EditorialReview.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/EditorialReview.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/EditorialReview.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/EditorialReview.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Exception/ExceptionInterface.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Exception/ExceptionInterface.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Exception/ExceptionInterface.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Exception/InvalidArgumentException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Exception/InvalidArgumentException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Exception/OutOfBoundsException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Exception/OutOfBoundsException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Exception/OutOfBoundsException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Exception/OutOfBoundsException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Exception/RuntimeException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Exception/RuntimeException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Exception/RuntimeException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Exception/RuntimeException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Image.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Image.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Image.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Image.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Item.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Item.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Item.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Item.php diff --git a/vendor/ZendService/library/ZendService/Amazon/ListmaniaList.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/ListmaniaList.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/ListmaniaList.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/ListmaniaList.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Offer.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Offer.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Offer.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Offer.php diff --git a/vendor/ZendService/library/ZendService/Amazon/OfferSet.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/OfferSet.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/OfferSet.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/OfferSet.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Query.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Query.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Query.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Query.php diff --git a/vendor/ZendService/library/ZendService/Amazon/ResultSet.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/ResultSet.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/ResultSet.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/ResultSet.php diff --git a/vendor/ZendService/library/ZendService/Amazon/S3/Exception/ExceptionInterface.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/S3/Exception/ExceptionInterface.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/Exception/ExceptionInterface.php diff --git a/vendor/ZendService/library/ZendService/Amazon/S3/Exception/InvalidArgumentException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/S3/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/Exception/InvalidArgumentException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/S3/Exception/RuntimeException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/Exception/RuntimeException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/S3/Exception/RuntimeException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/Exception/RuntimeException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/S3/S3.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/S3.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/S3/S3.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/S3.php diff --git a/vendor/ZendService/library/ZendService/Amazon/S3/Stream.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/Stream.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/S3/Stream.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/S3/Stream.php diff --git a/vendor/ZendService/library/ZendService/Amazon/SimilarProduct.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimilarProduct.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/SimilarProduct.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimilarProduct.php diff --git a/vendor/ZendService/library/ZendService/Amazon/SimpleDb/Attribute.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Attribute.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/SimpleDb/Attribute.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Attribute.php diff --git a/vendor/ZendService/library/ZendService/Amazon/SimpleDb/Exception/ExceptionInterface.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/SimpleDb/Exception/ExceptionInterface.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Exception/ExceptionInterface.php diff --git a/vendor/ZendService/library/ZendService/Amazon/SimpleDb/Exception/InvalidArgumentException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/SimpleDb/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Exception/InvalidArgumentException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/SimpleDb/Exception/RuntimeException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Exception/RuntimeException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/SimpleDb/Exception/RuntimeException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Exception/RuntimeException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/SimpleDb/Page.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Page.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/SimpleDb/Page.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Page.php diff --git a/vendor/ZendService/library/ZendService/Amazon/SimpleDb/Response.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Response.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/SimpleDb/Response.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/Response.php diff --git a/vendor/ZendService/library/ZendService/Amazon/SimpleDb/SimpleDb.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/SimpleDb.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/SimpleDb/SimpleDb.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/SimpleDb/SimpleDb.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Sqs/Exception/ExceptionInterface.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Sqs/Exception/ExceptionInterface.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Sqs/Exception/ExceptionInterface.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Sqs/Exception/ExceptionInterface.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Sqs/Exception/InvalidArgumentException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Sqs/Exception/InvalidArgumentException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Sqs/Exception/InvalidArgumentException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Sqs/Exception/InvalidArgumentException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Sqs/Exception/RuntimeException.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Sqs/Exception/RuntimeException.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Sqs/Exception/RuntimeException.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Sqs/Exception/RuntimeException.php diff --git a/vendor/ZendService/library/ZendService/Amazon/Sqs/Sqs.php b/vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Sqs/Sqs.php similarity index 100% rename from vendor/ZendService/library/ZendService/Amazon/Sqs/Sqs.php rename to vendor/zendframework/zendservice-amazon/library/ZendService/Amazon/Sqs/Sqs.php diff --git a/vendor/zendframework/zendservice-amazon/tests/Bootstrap.php b/vendor/zendframework/zendservice-amazon/tests/Bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..40a74517b848a4592d9cca7046bda48c1d8f059f --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/Bootstrap.php @@ -0,0 +1,92 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend + */ + +/* + * Set error reporting to the level to which Zend Framework code must comply. + */ +error_reporting( E_ALL | E_STRICT ); + +$phpUnitVersion = PHPUnit_Runner_Version::id(); +if ('@package_version@' !== $phpUnitVersion && version_compare($phpUnitVersion, '3.5.0', '<')) { + echo 'This version of PHPUnit (' . PHPUnit_Runner_Version::id() . ') is not supported in Zend Framework 2.x unit tests.' . PHP_EOL; + exit(1); +} +unset($phpUnitVersion); + +/* + * Determine the root, library, and tests directories of the framework + * distribution. + */ +$zfRoot = realpath(dirname(__DIR__)); +$zfCoreLibrary = "$zfRoot/library"; +$zfCoreTests = "$zfRoot/tests"; + +/* + * Prepend the Zend Framework library/ and tests/ directories to the + * include_path. This allows the tests to run out of the box and helps prevent + * loading other copies of the framework code and tests that would supersede + * this copy. + */ +$path = array( + $zfCoreLibrary, + $zfCoreTests, + get_include_path(), +); +set_include_path(implode(PATH_SEPARATOR, $path)); + +/** + * Setup autoloading + */ +include __DIR__ . '/_autoload.php'; + +/* + * Load the user-defined test configuration file, if it exists; otherwise, load + * the default configuration. + */ +if (is_readable($zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php')) { + require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php'; +} else { + require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php.dist'; +} + +if (defined('TESTS_GENERATE_REPORT') && TESTS_GENERATE_REPORT === true) { + $codeCoverageFilter = PHP_CodeCoverage_Filter::getInstance(); + + $lastArg = end($_SERVER['argv']); + if (is_dir($zfCoreTests . '/' . $lastArg)) { + $codeCoverageFilter->addDirectoryToWhitelist($zfCoreLibrary . '/' . $lastArg); + } else if (is_file($zfCoreTests . '/' . $lastArg)) { + $codeCoverageFilter->addDirectoryToWhitelist(dirname($zfCoreLibrary . '/' . $lastArg)); + } else { + $codeCoverageFilter->addDirectoryToWhitelist($zfCoreLibrary); + } + + /* + * Omit from code coverage reports the contents of the tests directory + */ + $codeCoverageFilter->addDirectoryToBlacklist($zfCoreTests, ''); + $codeCoverageFilter->addDirectoryToBlacklist(PEAR_INSTALL_DIR, ''); + $codeCoverageFilter->addDirectoryToBlacklist(PHP_LIBDIR, ''); + + unset($codeCoverageFilter); +} + + +/** + * Start output buffering, if enabled + */ +if (defined('TESTS_ZEND_OB_ENABLED') && constant('TESTS_ZEND_OB_ENABLED')) { + ob_start(); +} + +/* + * Unset global variables that are no longer needed. + */ +unset($zfRoot, $zfCoreLibrary, $zfCoreTests, $path); diff --git a/vendor/zendframework/zendservice-amazon/tests/TestConfiguration.php.dist b/vendor/zendframework/zendservice-amazon/tests/TestConfiguration.php.dist new file mode 100644 index 0000000000000000000000000000000000000000..77027a6ba6bd40707e6a2e97bc7be3a010348c4b --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/TestConfiguration.php.dist @@ -0,0 +1,57 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package UnitTests + */ + +/** + * This file defines configuration for running the unit tests for the Zend + * Framework. Some tests have dependencies to PHP extensions or databases + * which may not necessary installed on the target system. For these cases, + * the ability to disable or configure testing is provided below. Tests for + * components which should run universally are always run by the master + * suite and cannot be disabled. + * + * Do not edit this file. Instead, copy this file to TestConfiguration.php, + * and edit the new file. Never commit passwords to the source code repository. + */ + +/** + * Use the notation: + * + * defined(...) || define(...); + * + * This ensures that, when a test is marked to run in a separate process, + * PHP will not complain of a constant already being defined. + */ + +/** + * GENERAL SETTINGS + * + * OB_ENABLED should be enabled for some tests to check if all functionality + * works as expected. Such tests include those for Zend\Soap and Zend\Session, + * which require that headers not be sent in order to work. + */ +defined('TESTS_ZEND_OB_ENABLED') || define('TESTS_ZEND_OB_ENABLED', false); + +/** + * PHPUnit Code Coverage / Test Report + */ +defined('TESTS_GENERATE_REPORT') || define('TESTS_GENERATE_REPORT', false); +defined('TESTS_GENERATE_REPORT_TARGET') || define('TESTS_GENERATE_REPORT_TARGET', '/path/to/target'); + +/** + * Zend\Service\Amazon online tests + */ +defined('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED') || define('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED', false); +defined('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID') || define('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID', 'Enter AWSAccessKeyId here'); +defined('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY') || define('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY', 'Enter AWSSecretKey here'); +defined('TESTS_ZEND_SERVICE_AMAZON_EC2_IMAGE_ID') || define('TESTS_ZEND_SERVICE_AMAZON_EC2_IMAGE_ID', 'zftestamazonimageid'); +defined('TESTS_ZEND_SERVICE_AMAZON_EC2_ZONE') || define('TESTS_ZEND_SERVICE_AMAZON_EC2_ZONE', 'us-east-1'); +defined('TESTS_ZEND_SERVICE_AMAZON_EC2_SECURITY_GROUP') || define('TESTS_ZEND_SERVICE_AMAZON_EC2_SECURITY_GROUP', 'default'); +defined('TESTS_ZEND_SERVICE_AMAZON_S3_BUCKET') || define('TESTS_ZEND_SERVICE_AMAZON_S3_BUCKET', 'zftestamazons3bucket'); +defined('TESTS_ZEND_SERVICE_AMAZON_SQS_QUEUE') || define('TESTS_ZEND_SERVICE_AMAZON_SQS_QUEUE', 'zftestamazonsqsqueuename'); diff --git a/vendor/zendframework/zendservice-amazon/tests/TestConfiguration.php.travis b/vendor/zendframework/zendservice-amazon/tests/TestConfiguration.php.travis new file mode 100644 index 0000000000000000000000000000000000000000..f49b94cdbf96f412c2a337652947a128c0749c89 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/TestConfiguration.php.travis @@ -0,0 +1,20 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package UnitTests + */ + +/** + * This file defines specific configuration that differs from the standard configuration + * for running the unit tests with Travis-CI (http://www.travis-ci.org) + * + * See TestConfiguration.php.dist to get more details. + * + * Never commit passwords to the source code repository. + */ + +require_once __DIR__ . '/TestConfiguration.php.dist'; diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/S3Test.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/S3Test.php new file mode 100644 index 0000000000000000000000000000000000000000..53f2e935b1267552a54c6449a4e849267d0848e7 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/S3Test.php @@ -0,0 +1,155 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Authentication; + +use ZendService\Amazon\Authentication; +use ZendService\Amazon\Authentication\Exception; + +/** + * S3 authentication test case + * + * @category Zend + * @package Zend_Service_Amazon_Authentication + * @subpackage UnitTests + */ +class S3Test extends \PHPUnit_Framework_TestCase +{ + + /** + * @var ZendService\Amazon\Authentication\S3 + */ + private $_amazon; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->_amazon = new Authentication\S3('0PN5J17HBGZHT7JJ3X82', 'uV3F3YluFJax1cknvbcGwgjvx4QpvB+leU8dUj2o', '2006-03-01'); + + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() + { + $this->_amazon = null; + } + + + public function testGetGeneratesCorrectSignature() + { + $headers = array(); + $headers['Date'] = "Tue, 27 Mar 2007 19:36:42 +0000"; + + $ret = $this->_amazon->generateSignature('GET', 'http://s3.amazonaws.com/johnsmith/photos/puppy.jpg', $headers); + + $this->assertEquals('AWS 0PN5J17HBGZHT7JJ3X82:soqB4L9flQ6AHG4d5FVnKj26D2s=', $headers['Authorization']); + $rawHttpResponse = "GET\n\n\n" + . "Tue, 27 Mar 2007 19:36:42 +0000\n" + . "//johnsmith/photos/puppy.jpg"; + $this->assertEquals($ret, $rawHttpResponse); + } + + public function testPutGeneratesCorrectSignature() + { + $headers = array(); + $headers['Date'] = "Tue, 27 Mar 2007 21:15:45 +0000"; + $headers['Content-Type'] = "image/jpeg"; + $headers['Content-Length'] = 94328; + + $ret = $this->_amazon->generateSignature('PUT', 'http://s3.amazonaws.com/johnsmith/photos/puppy.jpg', $headers); + + $this->assertEquals('AWS 0PN5J17HBGZHT7JJ3X82:88cf7BdpjrBlCsIiWWLn8wLpWzI=', $headers['Authorization']); + $rawHttpResponse = "PUT\n\n" + . "image/jpeg\n" + . "Tue, 27 Mar 2007 21:15:45 +0000\n" + . "//johnsmith/photos/puppy.jpg"; + $this->assertEquals($ret, $rawHttpResponse); + } + + public function testListGeneratesCorrectSignature() + { + $headers = array(); + $headers['Date'] = "Tue, 27 Mar 2007 19:42:41 +0000"; + + $ret = $this->_amazon->generateSignature('GET', 'http://s3.amazonaws.com/johnsmith/?prefix=photos&max-keys=50&marker=puppy', $headers); + + $this->assertEquals('AWS 0PN5J17HBGZHT7JJ3X82:pm3Adv2BIFCCJiUSikcLcGYFtiA=', $headers['Authorization']); + $rawHttpResponse = "GET\n\n\n" + . "Tue, 27 Mar 2007 19:42:41 +0000\n" + . "//johnsmith/"; + $this->assertEquals($ret, $rawHttpResponse); + } + + public function testFetchGeneratesCorrectSignature() + { + $headers = array(); + $headers['Date'] = "Tue, 27 Mar 2007 19:44:46 +0000"; + + $ret = $this->_amazon->generateSignature('GET', 'http://s3.amazonaws.com/johnsmith/?acl', $headers); + + $this->assertEquals('AWS 0PN5J17HBGZHT7JJ3X82:TCNlZPuxY41veihZbxjnjw8P93w=', $headers['Authorization']); + $rawHttpResponse = "GET\n\n\n" + . "Tue, 27 Mar 2007 19:44:46 +0000\n" + . "//johnsmith/?acl"; + $this->assertEquals($ret, $rawHttpResponse); + } + + public function testDeleteGeneratesCorrectSignature() + { + + $headers = array(); + $headers['x-amz-date'] = "Tue, 27 Mar 2007 21:20:26 +0000"; + + $ret = $this->_amazon->generateSignature('DELETE', 'http://s3.amazonaws.com/johnsmith/photos/puppy.jpg', $headers); + + $this->assertEquals('AWS 0PN5J17HBGZHT7JJ3X82:O9AsSXUIowhjTiJC5escAqjsAyk=', $headers['Authorization']); + $rawHttpResponse = "DELETE\n\n\n\n" + . "x-amz-date:Tue, 27 Mar 2007 21:20:26 +0000\n" + . "//johnsmith/photos/puppy.jpg"; + $this->assertEquals($ret, $rawHttpResponse); + } + + public function testUploadGeneratesCorrectSignature() + { + $headers = array(); + $headers['Date'] = "Tue, 27 Mar 2007 21:06:08 +0000"; + $headers['x-amz-acl'] = "public-read"; + $headers['content-type'] = "application/x-download"; + $headers['Content-MD5'] = "4gJE4saaMU4BqNR0kLY+lw=="; + $headers['X-Amz-Meta-ReviewedBy'][] = "joe@johnsmith.net"; + $headers['X-Amz-Meta-ReviewedBy'][] = "jane@johnsmith.net"; + $headers['X-Amz-Meta-FileChecksum'] = "0x02661779"; + $headers['X-Amz-Meta-ChecksumAlgorithm'] = "crc32"; + $headers['Content-Disposition'] = "attachment; filename=database.dat"; + $headers['Content-Encoding'] = "gzip"; + $headers['Content-Length'] = "5913339"; + + + $ret = $this->_amazon->generateSignature('PUT', 'http://s3.amazonaws.com/static.johnsmith.net/db-backup.dat.gz', $headers); + + $this->assertEquals('AWS 0PN5J17HBGZHT7JJ3X82:IQh2zwCpX2xqRgP2rbIkXL/GVbA=', $headers['Authorization']); + $rawHttpResponse = "PUT\n" + . "4gJE4saaMU4BqNR0kLY+lw==\n" + . "application/x-download\n" + . "Tue, 27 Mar 2007 21:06:08 +0000\n" + . "x-amz-acl:public-read\n" + . "x-amz-meta-checksumalgorithm:crc32\n" + . "x-amz-meta-filechecksum:0x02661779\n" + . "x-amz-meta-reviewedby:joe@johnsmith.net,jane@johnsmith.net\n" + . "//static.johnsmith.net/db-backup.dat.gz"; + $this->assertEquals($ret, $rawHttpResponse); + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/V1Test.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/V1Test.php new file mode 100644 index 0000000000000000000000000000000000000000..d21ede0f24d20e1f8c06e9eb5a05f3bdbc08157c --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/V1Test.php @@ -0,0 +1,64 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Authentication; + +use ZendService\Amazon\Authentication; +use ZendService\Amazon\Authentication\Exception; + +/** + * Amazon V1 authentication test case + * + * @category Zend + * @package Zend_Service_Amazon_Authentication + * @subpackage UnitTests + */ +class V1Test extends \PHPUnit_Framework_TestCase +{ + + /** + * @var Authentication\V1 + */ + private $_amazon; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->_amazon = new Authentication\V1('0PN5J17HBGZHT7JJ3X82', 'uV3F3YluFJax1cknvbcGwgjvx4QpvB+leU8dUj2o', '2007-12-01'); + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() + { + $this->_amazon = null; + } + + /** + * Tests Authentication\V1::generateSignature() + */ + public function testGenerateDevPaySignature() + { + $url = "https://ls.amazonaws.com/"; + $params = array(); + $params['Action'] = "ActivateHostedProduct"; + $params['Timestamp'] = "2009-11-11T13:52:38Z"; + + $ret = $this->_amazon->generateSignature($url, $params); + + $this->assertEquals('31Q2YlgABM5X3GkYQpGErcL10Xc=', $params['Signature']); + $this->assertEquals("ActionActivateHostedProductAWSAccessKeyId0PN5J17HBGZHT7JJ3X82SignatureVersion1Timestamp2009-11-11T13:52:38ZVersion2007-12-01", $ret); + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/V2Test.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/V2Test.php new file mode 100644 index 0000000000000000000000000000000000000000..8ab827e59b652e5f1b61c6dd7deeff9a8d11c70c --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/V2Test.php @@ -0,0 +1,81 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Authentication; + +use ZendService\Amazon\Authentication; +use ZendService\Amazon\Authentication\Exception; + +/** + * Amazon V2 authentication test case + * + * @category Zend + * @package Zend_Service_Amazon_Authentication + * @subpackage UnitTests + */ +class V2Test extends \PHPUnit_Framework_TestCase +{ + + /** + * @var Authentication\V2 + */ + private $_amazon; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->_amazon = new Authentication\V2('0PN5J17HBGZHT7JJ3X82', 'uV3F3YluFJax1cknvbcGwgjvx4QpvB+leU8dUj2o', '2009-07-15'); + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() + { + $this->_amazon = null; + } + + /** + * Tests Authentication\V2::generateSignature() + */ + public function testGenerateEc2PostSignature() + { + $url = "https://ec2.amazonaws.com/"; + $params = array(); + $params['Action'] = "DescribeImages"; + $params['ImageId.1'] = "ami-2bb65342"; + $params['Timestamp'] = "2009-11-11T13:52:38Z"; + + $ret = $this->_amazon->generateSignature($url, $params); + + $this->assertEquals('8B2cxwK/dfezT49KEzD+wjo1ZbJCddyFOLA0RNZobbc=', $params['Signature']); + $this->assertEquals(str_replace("\r\n", "\n", file_get_contents(dirname(__FILE__) . '/_files/ec2_v2_return.txt')), $ret); + } + + public function testGenerateSqsGetSignature() + { + $url = "https://queue.amazonaws.com/770098461991/queue2"; + $params = array(); + $params['Action'] = "SetQueueAttributes"; + $params['Attribute.Name'] = "VisibilityTimeout"; + $params['Attribute.Value'] = "90"; + $params['Timestamp'] = "2009-11-11T13:52:38Z"; + + $this->_amazon->setHttpMethod('GET'); + $ret = $this->_amazon->generateSignature($url, $params); + + $this->assertEquals('YSw7HXDqokM/A6DhLz8kG+sd+oD5eMjqx3a02A0+GkE=', $params['Signature']); + $this->assertEquals(str_replace("\r\n", "\n", file_get_contents(dirname(__FILE__) . '/_files/sqs_v2_get_return.txt')), $ret); + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/_files/ec2_v2_return.txt b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/_files/ec2_v2_return.txt new file mode 100644 index 0000000000000000000000000000000000000000..af3af2a4741f1bd674335f8c67928d17969f2293 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/_files/ec2_v2_return.txt @@ -0,0 +1,4 @@ +POST +ec2.amazonaws.com +/ +AWSAccessKeyId=0PN5J17HBGZHT7JJ3X82&Action=DescribeImages&ImageId.1=ami-2bb65342&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2009-11-11T13%3A52%3A38Z&Version=2009-07-15 \ No newline at end of file diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/_files/sqs_v2_get_return.txt b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/_files/sqs_v2_get_return.txt new file mode 100644 index 0000000000000000000000000000000000000000..2aa8f78d00c97fccf3967c43541141fd89582aec --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Authentication/_files/sqs_v2_get_return.txt @@ -0,0 +1,4 @@ +GET +queue.amazonaws.com +/770098461991/queue2 +AWSAccessKeyId=0PN5J17HBGZHT7JJ3X82&Action=SetQueueAttributes&Attribute.Name=VisibilityTimeout&Attribute.Value=90&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2009-11-11T13%3A52%3A38Z&Version=2009-07-15 \ No newline at end of file diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/AbstractTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/AbstractTest.php new file mode 100644 index 0000000000000000000000000000000000000000..47b3938f1cb5fc7e903720f79f739eb37cb132c3 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/AbstractTest.php @@ -0,0 +1,66 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon; +use ZendService\Amazon\Ec2\Exception; + +/** + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class AbstractTest extends \PHPUnit_Framework_TestCase +{ + public function testSetRegion() + { + TestAmazonAbstract::setRegion('eu-west-1'); + + $class = new TestAmazonAbstract('TestAccessKey', 'TestSecretKey'); + $this->assertEquals('eu-west-1', $class->returnRegion()); + } + + public function testSetInvalidRegionThrowsException() + { + $this->setExpectedException( + 'ZendService\Amazon\Ec2\Exception\InvalidArgumentException', + 'Invalid Amazon Ec2 Region'); + TestAmazonAbstract::setRegion('eu-west-1a'); + } + + public function testSignParamsWithSpaceEncodesWithPercentInsteadOfPlus() + { + $class = new TestAmazonAbstract('TestAccessKey', 'TestSecretKey'); + $ret = $class->testSign(array('Action' => 'Space Test')); + + // this is the encode signuature with urlencode - It's Invalid! + $invalidSignature = 'EeHAfo7cMcLyvH4SW4fEpjo51xJJ4ES1gdjRPxZTlto='; + + $this->assertNotEquals($ret, $invalidSignature); + } +} + +class TestAmazonAbstract extends \ZendService\Amazon\Ec2\AbstractEc2 +{ + + public function returnRegion() + { + return $this->_region; + } + + public function testSign($params) + { + return $this->signParameters($params); + } +} diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/AvailabilityZonesTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/AvailabilityZonesTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8c614c62d9ff98efd72ad8f3f62ef0d0f26318d0 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/AvailabilityZonesTest.php @@ -0,0 +1,122 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; +use ZendService\Amazon\Ec2\Exception; +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + +/** + * ZendService\Amazon\Ec2\Availabilityzones test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class AvailabilityZonesTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var \ZendService\Amazon\Ec2\AvailabilityZones + */ + protected $availabilityZones; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->availabilityZones = new Ec2\AvailabilityZones('access_key', 'secret_access_key', null, $this->httpClient); + } + + public function testDescribeSingleAvailabilityZone() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeAvailabilityZonesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <availabilityZoneInfo>\r\n" + . " <item>\r\n" + . " <zoneName>us-east-1a</zoneName>\r\n" + . " <zoneState>available</zoneState>\r\n" + . " </item>\r\n" + . " </availabilityZoneInfo>\r\n" + . "</DescribeAvailabilityZonesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->availabilityZones->describe('us-east-1a'); + $this->assertInternalType('array', $response); + $this->assertEquals('us-east-1a', $response[0]['zoneName']); + $this->assertEquals('available', $response[0]['zoneState']); + } + + public function testDescribeMultipleAvailabilityZones() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeAvailabilityZonesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <availabilityZoneInfo>\r\n" + . " <item>\r\n" + . " <zoneName>us-east-1a</zoneName>\r\n" + . " <zoneState>available</zoneState>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <zoneName>us-east-1b</zoneName>\r\n" + . " <zoneState>available</zoneState>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <zoneName>us-east-1c</zoneName>\r\n" + . " <zoneState>available</zoneState>\r\n" + . " </item>\r\n" + . " </availabilityZoneInfo>\r\n" + . "</DescribeAvailabilityZonesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->availabilityZones->describe(); + + $this->assertInternalType('array', $response); + + $arrExpected = array('us-east-1a', 'us-east-1b', 'us-east-1c'); + foreach ($response as $k => $node) { + $this->assertEquals($arrExpected[$k], $node['zoneName']); + } + } +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/CloudWatchTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/CloudWatchTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0fb6196a38b3218c69c5d98e2c3ee9ee499997cd --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/CloudWatchTest.php @@ -0,0 +1,300 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + +/** + * ZendService\Amazon\Ec2\CloudWatch test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class CloudWatchTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var ZendService\Amazon\Ec2\CloudWatch + */ + private $cloudWatchInstance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->cloudWatchInstance = new Ec2\CloudWatch('access_key', 'secret_access_key', null, $this->httpClient); + } + + /** + * Tests ZendService\Amazon\Ec2\CloudWatch->getMetricStatistics() + */ + public function testGetMetricStatistics() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<GetMetricStatisticsResponse xmlns=\"http://monitoring.amazonaws.com/doc/2009-05-15/\">\r\n" + ." <GetMetricStatisticsResult>\r\n" + ." <Datapoints>\r\n" + ." <member>\r\n" + ." <Timestamp>2009-06-16T23:57:00Z</Timestamp>\r\n" + ." <Unit>Bytes</Unit>\r\n" + ." <Samples>1.0</Samples>\r\n" + ." <Average>14838.0</Average>\r\n" + ." </member>\r\n" + ." <member>\r\n" + ." <Timestamp>2009-06-17T00:16:00Z</Timestamp>\r\n" + ." <Unit>Bytes</Unit>\r\n" + ." <Samples>1.0</Samples>\r\n" + ." <Average>18251.0</Average>\r\n" + ." </member>\r\n" + ." </Datapoints>\r\n" + ." <Label>NetworkIn</Label>" + ." </GetMetricStatisticsResult>\r\n" + ."</GetMetricStatisticsResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->cloudWatchInstance->getMetricStatistics(array('MeasureName' => 'NetworkIn', 'Statistics' => array('Average'))); + + $arrReturn = array( + 'label' => 'NetworkIn', + 'datapoints' => array( + array( + 'Timestamp' => '2009-06-16T23:57:00Z', + 'Unit' => 'Bytes', + 'Samples' => '1.0', + 'Average' => '14838.0', + ), + array( + 'Timestamp' => '2009-06-17T00:16:00Z', + 'Unit' => 'Bytes', + 'Samples' => '1.0', + 'Average' => '18251.0', + ) + ) + ); + + $this->assertSame($arrReturn, $return); + + } + + /** + * Tests ZendService\Amazon\Ec2\CloudWatch->listMetrics() + */ + public function testListMetrics() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<ListMetricsResponse xmlns=\"http://monitoring.amazonaws.com/doc/2009-05-15/\">\r\n" + ." <ListMetricsResult>\r\n" + ." <Metrics>\r\n" + ." <member>\r\n" + ." <Dimensions>\r\n" + ." <member>\r\n" + ." <Name>InstanceId</Name>\r\n" + ." <Value>i-bec576d7</Value>\r\n" + ." </member>\r\n" + ." </Dimensions>\r\n" + ." <MeasureName>NetworkIn</MeasureName>\r\n" + ." <Namespace>AWS/EC2</Namespace>\r\n" + ." </member>\r\n" + ." <member>\r\n" + ." <Dimensions>\r\n" + ." <member>\r\n" + ." <Name>InstanceId</Name>\r\n" + ." <Value>i-bec576d7</Value>\r\n" + ." </member>\r\n" + ." </Dimensions>\r\n" + ." <MeasureName>CPUUtilization</MeasureName>\r\n" + ." <Namespace>AWS/EC2</Namespace>\r\n" + ." </member>\r\n" + ." <member>\r\n" + ." <Dimensions/>\r\n" + ." <MeasureName>NetworkIn</MeasureName>\r\n" + ." <Namespace>AWS/EC2</Namespace>\r\n" + ." </member>\r\n" + ." </Metrics>\r\n" + ." </ListMetricsResult>\r\n" + ."</ListMetricsResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->cloudWatchInstance->listMetrics(); + + $arrReturn = array( + array( + 'MeasureName' => 'NetworkIn', + 'Namespace' => 'AWS/EC2', + 'Deminsions' => array( + 'name' => 'InstanceId', + 'value' => 'i-bec576d7' + ) + ), + array( + 'MeasureName' => 'CPUUtilization', + 'Namespace' => 'AWS/EC2', + 'Deminsions' => array( + 'name' => 'InstanceId', + 'value' => 'i-bec576d7' + ) + ), + array( + 'MeasureName' => 'NetworkIn', + 'Namespace' => 'AWS/EC2', + 'Deminsions' => array() + ) + ); + + $this->assertSame($arrReturn, $return); + } + + public function testZF8149() + { + + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<GetMetricStatisticsResponse xmlns=\"http://monitoring.amazonaws.com/doc/2009-05-15/\">\r\n" + ." <GetMetricStatisticsResult>\r\n" + ." <Datapoints>\r\n" + ." <member>\r\n" + ." <Timestamp>2009-11-19T21:52:00Z</Timestamp>\r\n" + ." <Unit>Percent</Unit>\r\n" + ." <Samples>1.0</Samples>\r\n" + ." <Average>0.09</Average>\r\n" + ." </member>\r\n" + ." <member>\r\n" + ." <Timestamp>2009-11-19T21:55:00Z</Timestamp>\r\n" + ." <Unit>Percent</Unit>\r\n" + ." <Samples>1.0</Samples>\r\n" + ." <Average>0.18</Average>\r\n" + ." </member>\r\n" + ." <member>\r\n" + ." <Timestamp>2009-11-19T21:54:00Z</Timestamp>\r\n" + ." <Unit>Percent</Unit>\r\n" + ." <Samples>1.0</Samples>\r\n" + ." <Average>0.09</Average>\r\n" + ." </member>\r\n" + ." <member>\r\n" + ." <Timestamp>2009-11-19T21:51:00Z</Timestamp>\r\n" + ." <Unit>Percent</Unit>\r\n" + ." <Samples>1.0</Samples>\r\n" + ." <Average>0.18</Average>\r\n" + ." </member>\r\n" + ." <member>\r\n" + ." <Timestamp>2009-11-19T21:53:00Z</Timestamp>\r\n" + ." <Unit>Percent</Unit>\r\n" + ." <Samples>1.0</Samples>\r\n" + ." <Average>0.09</Average>\r\n" + ." </member>\r\n" + ." </Datapoints>\r\n" + ." <Label>CPUUtilization</Label>\r\n" + ." </GetMetricStatisticsResult>\r\n" + ." <ResponseMetadata>\r\n" + ." <RequestId>6fb864fd-d557-11de-ac37-475775222f21</RequestId>\r\n" + ." </ResponseMetadata>\r\n" + ."</GetMetricStatisticsResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->cloudWatchInstance->getMetricStatistics( + array( + 'MeasureName' => 'CPUUtilization', + 'Statistics' => array('Average'), + 'Dimensions'=> array('InstanceId'=>'i-93ba31fa'), + 'StartTime'=> '2009-11-19T21:51:57+00:00', + 'EndTime'=> '2009-11-19T21:56:57+00:00' + ) + ); + + $arrReturn = array ( + 'label' => 'CPUUtilization', + 'datapoints' => + array ( + 0 => + array ( + 'Timestamp' => '2009-11-19T21:52:00Z', + 'Unit' => 'Percent', + 'Samples' => '1.0', + 'Average' => '0.09', + ), + 1 => + array ( + 'Timestamp' => '2009-11-19T21:55:00Z', + 'Unit' => 'Percent', + 'Samples' => '1.0', + 'Average' => '0.18', + ), + 2 => + array ( + 'Timestamp' => '2009-11-19T21:54:00Z', + 'Unit' => 'Percent', + 'Samples' => '1.0', + 'Average' => '0.09', + ), + 3 => + array ( + 'Timestamp' => '2009-11-19T21:51:00Z', + 'Unit' => 'Percent', + 'Samples' => '1.0', + 'Average' => '0.18', + ), + 4 => + array ( + 'Timestamp' => '2009-11-19T21:53:00Z', + 'Unit' => 'Percent', + 'Samples' => '1.0', + 'Average' => '0.09', + ), + ), + ); + + $this->assertSame($arrReturn, $return); + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/EbsTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/EbsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..6579c9437a1353ffef8ea5e4fc32bc5dfa5ab628 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/EbsTest.php @@ -0,0 +1,563 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; + +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + + +/** + * ZendService\Amazon\Ec2\Ebs test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class EbsTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var \ZendService\Amazon\Ec2\Ebs + */ + private $ebsInstance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->ebsInstance = new Ec2\Ebs('access_key', 'secret_access_key', null, $this->httpClient); + } + + public function testAttachVolume() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<AttachVolumeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <volumeId>vol-4d826724</volumeId>\r\n" + . " <instanceId>i-6058a509</instanceId>\r\n" + . " <device>/dev/sdh</device>\r\n" + . " <status>attaching</status>\r\n" + . " <attachTime>2008-05-07T11:51:50.000Z</attachTime>\r\n" + . "</AttachVolumeResponse >"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->attachVolume('vol-4d826724', 'i-6058a509', '/dev/sdh'); + + $arrAttach = array( + 'volumeId' => 'vol-4d826724', + 'instanceId' => 'i-6058a509', + 'device' => '/dev/sdh', + 'status' => 'attaching', + 'attachTime' => '2008-05-07T11:51:50.000Z' + ); + + $this->assertSame($arrAttach, $return); + } + + public function testCreateSnapshot() + { + + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<CreateSnapshotResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <snapshotId>snap-78a54011</snapshotId>\r\n" + . " <volumeId>vol-4d826724</volumeId>\r\n" + . " <status>pending</status>\r\n" + . " <startTime>2008-05-07T11:51:50.000Z</startTime>\r\n" + . " <progress></progress>\r\n" + . "</CreateSnapshotResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->createSnapshot('vol-4d826724'); + + $arrCreateSnapShot = array( + 'snapshotId' => 'snap-78a54011', + 'volumeId' => 'vol-4d826724', + 'status' => 'pending', + 'startTime' => '2008-05-07T11:51:50.000Z', + 'progress' => '' + ); + + $this->assertSame($arrCreateSnapShot, $return); + + } + + public function testCreateNewVolume() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<CreateVolumeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <volumeId>vol-4d826724</volumeId>\r\n" + . " <size>400</size>\r\n" + . " <status>creating</status>\r\n" + . " <createTime>2008-05-07T11:51:50.000Z</createTime>\r\n" + . " <availabilityZone>us-east-1a</availabilityZone>\r\n" + . " <snapshotId></snapshotId>\r\n" + . "</CreateVolumeResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->createNewVolume(400, 'us-east-1a'); + + $arrCreateNewVolume = array( + 'volumeId' => 'vol-4d826724', + 'size' => '400', + 'status' => 'creating', + 'createTime' => '2008-05-07T11:51:50.000Z', + 'availabilityZone' => 'us-east-1a' + ); + + $this->assertSame($arrCreateNewVolume, $return); + + } + + public function testCreateVolumeFromSnapshot() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<CreateVolumeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <volumeId>vol-4d826724</volumeId>\r\n" + . " <size>400</size>\r\n" + . " <status>creating</status>\r\n" + . " <createTime>2008-05-07T11:51:50.000Z</createTime>\r\n" + . " <availabilityZone>us-east-1a</availabilityZone>\r\n" + . " <snapshotId>snap-78a54011</snapshotId>\r\n" + . "</CreateVolumeResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->createVolumeFromSnapshot('snap-78a54011', 'us-east-1a'); + + $arrCreateNewVolume = array( + 'volumeId' => 'vol-4d826724', + 'size' => '400', + 'status' => 'creating', + 'createTime' => '2008-05-07T11:51:50.000Z', + 'availabilityZone' => 'us-east-1a', + 'snapshotId' => 'snap-78a54011' + ); + + $this->assertSame($arrCreateNewVolume, $return); + + } + + public function testDeleteSnapshot() + { + + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DeleteSnapshotResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</DeleteSnapshotResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->deleteSnapshot('snap-78a54011'); + + $this->assertTrue($return); + + } + + public function testDeleteVolume() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DeleteVolumeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</DeleteVolumeResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->deleteVolume('vol-4d826724'); + + $this->assertTrue($return); + } + + /** + * Tests ZendService\Amazon\Ec2\Ebs->describeSnapshot() + */ + public function testDescribeSingleSnapshot() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeSnapshotsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <snapshotSet>\r\n" + . " <item>\r\n" + . " <snapshotId>snap-78a54011</snapshotId>\r\n" + . " <volumeId>vol-4d826724</volumeId>\r\n" + . " <status>pending</status>\r\n" + . " <startTime>2008-05-07T12:51:50.000Z</startTime>\r\n" + . " <progress>80%</progress>\r\n" + . " </item>\r\n" + . " </snapshotSet>\r\n" + . "</DescribeSnapshotsResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->describeSnapshot('snap-78a54011'); + + $arrSnapshot = array(array( + 'snapshotId' => 'snap-78a54011', + 'volumeId' => 'vol-4d826724', + 'status' => 'pending', + 'startTime' => '2008-05-07T12:51:50.000Z', + 'progress' => '80%' + )); + + $this->assertSame($arrSnapshot, $return); + + + } + + public function testDescribeMultipleSnapshots() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeSnapshotsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <snapshotSet>\r\n" + . " <item>\r\n" + . " <snapshotId>snap-78a54011</snapshotId>\r\n" + . " <volumeId>vol-4d826724</volumeId>\r\n" + . " <status>pending</status>\r\n" + . " <startTime>2008-05-07T12:51:50.000Z</startTime>\r\n" + . " <progress>80%</progress>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <snapshotId>snap-78a54012</snapshotId>\r\n" + . " <volumeId>vol-4d826725</volumeId>\r\n" + . " <status>pending</status>\r\n" + . " <startTime>2008-08-07T12:51:50.000Z</startTime>\r\n" + . " <progress>65%</progress>\r\n" + . " </item>\r\n" + . " </snapshotSet>\r\n" + . "</DescribeSnapshotsResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->describeSnapshot(array('snap-78a54011', 'snap-78a54012')); + + $arrSnapshots = array( + array( + 'snapshotId' => 'snap-78a54011', + 'volumeId' => 'vol-4d826724', + 'status' => 'pending', + 'startTime' => '2008-05-07T12:51:50.000Z', + 'progress' => '80%', + ), + array( + 'snapshotId' => 'snap-78a54012', + 'volumeId' => 'vol-4d826725', + 'status' => 'pending', + 'startTime' => '2008-08-07T12:51:50.000Z', + 'progress' => '65%', + ) + ); + + $this->assertSame($arrSnapshots, $return); + + } + + /** + * Tests ZendService\Amazon\Ec2\Ebs->describeVolume() + */ + public function testDescribeSingleVolume() + { + + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeVolumesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . "<volumeSet>\r\n" + . " <item>\r\n" + . " <volumeId>vol-4282672b</volumeId>\r\n" + . " <size>800</size>\r\n" + . " <status>in-use</status>\r\n" + . " <createTime>2008-05-07T11:51:50.000Z</createTime>\r\n" + . " <attachmentSet>\r\n" + . " <item>\r\n" + . " <volumeId>vol-4282672b</volumeId>\r\n" + . " <instanceId>i-6058a509</instanceId>\r\n" + . " <device>/dev/sdh</device>\r\n" + . " <snapshotId>snap-12345678</snapshotId>\r\n" + . " <availabilityZone>us-east-1a</availabilityZone>\r\n" + . " <status>attached</status>\r\n" + . " <attachTime>2008-05-07T12:51:50.000Z</attachTime>\r\n" + . " </item>\r\n" + . " </attachmentSet>\r\n" + . " </item>\r\n" + . "</volumeSet>\r\n" + . "</DescribeVolumesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->describeVolume('vol-4282672b'); + + $arrVolumes = array( + array( + 'volumeId' => 'vol-4282672b', + 'size' => '800', + 'status' => 'in-use', + 'createTime' => '2008-05-07T11:51:50.000Z', + 'attachmentSet' => array( + 'volumeId' => 'vol-4282672b', + 'instanceId' => 'i-6058a509', + 'device' => '/dev/sdh', + 'status' => 'attached', + 'attachTime' => '2008-05-07T12:51:50.000Z', + ) + ) + ); + + $this->assertSame($arrVolumes, $return); + + } + + public function testDescribeMultipleVolume() + { + + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeVolumesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . "<volumeSet>\r\n" + . " <item>\r\n" + . " <volumeId>vol-4282672b</volumeId>\r\n" + . " <size>800</size>\r\n" + . " <status>in-use</status>\r\n" + . " <createTime>2008-05-07T11:51:50.000Z</createTime>\r\n" + . " <attachmentSet>\r\n" + . " <item>\r\n" + . " <volumeId>vol-4282672b</volumeId>\r\n" + . " <instanceId>i-6058a509</instanceId>\r\n" + . " <device>/dev/sdh</device>\r\n" + . " <snapshotId>snap-12345678</snapshotId>\r\n" + . " <availabilityZone>us-east-1a</availabilityZone>\r\n" + . " <status>attached</status>\r\n" + . " <attachTime>2008-05-07T12:51:50.000Z</attachTime>\r\n" + . " </item>\r\n" + . " </attachmentSet>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <volumeId>vol-42826775</volumeId>\r\n" + . " <size>40</size>\r\n" + . " <status>available</status>\r\n" + . " <createTime>2008-08-07T11:51:50.000Z</createTime>\r\n" + . " </item>\r\n" + . "</volumeSet>\r\n" + . "</DescribeVolumesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->describeVolume(array('vol-4282672b', 'vol-42826775')); + + $arrVolumes = array( + array( + 'volumeId' => 'vol-4282672b', + 'size' => '800', + 'status' => 'in-use', + 'createTime' => '2008-05-07T11:51:50.000Z', + 'attachmentSet' => array( + 'volumeId' => 'vol-4282672b', + 'instanceId' => 'i-6058a509', + 'device' => '/dev/sdh', + 'status' => 'attached', + 'attachTime' => '2008-05-07T12:51:50.000Z', + ) + ), + array( + 'volumeId' => 'vol-42826775', + 'size' => '40', + 'status' => 'available', + 'createTime' => '2008-08-07T11:51:50.000Z' + ) + ); + + $this->assertSame($arrVolumes, $return); + } + + public function testDescribeAttachedVolumes() + { + + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeVolumesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . "<volumeSet>\r\n" + . " <item>\r\n" + . " <volumeId>vol-4282672b</volumeId>\r\n" + . " <size>800</size>\r\n" + . " <status>in-use</status>\r\n" + . " <createTime>2008-05-07T11:51:50.000Z</createTime>\r\n" + . " <attachmentSet>\r\n" + . " <item>\r\n" + . " <volumeId>vol-4282672b</volumeId>\r\n" + . " <instanceId>i-6058a509</instanceId>\r\n" + . " <device>/dev/sdh</device>\r\n" + . " <snapshotId>snap-12345678</snapshotId>\r\n" + . " <availabilityZone>us-east-1a</availabilityZone>\r\n" + . " <status>attached</status>\r\n" + . " <attachTime>2008-05-07T12:51:50.000Z</attachTime>\r\n" + . " </item>\r\n" + . " </attachmentSet>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <volumeId>vol-42826775</volumeId>\r\n" + . " <size>40</size>\r\n" + . " <status>available</status>\r\n" + . " <createTime>2008-08-07T11:51:50.000Z</createTime>\r\n" + . " </item>\r\n" + . "</volumeSet>\r\n" + . "</DescribeVolumesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->describeAttachedVolumes('i-6058a509'); + + $arrVolumes = array( + array( + 'volumeId' => 'vol-4282672b', + 'size' => '800', + 'status' => 'in-use', + 'createTime' => '2008-05-07T11:51:50.000Z', + 'attachmentSet' => array( + 'volumeId' => 'vol-4282672b', + 'instanceId' => 'i-6058a509', + 'device' => '/dev/sdh', + 'status' => 'attached', + 'attachTime' => '2008-05-07T12:51:50.000Z', + ) + ) + ); + + $this->assertSame($arrVolumes, $return); + } + + /** + * Tests ZendService\Amazon\Ec2\Ebs->detachVolume() + */ + public function testDetachVolume() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DetachVolumeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <volumeId>vol-4d826724</volumeId>\r\n" + . " <instanceId>i-6058a509</instanceId>\r\n" + . " <device>/dev/sdh</device>\r\n" + . " <status>detaching</status>\r\n" + . " <attachTime>2008-05-08T11:51:50.000Z</attachTime>\r\n" + . "</DetachVolumeResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ebsInstance->detachVolume('vol-4d826724'); + + $arrVolume = array( + 'volumeId' => 'vol-4d826724', + 'instanceId' => 'i-6058a509', + 'device' => '/dev/sdh', + 'status' => 'detaching', + 'attachTime' => '2008-05-08T11:51:50.000Z' + ); + + $this->assertSame($arrVolume, $return); + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/Ec2Test.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/Ec2Test.php new file mode 100644 index 0000000000000000000000000000000000000000..8594ae246317b1f1e566da52bb78c58fb1222af8 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/Ec2Test.php @@ -0,0 +1,84 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; + +/** + * ZendService\Amazon\Ec2 test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class Ec2Test extends \PHPUnit_Framework_TestCase +{ + + /** + * @var ZendService\Amazon\Ec2 + */ + private $ec2Instance; + + public function testFactoryReturnsKeyPairObject() + { + $object = Ec2\Ec2::factory('keypair', 'access_key', 'secret_access_key'); + $this->assertInstanceOf('ZendService\Amazon\Ec2\Keypair', $object); + } + + public function testFactoryReturnsElasticIpObject() + { + $object = Ec2\Ec2::factory('elasticip', 'access_key', 'secret_access_key'); + $this->assertInstanceOf('ZendService\Amazon\Ec2\Elasticip', $object); + } + + public function testFactoryReturnsEbsObject() + { + $object = Ec2\Ec2::factory('ebs', 'access_key', 'secret_access_key'); + $this->assertInstanceOf('ZendService\Amazon\Ec2\Ebs', $object); + } + + public function testFactoryReturnsAvailabilityZonesObject() + { + $object = Ec2\Ec2::factory('availabilityzones', 'access_key', 'secret_access_key'); + $this->assertInstanceOf('ZendService\Amazon\Ec2\AvailabilityZones', $object); + } + + public function testFactoryReturnImageObject() + { + $object = Ec2\Ec2::factory('image', 'access_key', 'secret_access_key'); + $this->assertInstanceOf('ZendService\Amazon\Ec2\Image', $object); + } + + public function testFactoryReturnsInstanceObject() + { + $object = Ec2\Ec2::factory('instance', 'access_key', 'secret_access_key'); + $this->assertInstanceOf('ZendService\Amazon\Ec2\Instance', $object); + } + + public function testFactoryReturnsSecurityGroupsObject() + { + $object = Ec2\Ec2::factory('security', 'access_key', 'secret_access_key'); + $this->assertInstanceOf('ZendService\Amazon\Ec2\Securitygroups', $object); + } + + public function testFactoryWillFailInvalidSection() + { + try { + $object = Ec2\Ec2::factory('avaavaavailabilityzones', 'access_key', 'secret_access_key'); + $this->fail('RuntimeException was expected but not thrown'); + } catch (Ec2\Exception\RuntimeException $e) { + } + } +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/ElasticIpTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/ElasticIpTest.php new file mode 100644 index 0000000000000000000000000000000000000000..569084cf7edd63a7fe52cccaa534329c5eef56b6 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/ElasticIpTest.php @@ -0,0 +1,225 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + +/** + * Zend_Service_Amazon_Ec2_Elasticip test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class ElasticIpTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var \ZendService\Amazon\Ec2\Elasticip + */ + protected $elasticip; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->elasticip = new Ec2\ElasticIp('access_key', 'secret_access_key', null, $this->httpClient); + } + + public function testAllocateNewElasticIp() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<AllocateAddressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <publicIp>67.202.55.255</publicIp>\r\n" + . "</AllocateAddressResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $ipAddress = $this->elasticip->allocate(); + $this->assertEquals('67.202.55.255', $ipAddress); + } + + public function testAssociateElasticIpWithInstanceReturnsTrue() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<AssociateAddressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</AssociateAddressResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->elasticip->associate('67.202.55.255', 'i-ag8ga0a'); + + $this->assertTrue($return); + + } + + /** + * Tests Zend_Service_Amazon_Ec2_Elasticip->describe() + */ + public function testDescribeSingleElasticIp() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeAddressesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <addressSet>\r\n" + . " <item>\r\n" + . " <publicIp>67.202.55.255</publicIp>\r\n" + . " <instanceId>i-ag8ga0a</instanceId>\r\n" + . " </item>\r\n" + . " </addressSet>\r\n" + . "</DescribeAddressesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->elasticip->describe('67.202.55.255'); + + $arrIp = array( + 'publicIp' => '67.202.55.255', + 'instanceId' => 'i-ag8ga0a' + ); + + $this->assertSame($arrIp, $response[0]); + } + + public function testDescribeMultipleElasticIp() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeAddressesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <addressSet>\r\n" + . " <item>\r\n" + . " <publicIp>67.202.55.255</publicIp>\r\n" + . " <instanceId>i-ag8ga0a</instanceId>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <publicIp>67.202.55.200</publicIp>\r\n" + . " <instanceId>i-aauoi9g</instanceId>\r\n" + . " </item>\r\n" + . " </addressSet>\r\n" + . "</DescribeAddressesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->elasticip->describe(array('67.202.55.255', '67.202.55.200')); + + $arrIps = array( + array( + 'publicIp' => '67.202.55.255', + 'instanceId' => 'i-ag8ga0a' + ), + array( + 'publicIp' => '67.202.55.200', + 'instanceId' => 'i-aauoi9g' + ) + ); + + foreach($response as $k => $r) { + $this->assertSame($arrIps[$k], $r); + } + } + + /** + * Tests Zend_Service_Amazon_Ec2_Elasticip->disassocate() + */ + public function testDisassocateElasticIpFromInstance() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DisassociateAddressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</DisassociateAddressResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->elasticip->disassocate('67.202.55.255'); + + $this->assertTrue($return); + + } + + /** + * Tests Zend_Service_Amazon_Ec2_Elasticip->release() + */ + public function testReleaseElasticIp() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<ReleaseAddressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</ReleaseAddressResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->elasticip->release('67.202.55.255'); + + $this->assertTrue($return); + + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/ImageTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/ImageTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5abc394994a1929290173deed00188ed13f78e7a --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/ImageTest.php @@ -0,0 +1,605 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; +use ZendService\Amazon\Ec2\Exception; + +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + +/** + * ZendService\Amazon\Ec2\Image test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class ImageTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var ZendService\Amazon\Ec2\Image + */ + private $ec2ImageInstance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->ec2ImageInstance = new Ec2\Image('access_key', 'secret_access_key', null, $this->httpClient); + } + + public function testDeregister() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DeregisterImageResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</DeregisterImageResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->deregister('ami-61a54008'); + + $this->assertTrue($return); + + } + + public function testDescribeSingleImageMultipleImagesByIds() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeImagesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imagesSet>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd7</imageId>\r\n" + . " <imageLocation>ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>206029621532</imageOwnerId>\r\n" + . " <isPublic>false</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd6</imageId>\r\n" + . " <imageLocation>ec2-public-images/ubuntu-8.10-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>206029621532</imageOwnerId>\r\n" + . " <isPublic>true</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " </imagesSet>\r\n" + . "</DescribeImagesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->describe(array('ami-be3adfd7', 'ami-be3adfd6')); + + $arrImage = array( + array( + 'imageId' => 'ami-be3adfd7', + 'imageLocation' => 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '206029621532', + 'isPublic' => 'false', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ), + array( + 'imageId' => 'ami-be3adfd6', + 'imageLocation' => 'ec2-public-images/ubuntu-8.10-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '206029621532', + 'isPublic' => 'true', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ) + ); + + $this->assertSame($arrImage, $return); + } + + public function testDescribeSingleImageById() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeImagesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imagesSet>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd7</imageId>\r\n" + . " <imageLocation>ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>206029621532</imageOwnerId>\r\n" + . " <isPublic>false</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " </imagesSet>\r\n" + . "</DescribeImagesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->describe('ami-be3adfd7'); + + $arrImage = array( + array( + 'imageId' => 'ami-be3adfd7', + 'imageLocation' => 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '206029621532', + 'isPublic' => 'false', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ) + ); + + $this->assertSame($arrImage, $return); + } + + public function testDescribeSingleImageMultipleImagesByOwnerId() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeImagesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imagesSet>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd7</imageId>\r\n" + . " <imageLocation>ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>2060296256884</imageOwnerId>\r\n" + . " <isPublic>false</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd6</imageId>\r\n" + . " <imageLocation>ec2-public-images/ubuntu-8.10-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>206029621532</imageOwnerId>\r\n" + . " <isPublic>true</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " </imagesSet>\r\n" + . "</DescribeImagesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->describe(null, array('2060296256884', '206029621532')); + + $arrImage = array( + array( + 'imageId' => 'ami-be3adfd7', + 'imageLocation' => 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '2060296256884', + 'isPublic' => 'false', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ), + array( + 'imageId' => 'ami-be3adfd6', + 'imageLocation' => 'ec2-public-images/ubuntu-8.10-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '206029621532', + 'isPublic' => 'true', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ) + ); + + $this->assertSame($arrImage, $return); + } + + public function testDescribeSingleImageByOwnerId() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeImagesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imagesSet>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd7</imageId>\r\n" + . " <imageLocation>ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>206029621532</imageOwnerId>\r\n" + . " <isPublic>false</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " </imagesSet>\r\n" + . "</DescribeImagesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->describe(null, '206029621532'); + + $arrImage = array( + array( + 'imageId' => 'ami-be3adfd7', + 'imageLocation' => 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '206029621532', + 'isPublic' => 'false', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ) + ); + + $this->assertSame($arrImage, $return); + } + + public function testDescribeSingleImageMultipleImagesByExecutableBy() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeImagesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imagesSet>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd7</imageId>\r\n" + . " <imageLocation>ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>2060296256884</imageOwnerId>\r\n" + . " <isPublic>false</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd6</imageId>\r\n" + . " <imageLocation>ec2-public-images/ubuntu-8.10-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>206029621532</imageOwnerId>\r\n" + . " <isPublic>true</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " </imagesSet>\r\n" + . "</DescribeImagesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->describe(null, null, array('46361432890', '432432265322')); + + $arrImage = array( + array( + 'imageId' => 'ami-be3adfd7', + 'imageLocation' => 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '2060296256884', + 'isPublic' => 'false', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ), + array( + 'imageId' => 'ami-be3adfd6', + 'imageLocation' => 'ec2-public-images/ubuntu-8.10-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '206029621532', + 'isPublic' => 'true', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ) + ); + + $this->assertSame($arrImage, $return); + } + + public function testDescribeSingleImageByExecutableBy() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeImagesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imagesSet>\r\n" + . " <item>\r\n" + . " <imageId>ami-be3adfd7</imageId>\r\n" + . " <imageLocation>ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml</imageLocation>\r\n" + . " <imageState>available</imageState>\r\n" + . " <imageOwnerId>206029621532</imageOwnerId>\r\n" + . " <isPublic>false</isPublic>\r\n" + . " <architecture>i386</architecture>\r\n" + . " <imageType>machine</imageType>\r\n" + . " <kernelId>aki-4438dd2d</kernelId>\r\n" + . " <ramdiskId>ari-4538dd2c</ramdiskId>\r\n" + . " </item>\r\n" + . " </imagesSet>\r\n" + . "</DescribeImagesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->describe(null, null, '46361432890'); + + $arrImage = array( + array( + 'imageId' => 'ami-be3adfd7', + 'imageLocation' => 'ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml', + 'imageState' => 'available', + 'imageOwnerId' => '206029621532', + 'isPublic' => 'false', + 'architecture' => 'i386', + 'imageType' => 'machine', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'platform' => '', + ) + ); + + $this->assertSame($arrImage, $return); + } + + public function testDescribeAttributeLaunchPermission() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeImageAttributeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imageId>ami-61a54008</imageId>\r\n" + . " <launchPermission>\r\n" + . " <item>\r\n" + . " <userId>495219933132</userId>\r\n" + . " </item>\r\n" + . " </launchPermission>\r\n" + . "</DescribeImageAttributeResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->describeAttribute('ami-61a54008', 'launchPermission'); + + $this->assertEquals('ami-61a54008', $return['imageId']); + $this->assertEquals('495219933132', $return['launchPermission'][0]); + } + + public function testDescribeAttributeProductCodes() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeImageAttributeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imageId>ami-61a54008</imageId>\r\n" + . " <productCodes>\r\n" + . " <item>\r\n" + . " <productCode>774F4FF8</productCode>\r\n" + . " </item>\r\n" + . " </productCodes>\r\n" + . "</DescribeImageAttributeResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->describeAttribute('ami-61a54008', 'productCodes'); + + $this->assertEquals('ami-61a54008', $return['imageId']); + $this->assertEquals('774F4FF8', $return['productCodes'][0]); + } + + public function testModifyAttributeSingleLaunchPermission() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<ModifyImageAttributeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</ModifyImageAttributeResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->modifyAttribute('ami-61a54008', 'launchPermission', 'add', '495219933132', 'all'); + $this->assertTrue($return); + } + + public function testModifyAttributeMultipleLaunchPermission() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<ModifyImageAttributeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</ModifyImageAttributeResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->modifyAttribute('ami-61a54008', 'launchPermission', 'add', array('495219933132', '495219933133'), array('all', 'all')); + $this->assertTrue($return); + } + + public function testModifyAttributeThrowsExceptionOnInvalidAttribute() + { + $this->setExpectedException( + 'ZendService\Amazon\Ec2\Exception\InvalidArgumentException', + 'Invalid attribute passed in.'); + $return = $this->ec2ImageInstance->modifyAttribute('ami-61a54008', 'invalidPermission', 'add', '495219933132', 'all'); + } + + public function testModifyAttributeProuctCodes() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<ModifyImageAttributeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</ModifyImageAttributeResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->modifyAttribute('ami-61a54008', 'productCodes', null, null, null, '774F4FF8'); + + $this->assertTrue($return); + + } + + public function testRegister() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<RegisterImageResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <imageId>ami-61a54008</imageId>\r\n" + . "</RegisterImageResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->register('mybucket-myimage.manifest.xml'); + + $this->assertEquals('ami-61a54008', $return); + + } + + public function testResetAttribute() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<ResetImageAttributeResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</ResetImageAttributeResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->ec2ImageInstance->resetAttribute('ami-61a54008', 'launchPermission'); + + $this->assertTrue($return); + + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceReservedTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceReservedTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1143d071252834318c5dc46a4260627fa89f6211 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceReservedTest.php @@ -0,0 +1,182 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2\ReservedInstance; + +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + +/** + * Zend_Service_Amazon_Ec2_Instance_Reserved test case. + * @todo Should this class be named Zend_Service_Amazon_Ec2_Instance_ReservedTest? + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class InstanceReservedTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var \ZendService\Amazon\Ec2\ReservedInstance + */ + private $instance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + + $this->instance = new ReservedInstance('access_key', 'secret_access_key', null, $this->httpClient); + } + + /** + * Tests Zend_Service_Amazon_Ec2_Instance_Reserved->describeInstances() + */ + public function testDescribeInstances() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<DescribeReservedInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + ." <reservedInstancesSet>\r\n" + ." <item>\r\n" + ." <reservedInstancesId>4b2293b4-5813-4cc8-9ce3-1957fc1dcfc8</reservedInstancesId>\r\n" + ." <instanceType>m1.small</instanceType>\r\n" + ." <availabilityZone>us-east-1a</availabilityZone>\r\n" + ." <duration>12</duration>\r\n" + ." <usagePrice>0.00</usagePrice>\r\n" + ." <fixedPrice>0.00</fixedPrice>\r\n" + ." <instanceCount>19</instanceCount>\r\n" + ." <productDescription>m1.small offering in us-east-1a</productDescription>\r\n" + ." <state>Active</state>\r\n" + ." </item>\r\n" + ." </reservedInstancesSet>\r\n" + ."</DescribeReservedInstancesResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->describeInstances('4b2293b4-5813-4cc8-9ce3-1957fc1dcfc8'); + + $arrReturn = array( + array( + "reservedInstancesId" => "4b2293b4-5813-4cc8-9ce3-1957fc1dcfc8", + "instanceType" => "m1.small", + "availabilityZone" => "us-east-1a", + "duration" => "12", + "fixedPrice" => "0.00", + "usagePrice" => "0.00", + "productDescription" => "m1.small offering in us-east-1a", + "instanceCount" => "19", + "state" => "Active" + ) + ); + + $this->assertSame($arrReturn, $return); + + } + + /** + * Tests Zend_Service_Amazon_Ec2_Instance_Reserved->describeOfferings() + */ + public function testDescribeOfferings() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<DescribeReservedInstancesOfferingsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + ." <reservedInstancesOfferingsSet>\r\n" + ." <item>\r\n" + ." <reservedInstancesOfferingId>4b2293b4-5813-4cc8-9ce3-1957fc1dcfc8</reservedInstancesOfferingId>\r\n" + ." <instanceType>m1.small</instanceType>\r\n" + ." <availabilityZone>us-east-1a</availabilityZone>\r\n" + ." <duration>12</duration>\r\n" + ." <usagePrice>0.00</usagePrice>\r\n" + ." <fixedPrice>0.00</fixedPrice>\r\n" + ." <productDescription>m1.small offering in us-east-1a</productDescription>\r\n" + ." </item>\r\n" + ." </reservedInstancesOfferingsSet>\r\n" + ."</DescribeReservedInstancesOfferingsResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->describeOfferings(); + + $arrReturn = array( + array( + "reservedInstancesOfferingId" => "4b2293b4-5813-4cc8-9ce3-1957fc1dcfc8", + "instanceType" => "m1.small", + "availabilityZone" => "us-east-1a", + "duration" => "12", + "fixedPrice" => "0.00", + "usagePrice" => "0.00", + "productDescription" => "m1.small offering in us-east-1a", + ) + ); + + $this->assertSame($arrReturn, $return); + + } + + /** + * Tests Zend_Service_Amazon_Ec2_Instance_Reserved->purchaseOffering() + */ + public function testPurchaseOffering() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<PurchaseReservedInstancesOfferingResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + ." <reservedInstancesId>4b2293b4-5813-4cc8-9ce3-1957fc1dcfc8</reservedInstancesId>\r\n" + ."</PurchaseReservedInstancesOfferingResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->purchaseOffering('4b2293b4-5813-4cc8-9ce3-1957fc1dcfc8'); + + $this->assertSame('4b2293b4-5813-4cc8-9ce3-1957fc1dcfc8', $return); + + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1395d01c9f212da803294e0fe71d33ed296ca897 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceTest.php @@ -0,0 +1,704 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2\Instance; +use ZendService\Amazon\Ec2\Exception; +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + + +/** + * Zend_Service_Amazon_Ec2_Instance test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class InstanceTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var Zend_Service_Amazon_Ec2_Instance + */ + private $instance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->instance = new Instance('access_key', 'secret_access_key', null, $this->httpClient); + } + + public function testConstants() + { + $this->assertEquals('m1.small', Instance::SMALL); + $this->assertEquals('m1.large', Instance::LARGE); + $this->assertEquals('m1.xlarge', Instance::XLARGE); + $this->assertEquals('c1.medium', Instance::HCPU_MEDIUM); + $this->assertEquals('c1.xlarge', Instance::HCPU_XLARGE); + } + + /** + * Tests Zend_Service_Amazon_Ec2_Instance->confirmProduct() + */ + public function testConfirmProductReturnsOwnerId() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<ConfirmProductInstanceResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <result>true</result>\r\n" + . " <ownerId>254933287430</ownerId>\r\n" + . "</ConfirmProductInstanceResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->confirmProduct('254933287430', 'i-1bda7172'); + + $this->assertEquals('254933287430', $return['ownerId']); + } + + public function testConfirmProductReturnsFalse() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<ConfirmProductInstanceResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <result>false</result>\r\n" + . "</ConfirmProductInstanceResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->confirmProduct('254933287430', 'i-1bda7172'); + + $this->assertFalse($return); + } + + /** + * Tests Zend_Service_Amazon_Ec2_Instance->describe() + */ + public function testDescribeSingleInstance() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <reservationSet>\r\n" + . " <item>\r\n" + . " <reservationId>r-44a5402d</reservationId>\r\n" + . " <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>\r\n" + . " <groupSet>\r\n" + . " <item>\r\n" + . " <groupId>default</groupId>\r\n" + . " </item>\r\n" + . " </groupSet>\r\n" + . " <instancesSet>\r\n" + . " <item>\r\n" + . " <instanceId>i-28a64341</instanceId>\r\n" + . " <imageId>ami-6ea54007</imageId>\r\n" + . " <instanceState>\r\n" + . " <code>0</code>\r\n" + . " <name>running</name>\r\n" + . " </instanceState>\r\n" + . " <privateDnsName>10-251-50-75.ec2.internal</privateDnsName>\r\n" + . " <dnsName>ec2-72-44-33-4.compute-1.amazonaws.com</dnsName>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <productCodesSet>\r\n" + . " <item><productCode>774F4FF8</productCode></item>\r\n" + . " </productCodesSet>\r\n" + . " <instanceType>m1.small</instanceType>\r\n" + . " <launchTime>2007-08-07T11:54:42.000Z</launchTime>\r\n" + . " <placement>\r\n" + . " <availabilityZone>us-east-1b</availabilityZone>\r\n" + . " </placement>\r\n" + . " <kernelId>aki-ba3adfd3</kernelId>\r\n" + . " <ramdiskId>ari-badbad00</ramdiskId>\r\n" + . " </item>\r\n" + . " </instancesSet>\r\n" + . " </item>\r\n" + . " </reservationSet>\r\n" + . "</DescribeInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->describe('i-28a64341'); + + $this->assertEquals('r-44a5402d', $return['instances'][0]['reservationId']); + $this->assertEquals('default', $return['instances'][0]['groupSet'][0]); + $this->assertEquals('i-28a64341', $return['instances'][0]['instanceId']); + $this->assertEquals('ami-6ea54007', $return['instances'][0]['imageId']); + $this->assertEquals('m1.small', $return['instances'][0]['instanceType']); + $this->assertEquals('us-east-1b', $return['instances'][0]['availabilityZone']); + } + + public function testDescribeIgnoreTerminatedInstance() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <reservationSet>\r\n" + . " <item>\r\n" + . " <reservationId>r-44a5402d</reservationId>\r\n" + . " <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>\r\n" + . " <groupSet>\r\n" + . " <item>\r\n" + . " <groupId>default</groupId>\r\n" + . " </item>\r\n" + . " </groupSet>\r\n" + . " <instancesSet>\r\n" + . " <item>\r\n" + . " <instanceId>i-28a64341</instanceId>\r\n" + . " <imageId>ami-6ea54007</imageId>\r\n" + . " <instanceState>\r\n" + . " <code>48</code>\r\n" + . " <name>terminated</name>\r\n" + . " </instanceState>\r\n" + . " <privateDnsName>10-251-50-75.ec2.internal</privateDnsName>\r\n" + . " <dnsName>ec2-72-44-33-4.compute-1.amazonaws.com</dnsName>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <productCodesSet>\r\n" + . " <item><productCode>774F4FF8</productCode></item>\r\n" + . " </productCodesSet>\r\n" + . " <instanceType>m1.small</instanceType>\r\n" + . " <launchTime>2007-08-07T11:54:42.000Z</launchTime>\r\n" + . " <placement>\r\n" + . " <availabilityZone>us-east-1b</availabilityZone>\r\n" + . " </placement>\r\n" + . " <kernelId>aki-ba3adfd3</kernelId>\r\n" + . " <ramdiskId>ari-badbad00</ramdiskId>\r\n" + . " </item>\r\n" + . " </instancesSet>\r\n" + . " </item>\r\n" + . " </reservationSet>\r\n" + . "</DescribeInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse, true); + + $return = $this->instance->describe('i-28a64341', true); + + $this->assertEquals(0, count($return['instances'])); + } + + public function testDescribeByImageId() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <reservationSet>\r\n" + . " <item>\r\n" + . " <reservationId>r-44a5402d</reservationId>\r\n" + . " <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>\r\n" + . " <groupSet>\r\n" + . " <item>\r\n" + . " <groupId>default</groupId>\r\n" + . " </item>\r\n" + . " </groupSet>\r\n" + . " <instancesSet>\r\n" + . " <item>\r\n" + . " <instanceId>i-28a64341</instanceId>\r\n" + . " <imageId>ami-6ea54007</imageId>\r\n" + . " <instanceState>\r\n" + . " <code>0</code>\r\n" + . " <name>running</name>\r\n" + . " </instanceState>\r\n" + . " <privateDnsName>10-251-50-75.ec2.internal</privateDnsName>\r\n" + . " <dnsName>ec2-72-44-33-4.compute-1.amazonaws.com</dnsName>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <productCodesSet>\r\n" + . " <item><productCode>774F4FF8</productCode></item>\r\n" + . " </productCodesSet>\r\n" + . " <instanceType>m1.small</instanceType>\r\n" + . " <launchTime>2007-08-07T11:54:42.000Z</launchTime>\r\n" + . " <placement>\r\n" + . " <availabilityZone>us-east-1b</availabilityZone>\r\n" + . " </placement>\r\n" + . " <kernelId>aki-ba3adfd3</kernelId>\r\n" + . " <ramdiskId>ari-badbad00</ramdiskId>\r\n" + . " </item>\r\n" + . " </instancesSet>\r\n" + . " </item>\r\n" + . " </reservationSet>\r\n" + . "</DescribeInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->describeByImageId('ami-6ea54007'); + + $this->assertEquals('i-28a64341', $return[0]['instanceId']); + $this->assertEquals('ami-6ea54007', $return[0]['imageId']); + $this->assertEquals('m1.small', $return[0]['instanceType']); + $this->assertEquals('us-east-1b', $return[0]['availabilityZone']); + } + + public function testRunThrowsExceptionWhenNoImageIdPassedIn() + { + $this->setExpectedException( + 'ZendService\Amazon\Ec2\Exception\InvalidArgumentException', + 'No Image Id Provided'); + $arrStart = array( + 'maxStart' => 3, + 'keyName' => 'example-key-name', + 'securityGroup' => 'default', + 'userData' => 'instance_id=www3', + 'placement' => 'us-east-1b', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'blockDeviceVirtualName' => 'vertdevice', + 'blockDeviceName' => '/dev/sdv' + ); + + $return = $this->instance->run($arrStart); + } + + public function testRunOneSecurityGroup() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<RunInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <reservationId>r-47a5402e</reservationId>\r\n" + . " <ownerId>495219933132</ownerId>\r\n" + . " <groupSet>\r\n" + . " <item>\r\n" + . " <groupId>default</groupId>\r\n" + . " </item>\r\n" + . " </groupSet>\r\n" + . " <instancesSet>\r\n" + . " <item>\r\n" + . " <instanceId>i-2ba64342</instanceId>\r\n" + . " <imageId>ami-60a54009</imageId>\r\n" + . " <instanceState>\r\n" + . " <code>0</code>\r\n" + . " <name>pending</name>\r\n" + . " </instanceState>\r\n" + . " <privateDnsName></privateDnsName>\r\n" + . " <dnsName></dnsName>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <amiLaunchIndex>0</amiLaunchIndex>\r\n" + . " <InstanceType>m1.small</InstanceType>\r\n" + . " <launchTime>2007-08-07T11:51:50.000Z</launchTime>\r\n" + . " <placement>\r\n" + . " <availabilityZone>us-east-1b</availabilityZone>\r\n" + . " </placement>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <instanceId>i-2bc64242</instanceId>\r\n" + . " <imageId>ami-60a54009</imageId>\r\n" + . " <instanceState>\r\n" + . " <code>0</code>\r\n" + . " <name>pending</name>\r\n" + . " </instanceState>\r\n" + . " <privateDnsName></privateDnsName>\r\n" + . " <dnsName></dnsName>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <amiLaunchIndex>1</amiLaunchIndex>\r\n" + . " <InstanceType>m1.small</InstanceType>\r\n" + . " <launchTime>2007-08-07T11:51:50.000Z</launchTime>\r\n" + . " <placement>\r\n" + . " <availabilityZone>us-east-1b</availabilityZone>\r\n" + . " </placement>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <instanceId>i-2be64332</instanceId>\r\n" + . " <imageId>ami-60a54009</imageId>\r\n" + . " <instanceState>\r\n" + . " <code>0</code>\r\n" + . " <name>pending</name>\r\n" + . " </instanceState>\r\n" + . " <privateDnsName></privateDnsName>\r\n" + . " <dnsName></dnsName>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <amiLaunchIndex>2</amiLaunchIndex>\r\n" + . " <InstanceType>m1.small</InstanceType>\r\n" + . " <launchTime>2007-08-07T11:51:50.000Z</launchTime>\r\n" + . " <placement>\r\n" + . " <availabilityZone>us-east-1b</availabilityZone>\r\n" + . " </placement>\r\n" + . " </item>\r\n" + . " </instancesSet>\r\n" + . "</RunInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + + $arrStart = array( + 'imageId' => 'ami-60a54009', + 'maxStart' => 3, + 'keyName' => 'example-key-name', + 'securityGroup' => 'default', + 'userData' => 'instance_id=www3', + 'placement' => 'us-east-1b', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'blockDeviceVirtualName' => 'vertdevice', + 'blockDeviceName' => '/dev/sdv' + ); + + $return = $this->instance->run($arrStart); + + $this->assertEquals(3, count($return['instances'])); + $this->assertEquals('495219933132', $return['ownerId']); + + $arrInstanceIds = array('i-2ba64342', 'i-2bc64242', 'i-2be64332'); + + foreach($return['instances'] as $k => $r) { + $this->assertEquals($arrInstanceIds[$k], $r['instanceId']); + $this->assertEquals($k, $r['amiLaunchIndex']); + } + + } + + public function testRunMultipleSecurityGroups() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\nn" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<RunInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <reservationId>r-47a5402e</reservationId>\r\n" + . " <ownerId>495219933132</ownerId>\r\n" + . " <groupSet>\r\n" + . " <item>\r\n" + . " <groupId>default</groupId>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <groupId>web</groupId>\r\n" + . " </item>\r\n" + . " </groupSet>\r\n" + . " <instancesSet>\r\n" + . " <item>\r\n" + . " <instanceId>i-2ba64342</instanceId>\r\n" + . " <imageId>ami-60a54009</imageId>\r\n" + . " <instanceState>\r\n" + . " <code>0</code>\r\n" + . " <name>pending</name>\r\n" + . " </instanceState>\r\n" + . " <privateDnsName></privateDnsName>\r\n" + . " <dnsName></dnsName>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <amiLaunchIndex>0</amiLaunchIndex>\r\n" + . " <InstanceType>m1.small</InstanceType>\r\n" + . " <launchTime>2007-08-07T11:51:50.000Z</launchTime>\r\n" + . " <placement>\r\n" + . " <availabilityZone>us-east-1b</availabilityZone>\r\n" + . " </placement>\r\n" + . " </item>\r\n" + . " </instancesSet>\r\n" + . "</RunInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $arrStart = array( + 'imageId' => 'ami-60a54009', + 'keyName' => 'example-key-name', + 'securityGroup' => array('default','web'), + 'userData' => 'instance_id=www3', + 'placement' => 'us-east-1b', + 'kernelId' => 'aki-4438dd2d', + 'ramdiskId' => 'ari-4538dd2c', + 'blockDeviceVirtualName' => 'vertdevice', + 'blockDeviceName' => '/dev/sdv' + ); + + $return = $this->instance->run($arrStart); + + $arrGroups = array('default', 'web'); + + $this->assertSame($arrGroups, $return['groupSet']); + } + + public function testTerminateSingleInstances() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<TerminateInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <instancesSet>\r\n" + . " <item>\r\n" + . " <instanceId>i-28a64341</instanceId>\r\n" + . " <shutdownState>\r\n" + . " <code>32</code>\r\n" + . " <name>shutting-down</name>\r\n" + . " </shutdownState>\r\n" + . " <previousState>\r\n" + . " <code>16</code>\r\n" + . " <name>running</name>\r\n" + . " </previousState>\r\n" + . " </item>\r\n" + . " </instancesSet>\r\n" + . "</TerminateInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->terminate('i-28a64341'); + + $this->assertEquals(1, count($return)); + + foreach($return as $r) { + $this->assertEquals('i-28a64341', $r['instanceId']); + } + } + + public function testTerminateMultipleInstances() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<TerminateInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <instancesSet>\r\n" + . " <item>\r\n" + . " <instanceId>i-28a64341</instanceId>\r\n" + . " <shutdownState>\r\n" + . " <code>32</code>\r\n" + . " <name>shutting-down</name>\r\n" + . " </shutdownState>\r\n" + . " <previousState>\r\n" + . " <code>16</code>\r\n" + . " <name>running</name>\r\n" + . " </previousState>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <instanceId>i-21a64348</instanceId>\r\n" + . " <shutdownState>\r\n" + . " <code>32</code>\r\n" + . " <name>shutting-down</name>\r\n" + . " </shutdownState>\r\n" + . " <previousState>\r\n" + . " <code>16</code>\r\n" + . " <name>running</name>\r\n" + . " </previousState>\r\n" + . " </item>\r\n" + . " </instancesSet>\r\n" + . "</TerminateInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $arrInstanceIds = array('i-28a64341', 'i-21a64348'); + + $return = $this->instance->terminate($arrInstanceIds); + + $this->assertEquals(2, count($return)); + + foreach($return as $k=>$r) { + $this->assertEquals($arrInstanceIds[$k], $r['instanceId']); + } + } + + public function testRebootMultipleInstances() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<RebootInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</RebootInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $arrInstanceIds = array('i-28a64341', 'i-21a64348'); + $return = $this->instance->reboot($arrInstanceIds); + + $this->assertTrue($return); + } + + public function testRebootSingleInstance() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<RebootInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</RebootInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->reboot('i-28a64341'); + + $this->assertTrue($return); + } + + public function testGetConsoleOutput() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<GetConsoleOutputResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <instanceId>i-28a64341</instanceId>\r\n" + . " <timestamp>2007-01-03 15:00:00</timestamp>\r\n" + . " <output>TGludXggdmVyc2lvbiAyLjYuMTYteGVuVSAoYnVpbGRlckBwYXRjaGJhdC5hbWF6b25zYSkgKGdj\r\n" +. "YyB2ZXJzaW9uIDQuMC4xIDIwMDUwNzI3IChSZWQgSGF0IDQuMC4xLTUpKSAjMSBTTVAgVGh1IE9j\r\n" +. "dCAyNiAwODo0MToyNiBTQVNUIDIwMDYKQklPUy1wcm92aWRlZCBwaHlzaWNhbCBSQU0gbWFwOgpY\r\n" +. "ZW46IDAwMDAwMDAwMDAwMDAwMDAgLSAwMDAwMDAwMDZhNDAwMDAwICh1c2FibGUpCjk4ME1CIEhJ\r\n" +. "R0hNRU0gYXZhaWxhYmxlLgo3MjdNQiBMT1dNRU0gYXZhaWxhYmxlLgpOWCAoRXhlY3V0ZSBEaXNh\r\n" +. "YmxlKSBwcm90ZWN0aW9uOiBhY3RpdmUKSVJRIGxvY2t1cCBkZXRlY3Rpb24gZGlzYWJsZWQKQnVp\r\n" +. "bHQgMSB6b25lbGlzdHMKS2VybmVsIGNvbW1hbmQgbGluZTogcm9vdD0vZGV2L3NkYTEgcm8gNApF\r\n" +. "bmFibGluZyBmYXN0IEZQVSBzYXZlIGFuZCByZXN0b3JlLi4uIGRvbmUuCg==</output>\r\n" + . "</GetConsoleOutputResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->consoleOutput('i-28a64341'); + + $arrOutput = array( + 'instanceId' => 'i-28a64341', + 'timestamp' => '2007-01-03 15:00:00', + 'output' => "Linux version 2.6.16-xenU (builder@patchbat.amazonsa) (gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)) #1 SMP Thu Oct 26 08:41:26 SAST 2006\n" +. "BIOS-provided physical RAM map:\n" +. "Xen: 0000000000000000 - 000000006a400000 (usable)\n" +. "980MB HIGHMEM available.\n" +. "727MB LOWMEM available.\n" +. "NX (Execute Disable) protection: active\n" +. "IRQ lockup detection disabled\n" +. "Built 1 zonelists\n" +. "Kernel command line: root=/dev/sda1 ro 4\n" +. "Enabling fast FPU save and restore... done.\n"); + + $this->assertSame($arrOutput, $return); + } + + public function testMonitorInstance() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<MonitorInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <instancesSet>" + . " <item>" + . " <instanceId>i-43a4412a</instanceId>" + . " <monitoring>" + . " <state>monitoring</state>" + . " </monitoring>" + . " </item>" + . " </instancesSet>" + . "</MonitorInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->monitor('i-43a4412a'); + + $arrReturn = array(array('instanceid' => 'i-43a4412a', 'monitorstate' => 'monitoring')); + $this->assertSame($arrReturn, $return); + } + + public function testUnmonitorInstance() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<UnmonitorInstancesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <instancesSet>" + . " <item>" + . " <instanceId>i-43a4412a</instanceId>" + . " <monitoring>" + . " <state>pending</state>" + . " </monitoring>" + . " </item>" + . " </instancesSet>" + . "</UnmonitorInstancesResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->unmonitor('i-43a4412a'); + + $arrReturn = array(array('instanceid' => 'i-43a4412a', 'monitorstate' => 'pending')); + $this->assertSame($arrReturn, $return); + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceWindowsTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceWindowsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ec26489e9a62495f51ac455fc3d43f2a85682ab6 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/InstanceWindowsTest.php @@ -0,0 +1,228 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2\WindowsInstance; +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + +/** + * Zend_Service_Amazon_Ec2_Instance_Windows test case. + * + * @todo: Should this class be named Zend_Service_Amazon_Ec2_Instance_WindowsTest? + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class InstanceWindowsTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var Zend_Service_Amazon_Ec2_Instance_Windows + */ + private $instance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->instance = new WindowsInstance('access_key', 'secret_access_key', null, $this->httpClient); + } + + /** + * Tests Zend_Service_Amazon_Ec2_Instance_Windows->bundle() + */ + public function testBundle() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<BundleInstanceResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + ." <requestId>bun-c1a540a8</requestId>\r\n" + ." <bundleInstanceTask>\r\n" + ." <instanceId>i-12345678</instanceId>\r\n" + ." <bundleId>bun-cla322b9</bundleId>\r\n" + ." <state>bundling</state>\r\n" + ." <startTime>2008-10-07T11:41:50.000Z</startTime>\r\n" + ." <updateTime>2008-10-07T11:51:50.000Z</updateTime>\r\n" + ." <progress>20%</progress>\r\n" + ." <storage>\r\n" + ." <S3>\r\n" + ." <bucket>my-bucket</bucket>\r\n" + ." <prefix>my-new-image</prefix>\r\n" + ." </S3>\r\n" + ." </storage>\r\n" + ." </bundleInstanceTask>\r\n" + ."</BundleInstanceResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->bundle('i-12345678', 'my-bucket', 'my-new-image'); + + //print_r($return); + + $arrReturn = array( + "instanceId" => "i-12345678", + "bundleId" => "bun-cla322b9", + "state" => "bundling", + "startTime" => "2008-10-07T11:41:50.000Z", + "updateTime" => "2008-10-07T11:51:50.000Z", + "progress" => "20%", + "storage" => array( + "s3" => array + ( + "bucket" => "my-bucket", + "prefix" => "my-new-image" + ) + ) + ); + + $this->assertSame($arrReturn, $return); + + } + + /** + * Tests Zend_Service_Amazon_Ec2_Instance_Windows->cancelBundle() + */ + public function testCancelBundle() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<CancelBundleTaskResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + ." <bundleInstanceTask>\r\n" + ." <instanceId>i-12345678</instanceId>\r\n" + ." <bundleId>bun-cla322b9</bundleId>\r\n" + ." <state>canceling</state>\r\n" + ." <startTime>2008-10-07T11:41:50.000Z</startTime>\r\n" + ." <updateTime>2008-10-07T11:51:50.000Z</updateTime>\r\n" + ." <progress>20%</progress>\r\n" + ." <storage>\r\n" + ." <S3>\r\n" + ." <bucket>my-bucket</bucket>\r\n" + ." <prefix>my-new-image</prefix>\r\n" + ." </S3>\r\n" + ." </storage>\r\n" + ." </bundleInstanceTask>\r\n" + ."</CancelBundleTaskResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->cancelBundle('bun-cla322b9'); + + $arrReturn = array( "instanceId" => "i-12345678", + "bundleId" => "bun-cla322b9", + "state" => "canceling", + "startTime" => "2008-10-07T11:41:50.000Z", + "updateTime" => "2008-10-07T11:51:50.000Z", + "progress" => "20%", + "storage" => array( + "s3" => array + ( + "bucket" => "my-bucket", + "prefix" => "my-new-image" + ) + ) + ); + + $this->assertSame($arrReturn, $return); + + + + } + + /** + * Tests Zend_Service_Amazon_Ec2_Instance_Windows->describeBundle() + */ + public function testDescribeBundle() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + ."<DescribeBundleTasksResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + ." <bundleInstanceTasksSet>\r\n" + ." <item>\r\n" + ." <instanceId>i-12345678</instanceId>\r\n" + ." <bundleId>bun-cla322b9</bundleId>\r\n" + ." <state>bundling</state>\r\n" + ." <startTime>2008-10-07T11:41:50.000Z</startTime>\r\n" + ." <updateTime>2008-10-07T11:51:50.000Z</updateTime>\r\n" + ." <progress>20%</progress>\r\n" + ." <storage>\r\n" + ." <S3>\r\n" + ." <bucket>my-bucket</bucket>\r\n" + ." <prefix>my-new-image</prefix>\r\n" + ." </S3>\r\n" + ." </storage>\r\n" + ." </item>\r\n" + ." </bundleInstanceTasksSet>\r\n" + ."</DescribeBundleTasksResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->instance->describeBundle('bun-cla322b9'); + + $arrReturn = array( + array( + "instanceId" => "i-12345678", + "bundleId" => "bun-cla322b9", + "state" => "bundling", + "startTime" => "2008-10-07T11:41:50.000Z", + "updateTime" => "2008-10-07T11:51:50.000Z", + "progress" => "20%", + "storage" => array( + "s3" => array + ( + "bucket" => "my-bucket", + "prefix" => "my-new-image" + ) + ) + ) + ); + + $this->assertSame($arrReturn, $return); + + } + +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/KeypairTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/KeypairTest.php new file mode 100644 index 0000000000000000000000000000000000000000..4d8545db6dc3e93fc43ec42a9113078a137aa284 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/KeypairTest.php @@ -0,0 +1,239 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; +use ZendService\Amazon\Ec2\Exception; +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + +/** + * ZendService\Amazon\Ec2\Keypair test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class KeypairTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var ZendService\Amazon\Ec2\Keypair + */ + private $keypairInstance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->keypairInstance = new Ec2\Keypair('access_key', 'secret_access_key', null, $this->httpClient); + } + + + public function testCreateKeyPairNoNameThrowsException() + { + $this->setExpectedException( + 'ZendService\Amazon\Ec2\Exception\InvalidArgumentException', + 'Invalid Key Name'); + $this->keypairInstance->create(''); + } + + /** + * Tests ZendService\Amazon\Ec2\Keypair->create() + */ + public function testCreateKeyPair() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<CreateKeyPairResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>\r\n" + . " <keyMaterial>-----BEGIN RSA PRIVATE KEY-----\r\n" +. "MIIEoQIBAAKCAQBuLFg5ujHrtm1jnutSuoO8Xe56LlT+HM8v/xkaa39EstM3/aFxTHgElQiJLChp\r\n" +. "HungXQ29VTc8rc1bW0lkdi23OH5eqkMHGhvEwqa0HWASUMll4o3o/IX+0f2UcPoKCOVUR+jx71Sg\r\n" +. "5AU52EQfanIn3ZQ8lFW7Edp5a3q4DhjGlUKToHVbicL5E+g45zfB95wIyywWZfeW/UUF3LpGZyq/\r\n" +. "ebIUlq1qTbHkLbCC2r7RTn8vpQWp47BGVYGtGSBMpTRP5hnbzzuqj3itkiLHjU39S2sJCJ0TrJx5\r\n" +. "i8BygR4s3mHKBj8l+ePQxG1kGbF6R4yg6sECmXn17MRQVXODNHZbAgMBAAECggEAY1tsiUsIwDl5\r\n" +. "91CXirkYGuVfLyLflXenxfI50mDFms/mumTqloHO7tr0oriHDR5K7wMcY/YY5YkcXNo7mvUVD1pM\r\n" +. "ZNUJs7rw9gZRTrf7LylaJ58kOcyajw8TsC4e4LPbFaHwS1d6K8rXh64o6WgW4SrsB6ICmr1kGQI7\r\n" +. "3wcfgt5ecIu4TZf0OE9IHjn+2eRlsrjBdeORi7KiUNC/pAG23I6MdDOFEQRcCSigCj+4/mciFUSA\r\n" +. "SWS4dMbrpb9FNSIcf9dcLxVM7/6KxgJNfZc9XWzUw77Jg8x92Zd0fVhHOux5IZC+UvSKWB4dyfcI\r\n" +. "tE8C3p9bbU9VGyY5vLCAiIb4qQKBgQDLiO24GXrIkswF32YtBBMuVgLGCwU9h9HlO9mKAc2m8Cm1\r\n" +. "jUE5IpzRjTedc9I2qiIMUTwtgnw42auSCzbUeYMURPtDqyQ7p6AjMujp9EPemcSVOK9vXYL0Ptco\r\n" +. "xW9MC0dtV6iPkCN7gOqiZXPRKaFbWADp16p8UAIvS/a5XXk5jwKBgQCKkpHi2EISh1uRkhxljyWC\r\n" +. "iDCiK6JBRsMvpLbc0v5dKwP5alo1fmdR5PJaV2qvZSj5CYNpMAy1/EDNTY5OSIJU+0KFmQbyhsbm\r\n" +. "rdLNLDL4+TcnT7c62/aH01ohYaf/VCbRhtLlBfqGoQc7+sAc8vmKkesnF7CqCEKDyF/dhrxYdQKB\r\n" +. "gC0iZzzNAapayz1+JcVTwwEid6j9JqNXbBc+Z2YwMi+T0Fv/P/hwkX/ypeOXnIUcw0Ih/YtGBVAC\r\n" +. "DQbsz7LcY1HqXiHKYNWNvXgwwO+oiChjxvEkSdsTTIfnK4VSCvU9BxDbQHjdiNDJbL6oar92UN7V\r\n" +. "rBYvChJZF7LvUH4YmVpHAoGAbZ2X7XvoeEO+uZ58/BGKOIGHByHBDiXtzMhdJr15HTYjxK7OgTZm\r\n" +. "gK+8zp4L9IbvLGDMJO8vft32XPEWuvI8twCzFH+CsWLQADZMZKSsBasOZ/h1FwhdMgCMcY+Qlzd4\r\n" +. "JZKjTSu3i7vhvx6RzdSedXEMNTZWN4qlIx3kR5aHcukCgYA9T+Zrvm1F0seQPbLknn7EqhXIjBaT\r\n" +. "P8TTvW/6bdPi23ExzxZn7KOdrfclYRph1LHMpAONv/x2xALIf91UB+v5ohy1oDoasL0gij1houRe\r\n" +. "2ERKKdwz0ZL9SWq6VTdhr/5G994CK72fy5WhyERbDjUIdHaK3M849JJuf8cSrvSb4g==\r\n" +. "-----END RSA PRIVATE KEY-----</keyMaterial>\r\n" + . "</CreateKeyPairResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->keypairInstance->create('example-key-name'); + + $this->assertInternalType('array', $response); + + $this->assertEquals('example-key-name', $response['keyName']); + $this->assertEquals('1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f', $response['keyFingerprint']); + } + + public function testDescribeSingleKeyPair() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<DescribeKeyPairsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <keySet>\r\n" + . " <item>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>\r\n" + . " </item>\r\n" + . " </keySet>\r\n" + . "</DescribeKeyPairsResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->keypairInstance->describe('example-key-name'); + $this->assertEquals('example-key-name', $response[0]['keyName']); + } + + public function testDescribeMultipleKeyPair() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<DescribeKeyPairsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <keySet>\r\n" + . " <item>\r\n" + . " <keyName>example-key-name</keyName>\r\n" + . " <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <keyName>zend-test-key</keyName>\r\n" + . " <keyFingerprint>25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f:1f:51:ae:28:bf:89:e9:d8:1f</keyFingerprint>\r\n" + . " </item>\r\n" + . " </keySet>\r\n" + . "</DescribeKeyPairsResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->keypairInstance->describe(array('example-key-name', 'zend-test-key')); + + $arrKeys = array( + array( + 'keyName' => 'example-key-name', + 'keyFingerprint'=> '1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f' + ), + array( + 'keyName' => 'zend-test-key', + 'keyFingerprint'=> '25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f:1f:51:ae:28:bf:89:e9:d8:1f' + ) + ); + + foreach($response as $k => $r) { + $this->assertSame($arrKeys[$k], $r); + } + } + + public function testDeleteKeyPairNoNameThrowsException() + { + $this->setExpectedException( + 'ZendService\Amazon\Ec2\Exception\InvalidArgumentException', + 'Invalid Key Name'); + $this->keypairInstance->delete(''); + } + + public function testDeleteFailsOnNonValidKey() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<DeleteKeyPair xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>false</return>\r\n" + . "</DeleteKeyPair>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->keypairInstance->delete('myfakekeyname'); + $this->assertInternalType('boolean', $response); + $this->assertFalse($response); + } + + public function testDeleteDoesNotFailOnValidKey() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<DeleteKeyPair xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</DeleteKeyPair>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->keypairInstance->delete('example-key-name'); + $this->assertInternalType('boolean', $response); + $this->assertTrue($response); + } +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/RegionTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/RegionTest.php new file mode 100644 index 0000000000000000000000000000000000000000..55f8255e5e9fcbeb85ade0118e17fc96c83da824 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/RegionTest.php @@ -0,0 +1,130 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + + +/** + * ZendService\Amazon\Ec\Region test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class RegionTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var Zend_Service_Amazon_Ec2_Availabilityzones + */ + private $regionInstance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->regionInstance = new Ec2\Region('access_key', 'secret_access_key', null, $this->httpClient); + } + + public function testDescribeSingleRegion() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeRegionsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <regionInfo>\r\n" + . " <item>\r\n" + . " <regionName>us-east-1</regionName>\r\n" + . " <regionUrl>us-east-1.ec2.amazonaws.com</regionUrl>\r\n" + . " </item>\r\n" + . " </regionInfo>\r\n" + . "</DescribeRegionsResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->regionInstance->describe('us-east-1'); + + $arrRegion = array( + array( + 'regionName' => 'us-east-1', + 'regionUrl' => 'us-east-1.ec2.amazonaws.com' + ) + ); + + $this->assertSame($arrRegion, $response); + } + + public function testDescribeMultipleRegions() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeRegionsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <regionInfo>\r\n" + . " <item>\r\n" + . " <regionName>us-east-1</regionName>\r\n" + . " <regionUrl>us-east-1.ec2.amazonaws.com</regionUrl>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <regionName>us-west-1</regionName>\r\n" + . " <regionUrl>us-west-1.ec2.amazonaws.com</regionUrl>\r\n" + . " </item>\r\n" + . " </regionInfo>\r\n" + . "</DescribeRegionsResponse>"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $response = $this->regionInstance->describe(array('us-east-1','us-west-1')); + + $arrRegion = array( + array( + 'regionName' => 'us-east-1', + 'regionUrl' => 'us-east-1.ec2.amazonaws.com' + ), + array( + 'regionName' => 'us-west-1', + 'regionUrl' => 'us-west-1.ec2.amazonaws.com' + ) + ); + + $this->assertSame($arrRegion, $response); + } +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/SecurityGroupsTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/SecurityGroupsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..6c4dcb90aed680537e5e3b4c91fcf81047ff021c --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Ec2/SecurityGroupsTest.php @@ -0,0 +1,459 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Ec2; + +use ZendService\Amazon\Ec2; +use Zend\Http\Client as HttpClient; +use Zend\Http\Client\Adapter\Test as HttpClientTestAdapter; + + +/** + * ZendService\Amazon\Ec2\Securitygroups test case. + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Ec2 + */ +class SecurityGroupsTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @var ZendService\Amazon\Ec2\Securitygroups + */ + private $securitygroupsInstance; + + /** + * @var HttpClient + */ + protected $httpClient = null; + + /** + * @var HttpClientTestAdapter + */ + protected $httpClientTestAdapter = null; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() + { + $this->httpClientTestAdapter = new HttpClientTestAdapter; + $this->httpClient = new HttpClient(null, array('adapter' => $this->httpClientTestAdapter)); + $this->securitygroupsInstance = new Ec2\SecurityGroups('access_key', 'secret_access_key', null, $this->httpClient); + } + + /** + * Tests ZendService\Amazon\Ec2\Securitygroups->authorize() + */ + public function testAuthorizeSinglePort() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<AuthorizeSecurityGroupIngressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</AuthorizeSecurityGroupIngressResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->authorizeIp('MyGroup', 'tcp', '80', '80', '0.0.0.0/0'); + $this->assertTrue($return); + + } + + public function testAuthorizeRangeOfPorts() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<AuthorizeSecurityGroupIngressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</AuthorizeSecurityGroupIngressResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->authorizeIp('MyGroup', 'tcp', '6000', '7000', '0.0.0.0/0'); + $this->assertTrue($return); + + } + + public function testAuthorizeSecurityGroupName() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<AuthorizeSecurityGroupIngressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</AuthorizeSecurityGroupIngressResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->authorizeGroup('MyGroup', 'groupname', '15333848'); + $this->assertTrue($return); + + } + + /** + * Tests ZendService\Amazon\Ec2\Securitygroups->create() + */ + public function testCreate() + { + + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<CreateSecurityGroupResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</CreateSecurityGroupResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->create('MyGroup', 'My Security Grup'); + + $this->assertTrue($return); + + } + + /** + * Tests ZendService\Amazon\Ec2\Securitygroups->delete() + */ + public function testDelete() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<DeleteSecurityGroupResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</DeleteSecurityGroupResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->delete('MyGroup'); + + $this->assertTrue($return); + + } + + /** + * Tests ZendService\Amazon\Ec2\Securitygroups->describe() + */ + public function testDescribeMultipleSecruityGroups() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeSecurityGroupsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <securityGroupInfo>\r\n" + . " <item>\r\n" + . " <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>\r\n" + . " <groupName>WebServers</groupName>\r\n" + . " <groupDescription>Web</groupDescription>\r\n" + . " <ipPermissions>\r\n" + . " <item>\r\n" + . " <ipProtocol>tcp</ipProtocol>\r\n" + . " <fromPort>80</fromPort>\r\n" + . " <toPort>80</toPort>\r\n" + . " <groups/>\r\n" + . " <ipRanges>\r\n" + . " <item>\r\n" + . " <cidrIp>0.0.0.0/0</cidrIp>\r\n" + . " </item>\r\n" + . " </ipRanges>\r\n" + . " </item>\r\n" + . " </ipPermissions>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>\r\n" + . " <groupName>RangedPortsBySource</groupName>\r\n" + . " <groupDescription>A</groupDescription>\r\n" + . " <ipPermissions>\r\n" + . " <item>\r\n" + . " <ipProtocol>tcp</ipProtocol>\r\n" + . " <fromPort>6000</fromPort>\r\n" + . " <toPort>7000</toPort>\r\n" + . " <groups/>\r\n" + . " <ipRanges>\r\n" + . " <item>\r\n" + . " <cidrIp>0.0.0.0/0</cidrIp>\r\n" + . " </item>\r\n" + . " </ipRanges>\r\n" + . " </item>\r\n" + . " </ipPermissions>\r\n" + . " </item>\r\n" + . " </securityGroupInfo>\r\n" + . "</DescribeSecurityGroupsResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->describe(array('WebServers','RangedPortsBySource')); + + $this->assertEquals(2, count($return)); + + $arrGroups = array( + array( + 'ownerId' => 'UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM', + 'groupName' => 'WebServers', + 'groupDescription' => 'Web', + 'ipPermissions' => array(0 => array( + 'ipProtocol' => 'tcp', + 'fromPort' => '80', + 'toPort' => '80', + 'ipRanges' => '0.0.0.0/0' + )) + ), + array( + 'ownerId' => 'UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM', + 'groupName' => 'RangedPortsBySource', + 'groupDescription' => 'A', + 'ipPermissions' => array(0 => array( + 'ipProtocol' => 'tcp', + 'fromPort' => '6000', + 'toPort' => '7000', + 'ipRanges' => '0.0.0.0/0' + )) + ) + ); + foreach($return as $k => $r) { + $this->assertSame($arrGroups[$k], $r); + } + } + + public function testDescribeSingleSecruityGroup() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeSecurityGroupsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <securityGroupInfo>\r\n" + . " <item>\r\n" + . " <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>\r\n" + . " <groupName>WebServers</groupName>\r\n" + . " <groupDescription>Web</groupDescription>\r\n" + . " <ipPermissions>\r\n" + . " <item>\r\n" + . " <ipProtocol>tcp</ipProtocol>\r\n" + . " <fromPort>80</fromPort>\r\n" + . " <toPort>80</toPort>\r\n" + . " <groups/>\r\n" + . " <ipRanges>\r\n" + . " <item>\r\n" + . " <cidrIp>0.0.0.0/0</cidrIp>\r\n" + . " </item>\r\n" + . " </ipRanges>\r\n" + . " </item>\r\n" + . " </ipPermissions>\r\n" + . " </item>\r\n" + . " </securityGroupInfo>\r\n" + . "</DescribeSecurityGroupsResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->describe('WebServers'); + + $this->assertEquals(1, count($return)); + + $arrGroups = array( + array( + 'ownerId' => 'UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM', + 'groupName' => 'WebServers', + 'groupDescription' => 'Web', + 'ipPermissions' => array(0 => array( + 'ipProtocol' => 'tcp', + 'fromPort' => '80', + 'toPort' => '80', + 'ipRanges' => '0.0.0.0/0' + )) + ) + ); + foreach($return as $k => $r) { + $this->assertSame($arrGroups[$k], $r); + } + } + + public function testDescribeSingleSecruityGroupWithMultipleIpsSamePort() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<DescribeSecurityGroupsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <securityGroupInfo>\r\n" + . " <item>\r\n" + . " <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>\r\n" + . " <groupName>WebServers</groupName>\r\n" + . " <groupDescription>Web</groupDescription>\r\n" + . " <ipPermissions>\r\n" + . " <item>\r\n" + . " <ipProtocol>tcp</ipProtocol>\r\n" + . " <fromPort>80</fromPort>\r\n" + . " <toPort>80</toPort>\r\n" + . " <groups/>\r\n" + . " <ipRanges>\r\n" + . " <item>\r\n" + . " <cidrIp>0.0.0.0/0</cidrIp>\r\n" + . " </item>\r\n" + . " <item>\r\n" + . " <cidrIp>1.1.1.1/0</cidrIp>\r\n" + . " </item>\r\n" + . " </ipRanges>\r\n" + . " </item>\r\n" + . " </ipPermissions>\r\n" + . " </item>\r\n" + . " </securityGroupInfo>\r\n" + . "</DescribeSecurityGroupsResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->describe('WebServers'); + + $this->assertEquals(1, count($return)); + + $arrGroups = array( + array( + 'ownerId' => 'UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM', + 'groupName' => 'WebServers', + 'groupDescription' => 'Web', + 'ipPermissions' => array(0 => array( + 'ipProtocol' => 'tcp', + 'fromPort' => '80', + 'toPort' => '80', + 'ipRanges' => array( + '0.0.0.0/0', + '1.1.1.1/0' + ) + )) + ) + ); + foreach($return as $k => $r) { + $this->assertSame($arrGroups[$k], $r); + } + } + + /** + * Tests ZendService\Amazon\Ec2\Securitygroups->revoke() + */ + public function testRevokeSinglePort() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<RevokeSecurityGroupIngressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</RevokeSecurityGroupIngressResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->revokeIp('MyGroup', 'tcp', '80', '80', '0.0.0.0/0'); + $this->assertTrue($return); + + } + + public function testRevokePortRange() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<RevokeSecurityGroupIngressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</RevokeSecurityGroupIngressResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->revokeIp('MyGroup', 'tcp', '6000', '7000', '0.0.0.0/0'); + $this->assertTrue($return); + + } + + + public function testRevokeSecurityGroupName() + { + $rawHttpResponse = "HTTP/1.1 200 OK\r\n" + . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Server: hi\r\n" + . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" + . "Status: 200 OK\r\n" + . "Content-type: application/xml; charset=utf-8\r\n" + . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" + . "Connection: close\r\n" + . "\r\n" + . "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + . "<RevokeSecurityGroupIngressResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" + . " <return>true</return>\r\n" + . "</RevokeSecurityGroupIngressResponse>\r\n"; + $this->httpClientTestAdapter->setResponse($rawHttpResponse); + + $return = $this->securitygroupsInstance->revokeGroup('MyGroup', 'groupname', '15333848'); + $this->assertTrue($return); + + } + +} + + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/OfflineTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/OfflineTest.php new file mode 100644 index 0000000000000000000000000000000000000000..363d4643e017f48e502cb20d9655987c5daf7814 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/OfflineTest.php @@ -0,0 +1,331 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon; + +use ZendService\Amazon, + Zend\Http\Client\Adapter\Test as HttpClientAdapter; + +/** + * Test helper + * + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + */ +class OfflineTest extends \PHPUnit_Framework_TestCase +{ + /** + * Reference to Amazon service consumer object + * + * @var Amazon\Amazon + */ + protected $amazon; + + /** + * HTTP client adapter for testing + * + * @var HttpClientAdapter + */ + protected $httpClientTestAdapter; + + /** + * Sets up this test case + * + * @return void + */ + public function setUp() + { + $this->amazon = new Amazon\Amazon(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID')); + + $this->httpClientTestAdapter = new HttpClientAdapter(); + } + + /** + * Ensures that __construct() throws an exception when given an invalid country code + * + * @return void + */ + public function testConstructExceptionCountryCodeInvalid() + { + $this->setExpectedException( + 'ZendService\Amazon\Exception\InvalidArgumentException', + 'Unknown country code: oops' + ); + $amazon = new Amazon\Amazon(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), 'oops'); + } + + /** + * @group ZF-2056 + */ + public function testMozardSearchFromFile() + { + $xml = file_get_contents(__DIR__."/_files/mozart_result.xml"); + $dom = new \DOMDocument(); + $dom->loadXML($xml); + + $mozartTracks = array( + 'B00005A8JZ' => '29', + 'B0000058HV' => '25', + 'B000BLI3K2' => '500', + 'B00004X0QF' => '9', + 'B000004194' => '19', + 'B00000I9M0' => '9', + 'B000004166' => '20', + 'B00002DEH1' => '58', + 'B0000041EV' => '12', + 'B00004SA87' => '42', + ); + + $result = new Amazon\ResultSet($dom); + + foreach($result AS $item) { + $trackCount = $mozartTracks[$item->ASIN]; + $this->assertEquals($trackCount, count($item->Tracks)); + } + } + + /** + * @group ZF-2749 + */ + public function testSimilarProductConstructorMissingAttributeDoesNotThrowNotice() + { + $dom = new \DOMDocument(); + $asin = $dom->createElement("ASIN", "TEST"); + $product = $dom->createElement("product"); + $product->appendChild($asin); + + $similarproduct = new Amazon\SimilarProduct($product); + } + + /** + * @group ZF-7251 + */ + public function testFullOffersFromFile() + { + $xml = file_get_contents(__DIR__."/_files/offers_with_names.xml"); + $dom = new \DOMDocument(); + $dom->loadXML($xml); + + $dataExpected = array( + '0439774098' => array( + 'offers' => array( + 'A79CLRHOQ3NF4' => array( + 'name' => 'PLEXSUPPLY', + 'price' => '5153' + ), + 'A2K9NS8DSVOE2W' => array( + 'name' => 'nangsuer', + 'price' => '5153' + ), + 'A31EVTLIC13ORD' => array( + 'name' => 'Wizard of Math', + 'price' => '7599' + ), + 'A3SKJE188CW5XG' => array( + 'name' => 'ReStockIt', + 'price' => '5299' + ), + 'A1729W3053T57N' => array( + 'name' => 'The Price Pros', + 'price' => '5487' + ), + 'A29PHU0KPCGV8S' => array( + 'name' => 'TheFactoryDepot', + 'price' => '5821' + ), + 'AIHRRFGW11GJ8' => array( + 'name' => 'Design Tec Office Products', + 'price' => '5987' + ), + 'A27OK403WRHSGI' => array( + 'name' => 'Kaplan Early Learning Company', + 'price' => '7595' + ), + 'A25DVOZOPBFMAN' => array( + 'name' => 'Deerso', + 'price' => '7599' + ), + 'A6IFKC796Y64H' => array( + 'name' => 'The Education Station Inc', + 'price' => '7599' + ), + ), + ), + 'B00000194U' => array( + 'offers' => array( + 'A3UOG6723G7MG0' => array( + 'name' => 'Efunctional', + 'price' => '480' + ), + 'A3SNNXCKUIW1O2' => array( + 'name' => 'Universal Mania', + 'price' => '531' + ), + 'A18ACDNYOEMMOL' => array( + 'name' => 'ApexSuppliers', + 'price' => '589' + ), + 'A2NYACAJP9I1IY' => array( + 'name' => 'GizmosForLife', + 'price' => '608' + ), + 'A1729W3053T57N' => array( + 'name' => 'The Price Pros', + 'price' => '628' + ), + 'A29PHU0KPCGV8S' => array( + 'name' => 'TheFactoryDepot', + 'price' => '638' + ), + 'A3Q3IAIX1CLBMZ' => array( + 'name' => 'ElectroGalaxy', + 'price' => '697' + ), + 'A1PC5XI7QQLW5G' => array( + 'name' => 'Long Trading Company', + 'price' => '860' + ), + 'A2R0FX412W1BDT' => array( + 'name' => 'Beach Audio', + 'price' => '896' + ), + 'AKJJGJ0JKT8F1' => array( + 'name' => 'Buy.com', + 'price' => '899' + ), + ), + ), + ); + + $result = new Amazon\ResultSet($dom); + + foreach($result AS $item) { + $data = $dataExpected[$item->ASIN]; + foreach($item->Offers->Offers as $offer) { + $this->assertEquals($data['offers'][$offer->MerchantId]['name'], $offer->MerchantName); + $this->assertEquals($data['offers'][$offer->MerchantId]['price'], $offer->Price); + } + } + } + + public function dataSignatureEncryption() + { + return array( + array( + 'http://webservices.amazon.com', + array( + 'Service' => 'AWSECommerceService', + 'AWSAccessKeyId' => '00000000000000000000', + 'Operation' => 'ItemLookup', + 'ItemId' => '0679722769', + 'ResponseGroup' => 'ItemAttributes,Offers,Images,Reviews', + 'Version' => '2009-01-06', + 'Timestamp' => '2009-01-01T12:00:00Z', + ), + "GET\n". + "webservices.amazon.com\n". + "/onca/xml\n". + "AWSAccessKeyId=00000000000000000000&ItemId=0679722769&Operation=I". + "temLookup&ResponseGroup=ItemAttributes%2COffers%2CImages%2CReview". + "s&Service=AWSECommerceService&Timestamp=2009-01-01T12%3A00%3A00Z&". + "Version=2009-01-06", + 'Nace%2BU3Az4OhN7tISqgs1vdLBHBEijWcBeCqL5xN9xg%3D' + ), + array( + 'http://ecs.amazonaws.co.uk', + array( + 'Service' => 'AWSECommerceService', + 'AWSAccessKeyId' => '00000000000000000000', + 'Operation' => 'ItemSearch', + 'Actor' => 'Johnny Depp', + 'ResponseGroup' => 'ItemAttributes,Offers,Images,Reviews,Variations', + 'Version' => '2009-01-01', + 'SearchIndex' => 'DVD', + 'Sort' => 'salesrank', + 'AssociateTag' => 'mytag-20', + 'Timestamp' => '2009-01-01T12:00:00Z', + ), + "GET\n". + "ecs.amazonaws.co.uk\n". + "/onca/xml\n". + "AWSAccessKeyId=00000000000000000000&Actor=Johnny%20Depp&Associate". + "Tag=mytag-20&Operation=ItemSearch&ResponseGroup=ItemAttributes%2C". + "Offers%2CImages%2CReviews%2CVariations&SearchIndex=DVD&Service=AW". + "SECommerceService&Sort=salesrank&Timestamp=2009-01-01T12%3A00%3A0". + "0Z&Version=2009-01-01", + 'TuM6E5L9u%2FuNqOX09ET03BXVmHLVFfJIna5cxXuHxiU%3D', + ), + ); + } + + /** + * Checking if signature Encryption due on August 15th for Amazon Webservice API is working correctly. + * + * @dataProvider dataSignatureEncryption + * @group ZF-7033 + */ + public function testSignatureEncryption($baseUri, $params, $expectedStringToSign, $expectedSignature) + { + $this->assertEquals( + $expectedStringToSign, + Amazon\Amazon::buildRawSignature($baseUri, $params) + ); + + $this->assertEquals( + $expectedSignature, + rawurlencode(Amazon\Amazon::computeSignature( + $baseUri, '1234567890', $params + )) + ); + } + + /** + * Testing if Amazon service component can handle return values where the + * item-list is not empty + * + * @group ZF-9547 + */ + public function testAmazonComponentHandlesValidBookResults() + { + $xml = file_get_contents(__DIR__."/_files/amazon-response-valid.xml"); + $dom = new \DOMDocument(); + $dom->loadXML($xml); + + $result = new Amazon\ResultSet($dom); + + $currentItem = null; + + $currentItem = $result->current(); + + $this->assertInstanceOf('ZendService\Amazon\Item', $currentItem); + $this->assertEquals('0754512673', $currentItem->ASIN); + } + + /** + * Testing if Amazon service component can handle return values where the + * item-list is empty (no results found) + * + * @group ZF-9547 + */ + public function testAmazonComponentHandlesEmptyBookResults() + { + $xml = file_get_contents(__DIR__."/_files/amazon-response-invalid.xml"); + $dom = new \DOMDocument(); + $dom->loadXML($xml); + + $result = new Amazon\ResultSet($dom); + + $this->setExpectedException('ZendService\Amazon\Exception\ExceptionInterface'); + $result->current(); + } +} diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/OnlineTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/OnlineTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8a2989906dadb45d528ebec9b847d5a8f0dab257 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/OnlineTest.php @@ -0,0 +1,335 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon; + +use ZendService\Amazon; + +/** + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + */ +class OnlineTest extends \PHPUnit_Framework_TestCase +{ + /** + * Reference to Amazon service consumer object + * + * @var Amazon\Amazon + */ + protected $_amazon; + + /** + * Reference to Amazon query API object + * + * @var Amazon\Query + */ + protected $_query; + + /** + * Socket based HTTP client adapter + * + * @var \Zend\Http\Client\Adapter\Socket + */ + protected $_httpClientAdapterSocket; + + /** + * Sets up this test case + * + * @return void + */ + public function setUp() + { + if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) { + $this->markTestSkipped('Zend_Service_Amazon_S3 online tests are not enabled'); + } + if(!defined('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID') || !defined('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY')) { + $this->markTestSkipped('Constants AccessKeyId and SecretKey have to be set.'); + } + + $this->_amazon = new Amazon\Amazon( + TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID, + 'US', + TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY + ); + + $this->_query = new Amazon\Query( + TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID, + 'US', + TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY + ); + + $this->_httpClientAdapterSocket = new \Zend\Http\Client\Adapter\Socket(); + + $this->_amazon->getRestClient() + ->getHttpClient() + ->setAdapter($this->_httpClientAdapterSocket); + + // terms of use compliance: no more than one query per second + sleep(1); + } + + public function testUnknownCountryException() + { + $this->setExpectedException( + 'ZendService\Amazon\Exception\InvalidArgumentException', + 'Unknown country code: wrong-country-code'); + $aws = new Amazon\Amazon( + TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID, + 'wrong-country-code', + TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY); + } + + /** + * Ensures that itemSearch() works as expected when searching for PHP books + * @group ItemSearchPhp + * @return void + */ + public function testItemSearchBooksPhp() + { + $resultSet = $this->_amazon->itemSearch(array( + 'SearchIndex' => 'Books', + 'Keywords' => 'php', + 'ResponseGroup' => 'Small,ItemAttributes,Images,SalesRank,Reviews,EditorialReview,Similarities,' + . 'ListmaniaLists' + )); + + $this->assertTrue(10 < $resultSet->totalResults()); + $this->assertTrue(1 < $resultSet->totalPages()); + $this->assertEquals(0, $resultSet->key()); + + try { + $resultSet->seek(-1); + $this->fail('Expected OutOfBoundsException not thrown'); + } catch (\OutOfBoundsException $e) { + $this->assertContains('Illegal index', $e->getMessage()); + } + + $resultSet->seek(9); + + try { + $resultSet->seek(10); + $this->fail('Expected OutOfBoundsException not thrown'); + } catch (\OutOfBoundsException $e) { + $this->assertContains('Illegal index', $e->getMessage()); + } + + foreach ($resultSet as $item) { + $this->assertTrue($item instanceof Amazon\Item); + } + + $this->assertTrue(simplexml_load_string($item->asXml()) instanceof \SimpleXMLElement); + } + + /** + * Ensures that itemSearch() works as expected when searching for music with keyword of Mozart + * + * @return void + */ + public function testItemSearchMusicMozart() + { + $resultSet = $this->_amazon->itemSearch(array( + 'SearchIndex' => 'Music', + 'Keywords' => 'Mozart', + 'ResponseGroup' => 'Small,Tracks,Offers' + )); + + foreach ($resultSet as $item) { + $this->assertTrue($item instanceof Amazon\Item); + } + } + + /** + * Ensures that itemSearch() works as expected when searching for digital cameras + * + * @return void + */ + public function testItemSearchElectronicsDigitalCamera() + { + $resultSet = $this->_amazon->itemSearch(array( + 'SearchIndex' => 'Electronics', + 'Keywords' => 'digital camera', + 'ResponseGroup' => 'Accessories' + )); + + foreach ($resultSet as $item) { + $this->assertTrue($item instanceof Amazon\Item); + } + } + + /** + * Ensures that itemSearch() works as expected when sorting + * + * @return void + */ + public function testItemSearchBooksPHPSort() + { + $resultSet = $this->_amazon->itemSearch(array( + 'SearchIndex' => 'Books', + 'Keywords' => 'php', + 'Sort' => '-titlerank' + )); + + foreach ($resultSet as $item) { + $this->assertTrue($item instanceof Amazon\Item); + } + } + + /** + * Ensures that itemSearch() throws an exception when provided an invalid city + * + * @return void + */ + public function testItemSearchExceptionCityInvalid() + { + $this->setExpectedException( + 'ZendService\Amazon\Exception\RuntimeException', + 'The value you specified for SearchIndex is invalid.' + ); + $this->_amazon->itemSearch(array( + 'SearchIndex' => 'Restaurants', + 'Keywords' => 'seafood', + 'City' => 'Des Moines' + )); + } + + /** + * Ensures that itemLookup() works as expected + * + * @return void + */ + public function testItemLookup() + { + $item = $this->_amazon->itemLookup('B0015T963C'); + $this->assertTrue($item instanceof Amazon\Item); + } + + /** + * Ensures that itemLookup() throws an exception when provided an invalid ASIN + * + * @return void + */ + public function testItemLookupExceptionAsinInvalid() + { + $this->setExpectedException( + 'ZendService\Amazon\Exception\RuntimeException', + 'OOPS is not a valid value for ItemId. Please change this value and retry your request. (AWS.InvalidParameterValue)' + ); + $this->_amazon->itemLookup('oops'); + } + + /** + * Ensures that itemLookup() works as expected when provided multiple ASINs + * + * @return void + */ + public function testItemLookupMultiple() + { + $resultSet = $this->_amazon->itemLookup('0596006810,1590593804'); + + $count = 0; + foreach ($resultSet as $item) { + $this->assertTrue($item instanceof Amazon\Item); + $count++; + } + + $this->assertEquals(2, $count); + } + + /** + * Ensures that itemLookup() throws an exception when given a SearchIndex + * + * @return void + */ + public function testItemLookupExceptionSearchIndex() + { + $this->setExpectedException( + 'ZendService\Amazon\Exception\RuntimeException', + 'Your request contained a restricted parameter combination. When IdType equals ASIN, SearchIndex cannot be present.' + ); + $this->_amazon->itemLookup('oops', array('SearchIndex' => 'Books')); + } + + /** + * Ensures that the query API works as expected when searching for PHP books + * + * @return void + */ + public function testQueryBooksPhp() + { + $resultSet = $this->_query->category('Books')->Keywords('php')->search(); + + foreach ($resultSet as $item) { + $this->assertTrue($item instanceof Amazon\Item); + } + } + + /** + * Ensures that the query API throws an exception when a category is not first provided + * + * @return void + */ + public function testQueryExceptionCategoryMissing() + { + $this->setExpectedException( + 'ZendService\Amazon\Exception\RuntimeException', + 'You must set a category before setting the search parameters' + ); + $this->_query->Keywords('php'); + } + + /** + * Ensures that the query API throws an exception when the category is invalid + * + * @return void + */ + public function testQueryExceptionCategoryInvalid() + { + $this->setExpectedException( + 'ZendService\Amazon\Exception\RuntimeException', + 'The value you specified for SearchIndex is invalid.' + ); + $this->_query->category('oops')->search(); + } + + /** + * Ensures that the query API works as expected when searching by ASIN + * + * @return void + */ + public function testQueryAsin() + { + $item = $this->_query->asin('B0015T963C')->search(); + $this->assertTrue($item instanceof Amazon\Item); + } +} + + +/** + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + */ +class Skip extends \PHPUnit_Framework_TestCase +{ + public function setUp() + { + $this->markTestSkipped('Zend_Service_Amazon online tests not enabled with an access key ID in ' + . 'TestConfiguration.php'); + } + + public function testNothing() + { + } +} diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/OnlineTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/OnlineTest.php new file mode 100644 index 0000000000000000000000000000000000000000..5206c5f5778b333e678cdbe09d8cc1a161f367ba --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/OnlineTest.php @@ -0,0 +1,551 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\S3; + +use ZendService\Amazon\S3; +use ZendService\Amazon\S3\Exception; +use Zend\Http\Response; + +/** + * @category Zend + * @package Zend_Service_Amazon_S3 + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_S3 + */ +class OnlineTest extends \PHPUnit_Framework_TestCase +{ + /** + * Reference to Amazon service consumer object + * + * @var Zend_Service_Amazon_S3 + */ + protected $_amazon; + + /** + * Socket based HTTP client adapter + * + * @var Zend_Http_Client_Adapter_Socket + */ + protected $_httpClientAdapterSocket; + + /** + * Sets up this test case + * + * @return void + */ + public function setUp() + { + if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) { + $this->markTestSkipped('Zend_Service_Amazon online tests are not enabled'); + } + $this->_amazon = new S3\S3(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), + constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY') + ); + $this->_nosuchbucket = "nonexistingbucketnamewhichnobodyshoulduse"; + $this->_httpClientAdapterSocket = new \Zend\Http\Client\Adapter\Socket(); + + $this->_bucket = constant('TESTS_ZEND_SERVICE_AMAZON_S3_BUCKET'); + + $this->_amazon->getHttpClient() + ->setAdapter($this->_httpClientAdapterSocket); + + // terms of use compliance: no more than one query per second + sleep(1); + } + + /** + * Test creating bucket + * + * @return void + */ + public function testCreateBucket() + { + $this->_amazon->createBucket($this->_bucket); + $this->assertTrue($this->_amazon->isBucketAvailable($this->_bucket)); + $list = $this->_amazon->getBuckets(); + $this->assertContains($this->_bucket, $list); + } + + /** + * Test creating bucket with location + * ZF-6728 + * + */ + public function testCreateBucketEU() + { + // make sure that we use different bucket, + // as sometimes delete operation fails to propagate in one zone before you + // attempt to recreate it in another + $this->_bucket = $this->_bucket . 'eu'; + $this->_amazon->createBucket($this->_bucket, 'EU'); + $this->assertTrue($this->_amazon->isBucketAvailable($this->_bucket)); + $list = $this->_amazon->getBuckets(); + $this->assertContains($this->_bucket, $list); + } + + /** + * Test creating object + * + * @return void + */ + public function testCreateObject() + { + $this->_amazon->createBucket($this->_bucket); + $this->_amazon->putObject($this->_bucket."/zftest", "testdata"); + $this->assertEquals("testdata", $this->_amazon->getObject($this->_bucket."/zftest")); + } + + /** + * Get object using streaming and temp files + * + */ + public function testGetObjectStream() + { + $this->_amazon->createBucket($this->_bucket); + $this->_amazon->putObject($this->_bucket."/zftest", "testdata"); + $response = $this->_amazon->getObjectStream($this->_bucket."/zftest"); + + $this->assertTrue($response instanceof Response\Stream, 'The test did not return stream response'); + $this->assertTrue(is_resource($response->getStream()), 'Request does not contain stream!'); + + $stream_name = $response->getStreamName(); + + $stream_read = stream_get_contents($response->getStream()); + $file_read = file_get_contents($stream_name); + + $this->assertEquals("testdata", $stream_read, 'Downloaded stream does not seem to match!'); + $this->assertEquals("testdata", $file_read, 'Downloaded file does not seem to match!'); + } + + /** + * Get object using streaming and specific files + * + */ + public function testGetObjectStreamNamed() + { + $this->_amazon->createBucket($this->_bucket); + $this->_amazon->putObject($this->_bucket."/zftest", "testdata"); + $outfile = tempnam(sys_get_temp_dir(), "output"); + + $response = $this->_amazon->getObjectStream($this->_bucket."/zftest", $outfile); + + $this->assertTrue($response instanceof Response\Stream, 'The test did not return stream response'); + $this->assertTrue(is_resource($response->getStream()), 'Request does not contain stream!'); + + $this->assertEquals($outfile, $response->getStreamName()); + + $stream_read = stream_get_contents($response->getStream()); + $file_read = file_get_contents($outfile); + + $this->assertEquals("testdata", $stream_read, 'Downloaded stream does not seem to match!'); + $this->assertEquals("testdata", $file_read, 'Downloaded file does not seem to match!'); + } +/** + * Test getting info + * + * @return void + */ + public function testGetInfo() + { + $this->_amazon->createBucket($this->_bucket); + $data = "testdata"; + + $this->_amazon->putObject($this->_bucket."/zftest", $data); + $info = $this->_amazon->getInfo($this->_bucket."/zftest"); + $this->assertEquals('"'.md5($data).'"', $info["etag"]); + $this->assertEquals(strlen($data), $info["size"]); + + $this->_amazon->putObject($this->_bucket."/zftest.jpg", $data, null); + $info = $this->_amazon->getInfo($this->_bucket."/zftest.jpg"); + $this->assertEquals( 'image/jpeg', $info["type"]); + } + + public function testNoBucket() + { + $this->assertFalse($this->_amazon->putObject($this->_nosuchbucket."/zftest", "testdata")); + $this->assertFalse($this->_amazon->getObject($this->_nosuchbucket."/zftest")); + $this->assertFalse($this->_amazon->getObjectsByBucket($this->_nosuchbucket)); + } + + public function testNoObject() + { + $this->_amazon->createBucket($this->_bucket); + $this->assertFalse($this->_amazon->getObject($this->_bucket."/zftest-no-such-object/in/there")); + $this->assertFalse($this->_amazon->getInfo($this->_bucket."/zftest-no-such-object/in/there")); + } + + public function testOverwriteObject() + { + $this->_amazon->createBucket($this->_bucket); + $data = "testdata"; + + $this->_amazon->putObject($this->_bucket."/zftest", $data); + $info = $this->_amazon->getInfo($this->_bucket."/zftest"); + $this->assertEquals('"'.md5($data).'"', $info["etag"]); + $this->assertEquals(strlen($data), $info["size"]); + + $data = "testdata with some other data"; + + $this->_amazon->putObject($this->_bucket."/zftest", $data); + $info = $this->_amazon->getInfo($this->_bucket."/zftest"); + $this->assertEquals('"'.md5($data).'"', $info["etag"]); + $this->assertEquals(strlen($data), $info["size"]); + } + + public function testRemoveObject() + { + $this->_amazon->createBucket($this->_bucket); + $data = "testdata"; + + $this->_amazon->putObject($this->_bucket."/zftest", $data); + $this->_amazon->removeObject($this->_bucket."/zftest", $data); + $this->assertFalse($this->_amazon->getObject($this->_bucket."/zftest")); + $this->assertFalse($this->_amazon->getInfo($this->_bucket."/zftest")); + } + + public function testRemoveBucket() + { + $this->_amazon->createBucket($this->_bucket); + $data = "testdata"; + + $this->_amazon->putObject($this->_bucket."/zftest", $data); + $this->_amazon->cleanBucket($this->_bucket); + $this->_amazon->removeBucket($this->_bucket); + + // otherwise amazon sends cached data + sleep(3); + $this->assertFalse($this->_amazon->isBucketAvailable($this->_bucket)); + $this->assertFalse($this->_amazon->isObjectAvailable($this->_bucket."/zftest")); + $this->assertFalse($this->_amazon->getObjectsByBucket($this->_bucket)); + $list = $this->_amazon->getBuckets(); + $this->assertNotContains($this->_bucket, $list); + } + + protected function _fileTest($filename, $object, $type, $exp_type, $stream = false) + { + if($stream) { + $this->_amazon->putFile($filename, $object, array(S3\S3::S3_CONTENT_TYPE_HEADER => $type)); + } else { + $this->_amazon->putFileStream($filename, $object, array(S3\S3::S3_CONTENT_TYPE_HEADER => $type)); + } + + $data = file_get_contents($filename); + + $this->assertTrue($this->_amazon->isObjectAvailable($object)); + + $info = $this->_amazon->getInfo($object); + $this->assertEquals('"'.md5_file($filename).'"', $info["etag"]); + $this->assertEquals(filesize($filename), $info["size"]); + $this->assertEquals($exp_type, $info["type"]); + + $fdata = $this->_amazon->getObject($object); + $this->assertEquals($data, $fdata); + } + + public function testPutFile() + { + $filedir = __DIR__."/_files/"; + $this->_amazon->createBucket($this->_bucket); + + $this->_fileTest($filedir."testdata", $this->_bucket."/zftestfile", null, 'binary/octet-stream'); + $this->_fileTest($filedir."testdata", $this->_bucket."/zftestfile2", 'text/plain', 'text/plain'); + $this->_fileTest($filedir."testdata.html", $this->_bucket."/zftestfile3", null, 'text/html'); + $this->_fileTest($filedir."testdata.html", $this->_bucket."/zftestfile3.html", 'text/plain', 'text/plain'); + } + + public function testPutFileStream() + { + $filedir = __DIR__."/_files/"; + $this->_amazon->createBucket($this->_bucket); + + $this->_fileTest($filedir."testdata", $this->_bucket."/zftestfile", null, 'binary/octet-stream', true); + $this->_fileTest($filedir."testdata", $this->_bucket."/zftestfile2", 'text/plain', 'text/plain', true); + $this->_fileTest($filedir."testdata.html", $this->_bucket."/zftestfile3", null, 'text/html', true); + $this->_fileTest($filedir."testdata.html", $this->_bucket."/zftestfile3.html", 'text/plain', 'text/plain', true); + } + + /** + * Since exception post-condition is tested as well, + * two tests are created for a given exception + * @see testPutNoFile + */ + public function testPutNoFileException() + { + $filedir = __DIR__."/_files/"; + + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\RuntimeException', + 'Cannot read file ' . $filedir."nosuchfile"); + + $this->_amazon->putFile($filedir."nosuchfile", $this->_bucket."/zftestfile"); + } + + /** + * Since exception post-condition is tested as well, + * two tests are created for a given exception + * @see testPutNoFileException + */ + public function testPutNoFile() + { + $filedir = __DIR__."/_files/"; + try { + $this->_amazon->putFile($filedir."nosuchfile", $this->_bucket."/zftestfile"); + } catch (\ZendService\Amazon\Sqs\Exception\RuntimeException $e) { + $this->assertFalse($this->_amazon->isObjectAvailable($this->_bucket."/zftestfile")); + return; + } + $this->fail('Expected exception not thrown'); + } + + + /** + * @depends testCreateBucket + * @depends testCreateObject + */ + public function testCopyObject() + { + $this->_amazon->createBucket($this->_bucket); + $data = "testdata"; + + $this->_amazon->putObject($this->_bucket."/zftest", $data); + $info1 = $this->_amazon->getInfo($this->_bucket."/zftest"); + + $this->_amazon->copyObject($this->_bucket."/zftest", $this->_bucket."/zftest2"); + $this->assertTrue($this->_amazon->isObjectAvailable($this->_bucket."/zftest")); + $this->assertTrue($this->_amazon->isObjectAvailable($this->_bucket."/zftest2")); + $info2 = $this->_amazon->getInfo($this->_bucket."/zftest2"); + + $this->assertEquals($info1['etag'], $info2['etag']); + } + + /** + * @depends testCopyObject + * @depends testRemoveObject + */ + public function testMoveObject() + { + $this->_amazon->createBucket($this->_bucket); + $data = "testdata"; + + $this->_amazon->putObject($this->_bucket."/zftest", $data); + $info1 = $this->_amazon->getInfo($this->_bucket."/zftest"); + + $this->_amazon->moveObject($this->_bucket."/zftest", $this->_bucket."/zftest2"); + $this->assertFalse($this->_amazon->isObjectAvailable($this->_bucket."/zftest")); + $this->assertTrue($this->_amazon->isObjectAvailable($this->_bucket."/zftest2")); + $info2 = $this->_amazon->getInfo($this->_bucket."/zftest2"); + + $this->assertEquals($info1['etag'], $info2['etag']); + } + + public function testObjectEncoding() + { + $this->_amazon->createBucket($this->_bucket); + + $this->_amazon->putObject($this->_bucket."/this is a 100% test", "testdata"); + $this->assertEquals("testdata", $this->_amazon->getObject($this->_bucket."/this is a 100% test")); + + $this->_amazon->putObject($this->_bucket."/Ñто тоже теÑÑ‚!", "testdata123"); + $this->assertEquals("testdata123", $this->_amazon->getObject($this->_bucket."/Ñто тоже теÑÑ‚!")); + } + + + public function testCreateBucketWithBadName() + { + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\InvalidArgumentException', + 'Bucket name "This is a Very Bad Name" contains invalid characters'); + $this->_amazon->createBucket("This is a Very Bad Name"); + } + + public function testBucketAvailabilityWithBadName() + { + $this->setExpectedException( + '\Zend\Http\Client\Adapter\Exception', + 'Unable to Connect to tcp://This is a Very Bad Name.s3.amazonaws.com:80'); + $this->_amazon->isBucketAvailable("This is a Very Bad Name"); + } + + public function testPutObjectWithBadName() + { + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\InvalidArgumentException', + 'Bucket name "This is a Very Bad Name" contains invalid characters'); + $this->_amazon->putObject("This is a Very Bad Name/And It Gets Worse", "testdata"); + } + + public function testGetObjectWithBadName() + { + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\InvalidArgumentException', + 'Bucket name "This is a Very Bad Name" contains invalid characters'); + $this->_amazon->getObject("This is a Very Bad Name/And It Gets Worse"); + } + + public function testGetInfoWithBadName() + { + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\InvalidArgumentException', + 'Bucket name "This is a Very Bad Name" contains invalid characters'); + $this->_amazon->getInfo("This is a Very Bad Name/And It Gets Worse"); + } + + public function testSetEndpointWithBadName() + { + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\InvalidArgumentException', + 'Invalid endpoint supplied'); + $this->_amazon->setEndpoint("This is a Very Bad Name/And It Gets Worse"); + } + + public function testBucketNameIsTooShort() + { + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\InvalidArgumentException', + sprintf('Bucket name "%s" must be between 3 and 255 characters long', 'xx')); + $this->_amazon->createBucket('xx'); + } + + public function testBucketNameIsTooLong() + { + $bucketName = str_repeat('x', 256); + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\InvalidArgumentException', + sprintf('Bucket name "%s" must be between 3 and 255 characters long', $bucketName)); + $this->_amazon->createBucket($bucketName); + } + + public function testAcl() + { + $this->_amazon->createBucket($this->_bucket); + $filedir = __DIR__."/_files/"; + + $this->_amazon->putFile($filedir."testdata.html", $this->_bucket."/zftestfile.html"); + $this->_amazon->putFile($filedir."testdata.html", $this->_bucket."/zftestfile2.html", + array(S3\S3::S3_ACL_HEADER => S3\S3::S3_ACL_PUBLIC_READ)); + + $url = 'http://' . S3\S3::S3_ENDPOINT."/".$this->_bucket."/zftestfile.html"; + $data = @file_get_contents($url); + $this->assertFalse($data); + + $url = 'http://' . S3\S3::S3_ENDPOINT."/".$this->_bucket."/zftestfile2.html"; + $data = @file_get_contents($url); + $this->assertEquals(file_get_contents($filedir."testdata.html"), $data); + } + + /** + * Test bucket name with /'s and encoding + * + * ZF-6855 + * + */ + public function testObjectPath() + { + $this->_amazon->createBucket($this->_bucket); + $filedir = __DIR__."/_files/"; + $this->_amazon->putFile($filedir."testdata.html", $this->_bucket."/subdir/dir with spaces/zftestfile.html", + array(S3\S3::S3_ACL_HEADER => S3\S3::S3_ACL_PUBLIC_READ)); + $url = 'http://' . S3\S3::S3_ENDPOINT."/".$this->_bucket."/subdir/dir%20with%20spaces/zftestfile.html"; + $data = @file_get_contents($url); + $this->assertEquals(file_get_contents($filedir."testdata.html"), $data); + } + + /** + * Test creating object with https + * + * ZF-7029 + */ + public function testCreateObjectSSL() + { + $endpoint = $this->_amazon->getEndpoint(); + $this->_amazon->setEndpoint('https://s3.amazonaws.com'); + $this->assertEquals('https://s3.amazonaws.com', $this->_amazon->getEndpoint()->generate()); + $this->_amazon->createBucket($this->_bucket); + $this->_amazon->putObject($this->_bucket."/zftest", "testdata"); + $this->assertEquals("testdata", $this->_amazon->getObject($this->_bucket."/zftest")); + $this->_amazon->setEndpoint($endpoint); + } + + /** + * Test creating bucket with IP + * + * ZF-6686 + */ + public function testBucketIPMaskException() + { + $this->setExpectedException( + 'ZendService\Amazon\Sqs\Exception\InvalidArgumentException', + 'Bucket name "127.0.0.1" cannot be an IP address'); + $this->_amazon->createBucket("127.0.0.1"); + } + + /** + * Test creating bucket with IP + * + * ZF-6686 + */ + public function testBucketIPMaskPostCondition() + { + try { + $this->_amazon->createBucket("127.0.0.1"); + } catch(\ZendService\Amazon\Sqs\Exception\InvalidArgumentException $e) { + $this->_amazon->createBucket("123-456-789-123"); + $this->assertTrue($this->_amazon->isBucketAvailable("123-456-789-123")); + $this->_amazon->removeBucket("123-456-789-123"); + return; + } + $this->fail("Failed to throw expected exception"); + + } + + /** + * @group ZF-7773 + */ + public function testGetObjectsByBucketParams() + { + $this->_amazon->createBucket("testgetobjectparams1"); + $this->_amazon->putObject("testgetobjectparams1/zftest1", "testdata"); + $this->_amazon->putObject("testgetobjectparams1/zftest2", "testdata"); + + $list = $this->_amazon->getObjectsByBucket("testgetobjectparams1", array('max-keys' => 1)); + $this->assertEquals(1, count($list)); + + $this->_amazon->removeObject("testgetobjectparams1/zftest1", "testdata"); + $this->_amazon->removeObject("testgetobjectparams1/zftest2", "testdata"); + $this->_amazon->removeBucket("testgetobjectparams1"); + } + + public function testCommonPrefixes() + { + $this->_amazon->createBucket($this->_bucket); + $this->_amazon->putObject($this->_bucket.'/test-folder/test1','test'); + $this->_amazon->putObject($this->_bucket.'/test-folder/test2-folder/',''); + $params= array( + 'prefix' => 'test-folder/', + 'delimiter' => '/' + ); + $response= $this->_amazon->getObjectsAndPrefixesByBucket($this->_bucket,$params); + $this->assertEquals($response['objects'][0],'test-folder/test1'); + $this->assertEquals($response['prefixes'][0],'test-folder/test2-folder/'); + } + + public function tearDown() + { + if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) { + return; + } + unset($this->_amazon->debug); + $this->_amazon->cleanBucket($this->_bucket); + $this->_amazon->removeBucket($this->_bucket); + } +} diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/S3RestTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/S3RestTest.php new file mode 100644 index 0000000000000000000000000000000000000000..c60bd9237b1c3756cd59af1e2df0e0592f442d63 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/S3RestTest.php @@ -0,0 +1,276 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\S3; + +use DateTime; +use ZendService\Amazon\S3\S3; + +/** + * @category Zend + * @package Zend_Service_Amazon_S3 + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_S3 + */ +class S3RestTest extends \PHPUnit_Framework_TestCase +{ + /** + * Reference to Amazon service consumer object + * + * @var S3 + */ + protected $amazon; + + /** + * Http Client stub + * + * @var \Zend\Http\Client + */ + protected $httpClient; + + /** + * Uri Http stub + * + * @var \Zend\Uri\Http + */ + protected $uriHttp; + + /** + * Http Response stub + * + * @var \Zend\Http\Response + */ + protected $httpResponse; + + /** + * Sets up this test case + * + * @return void + */ + public function setUp() + { + + $accessKey = 'accessKey'; + $secretKey = 'secretKey'; + + // Create a stub for Http Client + $this->httpClient = $this->getMockBuilder('Zend\Http\Client')->getMock(); + // Create a stub for Http response for be used later. + $this->httpResponse = $this->getMockBuilder('Zend\Http\Response')->getMock(); + // Create a stub for Uri\Http for later. + $this->uriHttp = $this->getMockBuilder('Zend\Uri\Http')->getMock(); + + $this->uriHttp->expects($this->any()) + ->method('isValid') + ->will($this->returnValue(true)); + + + // Create a S3 instance + $this->amazon = new S3($accessKey, $secretKey); + // Inject the stub into the application. + $this->amazon->setHttpClient($this->httpClient); + // Inject the stub into the application. + $this->amazon->setEndpoint($this->uriHttp); + } + + /** + * Test get buckets + * + * @return void + */ + public function testGetBuckets() + { + $expected = array('quotes', 'samples'); + + // Http Response results + $this->httpResponse->expects($this->any()) + ->method('getStatusCode') + ->will($this->returnValue(200)); + $rawBody = <<<BODY +<?xml version="1.0" encoding="UTF-8"?> +<ListAllMyBucketsResult xmlns="http://doc.s3.amazonaws.com/2006-03-01"> + <Owner> + <ID>bcaf1ffd86f461ca5fb16fd081034f</ID> + <DisplayName>webfile</DisplayName> + </Owner> + <Buckets> + <Bucket> + <Name>quotes</Name> + <CreationDate>2006-02-03T16:45:09.000Z</CreationDate> + </Bucket> + <Bucket> + <Name>samples</Name> + <CreationDate>2006-02-03T16:41:58.000Z</CreationDate> + </Bucket> + </Buckets> +</ListAllMyBucketsResult> +BODY; + $this->httpResponse->expects($this->any()) + ->method('getBody') + ->will($this->returnValue($rawBody)); + + // Expects to be called only once the method send() then return a Http Response. + $this->httpClient->expects($this->once()) + ->method('send') + ->will($this->returnValue($this->httpResponse)); + + $buckets = $this->amazon->getBuckets(); + + $this->assertEquals($expected, $buckets); + } + + /** + * Test create bucket + * + * @return void + */ + public function testCreateBuckets() + { + //Valid bucket name + $bucket = 'iamavalidbucket'; + $location = ''; + $accessKey = 'AKIAIDCZ2WXN6NNB7YZA'; + $secretKey = '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'; + $requestDate = DateTime::createFromFormat(DateTime::RFC1123, 'Tue, 15 May 2012 15:18:31 +0000'); + $this->amazon->setRequestDate($requestDate); + $this->amazon->setKeys($accessKey, $secretKey); //Fake keys + + /** + * Check of request inside _makeRequest + * + */ + $this->uriHttp->expects($this->once()) + ->method('getHost') + ->with() + ->will($this->returnValue('s3.amazonaws.com')); + + $this->uriHttp->expects($this->once()) + ->method('setHost') + ->with('iamavalidbucket.s3.amazonaws.com'); + + $this->uriHttp->expects($this->once()) + ->method('setPath') + ->with('/'); + + $this->httpClient->expects($this->once()) + ->method('setUri') + ->with($this->uriHttp); + + $this->httpClient->expects($this->once()) + ->method('setMethod') + ->with('PUT'); + + $this->httpClient->expects($this->once()) + ->method('setHeaders') + ->with(array( + "Date" => "Tue, 15 May 2012 15:18:31 +0000", + "Content-Type" => "application/xml", + "Authorization" => "AWS ".$accessKey.":Y+T4nZxI1wBi1Yn1BMnOK9CDiOM=", + )); + + /** + * Fake response inside _makeRequest + * + */ + // Http Response results + $this->httpResponse->expects($this->any()) + ->method('getStatusCode') + ->will($this->returnValue(200)); + + // Expects to be called only once the method send() then return a Http Response. + $this->httpClient->expects($this->once()) + ->method('send') + ->will($this->returnValue($this->httpResponse)); + + $response = $this->amazon->createBucket($bucket, $location); + + $this->assertTrue($response); + } + + /** + * Test valid bucket name + * + * @return void + */ + public function testValidBucketName() + { + + $this->assertTrue($this->amazon->_validBucketName('iam.avalid.1bucket-name.endingwithnumber9')); + } + + /** + * Test invalid bucket name (name too short) + * + * @return void + */ + public function testBucketNameShort() + { + $this->setExpectedException('\ZendService\Amazon\S3\Exception\InvalidArgumentException'); + $this->amazon->_validBucketName('ia'); + } + + /** + * Test invalid bucket name (name too long) + * + * @return void + */ + public function testBucketNameLong() + { + $this->setExpectedException('\ZendService\Amazon\S3\Exception\InvalidArgumentException'); + $this->amazon->_validBucketName('iam.aninvalid.bucketname.because.iam.way.tooooooooooooooooo.long'); + } + + /** + * Test invalid bucket name (capital letters) + * + * @return void + */ + public function testBucketNameCapitalLetter() + { + $this->setExpectedException('\ZendService\Amazon\S3\Exception\InvalidArgumentException'); + $this->amazon->_validBucketName('iam.anInvalid.bucketname'); + } + + /** + * Test invalid bucket name (ip address) + * + * @return void + */ + public function testBucketNameIpAddress() + { + $this->setExpectedException('\ZendService\Amazon\S3\Exception\InvalidArgumentException'); + $this->amazon->_validBucketName('1.0.255.90'); + } + + /** + * Test invalid bucket name (empty label) + * + * @return void + */ + public function testBucketNameLabelEmtpy() + { + $this->setExpectedException('\ZendService\Amazon\S3\Exception\InvalidArgumentException'); + $this->amazon->_validBucketName('iam.aninvalid..empty.bucketname'); + } + + /** + * Test invalid bucket name (label starting with dash) + * + * @return void + */ + public function testBucketNameLabelDash() + { + $this->setExpectedException('\ZendService\Amazon\S3\Exception\InvalidArgumentException'); + $this->amazon->_validBucketName('iam.aninvalid.-bucketname'); + } +} + diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/StreamTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/StreamTest.php new file mode 100644 index 0000000000000000000000000000000000000000..df29925db16b1508b308f3c62f883997d61dfca6 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/StreamTest.php @@ -0,0 +1,238 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\S3; + +/** + * @category Zend + * @package Zend_Service_Amazon_S3 + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_S3 + */ +class StreamTest extends \PHPUnit_Framework_TestCase +{ + /** + * Sets up this test case + * + * @return void + */ + public function setUp() + { + if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) { + $this->markTestSkipped('Zend_Service_Amazon_S3 online tests are not enabled'); + } + $this->_amazon = new \ZendService\Amazon\S3\S3(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), + constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY') + ); + $this->_nosuchbucket = "nonexistingbucketnamewhichnobodyshoulduse"; + $this->_httpClientAdapterSocket = new \Zend\Http\Client\Adapter\Socket(); + + $this->_bucket = constant('TESTS_ZEND_SERVICE_AMAZON_S3_BUCKET'); + $this->_bucketName = "s3://".$this->_bucket; + $this->_fileName = $this->_bucketName."/sample_file.txt"; + + $this->_amazon->getHttpClient() + ->setAdapter($this->_httpClientAdapterSocket); + $this->_amazon->registerStreamWrapper(); + $this->_amazon->cleanBucket($this->_bucket); + $this->_amazon->removeBucket($this->_bucket); + // terms of use compliance: no more than one query per second + sleep(1); + } + + /** + * Tear down each test + * + * @return void + */ + public function tearDown() + { + if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) { + return; + } + $this->_amazon->unregisterStreamWrapper(); + $buckets = $this->_amazon->getBuckets(); + foreach($buckets as $bucket) { + if(substr($bucket, 0, strlen($this->_bucket)) != $this->_bucket) { + continue; + } + $this->_amazon->cleanBucket($bucket); + $this->_amazon->removeBucket($bucket); + } + } + + /** + * Test creating and removing buckets + * + * @return void + */ + public function testBuckets() + { + // Create the bucket + $result = mkdir($this->_bucketName); + $this->assertTrue($result); + // Remove the bucket + $result = rmdir($this->_bucketName); + $this->assertTrue($result); + } + + /** + * Test writing to an object + * + * @return void + */ + public function testWriteObject() + { + // Create the bucket + $result = mkdir($this->_bucketName); + $this->assertTrue($result); + + // Generate sample data + $data = str_repeat('x', 10000); + + // Write to an object + $size = file_put_contents($this->_fileName, $data); + $this->assertEquals(strlen($data), $size); + + // Write to an object + $f = fopen($this->_fileName, 'w'); + for ($i = 0; $i < 100; $i++) { + fwrite($f, 'x'); + } + fclose($f); + + unset($data); + + // Check object size + $size = filesize($this->_fileName); + $this->assertEquals(100, $size); + + // Remove the object + $result = unlink($this->_fileName); + $this->assertTrue($result); + } + + /** + * Test reading from an object + * + * @group ZF-10035 + * @return void + */ + public function testReadObject() + { + // Create the bucket + $result = mkdir($this->_bucketName); + $this->assertTrue($result); + + // Generate sample data + $data = str_repeat('x', 10000); + + // Write to an object + $size = file_put_contents($this->_fileName, $data); + $this->assertEquals(strlen($data), $size); + + // Read from an object + $new_data = file_get_contents($this->_fileName); + + $this->assertEquals($data, $new_data); + + // Read from an oject + $new_data = ''; + + $f = fopen($this->_fileName, 'r'); + fseek($f, 1000); + while (!feof($f)) { + $chunk = fread($f, 1000); + $new_data .= $chunk; + $this->assertEquals(strlen($chunk), 1000); + } + fclose($f); + + $this->assertEquals(substr($data, 1000), $new_data); + + unset($data); + unset($new_data); + + // Remove the object + $result = unlink($this->_fileName); + $this->assertTrue($result); + } + + /** + * Test getting the list of available buckets + * + * @return void + */ + public function testGetBucketList() + { + $buckets = array($this->_bucket.'zf-test1', $this->_bucket.'zf-test2', $this->_bucket.'zf-test3'); + + // Create the buckets + foreach ($buckets as $bucket) { + $result = mkdir('s3://'.$bucket); + $this->assertTrue($result); + } + + $online_buckets = array(); + + // Retrieve list of buckets on S3 + $e = opendir('s3://'); + while (($f = readdir($e)) !== false) { + $online_buckets[] = $f; + } + closedir($e); + + // Check that each bucket is in our original list + foreach ($buckets as $bucket) { + $this->assertContains($bucket, $online_buckets); + } + + // Remove the buckets + foreach ($buckets as $bucket) { + $result = rmdir('s3://'.$bucket); + $this->assertTrue($result); + } + } + + /** + * Test object stat + * + * @return void + */ + public function testObjectStat() + { + // Create the bucket + $result = mkdir($this->_bucketName); + $this->assertTrue($result); + + $this->assertTrue(is_dir($this->_bucketName)); + + $data = str_repeat('x', 10000); + $len = strlen($data); + + // Write to an object + $size = file_put_contents($this->_fileName, $data); + $this->assertEquals($len, $size); + + $this->assertFalse(is_dir($this->_fileName)); + + // Stat an object + $info = stat($this->_fileName); + $this->assertEquals($len, $info['size']); + + unset($data); + + // Remove the object + $result = unlink($this->_fileName); + $this->assertTrue($result); + } +} diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/_files/testdata b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/_files/testdata new file mode 100644 index 0000000000000000000000000000000000000000..b95931a5dcbd1294cddf4323202eb719ca1ed9a8 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/_files/testdata @@ -0,0 +1 @@ +test 12345 \ No newline at end of file diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/_files/testdata.html b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/_files/testdata.html new file mode 100644 index 0000000000000000000000000000000000000000..9f95c31a0b71100db23b63741069d592dc5ae472 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/S3/_files/testdata.html @@ -0,0 +1,3 @@ +<h1>test!</h1> + +test! diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/SimpleDb/OnlineTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/SimpleDb/OnlineTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d2b2156fa672408875bd69b0c4acc123ab68d5c1 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/SimpleDb/OnlineTest.php @@ -0,0 +1,508 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\SimpleDb; + +use ZendService\Amazon\SimpleDb; +use ZendService\Amazon\SimpleDb\Exception; +use Zend\Http\Client\Adapter\Socket; + + +/** + * @category Zend + * @package ZendService\Amazon\SimpleDb + * @subpackage UnitTests + */ +class OnlineTest extends \PHPUnit_Framework_TestCase +{ + /** + * Reference to Amazon service consumer object + * + * @var ZendService\Amazon\SimpleDb + */ + protected $_amazon; + + /** + * Socket based HTTP client adapter + * + * @var Zend\Http\Client\Adapter\Socket + */ + protected $_httpClientAdapterSocket; + + protected $_testDomainNamePrefix; + + protected $_testItemNamePrefix; + + protected $_testAttributeNamePrefix; + + // Because Amazon uses an eventual consistency model, this test period may + // help avoid *but not guarantee* false negatives + protected $_testWaitPeriod = 2; + + /** + * Maximum attempts performed in request() + * + * @var int + */ + protected $_testWaitRetries = 3; + + /** + * Sets up this test case + * + * @return void + */ + public function setUp() + { + if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) { + $this->markTestSkipped('Zend_Service_Amazon online tests are not enabled'); + } + + $this->_amazon = new SimpleDb\SimpleDb( + constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), + constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY') + ); + + $this->_httpClientAdapterSocket = new Socket(); + + $this->_amazon->getHttpClient() + ->setAdapter($this->_httpClientAdapterSocket); + + $this->_testDomainNamePrefix = 'TestsZendServiceAmazonSimpleDbDomain'; + + $this->_testItemNamePrefix = 'TestsZendServiceAmazonSimpleDbItem'; + + $this->_testAttributeNamePrefix = 'TestsZendServiceAmazonSimpleDbAttribute'; + + $this->_wait(); + } + + /** + * Wrapper around remote calls to retry, apply wait, etc. + * + * @param string $method SimpleDB method name + * @param array $args Method argument list + * @return void + */ + public function request($method, $args = array()) + { + $response = null; + for ($try = 1; $try <= $this->_testWaitRetries; $try++) { + try { + $this->_wait(); + $response = call_user_func_array(array($this->_amazon, $method), $args); + break; + } catch (Zend_Service_Amazon_SimpleDb_Exception $e) { + // Only retry after throtte-related error + if (false === strpos($e->getMessage(), 'currently unavailable')) { + throw $e; + } + } + } + return $response; + } + + public function testGetAttributes() + { + $domainName = $this->_testDomainNamePrefix . '_testGetAttributes'; + $this->request('deleteDomain', array($domainName)); + $this->request('createDomain', array($domainName)); + try { + $itemName = $this->_testItemNamePrefix . '_testGetAttributes'; + $attributeName1 = $this->_testAttributeNamePrefix . '_testGetAttributes1'; + $attributeName2 = $this->_testAttributeNamePrefix . '_testGetAttributes2'; + $attributeValue1 = 'value1'; + $attributeValue2 = 'value2'; + $attributes = array( + $attributeName1 => new SimpleDb\Attribute($itemName, $attributeName1, $attributeValue1), + $attributeName2 => new SimpleDb\Attribute($itemName, $attributeName2, $attributeValue2) + ); + + // Now that everything's set up, test it + $this->request('putAttributes', array($domainName, $itemName, $attributes)); + + // One attribute + $results = $this->request('getAttributes', array($domainName, $itemName, $attributeName1)); + $this->assertEquals(1, count($results)); + $attribute = current($results); + $this->assertEquals($attributeName1, $attribute->getName()); + $this->assertEquals($attributeValue1, current($attribute->getValues())); + + // Multiple attributes + $results = $this->request('getAttributes', array($domainName, $itemName)); + $this->assertEquals(2, count($results)); + $this->assertTrue(array_key_exists($attributeName1, $results)); + $this->assertTrue(array_key_exists($attributeName2, $results)); + $this->assertEquals($attributeValue1, current($results[$attributeName1]->getValues())); + $this->assertEquals($attributeValue2, current($results[$attributeName2]->getValues())); + + $this->request('deleteDomain', array($domainName)); + } catch(Exception $e) { + $this->request('deleteDomain', array($domainName)); + throw $e; + } + } + + public function testPutAttributes() + { + $domainName = $this->_testDomainNamePrefix . '_testPutAttributes'; + $this->request('deleteDomain', array($domainName)); + $this->request('createDomain', array($domainName)); + try { + $itemName = $this->_testItemNamePrefix . '_testPutAttributes'; + $attributeName1 = $this->_testAttributeNamePrefix . '_testPutAttributes1'; + $attributeName2 = $this->_testAttributeNamePrefix . '_testPutAttributes2'; + $attributeValue1 = 'value1'; + $attributeValue2 = 'value2'; + $attributes = array( + $attributeName1 => new SimpleDb\Attribute($itemName, $attributeName1, $attributeValue1), + $attributeName2 => new SimpleDb\Attribute($itemName, $attributeName2, $attributeValue2) + ); + + // Now that everything's set up, test it + $this->request('putAttributes', array($domainName, $itemName, $attributes)); + + // Multiple attributes + $results = $this->request('getAttributes', array($domainName, $itemName)); + $this->assertEquals(2, count($results)); + $this->assertTrue(array_key_exists($attributeName1, $results)); + $this->assertTrue(array_key_exists($attributeName2, $results)); + $this->assertEquals($attributes[$attributeName1], $results[$attributeName1]); + $this->assertEquals($attributes[$attributeName2], $results[$attributeName2]); + $this->request('deleteDomain', array($domainName)); + } catch(Exception $e) { + $this->request('deleteDomain', array($domainName)); + throw $e; + } + } + + public function testBatchPutAttributes() + { + $domainName = $this->_testDomainNamePrefix . '_testBatchPutAttributes'; + $this->request('deleteDomain', array($domainName)); + $this->request('createDomain', array($domainName)); + try { + $itemName1 = $this->_testItemNamePrefix . '_testBatchPutAttributes1'; + $itemName2 = $this->_testItemNamePrefix . '_testBatchPutAttributes2'; + $attributeName1 = $this->_testAttributeNamePrefix . '_testBatchPutAttributes1'; + $attributeName2 = $this->_testAttributeNamePrefix . '_testBatchPutAttributes2'; + $attributeName3 = $this->_testAttributeNamePrefix . '_testBatchPutAttributes3'; + $attributeName4 = $this->_testAttributeNamePrefix . '_testBatchPutAttributes4'; + $attributeValue1 = 'value1'; + $attributeValue2 = 'value2'; + $attributeValue3 = 'value3'; + $attributeValue4 = 'value4'; + $attributeValue5 = 'value5'; + $items = array( + $itemName1 => array( + $attributeName1 => new SimpleDb\Attribute($itemName1, $attributeName1, $attributeValue1), + $attributeName2 => new SimpleDb\Attribute($itemName1, $attributeName2, $attributeValue2)), + $itemName2 => array( + $attributeName3 => new SimpleDb\Attribute($itemName2, $attributeName3, $attributeValue3), + $attributeName4 => new SimpleDb\Attribute($itemName2, $attributeName4, array($attributeValue4, $attributeValue5))) + ); + + + $replace = array( + $itemName1 => array( + $attributeName1 => false, + $attributeName2 => false + ), + $itemName2 => array( + $attributeName3 => false, + $attributeName4 => false + ) + ); + + $this->assertEquals(array(), $this->request('getAttributes', array($domainName, $itemName1))); + $this->request('batchPutAttributes', array($items, $domainName, $replace)); + + $result = $this->request('getAttributes', array($domainName, $itemName1, $attributeName1)); + + $this->assertTrue(array_key_exists($attributeName1, $result)); + $this->assertEquals($attributeName1, $result[$attributeName1]->getName()); + $this->assertEquals($attributeValue1, current($result[$attributeName1]->getValues())); + $result = $this->request('getAttributes', array($domainName, $itemName2, $attributeName4)); + $this->assertTrue(array_key_exists($attributeName4, $result)); + $this->assertEquals(2, count($result[$attributeName4]->getValues())); + $result = $this->request('getAttributes', array($domainName, $itemName2)); + $this->assertEquals(2, count($result)); + $this->assertTrue(array_key_exists($attributeName3, $result)); + $this->assertEquals($attributeName3, $result[$attributeName3]->getName()); + $this->assertEquals(1, count($result[$attributeName3])); + $this->assertEquals($attributeValue3, current($result[$attributeName3]->getValues())); + $this->assertTrue(array_key_exists($attributeName4, $result)); + $this->assertEquals($attributeName4, $result[$attributeName4]->getName()); + $this->assertEquals(2, count($result[$attributeName4]->getValues())); + $this->assertEquals(array($attributeValue4, $attributeValue5), $result[$attributeName4]->getValues()); + + // Test replace + $newAttributeValue1 = 'newValue1'; + $newAttributeValue4 = 'newValue4'; + $items[$itemName1][$attributeName1]->setValues(array($newAttributeValue1)); + $items[$itemName2][$attributeName4]->setValues(array($newAttributeValue4)); + + $this->request('batchPutAttributes', array($items, $domainName, $replace)); + + $result = $this->request('getAttributes', array($domainName, $itemName1, $attributeName1)); + $this->assertEquals(array($newAttributeValue1, $attributeValue1), $result[$attributeName1]->getValues()); + + $result = $this->request('getAttributes', array($domainName, $itemName2, $attributeName4)); + $this->assertEquals(array($newAttributeValue4, $attributeValue4, $attributeValue5), $result[$attributeName4]->getValues()); + + $replace[$itemName1][$attributeName1] = true; + $replace[$itemName2][$attributeName4] = true; + + $this->request('batchPutAttributes', array($items, $domainName, $replace)); + + $result = $this->request('getAttributes', array($domainName, $itemName1, $attributeName1)); + $this->assertEquals($items[$itemName1][$attributeName1], $result[$attributeName1]); + + $result = $this->request('getAttributes', array($domainName, $itemName2, $attributeName4)); + $this->assertEquals($items[$itemName2][$attributeName4], $result[$attributeName4]); + $this->assertEquals($items[$itemName1], $this->request('getAttributes', array($domainName, $itemName1))); + + $this->request('deleteDomain', array($domainName)); + } catch(Exception $e) { + $this->request('deleteDomain', array($domainName)); + throw $e; + } + } + + public function testDeleteAttributes() + { + $domainName = $this->_testDomainNamePrefix . '_testDeleteAttributes'; + $this->request('deleteDomain', array($domainName)); + $this->request('createDomain', array($domainName)); + try { + $itemName = $this->_testItemNamePrefix . '_testDeleteAttributes'; + $attributeName1 = $this->_testAttributeNamePrefix . '_testDeleteAttributes1'; + $attributeName2 = $this->_testAttributeNamePrefix . '_testDeleteAttributes2'; + $attributeName3 = $this->_testAttributeNamePrefix . '_testDeleteAttributes3'; + $attributeName4 = $this->_testAttributeNamePrefix . '_testDeleteAttributes4'; + $attributeValue1 = 'value1'; + $attributeValue2 = 'value2'; + $attributeValue3 = 'value3'; + $attributeValue4 = 'value4'; + $attributes = array( + new SimpleDb\Attribute($itemName, $attributeName1, $attributeValue1), + new SimpleDb\Attribute($itemName, $attributeName2, $attributeValue2), + new SimpleDb\Attribute($itemName, $attributeName3, $attributeValue3), + new SimpleDb\Attribute($itemName, $attributeName4, $attributeValue4) + ); + + // Now that everything's set up, test it + $this->request('putAttributes', array($domainName, $itemName, $attributes)); + + $results = $this->request('getAttributes', array($domainName, $itemName)); + $this->assertEquals(4, count($results)); + $this->assertTrue(array_key_exists($attributeName1, $results)); + $this->assertTrue(array_key_exists($attributeName2, $results)); + $this->assertTrue(array_key_exists($attributeName3, $results)); + $this->assertTrue(array_key_exists($attributeName4, $results)); + $this->assertEquals($attributeValue1, current($results[$attributeName1]->getValues())); + $this->assertEquals($attributeValue2, current($results[$attributeName2]->getValues())); + $this->assertEquals($attributeValue3, current($results[$attributeName3]->getValues())); + $this->assertEquals($attributeValue4, current($results[$attributeName4]->getValues())); + + $this->request('deleteAttributes', array($domainName, $itemName, array($attributes[0]))); + + $results = $this->request('getAttributes', array($domainName, $itemName)); + $this->assertEquals(3, count($results)); + $this->assertTrue(array_key_exists($attributeName2, $results)); + $this->assertTrue(array_key_exists($attributeName3, $results)); + $this->assertTrue(array_key_exists($attributeName4, $results)); + $this->assertEquals($attributeValue2, current($results[$attributeName2]->getValues())); + $this->assertEquals($attributeValue3, current($results[$attributeName3]->getValues())); + $this->assertEquals($attributeValue4, current($results[$attributeName4]->getValues())); + + $this->request('deleteAttributes', array($domainName, $itemName, array($attributes[1], $attributes[2]))); + + $results = $this->request('getAttributes', array($domainName, $itemName)); + $this->assertEquals(1, count($results)); + $this->assertTrue(array_key_exists($attributeName4, $results)); + $this->assertEquals($attributeValue4, current($results[$attributeName4]->getValues())); + + + $this->request('deleteAttributes', array($domainName, $itemName, array($attributes[3]))); + + $results = $this->request('getAttributes', array($domainName, $itemName)); + $this->assertEquals(0, count($results)); + + $this->request('deleteDomain', array($domainName)); + } catch(Exception $e) { + $this->request('deleteDomain', array($domainName)); + throw $e; + } + } + + /** + * + * @param $maxNumberOfDomains Integer between 1 and 100 + * @param $nextToken Integer between 1 and 100 + * @return array 0 or more domain names + */ + public function testListDomains() + { + $domainName = null; + try { + // Create some domains + for($i = 1; $i <= 3; $i++) { + $domainName = $this->_testDomainNamePrefix . '_testListDomains' . $i; + $this->request('deleteDomain', array($domainName)); + $this->request('createDomain', array($domainName)); + } + + $page = $this->request('listDomains', array(3)); + $this->assertEquals(3, count($page->getData())); + // Amazon returns an empty page as the last page :/ + $isLast = $page->isLast(); + if (!$isLast) { + // The old isLast() assertTrue failed in full suite runs. Token often + // decodes to 'TestsZendServiceAmazonSimpleDbDomain_testPutAttributes' + // which no longer exists. Instead of a plain assertTrue, which seemed + // to pass only in single-case runs, we'll make sure the token's + // presence is worth a negative. + $token = $page->getToken(); + if ($token) { + $tokenDomainName = base64_decode($token); + if (false !== strpos($tokenDomainName, $this->_testDomainNamePrefix)) { + try { + $this->request('domainMetadata', array($tokenDomainName)); + $this->fail('listDomains call with 3 domain maximum did not return last page'); + } catch (Exception $e) { + $this->assertContains('The specified domain does not exist', $e->getMessage()); + } + } + } + } + $this->assertEquals(1, count($this->request('listDomains', array(1, $page->getToken())))); + + $page = $this->request('listDomains', array(4)); + $this->assertEquals(3, count($page->getData())); + $this->assertTrue($page->isLast()); + + $page = $this->request('listDomains', array(2)); + $this->assertEquals(2, count($page->getData())); + $this->assertFalse($page->isLast()); + + $nextPage = $this->request('listDomains', array(100, $page->getToken())); + $this->assertEquals(1, count($nextPage->getData())); + // Amazon returns an empty page as the last page :/ + $this->assertTrue($nextPage->isLast()); + + // Delete the domains + for($i = 1; $i <= 3; $i++) { + $domainName = $this->_testDomainNamePrefix . '_testListDomains' . $i; + $this->request('deleteDomain', array($domainName)); + } + } catch(Exception $e) { + // Delete the domains + for($i = 1; $i <= 3; $i++) { + $domainName = $this->_testDomainNamePrefix . '_testListDomains' . $i; + $this->request('deleteDomain', array($domainName)); + } + throw $e; + } + } + + /** + * @param $domainName string Name of the domain for which metadata will be requested + * @return array Key/value array of metadatum names and values. + */ + public function testDomainMetadata() + { + $domainName = $this->_testDomainNamePrefix . '_testDomainMetadata'; + $this->request('deleteDomain', array($domainName)); + $this->request('createDomain', array($domainName)); + try { + $metadata = $this->request('domainMetadata', array($domainName)); + $this->assertTrue(is_array($metadata)); + $this->assertGreaterThan(0, count($metadata)); + $this->assertTrue(array_key_exists('ItemCount', $metadata)); + $this->assertEquals(0, (int)$metadata['ItemCount']); + $this->assertTrue(array_key_exists('ItemNamesSizeBytes', $metadata)); + $this->assertEquals(0, (int)$metadata['ItemNamesSizeBytes']); + $this->assertTrue(array_key_exists('AttributeNameCount', $metadata)); + $this->assertEquals(0, (int)$metadata['AttributeNameCount']); + $this->assertTrue(array_key_exists('AttributeValueCount', $metadata)); + $this->assertEquals(0, (int)$metadata['AttributeValueCount']); + $this->assertTrue(array_key_exists('AttributeNamesSizeBytes', $metadata)); + $this->assertEquals(0, (int)$metadata['AttributeNamesSizeBytes']); + $this->assertTrue(array_key_exists('AttributeValuesSizeBytes', $metadata)); + $this->assertEquals(0, (int)$metadata['AttributeValuesSizeBytes']); + $this->assertTrue(array_key_exists('Timestamp', $metadata)); + + // Delete the domain + $this->request('deleteDomain', array($domainName)); + } catch(Exception $e) { + $this->request('deleteDomain', array($domainName)); + throw $e; + } + } + + /** + * + * @param $domainName string Valid domain name of the domain to create + * @return boolean True if successful, false if not + */ + public function testCreateDomain() + { + $domainName = $this->_testDomainNamePrefix . '_testCreateDomain'; + $this->request('deleteDomain', array($domainName)); + $this->request('createDomain', array($domainName)); + try { + $domainListPage = $this->request('listDomains'); + $this->assertContains($domainName, $domainListPage->getData()); + // Delete the domain + $this->request('deleteDomain', array($domainName)); + } catch(Exception $e) { + $this->request('deleteDomain', array($domainName)); + throw $e; + } + } + + public function testDeleteDomain() + { + $domainName = $this->_testDomainNamePrefix . '_testDeleteDomain'; + $this->request('deleteDomain', array($domainName)); + $this->request('createDomain', array($domainName)); + try { + $domainListPage = $this->request('listDomains'); + $this->assertContains($domainName, $domainListPage->getData()); + $this->assertNull($domainListPage->getToken()); + // Delete the domain + $this->request('deleteDomain', array($domainName)); + $domainListPage = $this->request('listDomains'); + $this->assertNotContains($domainName, $domainListPage->getData()); + } catch(Exception $e) { + $this->request('deleteDomain', array($domainName)); + throw $e; + } + } + + private function _wait() + { + sleep($this->_testWaitPeriod); + } + + /** + * Tear down the test case + * + * @return void + */ + public function tearDown() + { + + // $this->request('deleteDomain', array($this->_testDomainNamePrefix)); + // Delete domains + + unset($this->_amazon); + } +} diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Sqs/OnlineTest.php b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Sqs/OnlineTest.php new file mode 100644 index 0000000000000000000000000000000000000000..093fd895d407a3cbf182cbfaff255f6b82c830f3 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/Sqs/OnlineTest.php @@ -0,0 +1,103 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @package Zend_Service + */ + +namespace ZendServiceTest\Amazon\Sqs; + +/** + * @category Zend + * @package Zend_Service_Amazon + * @subpackage UnitTests + * @group Zend_Service + * @group Zend_Service_Amazon + * @group Zend_Service_Amazon_Sqs + */ +class OnlineTest extends \PHPUnit_Framework_TestCase +{ + /** + * Reference to Amazon service consumer object + * + * @var Zend_Service_Amazon_Sqs + */ + protected $_amazon; + + /** + * Socket based HTTP client adapter + * + * @var Zend_Http_Client_Adapter_Socket + */ + protected $_httpClientAdapterSocket; + + /** + * Sets up this test case + * + * @return void + */ + public function setUp() + { + if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) { + $this->markTestSkipped('Zend_Service_Amazon online tests are not enabled'); + } + $this->_amazon = new \ZendService\Amazon\Sqs\Sqs( + constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), + constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY') + ); + + $this->_queue_name = constant('TESTS_ZEND_SERVICE_AMAZON_SQS_QUEUE'); + + $this->_httpClientAdapterSocket = new \Zend\Http\Client\Adapter\Socket(); + + $this->_amazon->getHttpClient() + ->setAdapter($this->_httpClientAdapterSocket); + } + + /** + * Test SQS methods + * + * @return void + */ + public function testSqs() + { + $queue_url = $this->_amazon->create($this->_queue_name, 45); + $timeout = $this->_amazon->getAttribute($queue_url, 'VisibilityTimeout'); + $this->assertEquals(45, $timeout, 'VisibilityTimeout attribute is not 45'); + + $test_msg = 'this is a test'; + $this->_amazon->send($queue_url, $test_msg); + + $messages = $this->_amazon->receive($queue_url); + + foreach ($messages as $message) { + $this->assertEquals($test_msg, $message['body']); + } + + foreach ($messages as $message) { + $result = $this->_amazon->deleteMessage($queue_url, $message['handle']); + $this->assertTrue($result, 'Message was not deleted'); + } + + $count = $this->_amazon->count($queue_url); + $this->assertEquals(0, $count); + + $this->_amazon->delete($queue_url); + } + + /** + * Tear down the test case + * + * @return void + */ + public function tearDown() + { + if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) { + return; + } + unset($this->_amazon); + } +} diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/amazon-response-invalid.xml b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/amazon-response-invalid.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba5fc4209975a2e7dc309afe18438fa51683fb2e --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/amazon-response-invalid.xml @@ -0,0 +1 @@ +<?xml version="1.0" ?><ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"><OperationRequest><HTTPHeaders><Header Name="UserAgent" Value="Zend_Http_Client"></Header></HTTPHeaders><RequestId>ae1b57b9-ac1c-4408-87f2-942e72630361</RequestId><Arguments><Argument Name="Operation" Value="ItemSearch"></Argument><Argument Name="Service" Value="AWSECommerceService"></Argument><Argument Name="Power" Value="isbn:0750640162"></Argument><Argument Name="AWSAccessKeyId" Value="API_KEY"></Argument><Argument Name="Timestamp" Value="2010-03-26T19:26:31Z"></Argument><Argument Name="Signature" Value="A0ThHMQTqYixyc6aDFO6bdbRUEXc77E/k8nEKgfqY70="></Argument><Argument Name="ResponseGroup" Value="Large,ItemAttributes,Images,EditorialReview,Request"></Argument><Argument Name="SearchIndex" Value="Books"></Argument><Argument Name="Version" Value="2011-08-01"></Argument></Arguments><RequestProcessingTime>0.0410670000000000</RequestProcessingTime></OperationRequest><Items><Request><IsValid>True</IsValid><ItemSearchRequest><Condition>New</Condition><DeliveryMethod>Ship</DeliveryMethod><MerchantId>Amazon</MerchantId><Power>isbn:0750640162</Power><ResponseGroup>Large</ResponseGroup><ResponseGroup>ItemAttributes</ResponseGroup><ResponseGroup>Images</ResponseGroup><ResponseGroup>EditorialReview</ResponseGroup><ResponseGroup>Request</ResponseGroup><SearchIndex>Books</SearchIndex></ItemSearchRequest></Request><TotalResults>1</TotalResults><TotalPages>1</TotalPages></Items></ItemSearchResponse> diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/amazon-response-valid.xml b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/amazon-response-valid.xml new file mode 100644 index 0000000000000000000000000000000000000000..de20226bda987fb6ed776b14a28060ccbc2cbd6b --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/amazon-response-valid.xml @@ -0,0 +1 @@ +<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"><OperationRequest><HTTPHeaders><Header Name="UserAgent" Value="Zend_Http_Client"></Header></HTTPHeaders><RequestId>7c895353-04a0-4805-aaa2-ddda6ee78ae4</RequestId><Arguments><Argument Name="Operation" Value="ItemSearch"></Argument><Argument Name="Service" Value="AWSECommerceService"></Argument><Argument Name="Power" Value="isbn:0754512673"></Argument><Argument Name="AWSAccessKeyId" Value="API_KEY"></Argument><Argument Name="Timestamp" Value="2010-03-26T19:28:18Z"></Argument><Argument Name="Signature" Value="H7xta+UgHRFquAEpDoOLQir7PDBOlqw0oHjzeFd1kOs="></Argument><Argument Name="ResponseGroup" Value="Large,ItemAttributes,Images,EditorialReview,Request"></Argument><Argument Name="SearchIndex" Value="Books"></Argument><Argument Name="Version" Value="2011-08-01"></Argument></Arguments><RequestProcessingTime>0.0550310000000000</RequestProcessingTime></OperationRequest><Items><Request><IsValid>True</IsValid><ItemSearchRequest><Condition>New</Condition><DeliveryMethod>Ship</DeliveryMethod><MerchantId>Amazon</MerchantId><Power>isbn:0754512673</Power><ResponseGroup>Large</ResponseGroup><ResponseGroup>ItemAttributes</ResponseGroup><ResponseGroup>Images</ResponseGroup><ResponseGroup>EditorialReview</ResponseGroup><ResponseGroup>Request</ResponseGroup><SearchIndex>Books</SearchIndex></ItemSearchRequest></Request><TotalResults>1</TotalResults><TotalPages>1</TotalPages><Item><ASIN>0754512673</ASIN><DetailPageURL>http://www.amazon.co.uk/Tolleys-Office-Health-Safety-Handbook/dp/0754512673%3FSubscriptionId%3D1K801728Y3PCE30ZMG02%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0754512673</DetailPageURL><SalesRank>2408080</SalesRank><SmallImage><URL>http://ecx.images-amazon.com/images/I/41965ZC4WKL._SL75_.jpg</URL><Height Units="pixels">75</Height><Width Units="pixels">49</Width></SmallImage><MediumImage><URL>http://ecx.images-amazon.com/images/I/41965ZC4WKL._SL160_.jpg</URL><Height Units="pixels">160</Height><Width Units="pixels">104</Width></MediumImage><LargeImage><URL>http://ecx.images-amazon.com/images/I/41965ZC4WKL.jpg</URL><Height Units="pixels">475</Height><Width Units="pixels">309</Width></LargeImage><ImageSets><ImageSet Category="primary"><SwatchImage><URL>http://ecx.images-amazon.com/images/I/41965ZC4WKL._SL30_.jpg</URL><Height Units="pixels">30</Height><Width Units="pixels">20</Width></SwatchImage><SmallImage><URL>http://ecx.images-amazon.com/images/I/41965ZC4WKL._SL75_.jpg</URL><Height Units="pixels">75</Height><Width Units="pixels">49</Width></SmallImage><MediumImage><URL>http://ecx.images-amazon.com/images/I/41965ZC4WKL._SL160_.jpg</URL><Height Units="pixels">160</Height><Width Units="pixels">104</Width></MediumImage><LargeImage><URL>http://ecx.images-amazon.com/images/I/41965ZC4WKL.jpg</URL><Height Units="pixels">475</Height><Width Units="pixels">309</Width></LargeImage></ImageSet></ImageSets><ItemAttributes><Author>Sue Cox</Author><Author>Bill Janes</Author><Author>Deborah Walker</Author><Author>David Wenham</Author><Binding>Paperback</Binding><DeweyDecimalNumber>344.410465</DeweyDecimalNumber><EAN>9780754512677</EAN><Edition>3rd Revised edition</Edition><ISBN>0754512673</ISBN><Label>Butterworths Tolley Ltd.</Label><Languages><Language><Name>English</Name><Type>Original Language</Type></Language><Language><Name>English</Name><Type>Unknown</Type></Language></Languages><ListPrice><Amount>7800</Amount><CurrencyCode>GBP</CurrencyCode><FormattedPrice>£78.00</FormattedPrice></ListPrice><Manufacturer>Butterworths Tolley Ltd.</Manufacturer><NumberOfPages>526</NumberOfPages><ProductGroup>Book</ProductGroup><PublicationDate>2002-12-01</PublicationDate><Publisher>Butterworths Tolley Ltd.</Publisher><Studio>Butterworths Tolley Ltd.</Studio><Title>Tolley's Office Health and Safety Handbook</Title></ItemAttributes><OfferSummary><LowestUsedPrice><Amount>3495</Amount><CurrencyCode>GBP</CurrencyCode><FormattedPrice>£34.95</FormattedPrice></LowestUsedPrice><TotalNew>0</TotalNew><TotalUsed>2</TotalUsed><TotalCollectible>0</TotalCollectible><TotalRefurbished>0</TotalRefurbished></OfferSummary><Offers><TotalOffers>0</TotalOffers><TotalOfferPages>0</TotalOfferPages></Offers><BrowseNodes><BrowseNode><BrowseNodeId>268170</BrowseNodeId><Name>Labour</Name><Ancestors><BrowseNode><BrowseNodeId>268153</BrowseNodeId><Name>Economics</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>275963</BrowseNodeId><Name>Industrial</Name><Ancestors><BrowseNode><BrowseNodeId>275948</BrowseNodeId><Name>Commercial, Financial, Industrial & Taxation</Name><Ancestors><BrowseNode><BrowseNodeId>275946</BrowseNodeId><Name>English</Name><Ancestors><BrowseNode><BrowseNodeId>275945</BrowseNodeId><Name>Law</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>124681031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>275948</BrowseNodeId><Name>Commercial, Financial, Industrial & Taxation</Name><Ancestors><BrowseNode><BrowseNodeId>275946</BrowseNodeId><Name>English</Name><Ancestors><BrowseNode><BrowseNodeId>275945</BrowseNodeId><Name>Law</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>276018</BrowseNodeId><Name>Employment & Labour</Name><Ancestors><BrowseNode><BrowseNodeId>276016</BrowseNodeId><Name>Social</Name><Ancestors><BrowseNode><BrowseNodeId>275946</BrowseNodeId><Name>English</Name><Ancestors><BrowseNode><BrowseNodeId>275945</BrowseNodeId><Name>Law</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>124691031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>276016</BrowseNodeId><Name>Social</Name><Ancestors><BrowseNode><BrowseNodeId>275946</BrowseNodeId><Name>English</Name><Ancestors><BrowseNode><BrowseNodeId>275945</BrowseNodeId><Name>Law</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>124680031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>275946</BrowseNodeId><Name>English</Name><Ancestors><BrowseNode><BrowseNodeId>275945</BrowseNodeId><Name>Law</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>124679031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>275945</BrowseNodeId><Name>Law</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>268241</BrowseNodeId><Name>Health & Safety</Name><Ancestors><BrowseNode><BrowseNodeId>659890</BrowseNodeId><Name>Reference & Education</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>124720031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>659890</BrowseNodeId><Name>Reference & Education</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>124671031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>68</BrowseNodeId><Name>Business, Finance & Law</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>922322</BrowseNodeId><Name>Health & Safety</Name><Ancestors><BrowseNode><BrowseNodeId>922314</BrowseNodeId><Name>Production, Manufacturing & Operational</Name><Ancestors><BrowseNode><BrowseNodeId>278115</BrowseNodeId><Name>Engineering & Technology</Name><Ancestors><BrowseNode><BrowseNodeId>57</BrowseNodeId><Name>Science & Nature</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>125282031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>922314</BrowseNodeId><Name>Production, Manufacturing & Operational</Name><Ancestors><BrowseNode><BrowseNodeId>278115</BrowseNodeId><Name>Engineering & Technology</Name><Ancestors><BrowseNode><BrowseNodeId>57</BrowseNodeId><Name>Science & Nature</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>125259031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>278115</BrowseNodeId><Name>Engineering & Technology</Name><Ancestors><BrowseNode><BrowseNodeId>57</BrowseNodeId><Name>Science & Nature</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>125228031</BrowseNodeId><Name>General AAS</Name><Ancestors><BrowseNode><BrowseNodeId>57</BrowseNodeId><Name>Science & Nature</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>276509</BrowseNodeId><Name>Social Welfare & Services</Name><Children><BrowseNode><BrowseNodeId>276519</BrowseNodeId><Name>Charities & Voluntary Services</Name></BrowseNode><BrowseNode><BrowseNodeId>276511</BrowseNodeId><Name>Child Welfare</Name></BrowseNode><BrowseNode><BrowseNodeId>276512</BrowseNodeId><Name>Community Care</Name></BrowseNode><BrowseNode><BrowseNodeId>276520</BrowseNodeId><Name>Counselling</Name></BrowseNode><BrowseNode><BrowseNodeId>276510</BrowseNodeId><Name>Elderly Care</Name></BrowseNode><BrowseNode><BrowseNodeId>276513</BrowseNodeId><Name>Family Welfare</Name></BrowseNode><BrowseNode><BrowseNodeId>276515</BrowseNodeId><Name>Housing</Name></BrowseNode><BrowseNode><BrowseNodeId>276516</BrowseNodeId><Name>Welfare & Benefit Systems</Name></BrowseNode><BrowseNode><BrowseNodeId>125462031</BrowseNodeId><Name>General AAS</Name></BrowseNode></Children><Ancestors><BrowseNode><BrowseNodeId>276482</BrowseNodeId><Name>Social Issues</Name><Ancestors><BrowseNode><BrowseNodeId>276411</BrowseNodeId><Name>Social Sciences</Name><Ancestors><BrowseNode><BrowseNodeId>60</BrowseNodeId><Name>Society, Politics & Philosophy</Name><Ancestors><BrowseNode><BrowseNodeId>1025612</BrowseNodeId><Name>Subjects</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>400530011</BrowseNodeId><Name>English</Name><Ancestors><BrowseNode><BrowseNodeId>400529011</BrowseNodeId><Name>Language (feature_browse-bin)</Name><Ancestors><BrowseNode><BrowseNodeId>365481011</BrowseNodeId><Name>Refinements</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>492564011</BrowseNodeId><Name>Paperback</Name><Ancestors><BrowseNode><BrowseNodeId>492562011</BrowseNodeId><Name>Format (binding_browse-bin)</Name><Ancestors><BrowseNode><BrowseNodeId>365481011</BrowseNodeId><Name>Refinements</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode><BrowseNode><BrowseNodeId>182018031</BrowseNodeId><Name>Regular Size</Name><Ancestors><BrowseNode><BrowseNodeId>182016031</BrowseNodeId><Name>Font Size (format_browse-bin)</Name><Ancestors><BrowseNode><BrowseNodeId>365481011</BrowseNodeId><Name>Refinements</Name><Ancestors><BrowseNode><BrowseNodeId>266239</BrowseNodeId><Name>Books</Name></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></Ancestors></BrowseNode></BrowseNodes></Item></Items></ItemSearchResponse> diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/mozart_result.xml b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/mozart_result.xml new file mode 100644 index 0000000000000000000000000000000000000000..3071a0732ba56893ed2cb723d6a92689d1c2331a --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/mozart_result.xml @@ -0,0 +1,1504 @@ +<?xml version="1.0"?> +<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"> + <OperationRequest> + <HTTPHeaders> + <Header Name="UserAgent" Value="Zend_Http_Client"/> + </HTTPHeaders> + <RequestId></RequestId> + <Arguments> + <Argument Name="Operation" Value="ItemSearch"/> + <Argument Name="Service" Value="AWSECommerceService"/> + <Argument Name="ResponseGroup" Value="Small,Tracks,Offers,Request"/> + <Argument Name="SubscriptionId" Value=""/> + <Argument Name="SearchIndex" Value="Music"/> + <Argument Name="Keywords" Value="Mozart"/> + </Arguments> + <RequestProcessingTime>0.1464630000000000</RequestProcessingTime> + </OperationRequest> + <Items> + <Request> + <IsValid>True</IsValid> + <ItemSearchRequest> + <Condition>New</Condition> + <DeliveryMethod>Ship</DeliveryMethod> + <Keywords>Mozart</Keywords> + <MerchantId>Amazon</MerchantId> + <ResponseGroup>Small</ResponseGroup> + <ResponseGroup>Tracks</ResponseGroup> + <ResponseGroup>Offers</ResponseGroup> + <ResponseGroup>Request</ResponseGroup> + <SearchIndex>Music</SearchIndex> + </ItemSearchRequest> + </Request> + <TotalResults>20917</TotalResults> + <TotalPages>2092</TotalPages> + <Item> + <ASIN>B00005A8JZ</ASIN> + <DetailPageURL>http://www.amazon.com/Essential-Mozart-His-Greatest-Masterpieces/dp/B00005A8JZ%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00005A8JZ</DetailPageURL> + <ItemAttributes> + <Creator Role="Performer">Fritz Dolezal</Creator> + <Creator Role="Performer">Franklin Cohen</Creator> + <Creator Role="Performer">Peter Schmidl</Creator> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Conductor">Christoph von Dohnányi</Creator> + <Creator Role="Conductor">Christopher Hogwood</Creator> + <Creator Role="Conductor">David Hill</Creator> + <Creator Role="Conductor">Georg Solti</Creator> + <Creator Role="Conductor">George Guest</Creator> + <Creator Role="Conductor">Gyorgy Fischer</Creator> + <Creator Role="Conductor">Herbert von Karajan</Creator> + <Creator Role="Conductor">Jack Brymer</Creator> + <Creator Role="Conductor">Myung-Whun Chung</Creator> + <Creator Role="Conductor">Neville Marriner</Creator> + <Creator Role="Conductor">Peter Maag</Creator> + <Creator Role="Conductor">Stephen Cleobury</Creator> + <Creator Role="Conductor">Uri Segal</Creator> + <Creator Role="Conductor">Willi Boskovsky</Creator> + <Creator Role="Performer">Academy of Ancient Music</Creator> + <Creator Role="Performer">Academy of St. Martin-in-the-Fields</Creator> + <Manufacturer>Decca</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>Essential Mozart: 32 Of His Greatest Masterpieces</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>742</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$7.42</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>796</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$7.96</FormattedPrice> + </LowestUsedPrice> + <TotalNew>30</TotalNew> + <TotalUsed>8</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>miWNU7zpV2gjBgUxK0ySvB7%2FKRv7Rjl9dQAV%2FnwzkVW%2BLYVYm9V2NcorkZEz5pey6eT9O1JS6ijZ4%2BkTLrHZ5w%3D%3D</OfferListingId> + <Price> + <Amount>1099</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$10.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Voi che sapete</Track> + <Track Number="4">Largetto</Track> + <Track Number="5">Laudate Dominum</Track> + <Track Number="6">Andantino</Track> + <Track Number="7">Overture</Track> + <Track Number="8">Trio: Soava sia il vento</Track> + <Track Number="9">Andante con moto</Track> + <Track Number="10">Rondo</Track> + <Track Number="11">Serenade: Deh, vieni alla finestra</Track> + <Track Number="12">No. 1 Non più andrai</Track> + <Track Number="13">No. 3 Sleigh Ride</Track> + <Track Number="14">Adagio</Track> + <Track Number="15">Presto</Track> + </Disc> + <Disc Number="2"> + <Track Number="1">Molto allegro</Track> + <Track Number="2">Queen of the Night aria, Der Hölle Rache</Track> + <Track Number="3">Adagio</Track> + <Track Number="4">Là ci darem la mano</Track> + <Track Number="5">Adagio</Track> + <Track Number="6">Der Vogelfänger bin ich ja</Track> + <Track Number="7">Dove sono</Track> + <Track Number="8">Adagio</Track> + <Track Number="9">Lacrimosa</Track> + <Track Number="10">Rondo alla turca</Track> + <Track Number="11">Champagne aria: Fin ch'han dal vino</Track> + <Track Number="12">Minuet & Trio</Track> + <Track Number="13">Alleluja</Track> + <Track Number="14">Finale: Molto allegro</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B0000058HV</ASIN> + <DetailPageURL>http://www.amazon.com/25-Mozart-Favorites/dp/B0000058HV%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0000058HV</DetailPageURL> + <ItemAttributes> + <Creator Role="Performer">John Sant'Ambrogio</Creator> + <Creator Role="Performer">George Silfies</Creator> + <Creator Role="Performer">Jost Michaels</Creator> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Conductor">Alfred Scholz</Creator> + <Creator Role="Conductor">Ferdinand Grossmann</Creator> + <Creator Role="Conductor">Franz Bauer-Theussl</Creator> + <Creator Role="Conductor">Gunter Kehr</Creator> + <Creator Role="Conductor">H. Reichert</Creator> + <Creator Role="Conductor">Helmuth Rilling</Creator> + <Creator Role="Conductor">Henry Adolph</Creator> + <Creator Role="Conductor">Jörg Faerber</Creator> + <Creator Role="Conductor">Leopold Hager</Creator> + <Creator Role="Conductor">Peter Maag</Creator> + <Creator Role="Conductor">Philip Gibson</Creator> + <Creator Role="Conductor">Roland Bader</Creator> + <Creator Role="Conductor">Stanislaw Skrowaczewski</Creator> + <Creator Role="Performer">New York Philomusica Winds</Creator> + <Creator Role="Performer">Philharmonia Hungarica</Creator> + <Creator Role="Performer">Stuttgart Bach Collegium</Creator> + <Manufacturer>Vox (Classical)</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>25 Mozart Favorites</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>172</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$1.72</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>96</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$0.96</FormattedPrice> + </LowestUsedPrice> + <TotalNew>29</TotalNew> + <TotalUsed>13</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>C6bDMocDw5QcPLgm7AooGHkjBCa6joJIj9z10snNdzQuJa%2FvOa1lJeOjDfprvj9T7Rtqke5KjzDC6HNuDFUf1A%3D%3D</OfferListingId> + <Price> + <Amount>299</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$2.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">Overture</Track> + <Track Number="2">II. Andante</Track> + <Track Number="3">I. Allegro Con Brio</Track> + <Track Number="4">II. Andantino</Track> + <Track Number="5">I. Allegro</Track> + <Track Number="6">Overture</Track> + <Track Number="7">I. Molto Allegro</Track> + <Track Number="8">III. Finale: Presto</Track> + <Track Number="9">III. Andante</Track> + <Track Number="10">I. Allegro</Track> + <Track Number="11">II. Andante ma non troppo</Track> + <Track Number="12">II. Larghetto</Track> + <Track Number="13">II. Adagio</Track> + <Track Number="14">I. Allegro maestoso</Track> + <Track Number="15">II. Adagio</Track> + <Track Number="16">IV. Finale: Allegro</Track> + <Track Number="17">III. Allegro</Track> + <Track Number="18">II. Andante</Track> + <Track Number="19">I. Allegro maestoso</Track> + <Track Number="20">I. Allegro vivace assai</Track> + <Track Number="21">II. Andante cantabile</Track> + <Track Number="22">II. Adagio</Track> + <Track Number="23">IV. Presto</Track> + <Track Number="24">Confutatis Maledictis</Track> + <Track Number="25">Alleluia</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B000BLI3K2</ASIN> + <DetailPageURL>http://www.amazon.com/Mozart-Complete-Works-170-Box/dp/B000BLI3K2%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000BLI3K2</DetailPageURL> + <ItemAttributes> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Performer">Bruce Abel</Creator> + <Creator Role="Performer">Christian Tchelebiev</Creator> + <Creator Role="Performer">Christof Fischesser</Creator> + <Creator Role="Performer">Ezio Maria Tisi</Creator> + <Creator Role="Performer">Gottfried Hornik</Creator> + <Creator Role="Performer">Hermann-Christian Polster</Creator> + <Creator Role="Performer">Klaus Mertens</Creator> + <Creator Role="Performer">Manfred Bittner</Creator> + <Creator Role="Performer">Peter Schneyder</Creator> + <Manufacturer>Brilliant Classics</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>Mozart Edition: Complete Works (170 CD Box Set)</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>10824</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$108.24</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>10497</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$104.97</FormattedPrice> + </LowestUsedPrice> + <TotalNew>20</TotalNew> + <TotalUsed>9</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>pBHmKisDdqGh1zcoHasxardfvdwt4mCm4NgPdqjmyDJ0vUUJnm0Nbe%2B90H8%2F6JSkw2fRouM%2FDKLqRto7JTWaICGw65404CJm</OfferListingId> + <Price> + <Amount>14399</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$143.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">Molto allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Presto</Track> + <Track Number="7">Allegro assai</Track> + <Track Number="8">Andante</Track> + <Track Number="9">Presto</Track> + <Track Number="10">Allegro</Track> + <Track Number="11">Andante</Track> + <Track Number="12">Molto allegro</Track> + <Track Number="13">Allegro</Track> + <Track Number="14">Andante</Track> + <Track Number="15">Menuetto & trio</Track> + <Track Number="16">Allegro</Track> + <Track Number="17">Molto allegro</Track> + <Track Number="18">Andante</Track> + <Track Number="19">Menuetto & trio</Track> + <Track Number="20">Molto allegro</Track> + </Disc> + <Disc Number="2"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Menuetto & trio</Track> + <Track Number="4">Molto allegro</Track> + <Track Number="5">Allegro</Track> + <Track Number="6">Andante</Track> + <Track Number="7">Menuetto & trio</Track> + <Track Number="8">Molto allegro</Track> + <Track Number="9">Allegro-andante</Track> + <Track Number="10">Allegro</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Andante</Track> + <Track Number="13">Menuetto & trio</Track> + <Track Number="14">Allegro</Track> + <Track Number="15">Allegro</Track> + <Track Number="16">Andante</Track> + <Track Number="17">Menuetto & trio</Track> + <Track Number="18">Molto allegro</Track> + </Disc> + <Disc Number="3"> + <Track Number="1">Allegro moderato</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Menuetto & trio</Track> + <Track Number="4">Molto allegro</Track> + <Track Number="5">Allegro</Track> + <Track Number="6">Andante</Track> + <Track Number="7">Menuetto & trio</Track> + <Track Number="8">Presto</Track> + <Track Number="9">Allegro maestoso</Track> + <Track Number="10">Andante grazioso</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Allegro</Track> + <Track Number="13">Andante</Track> + <Track Number="14">Allegro</Track> + </Disc> + <Disc Number="4"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Menuetto & trio</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Allegro</Track> + <Track Number="6">Andante</Track> + <Track Number="7">Menuetto & trio</Track> + <Track Number="8">Allegro</Track> + <Track Number="9">Allegro assai</Track> + <Track Number="10">Andantino grazioso</Track> + <Track Number="11">Presto assai</Track> + <Track Number="12">Allegro spiritoso</Track> + <Track Number="13">Andantino grazioso</Track> + <Track Number="14">Presto assai</Track> + </Disc> + <Disc Number="5"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andantino grazioso</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Allegro spiritoso</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Menuetto & trio</Track> + <Track Number="7">Presto</Track> + <Track Number="8">Molto allegro</Track> + <Track Number="9">Andantino con moto</Track> + <Track Number="10">Menuetto & trio</Track> + <Track Number="11">Presto</Track> + </Disc> + <Disc Number="6"> + <Track Number="1">Allegro assai</Track> + <Track Number="2">Andante grazioso</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andantino grazioso</Track> + <Track Number="6">Menuetto</Track> + <Track Number="7">Molto allegro</Track> + <Track Number="8">Allegro</Track> + <Track Number="9">Andante</Track> + <Track Number="10">Menuetto</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Allegro con brio</Track> + <Track Number="13">Andante</Track> + <Track Number="14">Menuetto</Track> + <Track Number="15">Allegro</Track> + </Disc> + <Disc Number="7"> + <Track Number="1">Allegro spiritoso</Track> + <Track Number="2">Andantino grazioso</Track> + <Track Number="3">Allegro</Track> + <Track Number="4">Molto presto</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Allegro</Track> + <Track Number="7">Symphony in D major: Allegro molto</Track> + <Track Number="8">Symphony in D major: Andantino grazioso</Track> + <Track Number="9">Symphony in D major: Allegro</Track> + <Track Number="10">Allegro moderato</Track> + <Track Number="11">Andante</Track> + <Track Number="12">Menuetto</Track> + <Track Number="13">Allegro con spirito</Track> + <Track Number="14">Allegro spiritoso</Track> + <Track Number="15">Andante</Track> + <Track Number="16">Primo tempo</Track> + </Disc> + <Disc Number="8"> + <Track Number="1">Allegro assai</Track> + <Track Number="2">Andante moderato</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Allegro assai</Track> + <Track Number="5">Allegro vivace</Track> + <Track Number="6">Andante di molto più tosto allegretto</Track> + <Track Number="7">Allegro vivace</Track> + <Track Number="8">Allegro con spirito</Track> + <Track Number="9">Andante</Track> + <Track Number="10">Menuetto. Presto</Track> + </Disc> + <Disc Number="9"> + <Track Number="1">Allegro assai</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Allegro</Track> + <Track Number="4">Adagio - allegro con spirito</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Menuetto</Track> + <Track Number="7">Presto</Track> + <Track Number="8">Molto allegro</Track> + <Track Number="9">Andante</Track> + <Track Number="10">Menuetto</Track> + <Track Number="11">Allegro assai</Track> + </Disc> + <Disc Number="10"> + <Track Number="1">Adagio - allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Adagio - allegro</Track> + <Track Number="5">Andante con moto</Track> + <Track Number="6">Menuetto</Track> + <Track Number="7">Allegro</Track> + </Disc> + <Disc Number="11"> + <Track Number="1">Molto allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Allegro assai</Track> + <Track Number="5">Allegro vivace</Track> + <Track Number="6">Andante cantabile</Track> + <Track Number="7">Menuetto</Track> + <Track Number="8">Molto allegro</Track> + </Disc> + <Disc Number="12"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Tempo di Menuetto</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Allegretto (tema con 4 variazioni)</Track> + <Track Number="6">Allegro</Track> + <Track Number="7">Allegretto</Track> + <Track Number="8">Allegro di molto</Track> + <Track Number="9">Andante di molto</Track> + <Track Number="10">Minuetto</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Allegretto</Track> + <Track Number="13">Allegro</Track> + <Track Number="14">Rondeau, allegretto</Track> + </Disc> + <Disc Number="13"> + <Track Number="1">Allegro</Track> + <Track Number="2">Larghetto</Track> + <Track Number="3">Allegretto</Track> + <Track Number="4">Allegro maestoso</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Presto</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Andante</Track> + <Track Number="9">Allegro</Track> + </Disc> + <Disc Number="14"> + <Track Number="1">Allegro</Track> + <Track Number="2">Adagio</Track> + <Track Number="3">Allegro assai</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Larghetto</Track> + <Track Number="6">Tempo di menuetto</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Andante</Track> + <Track Number="9">Allegro</Track> + </Disc> + <Disc Number="15"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Allegro vivace assai</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Allegro</Track> + <Track Number="7">Allegro maestoso</Track> + <Track Number="8">Andante</Track> + <Track Number="9">Allegretto</Track> + </Disc> + <Disc Number="16"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andantino</Track> + <Track Number="3">Rondeau, presto</Track> + <Track Number="4">Allegro spiritoso</Track> + <Track Number="5">Andante staccato</Track> + <Track Number="6">Molto allegro</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Andante</Track> + <Track Number="9">Rondeau, allegretto</Track> + </Disc> + <Disc Number="17"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Allegretto, presto</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andante ma un poco adagio</Track> + <Track Number="6">Allegro</Track> + <Track Number="7">Allegro aperto</Track> + <Track Number="8">Andante un poco adagio</Track> + <Track Number="9">Roneau, allegro</Track> + </Disc> + <Disc Number="18"> + <Track Number="1">Allegro assai</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Rondo, allegro di molto</Track> + <Track Number="4">Allegro aperto</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Tempo di menuetto</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Allegretto</Track> + <Track Number="9">Allegro assai</Track> + </Disc> + <Disc Number="19"> + <Track Number="1">Allegro</Track> + <Track Number="2">Romanze</Track> + <Track Number="3">Allegro assai</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Allegro</Track> + </Disc> + <Disc Number="20"> + <Track Number="1">Allegro vivace</Track> + <Track Number="2">Andante un poco sostenuto</Track> + <Track Number="3">Allegro vivace</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Larghetto</Track> + <Track Number="6">Allegretto</Track> + </Disc> + <Disc Number="21"> + <Track Number="1">Allegro vivace</Track> + <Track Number="2">Andantino</Track> + <Track Number="3">Allegro ma non troppo</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Molto allegro</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Larghetto</Track> + <Track Number="9">Rondo, allegro</Track> + </Disc> + <Disc Number="22"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Rondo, allegro</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Adagio</Track> + <Track Number="6">Rondo, tempo di minuetto</Track> + </Disc> + <Disc Number="23"> + <Track Number="1">Allegro</Track> + <Track Number="2">Adagio</Track> + <Track Number="3">Rondo, allegro</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andantino</Track> + <Track Number="6">Rondeau, allegro</Track> + </Disc> + <Disc Number="24"> + <Track Number="1">Allegro maestoso</Track> + <Track Number="2">Adagio non troppo</Track> + <Track Number="3">Tempo di menuetto</Track> + <Track Number="4">Allegro aperto</Track> + <Track Number="5">Andante ma non troppo</Track> + <Track Number="6">Allegro</Track> + </Disc> + <Disc Number="25"> + <Track Number="1">Allegro aperto</Track> + <Track Number="2">Andante ma non troppo</Track> + <Track Number="3">Allegro</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andante ma adagio</Track> + <Track Number="6">Rondeau, tempo di menuetto</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Adagio</Track> + <Track Number="9">Andantino con variazioni</Track> + </Disc> + <Disc Number="26"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Rondo, allegro</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Romance, larghetto</Track> + <Track Number="6">Allegro</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Rondo, allegro</Track> + <Track Number="9">Allegro</Track> + <Track Number="10">Rondeau, allegro</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Andante</Track> + <Track Number="13">Allegro</Track> + </Disc> + <Disc Number="27"> + <Track Number="1">Allegro moderato</Track> + <Track Number="2">Adagio</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Allegro moderato</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Rondeau, allegro</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Adagio</Track> + <Track Number="9">Rondeau</Track> + </Disc> + <Disc Number="28"> + <Track Number="1">Allegro moderato</Track> + <Track Number="2">Andante cantabile</Track> + <Track Number="3">Rondeau</Track> + <Track Number="4">Allegro aperto</Track> + <Track Number="5">Adagio</Track> + <Track Number="6">Rondeau</Track> + </Disc> + <Disc Number="29"> + <Track Number="1">Allegro maestoso</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Allegro spiritoso</Track> + <Track Number="5">Andantino grazioso</Track> + <Track Number="6">Tempo di menuetto</Track> + </Disc> + <Disc Number="30"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Andante</Track> + <Track Number="5">Allegro di molto</Track> + <Track Number="6">Allegro assai</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Andante</Track> + <Track Number="9">Presto</Track> + <Track Number="10">Allegro</Track> + <Track Number="11">Andante</Track> + <Track Number="12">Menuetto</Track> + <Track Number="13">Adagio</Track> + <Track Number="14">Menuetto</Track> + <Track Number="15">Rondo Allegro</Track> + </Disc> + <Disc Number="31"> + <Track Number="1">Andante</Track> + <Track Number="2">Allegretto grazioso</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Menuetto</Track> + <Track Number="6">Adagio cantabile</Track> + <Track Number="7">Presto</Track> + <Track Number="8">Allegro</Track> + <Track Number="9">Romance. Andante</Track> + <Track Number="10">Menuetto</Track> + <Track Number="11">Rondo. Allegro</Track> + </Disc> + <Disc Number="32"> + <Track Number="1">Marche</Track> + <Track Number="2">Allegro</Track> + <Track Number="3">Andante</Track> + <Track Number="4">Menuett</Track> + <Track Number="5">Adagio</Track> + <Track Number="6">Menuett</Track> + <Track Number="7">Finale: Allegro assai</Track> + <Track Number="8">Marcia</Track> + <Track Number="9">Allegro moderato</Track> + <Track Number="10">Andante</Track> + <Track Number="11">Menuett</Track> + <Track Number="12">Andante</Track> + <Track Number="13">Menuett</Track> + <Track Number="14">Allegro</Track> + <Track Number="15">Molto allegro</Track> + <Track Number="16">Menuetto</Track> + <Track Number="17">Andantino</Track> + <Track Number="18">Menuetto (tema con variazioni)</Track> + <Track Number="19">Rondeau, allegro assai</Track> + <Track Number="20">Marcia alla francese</Track> + </Disc> + <Disc Number="33"> + <Track Number="1">Largo</Track> + <Track Number="2">Menuetto</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Adagio</Track> + <Track Number="5">Finale Presto</Track> + <Track Number="6">Allegro</Track> + <Track Number="7">Andante</Track> + <Track Number="8">Menuetto</Track> + <Track Number="9">Allegro</Track> + <Track Number="10">Allegro</Track> + <Track Number="11">Adagio</Track> + <Track Number="12">Menuetto</Track> + <Track Number="13">Allegretto</Track> + <Track Number="14">Menuetto</Track> + <Track Number="15">Adagio</Track> + <Track Number="16">Allegro assai</Track> + </Disc> + <Disc Number="34"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Menuetto</Track> + <Track Number="6">Andante</Track> + <Track Number="7">Menuetto</Track> + <Track Number="8">Allegro</Track> + <Track Number="9">Allegro assai</Track> + <Track Number="10">Andante moderato</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Menuetto & Trio</Track> + <Track Number="13">Andante</Track> + <Track Number="14">Menuetto & Trio</Track> + <Track Number="15">Andantino grazioso & Allegro</Track> + </Disc> + <Disc Number="35"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante grazioso</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Adagio</Track> + <Track Number="5">Menuetto</Track> + <Track Number="6">Andante-allegro assai</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Thema mit Variationen-andante grazioso</Track> + <Track Number="9">Menuetto</Track> + <Track Number="10">Adagio</Track> + <Track Number="11">Menuetto</Track> + <Track Number="12">Andante-allegro molto</Track> + </Disc> + <Disc Number="36"> + <Track Number="1">Marcia-maestoso</Track> + <Track Number="2">Menuetto</Track> + <Track Number="3">Rondeau</Track> + <Track Number="4">Adagio maestoso-allegro con spirito</Track> + <Track Number="5">Menuetto-allegretto</Track> + <Track Number="6">Concertante-andante grazioso</Track> + <Track Number="7">Rondeau-allegro ma non troppo</Track> + <Track Number="8">Andantino</Track> + <Track Number="9">Menuetto</Track> + <Track Number="10">Finale-presto</Track> + <Track Number="11">No. 1. molto allegro</Track> + <Track Number="12">No. 2. andante</Track> + <Track Number="13">No. 4. allegro finale</Track> + <Track Number="14">No. 5. Pastorella</Track> + <Track Number="15">No. 6-7. Allegro-allegretto</Track> + <Track Number="16">No. 8. allegro</Track> + <Track Number="17">No. 9. molto adagio</Track> + <Track Number="18">No. 10. allegro</Track> + <Track Number="19">No. 11-12. largo-molto allegro</Track> + <Track Number="20">No. 13-14. andante-allegro</Track> + <Track Number="21">No. 15. Menuett</Track> + <Track Number="22">No. 16-17. adagio-presto</Track> + <Track Number="23">No. 18. Fuga</Track> + </Disc> + <Disc Number="37"> + <Track Number="1">Allegro maestoso-allegro molto</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Rondo-allegro</Track> + <Track Number="5">Menuetto galante</Track> + <Track Number="6">Andante</Track> + <Track Number="7">Menuetto</Track> + <Track Number="8">Adagio-allegro assai</Track> + </Disc> + <Disc Number="38"> + <Track Number="1">Allegro assai</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Allegro</Track> + <Track Number="4">Menuetto</Track> + <Track Number="5">Andante grazioso</Track> + <Track Number="6">Menuetto</Track> + <Track Number="7">Adagio-allegro assai</Track> + <Track Number="8">Andante maestoso-allegro assai</Track> + <Track Number="9">Andante</Track> + <Track Number="10">Menuetto</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Menuetto</Track> + <Track Number="13">Andante</Track> + <Track Number="14">Menuetto</Track> + <Track Number="15">Prestissimo</Track> + </Disc> + <Disc Number="39"> + <Track Number="1">D major, KV. 335 No. 1</Track> + <Track Number="2">D major, KV. 335 No. 2</Track> + </Disc> + <Disc Number="40"> + <Track Number="1">Allegro</Track> + <Track Number="2">Menuetto</Track> + <Track Number="3">Adagio</Track> + <Track Number="4">Menuetto</Track> + <Track Number="5">Rondo</Track> + <Track Number="6">Allegro</Track> + <Track Number="7">Menuetto</Track> + <Track Number="8">Larghetto</Track> + <Track Number="9">Menuetto</Track> + <Track Number="10">Rondo</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Menuetto</Track> + <Track Number="13">Adagio</Track> + <Track Number="14">Menuetto</Track> + <Track Number="15">Rondo</Track> + </Disc> + <Disc Number="41"> + <Track Number="1">Allegro</Track> + <Track Number="2">Larghetto</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Adagio</Track> + <Track Number="5">Allegretto</Track> + <Track Number="6">Adagio</Track> + <Track Number="7">Menuetto</Track> + <Track Number="8">Adagio</Track> + <Track Number="9">Romance</Track> + <Track Number="10">Polonaise</Track> + <Track Number="11">Divertimento No. 6: Rondo, larghetto</Track> + <Track Number="12">Divertimento No. 6: Voi che sapete (from Le Nozze di Figaro)</Track> + <Track Number="13">Divertimento No. 6: Non piu andrai (from Le Nozze di Figaro)</Track> + <Track Number="14">Divertimento No. 6: La ci darem la mano (from Don Giovanni)</Track> + <Track Number="15">Divertimento No. 6: Vedrai, carino (from Don Giovanni)</Track> + </Disc> + <Disc Number="42"> + <Track Number="1">Allegro maestoso</Track> + <Track Number="2">Menuetto</Track> + <Track Number="3">Adagio</Track> + <Track Number="4">Menuetto-Trio</Track> + <Track Number="5">Allegro</Track> + <Track Number="6">Allegro</Track> + <Track Number="7">Andante</Track> + <Track Number="8">Menuetto-Trio</Track> + <Track Number="9">Allegro</Track> + </Disc> + <Disc Number="43"> + <Track Number="1">Allegro</Track> + <Track Number="2">Menuetto</Track> + <Track Number="3">Andante grazioso</Track> + <Track Number="4">Adagio</Track> + <Track Number="5">Allegro</Track> + <Track Number="6">Allegro assai</Track> + <Track Number="7">Menuetto</Track> + <Track Number="8">Andante</Track> + <Track Number="9">Adagio</Track> + <Track Number="10">Allegro</Track> + <Track Number="11">Allegro moderato</Track> + <Track Number="12">Menuetto</Track> + <Track Number="13">Romance</Track> + <Track Number="14">Menuetto</Track> + <Track Number="15">Rondo</Track> + <Track Number="16">Allegro</Track> + <Track Number="17">Menuetto</Track> + <Track Number="18">Adagio</Track> + <Track Number="19">Menuetto</Track> + <Track Number="20">Finale</Track> + </Disc> + <Disc Number="44"> + <Track Number="1">Allegro spiritoso</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Menuetto</Track> + <Track Number="4">Contredanse en rondeau</Track> + <Track Number="5">Allegro</Track> + <Track Number="6">Andante grazioso</Track> + <Track Number="7">Menuetto</Track> + <Track Number="8">Allegro</Track> + <Track Number="9">Andante</Track> + <Track Number="10">Menuetto</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B00004X0QF</ASIN> + <DetailPageURL>http://www.amazon.com/Mozart-Effect-Music-Babies-Nighty/dp/B00004X0QF%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00004X0QF</DetailPageURL> + <ItemAttributes> + <Creator Role="Performer">Jozsef Balogh</Creator> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Conductor">Harald Nerat</Creator> + <Creator Role="Conductor">Nicholas Ward</Creator> + <Creator Role="Performer">Capella Istropolitana</Creator> + <Creator Role="Performer">Danubius String Quartet</Creator> + <Creator Role="Performer">Netherlands Wind Ensemble</Creator> + <Creator Role="Orchestra">Northern Chamber Orchestra</Creator> + <Creator Role="Performer">Jeno Jando</Creator> + <Manufacturer>Children's Group</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>The Mozart Effect: Music For Babies: Nighty Night</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>370</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$3.70</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>497</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$4.97</FormattedPrice> + </LowestUsedPrice> + <TotalNew>33</TotalNew> + <TotalUsed>12</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>DxNxKZYiXIpX68jteXiPko0PVz3HQ5onOdUdJ6OU90UrLR%2BiOC92Twtp5HoXbrPDfjEBfB5heedESCotjypo3g%3D%3D</OfferListingId> + <Price> + <Amount>698</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$6.98</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">Den! Vienialla Finestra</Track> + <Track Number="2">1. Andante Gransioso</Track> + <Track Number="3">3. Adagio</Track> + <Track Number="4">2. Andante</Track> + <Track Number="5">2. Adagio</Track> + <Track Number="6">2. Andante</Track> + <Track Number="7">2. Adagio</Track> + <Track Number="8">4. Adagio</Track> + <Track Number="9">2. Larghetto</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B000004194</ASIN> + <DetailPageURL>http://www.amazon.com/Mozart-Great-Piano-Concertos-Vol/dp/B000004194%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000004194</DetailPageURL> + <ItemAttributes> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Conductor">Neville Marriner</Creator> + <Creator Role="Orchestra">Academy of St. Martin-in-the-Fields</Creator> + <Creator Role="Performer">Alfred Brendel</Creator> + <Manufacturer>Philips</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>Mozart: The Great Piano Concertos, Vol. 1</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>1048</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$10.48</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>1049</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$10.49</FormattedPrice> + </LowestUsedPrice> + <TotalNew>39</TotalNew> + <TotalUsed>12</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>FzDU%2F69oBEZxc6vUvcH96DEH29QpOw84n3192FI91oOkC%2B6cbK8%2B5tX5T6TXhZDYZwr%2B76%2BiI4ZCbrcICKG0Xw%3D%3D</OfferListingId> + <Price> + <Amount>1399</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$13.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">Piano Concerto No. 19 In F, KV 459: Allegro Vivace</Track> + <Track Number="2">Piano Concerto No. 19 In F, KV 459: Allegretto</Track> + <Track Number="3">Piano Concerto No. 19 In F, KV 459: Allegro Assai</Track> + <Track Number="4">Piano Concerto No. 20 In D Minor, KV 466: Allegro</Track> + <Track Number="5">Piano Concerto No. 20 In D Minor, KV 466: Romance</Track> + <Track Number="6">Piano Concerto No. 20 In D Minor, KV 466: Allegro Assai</Track> + <Track Number="7">Rondo In D, KV 382: Allegretto Grazioso</Track> + <Track Number="8">Rondo In D, KV 382: Adagio</Track> + <Track Number="9">Rondo In D, KV 382: Allegro</Track> + <Track Number="10">Piano Concerto No. 23 In A , KV 488: Allegro</Track> + </Disc> + <Disc Number="2"> + <Track Number="1">Piano Concerto No. 23 In A, KV 488: Adagio</Track> + <Track Number="2">Piano Concerto No. 23 In A, KV 488: Allegro assai</Track> + <Track Number="3">Piano Concerto #21 In C, KV 467: Allegro</Track> + <Track Number="4">Piano Concerto #21 In C, KV 467: Andante</Track> + <Track Number="5">Piano Concerto #21 In C, KV 467: Allegro Vivace Assai</Track> + <Track Number="6">Piano Concerto No. 24 in C Minor, KV 491: Allegro</Track> + <Track Number="7">Piano Concerto No. 24 in C Minor, KV 491: Larghetto</Track> + <Track Number="8">Piano Concerto No. 24 in C Minor, KV 491: Allegretto</Track> + <Track Number="9">Rondo In A, KV 386</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B00000I9M0</ASIN> + <DetailPageURL>http://www.amazon.com/Mozart-for-Relaxation/dp/B00000I9M0%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00000I9M0</DetailPageURL> + <ItemAttributes> + <Creator Role="Performer">Richard Stoltzman</Creator> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Conductor">Alexander Schneider [violin]</Creator> + <Creator Role="Conductor">Colin Davis</Creator> + <Creator Role="Conductor">Eduardo Mata</Creator> + <Creator Role="Conductor">Erich Leinsdorf</Creator> + <Creator Role="Conductor">James Galway</Creator> + <Creator Role="Performer">James Galway</Creator> + <Creator Role="Conductor">Libor Hlavacek</Creator> + <Creator Role="Performer">Julius Levine</Creator> + <Creator Role="Performer">Guarneri Quartet</Creator> + <Creator Role="Performer">Tokyo String Quartet</Creator> + <Creator Role="Orchestra">Chamber Orchestra of Europe</Creator> + <Creator Role="Orchestra">English Chamber Orchestra</Creator> + <Creator Role="Orchestra">London Symphony Orchestra</Creator> + <Creator Role="Orchestra">New Philharmonia Orchestra</Creator> + <Creator Role="Orchestra">Prague Chamber Orchestra</Creator> + <Creator Role="Orchestra">Winds of the Bavarian Radio Symphony Orchestra</Creator> + <Creator Role="Performer">Alicia de Larrocha</Creator> + <Creator Role="Performer">Leontyne Price</Creator> + <Manufacturer>RCA</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>Mozart for Relaxation</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>657</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$6.57</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>525</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$5.25</FormattedPrice> + </LowestUsedPrice> + <TotalNew>29</TotalNew> + <TotalUsed>16</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>8lrLac8DkxCvQyNAPudBZVKyLFG8MUvEvgCzbtk9X2myKLKNu7eWLebIAAFQ9vMkXATf3YwWDKR6eyvJTFsHLw%3D%3D</OfferListingId> + <Price> + <Amount>999</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$9.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">II: Andantino</Track> + <Track Number="2">II: Romanze, Andante</Track> + <Track Number="3">II: Andante cantabile</Track> + <Track Number="4">II: Adagio</Track> + <Track Number="5">Adagio</Track> + <Track Number="6">III: Adagio</Track> + <Track Number="7">Act I, Scene 2: Soave sia il vento</Track> + <Track Number="8">II: Larghetto</Track> + <Track Number="9">II: Andante</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B000004166</ASIN> + <DetailPageURL>http://www.amazon.com/Mozart-Violin-Concertos/dp/B000004166%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000004166</DetailPageURL> + <ItemAttributes> + <Artist>Wolfgang Amadeus Mozart</Artist> + <Artist>Raymond Leppard</Artist> + <Artist>Sir Colin Davis</Artist> + <Artist>London Symphony Orchestra</Artist> + <Artist>New Philharmonia Orchestra</Artist> + <Artist>Arrigo Pelliccia</Artist> + <Artist>Arthur Grumiaux</Artist> + <Manufacturer>Philips</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>Mozart: Violin Concertos</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>1058</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$10.58</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>799</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$7.99</FormattedPrice> + </LowestUsedPrice> + <TotalNew>34</TotalNew> + <TotalUsed>14</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>c%2BThiNmo%2FSef%2BGxOJei3EHV9uJ8B99JaXNamZf55JwkBepI6sRlslryh32vrKpzCAWEHnDIlQ4HCwUN49r%2Bj%2BA%3D%3D</OfferListingId> + <Price> + <Amount>1399</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$13.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">No. 1 In B Flat, K. 207: Allegro Moderato</Track> + <Track Number="2">No. 1 In B Flat, K. 207: Adagio</Track> + <Track Number="3">No. 1 In B Flat, K. 207: Presto</Track> + <Track Number="4">No. 3 In G, K. 216: Allegro</Track> + <Track Number="5">No. 3 In G, K. 216: Adagio</Track> + <Track Number="6">No. 3 In G, K. 216: Rondeau (Allegro)</Track> + <Track Number="7">No. 4 In D, K. 218: Allegro</Track> + <Track Number="8">No. 4 In D, K. 218: Andante Cantabile</Track> + <Track Number="9">No. 4 In D, K. 218: Rondeau</Track> + <Track Number="10">Adagio In E For Violin And Orchestra, K. 261</Track> + <Track Number="11">Rondo In C For Violin And Orchestra, K. 373</Track> + </Disc> + <Disc Number="2"> + <Track Number="1">Concerto No. 2 In D, K. 211: Allegro</Track> + <Track Number="2">Concerto No. 2 In D, K. 211: Andante</Track> + <Track Number="3">Concerto No. 2 In D, K. 211: Rondeau (Allegro)</Track> + <Track Number="4">Concerto No. 5 In A, K. 219: Allegro Aperto</Track> + <Track Number="5">Concerto No. 5 In A, K. 219: Adagio</Track> + <Track Number="6">Concerto No. 5 In A, K. 219: Rondeau (Tempo Di Menuetto)</Track> + <Track Number="7">Sinfonia Concertante In E Flat, K. 364 For Violin, Viola And Orchestra: Allegro Maestoso</Track> + <Track Number="8">Sinfonia Concertante In E Flat, K. 364 For Violin, Viola And Orchestra: Andante</Track> + <Track Number="9">Sinfonia Concertante In E Flat, K. 364 For Violin, Viola And Orchestra: Presto</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B00002DEH1</ASIN> + <DetailPageURL>http://www.amazon.com/Mozart-Piano-Sonatas/dp/B00002DEH1%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00002DEH1</DetailPageURL> + <ItemAttributes> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Performer">Christoph Eschenbach</Creator> + <Manufacturer>Deutsche Grammophon</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>Mozart: Piano Sonatas</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>2660</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$26.60</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>2692</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$26.92</FormattedPrice> + </LowestUsedPrice> + <TotalNew>23</TotalNew> + <TotalUsed>7</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>MGxz%2FlTy0KPjmQX3kpSoL3bmPjN3mxxYqqEk0SKVAJznTbwO%2BQjjy49TTJxRrwK3ZpW1kTC5n%2BbmQtVmNsOyhg%3D%3D</OfferListingId> + <Price> + <Amount>3599</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$35.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">1. Allegro</Track> + <Track Number="2">2. Menuet I & II</Track> + <Track Number="3">1. Allegro</Track> + <Track Number="4">2. Menuet I & II</Track> + <Track Number="5">Allegro</Track> + <Track Number="6">Andante</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Allegro assai</Track> + <Track Number="9">Adagio</Track> + <Track Number="10">Presto</Track> + <Track Number="11">Allegro</Track> + <Track Number="12">Andante amoroso</Track> + <Track Number="13">Rondeau, Allegro</Track> + <Track Number="14">Adagio</Track> + <Track Number="15">Menuetto I & II</Track> + <Track Number="16">Allegro</Track> + </Disc> + <Disc Number="2"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Rondeau en Polonaise, Andante</Track> + <Track Number="6">Thema und 12 Variationen</Track> + <Track Number="7">Allegro con spirito</Track> + <Track Number="8">Andante un poco Adagio</Track> + <Track Number="9">Rondeau, Allegretto grazioso</Track> + <Track Number="10">Allegro con spirito</Track> + <Track Number="11">Andante con espressione</Track> + <Track Number="12">Rondeau, Allegro</Track> + </Disc> + <Disc Number="3"> + <Track Number="1">Allegro maestoso</Track> + <Track Number="2">Andante cantabile con espressione</Track> + <Track Number="3">Presto</Track> + <Track Number="4">Allegro moderato</Track> + <Track Number="5">Andante cantabile</Track> + <Track Number="6">Allegretto</Track> + <Track Number="7">Theme, Andante grazioso</Track> + <Track Number="8">Menuetto & Trio</Track> + <Track Number="9">Alla Turca, Allegretto</Track> + </Disc> + <Disc Number="4"> + <Track Number="1">Allegro</Track> + <Track Number="2">Adagio</Track> + <Track Number="3">Allegro assai</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andante cantabile</Track> + <Track Number="6">Allegretto grazioso</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Adagio</Track> + <Track Number="9">Molto allegro</Track> + </Disc> + <Disc Number="5"> + <Track Number="1">Allegro</Track> + <Track Number="2">Andante</Track> + <Track Number="3">Rondo. Allegretto (K. 494)</Track> + <Track Number="4">Allegro</Track> + <Track Number="5">Andante</Track> + <Track Number="6">Rondo, Allegretto</Track> + <Track Number="7">Allegro</Track> + <Track Number="8">Adagio</Track> + <Track Number="9">Allegretto</Track> + <Track Number="10">Allegro</Track> + <Track Number="11">Adagio</Track> + <Track Number="12">Allegretto</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B0000041EV</ASIN> + <DetailPageURL>http://www.amazon.com/Mozart-Mothers-Be-Tender-Lullabies/dp/B0000041EV%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0000041EV</DetailPageURL> + <ItemAttributes> + <Creator Role="Performer">Eva Czako</Creator> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Conductor">Alexander Gibson</Creator> + <Creator Role="Conductor">Neville Marriner</Creator> + <Creator Role="Performer">Academy of St. Martin-in-the-Fields</Creator> + <Creator Role="Orchestra">Academy of St. Martin-in-the-Fields</Creator> + <Creator Role="Performer">Academy of St. Martin-in-the-Fields Chamber Ensemble</Creator> + <Creator Role="Performer">Grumiaux Trio</Creator> + <Creator Role="Performer">Quartetto Italiano</Creator> + <Creator Role="Orchestra">New Philharmonia Orchestra</Creator> + <Creator Role="Performer">Georges Janzer</Creator> + <Creator Role="Performer">Max Lesueur</Creator> + <Creator Role="Performer">Arpad Gerecz</Creator> + <Creator Role="Performer">Arthur Grumiaux</Creator> + <Manufacturer>Philips</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>Mozart for Mothers-To-Be: Tender Lullabies for Mother and Child</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>349</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$3.49</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>300</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$3.00</FormattedPrice> + </LowestUsedPrice> + <TotalNew>36</TotalNew> + <TotalUsed>21</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>xd0JIWdBe6d3hhzubUAq6GY64ZyX6uP4L0ckSYUj4XXwLaSYHiVarWkkGzGvpt1wF5hcXl%2FWRaVyV0bPRHYy3Q%3D%3D</OfferListingId> + <Price> + <Amount>699</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$6.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">[Unspecified] Divertimento in B-flat: Adagio</Track> + <Track Number="2">Adagio</Track> + <Track Number="3">[Unspecified] Divertimento G minor: (Andante)</Track> + <Track Number="4">Adagio</Track> + <Track Number="5">Adagio</Track> + <Track Number="6">Romance (Andante)</Track> + <Track Number="7">Andante</Track> + <Track Number="8">Adagio</Track> + <Track Number="9">Prelude</Track> + <Track Number="10">Adagio</Track> + <Track Number="11">Andante cantabile</Track> + <Track Number="12">Adagio</Track> + </Disc> + </Tracks> + </Item> + <Item> + <ASIN>B00004SA87</ASIN> + <DetailPageURL>http://www.amazon.com/Mozart-The-Violin-Sonatas/dp/B00004SA87%3FSubscriptionId%3D0CM6AXEW4QM6RZCH28R2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00004SA87</DetailPageURL> + <ItemAttributes> + <Creator Role="Composer">Wolfgang Amadeus Mozart</Creator> + <Creator Role="Performer">Daniel Barenboim</Creator> + <Creator Role="Performer">Itzhak Perlman</Creator> + <Manufacturer>Deutsche Grammophon</Manufacturer> + <ProductGroup>Music</ProductGroup> + <Title>Mozart: The Violin Sonatas</Title> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>1898</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$18.98</FormattedPrice> + </LowestNewPrice> + <LowestUsedPrice> + <Amount>1899</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$18.99</FormattedPrice> + </LowestUsedPrice> + <TotalNew>31</TotalNew> + <TotalUsed>8</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>1</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>ATVPDKIKX0DER</MerchantId> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=ATVPDKIKX0DER</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>VhgCmNPkXUUBD67bVqUThLmsIvSsG%2BQ3WrgOPfbik5aVnv6Bmgkn35RnfJZCYN9ZkKMHyxkPS0XipJiy15OULg%3D%3D</OfferListingId> + <Price> + <Amount>2799</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$27.99</FormattedPrice> + </Price> + <Availability>Usually ships in 24 hours</Availability> + <IsEligibleForSuperSaverShipping>1</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + <Tracks> + <Disc Number="1"> + <Track Number="1">1. Allegro con spirito</Track> + <Track Number="2">2. Allegro</Track> + <Track Number="3">1. Allegro</Track> + <Track Number="4">2. Rondo. Andante grazioso</Track> + <Track Number="5">1. Adagio - Molto allegro</Track> + <Track Number="6">2. Tempo di Menuetto</Track> + <Track Number="7">1. Allegro di molto</Track> + <Track Number="8">2. Thema. Andante grazioso - Variazioni 1-6</Track> + <Track Number="9">1. Allegro vivace</Track> + <Track Number="10">2. Andante sostenuto</Track> + <Track Number="11">3. Rondeau. Allegro</Track> + </Disc> + <Disc Number="2"> + <Track Number="1">1. Allegro</Track> + <Track Number="2">2. Tempo di Menuetto</Track> + <Track Number="3">1. Allegro con spirito</Track> + <Track Number="4">2. Andantino cantabile</Track> + <Track Number="5">3. Allegretto</Track> + <Track Number="6">1. Allegro moderato</Track> + <Track Number="7">2. Andantino sostenuto e cantabile</Track> + <Track Number="8">3. Rondeau. Allegro</Track> + <Track Number="9">1. Adagio - Allegro</Track> + <Track Number="10">2. Thema. Andantino cantabile - Var. 1-5 - Thema. Allegretto</Track> + </Disc> + <Disc Number="3"> + <Track Number="1">1. Allegro</Track> + <Track Number="2">2. Andante</Track> + <Track Number="3">3. Rondeau. Allegretto grazioso</Track> + <Track Number="4">1. Allegro</Track> + <Track Number="5">2. Thema. Andante - Variationen 1-6</Track> + <Track Number="6">3. Tempo di Menuetto</Track> + <Track Number="7">1. Allegro</Track> + <Track Number="8">2. Andante con moto</Track> + <Track Number="9">3. Rondeau. Allegro</Track> + <Track Number="10">1. Largo - Allegro</Track> + <Track Number="11">2. Andante</Track> + <Track Number="12">3. Allegretto</Track> + </Disc> + <Disc Number="4"> + <Track Number="1">1. Molto Allegro</Track> + <Track Number="2">2. Adagio</Track> + <Track Number="3">3. Thema. Allegretto - Var. 1-5 - Var. 6. Allegro</Track> + <Track Number="4">1. Molto Allegro</Track> + <Track Number="5">2. Andante</Track> + <Track Number="6">3. Presto</Track> + <Track Number="7">1. Andantino cantabile</Track> + <Track Number="8">2. Allegro</Track> + <Track Number="9">3. Thema. Andante - Var. 1-6</Track> + </Disc> + </Tracks> + </Item> + </Items> +</ItemSearchResponse> diff --git a/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/offers_with_names.xml b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/offers_with_names.xml new file mode 100644 index 0000000000000000000000000000000000000000..00ff3d21edbc9cada7fba9eee8c183799a84c6ea --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/ZendService/Amazon/_files/offers_with_names.xml @@ -0,0 +1,602 @@ +<?xml version="1.0"?> +<ItemLookupResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"> + <OperationRequest> + <HTTPHeaders> + <Header Name="UserAgent" Value="Zend_Http_Client"/> + </HTTPHeaders> + <RequestId>Passwordx-xxxx-424d-8ab9-14f856ee2bf1</RequestId> + <Arguments> + <Argument Name="Condition" Value="New"/> + <Argument Name="Operation" Value="ItemLookup"/> + <Argument Name="Service" Value="AWSECommerceService"/> + <Argument Name="Signature" Value="PasswordPasswordxxxxx"/> + <Argument Name="MerchantId" Value="All"/> + <Argument Name="Version" Value="2011-08-01"/> + <Argument Name="ItemId" Value="0439774098,B00000194U"/> + <Argument Name="IdType" Value="ASIN"/> + <Argument Name="AWSAccessKeyId" Value="PasswordPassword"/> + <Argument Name="Timestamp" Value="2010-01-13T21:36:29Z"/> + <Argument Name="ResponseGroup" Value="OfferFull,ItemAttributes,Request"/> + </Arguments> + <RequestProcessingTime>0.4718690000000000</RequestProcessingTime> + </OperationRequest> + <Items> + <Request> + <IsValid>True</IsValid> + <ItemLookupRequest> + <Condition>New</Condition> + <DeliveryMethod>Ship</DeliveryMethod> + <IdType>ASIN</IdType> + <MerchantId>All</MerchantId> + <OfferPage>1</OfferPage> + <ItemId>0439774098</ItemId> + <ItemId>B00000194U</ItemId> + <ResponseGroup>OfferFull</ResponseGroup> + <ResponseGroup>ItemAttributes</ResponseGroup> + <ResponseGroup>Request</ResponseGroup> + <ReviewPage>1</ReviewPage> + </ItemLookupRequest> + </Request> + <Item> + <ASIN>0439774098</ASIN> + <DetailPageURL>http://www.amazon.com/Folk-Fairy-Tale-Easy-Readers/dp/0439774098%3FSubscriptionId%3D140PM2JXHSP8PD7D7ZR2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0439774098</DetailPageURL> + <ItemAttributes> + <Author>a retelling by Violet Findley</Author> + <Binding>Paperback</Binding> + <Brand>Scholastic</Brand> + <Creator Role="Illustrator">Lynne Cravath</Creator> + <Department>Pens & Desk Supplies</Department> + <EAN>9780439774093</EAN> + <Feature>Features 16 page storybook</Feature> + <Feature>Easy to read text</Feature> + <Feature>INcludes teaching guide</Feature> + <ISBN>0439774098</ISBN> + <ItemDimensions> + <Height Units="hundredths-inches">0</Height> + <Length Units="hundredths-inches">0</Length> + <Weight Units="hundredths-pounds">300</Weight> + <Width Units="hundredths-inches">0</Width> + </ItemDimensions> + <Label>Scholastic</Label> + <LegalDisclaimer>no_warning_applicable</LegalDisclaimer> + <ListPrice> + <Amount>7599</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$75.99</FormattedPrice> + </ListPrice> + <Manufacturer>Scholastic</Manufacturer> + <MPN>0439773911</MPN> + <NumberOfPages>16</NumberOfPages> + <PackageDimensions> + <Height Units="hundredths-inches">410</Height> + <Length Units="hundredths-inches">1230</Length> + <Weight Units="hundredths-pounds">580</Weight> + <Width Units="hundredths-inches">1190</Width> + </PackageDimensions> + <ProductGroup>Toy</ProductGroup> + <PublicationDate>2006</PublicationDate> + <Publisher>Scholastic</Publisher> + <Studio>Scholastic</Studio> + <Title>Folk and Fairy Tale Easy Readers</Title> + <UPC>078073773916</UPC> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>5153</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$51.53</FormattedPrice> + </LowestNewPrice> + <TotalNew>10</TotalNew> + <TotalUsed>0</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>10</TotalOffers> + <TotalOfferPages>1</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>A79CLRHOQ3NF4</MerchantId> + <Name>PLEXSUPPLY</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A79CLRHOQ3NF4</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>arHE03690z1svVt8ru8psnwEb2xopClIw1rIclronh9EogSv2LbpkpVFK1qpCfo7BVsOm3EaBZ4NtRYIsbbeuHhEhX336%2BOrPTWph5JYg7Fy1dTIP4KZwNCxw7bzoic0CAOtuAjrh%2BA%3D</OfferListingId> + <ExchangeId>Y11M0201723M6610687</ExchangeId> + <Price> + <Amount>5153</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$51.53</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A2K9NS8DSVOE2W</MerchantId> + <Name>nangsuer</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A2K9NS8DSVOE2W</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + <ConditionNote>All orders ship from Florida each day. We value your satisfaction and our feedback! Thanks 22A</ConditionNote> + </OfferAttributes> + <OfferListing> + <OfferListingId>5hsbYfTB98fWdej8OTlzhiipbB15%2FT3DewxrtC8bB0AH%2BLYidGjodOtQlq%2BK35C9JIhLtPHxB65X95lKA5zwNl9bsiQrIFMAGCHMkK1lIYilDOgmDk7U0TcMp%2BcBrKTH%2BJpPUg3aTuz9DLaa9tcPgA%3D%3D</OfferListingId> + <ExchangeId>Y11M5390024M2549072</ExchangeId> + <Price> + <Amount>5153</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$51.53</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A31EVTLIC13ORD</MerchantId> + <Name>Wizard of Math</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A31EVTLIC13ORD</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>K71ef%2FDkwirgYxs9klaNY7%2FXINJ6d%2BsJDQw1V0K%2FCZirOl9lyGAMQKOat6yWPrDhPnHwjBcLBD6UZEWCOJ45Ut%2BS4dtNR2u2z%2FQHDlqPdoWcuenlkIb%2FGswW4Ksi6uf0AYrp7LmJRTA%3D</OfferListingId> + <ExchangeId>Y11M2582888M3406164</ExchangeId> + <Price> + <Amount>7599</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$75.99</FormattedPrice> + </Price> + <SalePrice> + <Amount>5299</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$52.99</FormattedPrice> + </SalePrice> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A3SKJE188CW5XG</MerchantId> + <Name>ReStockIt</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A3SKJE188CW5XG</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>2Z69gtUkoYkitzHfbC3yZeHf2htOelt8J%2F97d%2FLZ626nDSUSMljr2vYtVGRvuq3QzdIjaqhTtXAO8RZS0HtLjhzoNXN8fCI8Qr7Nao8WeMdGtvYXhFCExkGx3WdQqboFDKelsyE84FM%3D</OfferListingId> + <ExchangeId>Y11M0113967M1327691</ExchangeId> + <Price> + <Amount>5299</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$52.99</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A1729W3053T57N</MerchantId> + <Name>The Price Pros</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A1729W3053T57N</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>Cq1toSGDUKPcdcS0gbDexyIg9vyHBBJovh1Zxr2%2FccJve3b9CSMCJmrdPqxq%2BYmg2Dpa1wKNtx3hSh6ouF57%2F6QaqP3bCrv8Lw84c2yOio3T43P%2Br%2BA56QxId%2BhcHgujU7paxUxlu2s%3D</OfferListingId> + <ExchangeId>Y12M0938195M5982264</ExchangeId> + <Price> + <Amount>5487</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$54.87</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A29PHU0KPCGV8S</MerchantId> + <Name>TheFactoryDepot</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A29PHU0KPCGV8S</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>rzFcf7pfWh9c%2B%2FhjfPlKyTVHm7JwFSH3ySSNpFxegoSlit8N%2BdUg6Z1nXu4oytpBZ%2BXBruFjRHG%2FqCMnzHUigvb1vaX915R%2BYoJ%2FTXa38xv7qJuQnrfvNXh8NwtSzIh2ldjhtfEVOJs%3D</OfferListingId> + <ExchangeId>Y14M0996254M0742534</ExchangeId> + <Price> + <Amount>5821</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$58.21</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>AIHRRFGW11GJ8</MerchantId> + <Name>Design Tec Office Products</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=AIHRRFGW11GJ8</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>Rg1nRJ0ksv7M8HhQ2eo6y1Sw7wdrI8JXUSvIboZA0aNrrXYkWUQoZoAvIwc01mPHRpP6s%2Fwj%2FqucA38T96tmeQDXjj2KZRLotVRGwxA%2F3oLaDjEbJZgpHpQCrQUFefIIGXOLZfztRL90f4bRFmBPZQ%3D%3D</OfferListingId> + <ExchangeId>Y14M1008209M3912403</ExchangeId> + <Price> + <Amount>5987</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$59.87</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A27OK403WRHSGI</MerchantId> + <Name>Kaplan Early Learning Company</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A27OK403WRHSGI</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>8bjKifJMTTrNPYjb02hlOOP04ypVJ1tn7SE5Ky5nXJ8qjhPP7pUTIzfCM8jdvXiXHbNLOdPQF7Ioz8jelIEn5SE%2BEHn946W9PFjiLYFirY7LYYN8RJqKHYMqQWIBF9b%2Fs4p121K8JSl08KDEsptgKw%3D%3D</OfferListingId> + <ExchangeId>Y12M6611852M7296124</ExchangeId> + <Price> + <Amount>7595</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$75.95</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A25DVOZOPBFMAN</MerchantId> + <Name>Deerso</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A25DVOZOPBFMAN</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>Du47ofi%2BLI5weIbCKeSIM0BFnTAkQVQOzVXTt%2B7FsIPR7uF485oDlVG%2FFOJe6fYyuCwUjd69uh50L9eYkdJI0dtlBP2CpVlwyOVZbiwFPMrROXIlmLNAnSsMsxMk8bC5ENAUG1HhC0RHrxVs%2FhDhCA%3D%3D</OfferListingId> + <ExchangeId>Y14M1102156M0656871</ExchangeId> + <Price> + <Amount>7599</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$75.99</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A6IFKC796Y64H</MerchantId> + <Name>The Education Station Inc</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A6IFKC796Y64H</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>g41as4NDMJDKdfbbCAmQaTw7tir9aU6gLzoQ0PAo2nJTaVFQfb378nO9wSLcsW71KYBKYMiCaQw5eTkkwlNa74N18Kh5DHeCjc8KWVTIfaQzUDrhC56sag4nh30WiJQTHv4sn3%2Bme5SA4ht%2Bqp%2B%2F%2BA%3D%3D</OfferListingId> + <ExchangeId>Y13M0614645M8460461</ExchangeId> + <Price> + <Amount>7599</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$75.99</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + </Item> + <Item> + <ASIN>B00000194U</ASIN> + <DetailPageURL>http://www.amazon.com/PowerLab-52010-Allsop-Organizer-Hold/dp/B00000194U%3FSubscriptionId%3D140PM2JXHSP8PD7D7ZR2%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00000194U</DetailPageURL> + <ItemAttributes> + <Binding>Electronics</Binding> + <Brand>PowerLab</Brand> + <EAN>0035286520102</EAN> + <Feature>Sold Individually</Feature> + <IsAutographed>0</IsAutographed> + <IsMemorabilia>0</IsMemorabilia> + <ItemDimensions> + <Height Units="hundredths-inches">650</Height> + <Length Units="hundredths-inches">525</Length> + <Weight Units="hundredths-pounds">118</Weight> + <Width Units="hundredths-inches">1200</Width> + </ItemDimensions> + <Label>PowerLab</Label> + <LegalDisclaimer>Warranty does not cover misuse of product.</LegalDisclaimer> + <ListPrice> + <Amount>2500</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$25.00</FormattedPrice> + </ListPrice> + <Manufacturer>PowerLab</Manufacturer> + <Model>52010</Model> + <MPN>52010</MPN> + <NumberOfItems>1</NumberOfItems> + <PackageDimensions> + <Weight Units="hundredths-pounds">137</Weight> + </PackageDimensions> + <ProductGroup>CE</ProductGroup> + <Publisher>PowerLab</Publisher> + <ReleaseDate>1995-06-13</ReleaseDate> + <Studio>PowerLab</Studio> + <Title>Allsop CD Organizer Hold</Title> + <UPC>035286520102</UPC> + <Warranty>Limited lifetime warranty</Warranty> + </ItemAttributes> + <OfferSummary> + <LowestNewPrice> + <Amount>480</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$4.80</FormattedPrice> + </LowestNewPrice> + <TotalNew>28</TotalNew> + <TotalUsed>0</TotalUsed> + <TotalCollectible>0</TotalCollectible> + <TotalRefurbished>0</TotalRefurbished> + </OfferSummary> + <Offers> + <TotalOffers>28</TotalOffers> + <TotalOfferPages>3</TotalOfferPages> + <Offer> + <Merchant> + <MerchantId>A3UOG6723G7MG0</MerchantId> + <Name>Efunctional</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A3UOG6723G7MG0</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>yJxQddhCOuzQnnN7dYjXhFI3no%2FrwD6pFJ%2BDIqAIlr4S5KECnY8mw%2F72BsArhDC0LO6DYmwVCI73UExtkGmKmdI9JeEpYSJJABFJ0%2F1ZvMZbPHNtAu0PrRmRakBsvpp8%2B6BtL%2B%2BP658pC8jd%2FZKpYQ%3D%3D</OfferListingId> + <ExchangeId>Y11M6929242M2865346</ExchangeId> + <Price> + <Amount>480</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$4.80</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A3SNNXCKUIW1O2</MerchantId> + <Name>Universal Mania</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A3SNNXCKUIW1O2</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + <ConditionNote>Brand New with Manufacturer's Warranty. 30 Day Money Back Guarantee. Customer Satisfaction Guaranteed.</ConditionNote> + </OfferAttributes> + <OfferListing> + <OfferListingId>fMh64bCc0BZTTkGS%2BVnWdLNPWvBj4qdiJozj7assbn1UAHS%2F0ndOMxCkCpMUnOpKjR%2FKdIgfD52jAA8LAm0hYsz3BNsvgsdLovvWD1XpmlQ5%2BHTyhwJHVKRmqaXV7LBHByL0MnlW9%2BY%3D</OfferListingId> + <ExchangeId>Y13M0066978M2394682</ExchangeId> + <Price> + <Amount>531</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$5.31</FormattedPrice> + </Price> + <Availability>Usually ships in 2-3 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A18ACDNYOEMMOL</MerchantId> + <Name>ApexSuppliers</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A18ACDNYOEMMOL</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>gq5FQD1qNEsSXtUFCix2xNQ1cIn18eA7O4M6rp72rVuCU5JQ4wVjfEk02OKw%2F8%2BcjJ%2FQN%2BXGoGOIsL%2FJuI0wtGE4NP5OVoaZolyVovgH3WEBCcdkzkycA9kdhsSwTjdtMGUv733daUg%3D</OfferListingId> + <ExchangeId>Y13M2494869M4706198</ExchangeId> + <Price> + <Amount>589</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$5.89</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A2NYACAJP9I1IY</MerchantId> + <Name>GizmosForLife</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A2NYACAJP9I1IY</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + <ConditionNote>Brand New in Original Retail Packing. Ships same or next day. Customer Satisfaction Guaranteed. You will receive a tracking no after item is shipped.</ConditionNote> + </OfferAttributes> + <OfferListing> + <OfferListingId>D9VIH0u1HD%2FYqiyYAdzpBPdm9GKX4chka0pRkMz%2F9oNXQY4CRLSZakmuA1egjHJriR16wHexUo0YS7IfZyTHgBXzwXGIDnTZVkO3%2F8c2JvB1K8uDV4xz855XUIyLaKCEF97Aq9RMFtpT%2BBO5B8nawA%3D%3D</OfferListingId> + <ExchangeId>Y11M0263400M1689368</ExchangeId> + <Price> + <Amount>608</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$6.08</FormattedPrice> + </Price> + <Availability>Usually ships in 3-4 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A1729W3053T57N</MerchantId> + <Name>The Price Pros</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A1729W3053T57N</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>Jpj9K4lZIJP2aZywsub5C8FR3lrJ%2FL0NS8USedAkvqBeKJ7ruApUlZviA0ZtgzlC%2BXLxwdU3nY3b8M9PY40JHNSSRnnk7dtHPgwQLrMm5yu49szSQZMe6xscKRfzUr5CRYqXY5ERNlY%3D</OfferListingId> + <ExchangeId>Y12M0051210M8397966</ExchangeId> + <Price> + <Amount>628</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$6.28</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A29PHU0KPCGV8S</MerchantId> + <Name>TheFactoryDepot</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A29PHU0KPCGV8S</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>cjriZfMobVIWbKkJ3bqoPql1e9y6%2F%2FYX%2BpHbmHsj5D%2BSS0b0vs2DCYJ6TcsmJZetQVG0zFhgghXw86kFYxk08tW02DpWASFZjklbwYjPIz%2BSmiGS4RyRGmRzOY6iyY90gZ4OM5lgWbo%3D</OfferListingId> + <ExchangeId>Y14M0781666M9419447</ExchangeId> + <Price> + <Amount>638</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$6.38</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A3Q3IAIX1CLBMZ</MerchantId> + <Name>ElectroGalaxy</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A3Q3IAIX1CLBMZ</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>8b6epAKiwTalSkBp%2F63GmP9M%2F7B8dN9%2FIGO1ZEdBtLyPIjBVSr3zim66RqUW6t09tCy%2FEUSohjuL3N1Wzl%2F9aFL76Eopw0JHSz3vMwQ95NuMnRVjD0eSAS4cIHMfOAXSU08HfK9ItU3j1Qxm%2FEU8tw%3D%3D</OfferListingId> + <ExchangeId>Y12M3335001M2898300</ExchangeId> + <Price> + <Amount>697</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$6.97</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A1PC5XI7QQLW5G</MerchantId> + <Name>Long Trading Company</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A1PC5XI7QQLW5G</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>grcrSmvDVBzlTchqfhGNla0B8skYVnOqy9R9jsZi1s42G4%2BFWJUqELDGc5G1Xy8OLbgOvbKIOtwvOhymyNMe5%2BQbnFRJ47mUlIJQO5ZPbRxcQ7G2biJrSUF9OPtjd2wwRhrBaEl4cUbMq6gs6W4BZw%3D%3D</OfferListingId> + <ExchangeId>Y13M5953686M3162954</ExchangeId> + <Price> + <Amount>860</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$8.60</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>A2R0FX412W1BDT</MerchantId> + <Name>Beach Audio</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=A2R0FX412W1BDT</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>hGF9%2FDJ4fGEdRWXowkeuQKia70ARUEBtSHNVSrZHjg2Ceq4FT1cxD8VwDvtLGDqIpzn4ko%2BX6Z%2FAxoEWRpg1B0w9RiBlSiZttrVSdGZezZ5Lom%2BB7nzTe5o%2FqikC1ore98NN4cY91Ps%3D</OfferListingId> + <ExchangeId>Y11M1694666M7415801</ExchangeId> + <Price> + <Amount>896</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$8.96</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + <Offer> + <Merchant> + <MerchantId>AKJJGJ0JKT8F1</MerchantId> + <Name>Buy.com</Name> + <GlancePage>http://www.amazon.com/gp/help/seller/home.html?seller=AKJJGJ0JKT8F1</GlancePage> + </Merchant> + <OfferAttributes> + <Condition>New</Condition> + <SubCondition>new</SubCondition> + </OfferAttributes> + <OfferListing> + <OfferListingId>gAJB9Nd5wYWhz6Ct2bIhEKIJh96%2FPqdPxj0xopTp5NBG5Q0QGVYJ9Ko3WiVYPfGB1B%2B1MC70LQ4wTmjjh8aW%2BoXmzHjj2%2FeL8F8SkFRsMk%2B%2BR6O2OZ0psQ%2BoW%2BdMfkwJYD5frv4FcC0%3D</OfferListingId> + <ExchangeId>Y19M5468826M4135026</ExchangeId> + <Price> + <Amount>899</Amount> + <CurrencyCode>USD</CurrencyCode> + <FormattedPrice>$8.99</FormattedPrice> + </Price> + <Availability>Usually ships in 1-2 business days</Availability> + <IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping> + </OfferListing> + </Offer> + </Offers> + </Item> + </Items> +</ItemLookupResponse> diff --git a/vendor/zendframework/zendservice-amazon/tests/_autoload.php b/vendor/zendframework/zendservice-amazon/tests/_autoload.php new file mode 100644 index 0000000000000000000000000000000000000000..24f5cf6bd4dad8796d65a50825eb22c11010f0ed --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/_autoload.php @@ -0,0 +1,40 @@ +<?php +/** + * Setup autoloading + */ +if ($zf2Path = getenv('ZF2_PATH')) { + require_once $zf2Path . '/library/Zend/Loader/StandardAutoloader.php'; + + $loader = new Zend\Loader\StandardAutoloader(array( + Zend\Loader\StandardAutoloader::AUTOREGISTER_ZF => true, + Zend\Loader\StandardAutoloader::LOAD_NS => array( + 'ZendService' => __DIR__ . '/../library/ZendService' + ) + )); + $loader->register(); + +} elseif (!file_exists(__DIR__ . '/../vendor/autoload.php')) { + throw new RuntimeException('This component has dependencies that are unmet. + +Please install composer (http://getcomposer.org), and run the following +command in the root of this project: + + php /path/to/composer.phar install + +After that, you should be able to run tests.'); +} else { + include_once __DIR__ . '/../vendor/autoload.php'; +} + + +spl_autoload_register(function ($class) { + if (0 !== strpos($class, 'ZendServiceTest\\')) { + return false; + } + $normalized = str_replace('ZendServiceTest\\', '', $class); + $filename = __DIR__ . '/ZendService/' . str_replace(array('\\', '_'), '/', $normalized) . '.php'; + if (!file_exists($filename)) { + return false; + } + return include_once $filename; +}); \ No newline at end of file diff --git a/vendor/zendframework/zendservice-amazon/tests/phpunit.xml.dist b/vendor/zendframework/zendservice-amazon/tests/phpunit.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..aaec38cdf69e7bc4eef937a70c721ae39636dc05 --- /dev/null +++ b/vendor/zendframework/zendservice-amazon/tests/phpunit.xml.dist @@ -0,0 +1,13 @@ +<phpunit bootstrap="./Bootstrap.php" colors="true"> + <testsuites> + <testsuite name="ZendService Amazon Test Suite"> + <directory>./ZendService</directory> + </testsuite> + </testsuites> + + <groups> + <exclude> + <group>disable</group> + </exclude> + </groups> +</phpunit>