diff --git a/application/Espo/Core/Mail/Sender.php b/application/Espo/Core/Mail/Sender.php new file mode 100644 index 0000000000..b14e5e0f27 --- /dev/null +++ b/application/Espo/Core/Mail/Sender.php @@ -0,0 +1,60 @@ +config = $config; + $this->trasport = new SmtpTransport(); + $this->setupGlobal(); + } + + protected function setupGlobal() + { + $config = $this->config; + + $opts = array( + 'name' => 'admin', + 'host' => $config->get('smtpServer'), + 'port' => $config->get('smtpPort'), + 'connection_config' => array(); + + ); + if ($config->get('smtpAuth')) { + $opts['connection_class'] = 'login'; + $opts['connection_config']['username'] = $config->get('smtpUsername'); + $opts['connection_config']['password'] = $config->get('smtpPassword'); + } + if ($config->get('smtpSecurity')) { + $opts['connection_config']['ssl'] = strtolower($config->get('smtpSecurity')); + } + + $options = new SmtpOptions($opts); + $transport->setOptions($options); + + return $this; + } + + public function send(Email $email, $attachments = array()) + { + $message = new Message(); + + $message->setSubject($email->get('name')); + $message->setBody($email->get('body')); + $message->setSubject($email->get('subject')); + + + } +} diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Email.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Email.json index 6c23f90387..c56acc5325 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Email.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Email.json @@ -1,98 +1,7 @@ { - "fields": { - "name": { - "type": "varchar", - "required": true - }, - "from": { - "type": "varchar", - "db": false - }, - "to": { - "type": "varchar", - "db": false - }, - "cc": { - "type": "varchar", - "db": false - }, - "bcc": { - "type": "varchar", - "db": false - }, - "body": { - "type": "text" - }, - "status": { - "type": "varchar" - }, - "attachments": { - "type": "linkMultiple" - }, - "parent": { - "type": "linkParent" - }, - "dateSent": { - "type": "datetime", - "default": "javascript: return this.dateTime.getNow(15);" - }, - "createdAt": { - "type": "datetime", - "readOnly": true - }, - "modifiedAt": { - "type": "datetime", - "readOnly": true - }, - "createdBy": { - "type": "link", - "readOnly": true - }, - "modifiedBy": { - "type": "link", - "readOnly": true - }, - "assignedUser": { - "type": "link", - "required": true, - "default": "javascript: return {assignedUserId: this.getUser().id, assignedUserName: this.getUser().get(\"name\")};" - }, - "teams": { - "type": "linkMultiple" - } - }, "links": { - "createdBy": { - "type": "belongsTo", - "entity": "User" - }, - "modifiedBy": { - "type": "belongsTo", - "entity": "User" - }, - "assignedUser": { - "type": "belongsTo", - "entity": "User" - }, - "teams": { - "type": "hasMany", - "entity": "Team", - "relationName": "EntityTeam" - }, - "attachments": { - "type": "hasChildren", - "entity": "Attachment", - "foreign": "parent" - }, "parent": { - "type": "belongsToParent", - "entities": ["Account", "Opportunity", "Case"], - "foreign": "attachments" + "entities": ["Account", "Opportunity", "Case"] } - }, - "collection": { - "sortBy": "dateSent", - "asc": false, - "boolFilters": ["onlyMy"] } } diff --git a/application/Espo/Modules/Crm/Resources/layouts/Email/detail.json b/application/Espo/Resources/layouts/Email/detail.json similarity index 100% rename from application/Espo/Modules/Crm/Resources/layouts/Email/detail.json rename to application/Espo/Resources/layouts/Email/detail.json diff --git a/application/Espo/Modules/Crm/Resources/layouts/Email/detailSmall.json b/application/Espo/Resources/layouts/Email/detailSmall.json similarity index 100% rename from application/Espo/Modules/Crm/Resources/layouts/Email/detailSmall.json rename to application/Espo/Resources/layouts/Email/detailSmall.json diff --git a/application/Espo/Resources/metadata/entityDefs/Email.json b/application/Espo/Resources/metadata/entityDefs/Email.json new file mode 100644 index 0000000000..2ae25b8f96 --- /dev/null +++ b/application/Espo/Resources/metadata/entityDefs/Email.json @@ -0,0 +1,144 @@ +{ + "fields": { + "name": { + "type": "varchar", + "required": true + }, + "from": { + "type": "varchar", + "db": false + }, + "to": { + "type": "varchar", + "db": false + }, + "cc": { + "type": "varchar", + "db": false + }, + "bcc": { + "type": "varchar", + "db": false + }, + "body": { + "type": "text" + }, + "status": { + "type": "varchar" + }, + "attachments": { + "type": "linkMultiple" + }, + "parent": { + "type": "linkParent" + }, + "dateSent": { + "type": "datetime", + "default": "javascript: return this.dateTime.getNow(15);" + }, + "createdAt": { + "type": "datetime", + "readOnly": true + }, + "modifiedAt": { + "type": "datetime", + "readOnly": true + }, + "createdBy": { + "type": "link", + "readOnly": true + }, + "modifiedBy": { + "type": "link", + "readOnly": true + }, + "assignedUser": { + "type": "link", + "required": true, + "default": "javascript: return {assignedUserId: this.getUser().id, assignedUserName: this.getUser().get(\"name\")};" + }, + "teams": { + "type": "linkMultiple" + } + }, + "links": { + "createdBy": { + "type": "belongsTo", + "entity": "User" + }, + "modifiedBy": { + "type": "belongsTo", + "entity": "User" + }, + "assignedUser": { + "type": "belongsTo", + "entity": "User" + }, + "teams": { + "type": "hasMany", + "entity": "Team", + "relationName": "EntityTeam" + }, + "attachments": { + "type": "hasChildren", + "entity": "Attachment", + "foreign": "parent" + }, + "parent": { + "type": "belongsToParent", + "entities": [], + "foreign": "attachments" + }, + "fromEmailAddress": { + "type": "belongsTo", + "entity": "EmailAddress" + }, + "toEmailAddresses": { + "type": "hasMany", + "entity": "EmailAddress", + "relationName": "EmailEmailAddress", + "conditions": { + "addressType": "to" + }, + "additionalColumns": { + "addressType": { + "type": "varchar", + "len": "4" + } + } + }, + "ccEmailAddresses": { + "type": "hasMany", + "entity": "EmailAddress", + "relationName": "EmailEmailAddress", + "conditions": { + "addressType": "cc" + }, + "additionalColumns": { + "addressType": { + "type": "varchar", + "len": "4" + } + } + }, + "bccEmailAddresses": { + "type": "hasMany", + "entity": "EmailAddress", + "relationName": "EmailEmailAddress", + "conditions": { + "addressType": "bcc" + }, + "additionalColumns": { + "addressType": { + "type": "varchar", + "len": "4" + } + } + } + }, + "collection": { + "sortBy": "dateSent", + "asc": false, + "boolFilters": ["onlyMy"] + } +} diff --git a/application/Espo/Modules/Crm/Resources/metadata/scopes/Email.json b/application/Espo/Resources/metadata/scopes/Email.json similarity index 63% rename from application/Espo/Modules/Crm/Resources/metadata/scopes/Email.json rename to application/Espo/Resources/metadata/scopes/Email.json index e5390eed4e..75edf858e2 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/scopes/Email.json +++ b/application/Espo/Resources/metadata/scopes/Email.json @@ -2,6 +2,5 @@ "entity": true, "layouts": false, "tab": false, - "acl": true, - "module": "Crm" + "acl": true } diff --git a/composer.json b/composer.json index c34ed9b8b4..4ed1cbe9aa 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,8 @@ "require": { "doctrine/orm": "2.4.*", "symfony/yaml": "2.*", - "slim/slim": "2.*" + "slim/slim": "2.*", + "zendframework/zend-mail": "2.*" }, "autoload": { "psr-0": { diff --git a/composer.lock b/composer.lock index dd0186358d..ca45a10d7a 100644 --- a/composer.lock +++ b/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "2d47d82de4e8d58c920ca5f5225becfd", + "hash": "0609062cfc7bcc1a692686678397f1af", "packages": [ { "name": "doctrine/annotations", @@ -296,16 +296,16 @@ }, { "name": "doctrine/dbal", - "version": "v2.4.1", + "version": "v2.4.2", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "328357bd9eea9d671fe5fff0737f01953bfe66a0" + "reference": "fec965d330c958e175c39e61c3f6751955af32d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/328357bd9eea9d671fe5fff0737f01953bfe66a0", - "reference": "328357bd9eea9d671fe5fff0737f01953bfe66a0", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/fec965d330c958e175c39e61c3f6751955af32d0", + "reference": "fec965d330c958e175c39e61c3f6751955af32d0", "shasum": "" }, "require": { @@ -358,7 +358,7 @@ "persistence", "queryobject" ], - "time": "2013-11-12 12:38:28" + "time": "2014-01-01 16:43:57" }, { "name": "doctrine/inflector", @@ -600,17 +600,17 @@ }, { "name": "symfony/console", - "version": "v2.4.0", + "version": "v2.4.1", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "3c1496ae96d24ccc6c340fcc25f71d7a1ab4c12c" + "reference": "4c1ed2ff514bd85ee186eebb010ccbdeeab05af7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/3c1496ae96d24ccc6c340fcc25f71d7a1ab4c12c", - "reference": "3c1496ae96d24ccc6c340fcc25f71d7a1ab4c12c", + "url": "https://api.github.com/repos/symfony/Console/zipball/4c1ed2ff514bd85ee186eebb010ccbdeeab05af7", + "reference": "4c1ed2ff514bd85ee186eebb010ccbdeeab05af7", "shasum": "" }, "require": { @@ -649,21 +649,21 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2013-11-27 09:10:40" + "time": "2014-01-01 08:14:50" }, { "name": "symfony/yaml", - "version": "v2.4.0", + "version": "v2.4.1", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5" + "reference": "4e1a237fc48145fae114b96458d799746ad89aa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5", - "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4e1a237fc48145fae114b96458d799746ad89aa0", + "reference": "4e1a237fc48145fae114b96458d799746ad89aa0", "shasum": "" }, "require": { @@ -696,7 +696,310 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2013-11-26 16:40:27" + "time": "2013-12-28 08:12:03" + }, + { + "name": "zendframework/zend-crypt", + "version": "2.2.5", + "target-dir": "Zend/Crypt", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendCrypt.git", + "reference": "97755b496cda7889887adf1d283f8d32c86674b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendCrypt/zipball/97755b496cda7889887adf1d283f8d32c86674b9", + "reference": "97755b496cda7889887adf1d283f8d32c86674b9", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-math": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Crypt\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "crypt", + "zf2" + ], + "time": "2013-06-12 19:48:13" + }, + { + "name": "zendframework/zend-loader", + "version": "2.2.5", + "target-dir": "Zend/Loader", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendLoader.git", + "reference": "9e3537a6012dc0b184f66f8668e6c33fd805f0eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendLoader/zipball/9e3537a6012dc0b184f66f8668e6c33fd805f0eb", + "reference": "9e3537a6012dc0b184f66f8668e6c33fd805f0eb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Loader\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "loader", + "zf2" + ], + "time": "2013-10-20 06:00:17" + }, + { + "name": "zendframework/zend-mail", + "version": "2.2.5", + "target-dir": "Zend/Mail", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMail.git", + "reference": "654e02f0490b7ecbfb18150383c6b4e01fd6f1d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMail/zipball/654e02f0490b7ecbfb18150383c6b4e01fd6f1d3", + "reference": "654e02f0490b7ecbfb18150383c6b4e01fd6f1d3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-crypt": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-mime": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "suggest": { + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-validator": "Zend\\Validator component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Mail\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages", + "keywords": [ + "mail", + "zf2" + ], + "time": "2013-10-20 21:00:05" + }, + { + "name": "zendframework/zend-math", + "version": "2.2.5", + "target-dir": "Zend/Math", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMath.git", + "reference": "7cba0957e916b705ba280f31919e6acfa3d983fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMath/zipball/7cba0957e916b705ba280f31919e6acfa3d983fd", + "reference": "7cba0957e916b705ba280f31919e6acfa3d983fd", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Math\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "math", + "zf2" + ], + "time": "2013-10-02 08:00:14" + }, + { + "name": "zendframework/zend-mime", + "version": "2.2.5", + "target-dir": "Zend/Mime", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMime.git", + "reference": "34f88da8dc21bc89fce030c4b7f7b0155f59fb99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMime/zipball/34f88da8dc21bc89fce030c4b7f7b0155f59fb99", + "reference": "34f88da8dc21bc89fce030c4b7f7b0155f59fb99", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Mime\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "mime", + "zf2" + ], + "time": "2013-08-21 17:07:24" + }, + { + "name": "zendframework/zend-servicemanager", + "version": "2.2.5", + "target-dir": "Zend/ServiceManager", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendServiceManager.git", + "reference": "064bb1d0441529aded2f213a10002cc4523f328c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendServiceManager/zipball/064bb1d0441529aded2f213a10002cc4523f328c", + "reference": "064bb1d0441529aded2f213a10002cc4523f328c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "zendframework/zend-di": "Zend\\Di component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\ServiceManager\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "servicemanager", + "zf2" + ], + "time": "2013-10-23 20:00:05" + }, + { + "name": "zendframework/zend-stdlib", + "version": "2.2.5", + "target-dir": "Zend/Stdlib", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendStdlib.git", + "reference": "f440ecfc828d61d620662a03987c8287e1e4801e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/f440ecfc828d61d620662a03987c8287e1e4801e", + "reference": "f440ecfc828d61d620662a03987c8287e1e4801e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "zendframework/zend-eventmanager": "To support aggregate hydrator usage", + "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Stdlib\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "stdlib", + "zf2" + ], + "time": "2013-10-20 06:00:20" } ], "packages-dev": [ @@ -946,16 +1249,16 @@ }, { "name": "phpunit/phpunit", - "version": "3.7.28", + "version": "3.7.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d" + "reference": "faeb2d9f15dc83830d2db5e4c67acf1d68c9b5ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d", - "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/faeb2d9f15dc83830d2db5e4c67acf1d68c9b5ac", + "reference": "faeb2d9f15dc83830d2db5e4c67acf1d68c9b5ac", "shasum": "" }, "require": { @@ -1016,7 +1319,7 @@ "testing", "xunit" ], - "time": "2013-10-17 07:27:40" + "time": "2014-01-15 06:46:38" }, { "name": "phpunit/phpunit-mock-objects", diff --git a/vendor/autoload.php b/vendor/autoload.php index 76e7b3236c..068c667f99 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit1983a0e55fe28bbf984fa65ef179598e::getLoader(); +return ComposerAutoloaderInit2f30ba8344797b13150310690299ed93::getLoader(); diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit deleted file mode 100644 index 0c2f0b26aa..0000000000 --- a/vendor/bin/phpunit +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env php -. - * 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. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may 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. - */ - -define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main'); - -$files = array( - __DIR__ . '/../../vendor/autoload.php', - __DIR__ . '/../../../../autoload.php' -); - -foreach ($files as $file) { - if (file_exists($file)) { - require $file; - - define('PHPUNIT_COMPOSER_INSTALL', $file); - - break; - } -} - -if (!defined('PHPUNIT_COMPOSER_INSTALL')) { - die( - 'You need to set up the project dependencies using the following commands:' . PHP_EOL . - 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . - 'php composer.phar install' . PHP_EOL - ); -} - -PHPUnit_TextUI_Command::main(); diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit new file mode 120000 index 0000000000..d284b32d0c --- /dev/null +++ b/vendor/bin/phpunit @@ -0,0 +1 @@ +../phpunit/phpunit/composer/bin/phpunit \ No newline at end of file diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index ebb7a3dc52..b70815dab6 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -6,6 +6,13 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'Zend\\Stdlib\\' => array($vendorDir . '/zendframework/zend-stdlib'), + 'Zend\\ServiceManager\\' => array($vendorDir . '/zendframework/zend-servicemanager'), + 'Zend\\Mime\\' => array($vendorDir . '/zendframework/zend-mime'), + 'Zend\\Math\\' => array($vendorDir . '/zendframework/zend-math'), + 'Zend\\Mail\\' => array($vendorDir . '/zendframework/zend-mail'), + 'Zend\\Loader\\' => array($vendorDir . '/zendframework/zend-loader'), + 'Zend\\Crypt\\' => array($vendorDir . '/zendframework/zend-crypt'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), 'Slim' => array($vendorDir . '/slim/slim'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 6960e054cc..4ec4d714ac 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit1983a0e55fe28bbf984fa65ef179598e +class ComposerAutoloaderInit2f30ba8344797b13150310690299ed93 { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit1983a0e55fe28bbf984fa65ef179598e return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit1983a0e55fe28bbf984fa65ef179598e', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit2f30ba8344797b13150310690299ed93', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit1983a0e55fe28bbf984fa65ef179598e', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit2f30ba8344797b13150310690299ed93', 'loadClassLoader')); $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 9cc6d43233..a211f11226 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -559,74 +559,6 @@ "spl" ] }, - { - "name": "doctrine/dbal", - "version": "v2.4.1", - "version_normalized": "2.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/dbal.git", - "reference": "328357bd9eea9d671fe5fff0737f01953bfe66a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/328357bd9eea9d671fe5fff0737f01953bfe66a0", - "reference": "328357bd9eea9d671fe5fff0737f01953bfe66a0", - "shasum": "" - }, - "require": { - "doctrine/common": "~2.4", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*", - "symfony/console": "~2.0" - }, - "suggest": { - "symfony/console": "Allows use of the command line interface" - }, - "time": "2013-11-12 12:38:28", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\DBAL\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - } - ], - "description": "Database Abstraction Layer", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "database", - "dbal", - "persistence", - "queryobject" - ] - }, { "name": "doctrine/orm", "version": "v2.4.1", @@ -867,131 +799,6 @@ "xunit" ] }, - { - "name": "phpunit/phpunit", - "version": "3.7.28", - "version_normalized": "3.7.28.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d", - "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpunit/php-code-coverage": "~1.2.1", - "phpunit/php-file-iterator": ">=1.3.1", - "phpunit/php-text-template": ">=1.1.1", - "phpunit/php-timer": ">=1.0.4", - "phpunit/phpunit-mock-objects": "~1.2.0", - "symfony/yaml": "~2.0" - }, - "require-dev": { - "pear-pear/pear": "1.9.4" - }, - "suggest": { - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "phpunit/php-invoker": ">=1.1.0,<1.2.0" - }, - "time": "2013-10-17 07:27:40", - "bin": [ - "composer/bin/phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.7.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "PHPUnit/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ] - }, - { - "name": "symfony/yaml", - "version": "v2.4.0", - "version_normalized": "2.4.0.0", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5", - "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2013-11-26 16:40:27", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://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": "slim/slim", "version": "2.4.0", @@ -1040,20 +847,213 @@ "router" ] }, + { + "name": "symfony/yaml", + "version": "v2.4.1", + "version_normalized": "2.4.1.0", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "4e1a237fc48145fae114b96458d799746ad89aa0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4e1a237fc48145fae114b96458d799746ad89aa0", + "reference": "4e1a237fc48145fae114b96458d799746ad89aa0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2013-12-28 08:12:03", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://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": "phpunit/phpunit", + "version": "3.7.29", + "version_normalized": "3.7.29.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "faeb2d9f15dc83830d2db5e4c67acf1d68c9b5ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/faeb2d9f15dc83830d2db5e4c67acf1d68c9b5ac", + "reference": "faeb2d9f15dc83830d2db5e4c67acf1d68c9b5ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~1.2.1", + "phpunit/php-file-iterator": ">=1.3.1", + "phpunit/php-text-template": ">=1.1.1", + "phpunit/php-timer": ">=1.0.4", + "phpunit/phpunit-mock-objects": "~1.2.0", + "symfony/yaml": "~2.0" + }, + "require-dev": { + "pear-pear/pear": "1.9.4" + }, + "suggest": { + "ext-json": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "phpunit/php-invoker": ">=1.1.0,<1.2.0" + }, + "time": "2014-01-15 06:46:38", + "bin": [ + "composer/bin/phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.7.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ] + }, + { + "name": "doctrine/dbal", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "fec965d330c958e175c39e61c3f6751955af32d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/fec965d330c958e175c39e61c3f6751955af32d0", + "reference": "fec965d330c958e175c39e61c3f6751955af32d0", + "shasum": "" + }, + "require": { + "doctrine/common": "~2.4", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*", + "symfony/console": "~2.0" + }, + "suggest": { + "symfony/console": "Allows use of the command line interface" + }, + "time": "2014-01-01 16:43:57", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Doctrine\\DBAL\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + } + ], + "description": "Database Abstraction Layer", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "database", + "dbal", + "persistence", + "queryobject" + ] + }, { "name": "symfony/console", - "version": "v2.4.0", - "version_normalized": "2.4.0.0", + "version": "v2.4.1", + "version_normalized": "2.4.1.0", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "3c1496ae96d24ccc6c340fcc25f71d7a1ab4c12c" + "reference": "4c1ed2ff514bd85ee186eebb010ccbdeeab05af7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/3c1496ae96d24ccc6c340fcc25f71d7a1ab4c12c", - "reference": "3c1496ae96d24ccc6c340fcc25f71d7a1ab4c12c", + "url": "https://api.github.com/repos/symfony/Console/zipball/4c1ed2ff514bd85ee186eebb010ccbdeeab05af7", + "reference": "4c1ed2ff514bd85ee186eebb010ccbdeeab05af7", "shasum": "" }, "require": { @@ -1065,7 +1065,7 @@ "suggest": { "symfony/event-dispatcher": "" }, - "time": "2013-11-27 09:10:40", + "time": "2014-01-01 08:14:50", "type": "library", "extra": { "branch-alias": { @@ -1094,5 +1094,322 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com" + }, + { + "name": "zendframework/zend-stdlib", + "version": "2.2.5", + "version_normalized": "2.2.5.0", + "target-dir": "Zend/Stdlib", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendStdlib.git", + "reference": "f440ecfc828d61d620662a03987c8287e1e4801e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/f440ecfc828d61d620662a03987c8287e1e4801e", + "reference": "f440ecfc828d61d620662a03987c8287e1e4801e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "zendframework/zend-eventmanager": "To support aggregate hydrator usage", + "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + }, + "time": "2013-10-20 06:00:20", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\Stdlib\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "stdlib", + "zf2" + ] + }, + { + "name": "zendframework/zend-mime", + "version": "2.2.5", + "version_normalized": "2.2.5.0", + "target-dir": "Zend/Mime", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMime.git", + "reference": "34f88da8dc21bc89fce030c4b7f7b0155f59fb99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMime/zipball/34f88da8dc21bc89fce030c4b7f7b0155f59fb99", + "reference": "34f88da8dc21bc89fce030c4b7f7b0155f59fb99", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" + }, + "time": "2013-08-21 17:07:24", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\Mime\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "mime", + "zf2" + ] + }, + { + "name": "zendframework/zend-loader", + "version": "2.2.5", + "version_normalized": "2.2.5.0", + "target-dir": "Zend/Loader", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendLoader.git", + "reference": "9e3537a6012dc0b184f66f8668e6c33fd805f0eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendLoader/zipball/9e3537a6012dc0b184f66f8668e6c33fd805f0eb", + "reference": "9e3537a6012dc0b184f66f8668e6c33fd805f0eb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2013-10-20 06:00:17", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\Loader\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "loader", + "zf2" + ] + }, + { + "name": "zendframework/zend-servicemanager", + "version": "2.2.5", + "version_normalized": "2.2.5.0", + "target-dir": "Zend/ServiceManager", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendServiceManager.git", + "reference": "064bb1d0441529aded2f213a10002cc4523f328c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendServiceManager/zipball/064bb1d0441529aded2f213a10002cc4523f328c", + "reference": "064bb1d0441529aded2f213a10002cc4523f328c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "zendframework/zend-di": "Zend\\Di component" + }, + "time": "2013-10-23 20:00:05", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\ServiceManager\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "servicemanager", + "zf2" + ] + }, + { + "name": "zendframework/zend-math", + "version": "2.2.5", + "version_normalized": "2.2.5.0", + "target-dir": "Zend/Math", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMath.git", + "reference": "7cba0957e916b705ba280f31919e6acfa3d983fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMath/zipball/7cba0957e916b705ba280f31919e6acfa3d983fd", + "reference": "7cba0957e916b705ba280f31919e6acfa3d983fd", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable" + }, + "time": "2013-10-02 08:00:14", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\Math\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "math", + "zf2" + ] + }, + { + "name": "zendframework/zend-crypt", + "version": "2.2.5", + "version_normalized": "2.2.5.0", + "target-dir": "Zend/Crypt", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendCrypt.git", + "reference": "97755b496cda7889887adf1d283f8d32c86674b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendCrypt/zipball/97755b496cda7889887adf1d283f8d32c86674b9", + "reference": "97755b496cda7889887adf1d283f8d32c86674b9", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-math": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "time": "2013-06-12 19:48:13", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\Crypt\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "crypt", + "zf2" + ] + }, + { + "name": "zendframework/zend-mail", + "version": "2.2.5", + "version_normalized": "2.2.5.0", + "target-dir": "Zend/Mail", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMail.git", + "reference": "654e02f0490b7ecbfb18150383c6b4e01fd6f1d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMail/zipball/654e02f0490b7ecbfb18150383c6b4e01fd6f1d3", + "reference": "654e02f0490b7ecbfb18150383c6b4e01fd6f1d3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "zendframework/zend-crypt": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-mime": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "suggest": { + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-validator": "Zend\\Validator component" + }, + "time": "2013-10-20 21:00:05", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\Mail\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages", + "keywords": [ + "mail", + "zf2" + ] } ] diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php index 85cf0bb281..6efb24e6b6 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php @@ -548,15 +548,16 @@ class Connection implements DriverConnection { $this->connect(); - if ( ! is_int(key($types))) { - $types = $this->extractTypeValues($data, $types); + if (empty($data)) { + return $this->executeUpdate('INSERT INTO ' . $tableName . ' ()' . ' VALUES ()'); } - $query = 'INSERT INTO ' . $tableName - . ' (' . implode(', ', array_keys($data)) . ')' - . ' VALUES (' . implode(', ', array_fill(0, count($data), '?')) . ')'; - - return $this->executeUpdate($query, array_values($data), $types); + return $this->executeUpdate( + 'INSERT INTO ' . $tableName . ' (' . implode(', ', array_keys($data)) . ')' . + ' VALUES (' . implode(', ', array_fill(0, count($data), '?')) . ')', + array_values($data), + is_int(key($types)) ? $types : $this->extractTypeValues($data, $types) + ); } /** diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index 1e27cfebeb..38fed62218 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -169,6 +169,9 @@ class MysqliStatement implements \IteratorAggregate, Statement if (null === $this->_columnNames) { $meta = $this->_stmt->result_metadata(); if (false !== $meta) { + // We have a result. + $this->_stmt->store_result(); + $columnNames = array(); foreach ($meta->fetch_fields() as $col) { $columnNames[] = $col->name; @@ -191,11 +194,6 @@ class MysqliStatement implements \IteratorAggregate, Statement } } - // We have a result. - if (false !== $this->_columnNames) { - $this->_stmt->store_result(); - } - return true; } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php index 5fcc299c7b..15a6984b34 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php @@ -64,15 +64,18 @@ class Driver implements \Doctrine\DBAL\Driver $dsn .= '(PORT=1521)'; } + $database = 'SID=' . $params['dbname']; + $pooled = ''; + if (isset($params['service']) && $params['service'] == true) { - $dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . '))'; - } else { - $dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . '))'; + $database = 'SERVICE_NAME=' . $params['dbname']; } + if (isset($params['pooled']) && $params['pooled'] == true) { - $dsn .= '(SERVER=POOLED)'; + $pooled = '(SERVER=POOLED)'; } - $dsn .= ')'; + + $dsn .= '))(CONNECT_DATA=(' . $database . ')' . $pooled . '))'; } else { $dsn .= $params['dbname']; } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php index 61c8ba36e6..c6048bb41a 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php @@ -53,10 +53,11 @@ class Driver implements \Doctrine\DBAL\Driver */ private function _constructPdoDsn(array $params) { - $dsn = 'oci:'; + $dsn = 'oci:dbname='; + if (isset($params['host']) && $params['host'] != '') { - $dsn .= 'dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' . - '(HOST=' . $params['host'] . ')'; + $dsn .= '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' . + '(HOST=' . $params['host'] . ')'; if (isset($params['port'])) { $dsn .= '(PORT=' . $params['port'] . ')'; @@ -64,13 +65,20 @@ class Driver implements \Doctrine\DBAL\Driver $dsn .= '(PORT=1521)'; } + $database = 'SID=' . $params['dbname']; + $pooled = ''; + if (isset($params['service']) && $params['service'] == true) { - $dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $params['dbname'] . ')))'; - } else { - $dsn .= '))(CONNECT_DATA=(SID=' . $params['dbname'] . ')))'; + $database = 'SERVICE_NAME=' . $params['dbname']; } + + if (isset($params['pooled']) && $params['pooled'] == true) { + $pooled = '(SERVER=POOLED)'; + } + + $dsn .= '))(CONNECT_DATA=(' . $database . ')' . $pooled . '))'; } else { - $dsn .= 'dbname=' . $params['dbname']; + $dsn .= $params['dbname']; } if (isset($params['charset'])) { diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 0faa7a25d1..1a34a97b65 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -1284,7 +1284,7 @@ abstract class AbstractPlatform if ($this->supportsCommentOnStatement()) { foreach ($table->getColumns() as $column) { if ($this->getColumnComment($column)) { - $sql[] = $this->getCommentOnColumnSQL($tableName, $column->getName(), $this->getColumnComment($column)); + $sql[] = $this->getCommentOnColumnSQL($tableName, $column->getQuotedName($this), $this->getColumnComment($column)); } } } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php index b3e6adfbc1..6dc832da7b 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php @@ -391,7 +391,7 @@ class DB2Platform extends AbstractPlatform /* @var $columnDiff \Doctrine\DBAL\Schema\ColumnDiff */ $column = $columnDiff->column; - $queryParts[] = 'ALTER ' . ($columnDiff->oldColumnName) . ' ' + $queryParts[] = 'ALTER ' . ($columnDiff->getOldColumnName()->getQuotedName($this)) . ' ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php index 1ab71bd2d3..3520f36431 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php @@ -410,7 +410,7 @@ class DrizzlePlatform extends AbstractPlatform $column = $columnDiff->column; $columnArray = $column->toArray(); $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' ' + $queryParts[] = 'CHANGE ' . ($columnDiff->getOldColumnName()->getQuotedName($this)) . ' ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index 0e63b373c4..1230c9b794 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -23,7 +23,6 @@ use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Table; -use Doctrine\DBAL\Schema\ForeignKeyConstraint; /** * The MySqlPlatform provides the behavior, features and SQL dialect of the @@ -116,6 +115,22 @@ class MySqlPlatform extends AbstractPlatform return 'DATEDIFF(' . $date1 . ', ' . $date2 . ')'; } + /** + * {@inheritDoc} + */ + public function getDateAddHourExpression($date, $hours) + { + return 'DATE_ADD(' . $date . ', INTERVAL ' . $hours . ' HOUR)'; + } + + /** + * {@inheritDoc} + */ + public function getDateSubHourExpression($date, $hours) + { + return 'DATE_SUB(' . $date . ', INTERVAL ' . $hours . ' HOUR)'; + } + /** * {@inheritDoc} */ @@ -530,7 +545,7 @@ class MySqlPlatform extends AbstractPlatform continue; } - //$queryParts[] = 'DROP ' . $column->getQuotedName($this); //espo: no needs to remove columns + $queryParts[] = 'DROP ' . $column->getQuotedName($this); } foreach ($diff->changedColumns as $columnDiff) { @@ -542,13 +557,11 @@ class MySqlPlatform extends AbstractPlatform $column = $columnDiff->column; $columnArray = $column->toArray(); $columnArray['comment'] = $this->getColumnComment($column); - - $queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' ' + $queryParts[] = 'CHANGE ' . ($columnDiff->getOldColumnName()->getQuotedName($this)) . ' ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); } - //espo: It works not correctly. It can rename some existing fields. Need more tests - foreach ($diff->renamedColumns as $oldColumnName => $column) { + foreach ($diff->renamedColumns as $oldColumnName => $column) { if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { continue; } @@ -557,14 +570,20 @@ class MySqlPlatform extends AbstractPlatform $columnArray['comment'] = $this->getColumnComment($column); $queryParts[] = 'CHANGE ' . $oldColumnName . ' ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } //espo: END + } + + if (isset($diff->addedIndexes['primary'])) { + $keyColumns = array_unique(array_values($diff->addedIndexes['primary']->getColumns())); + $queryParts[] = 'ADD PRIMARY KEY (' . implode(', ', $keyColumns) . ')'; + unset($diff->addedIndexes['primary']); + } $sql = array(); $tableSql = array(); if ( ! $this->onSchemaAlterTable($diff, $tableSql)) { if (count($queryParts) > 0) { - $sql[] = 'ALTER TABLE ' . $this->espoQuote($diff->name) . ' ' . implode(", ", $queryParts); + $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . implode(", ", $queryParts); } $sql = array_merge( $this->getPreAlterTableIndexForeignKeySQL($diff), @@ -585,17 +604,33 @@ class MySqlPlatform extends AbstractPlatform $table = $diff->name; foreach ($diff->removedIndexes as $remKey => $remIndex) { + // Dropping primary keys requires to unset autoincrement attribute on the particular column first. + if ($remIndex->isPrimary() && $diff->fromTable instanceof Table) { + foreach ($remIndex->getColumns() as $columnName) { + $column = $diff->fromTable->getColumn($columnName); + + if ($column->getAutoincrement() === true) { + $column->setAutoincrement(false); + + $sql[] = 'ALTER TABLE ' . $table . ' MODIFY ' . + $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + } + } + } foreach ($diff->addedIndexes as $addKey => $addIndex) { if ($remIndex->getColumns() == $addIndex->getColumns()) { - $type = ''; - if ($addIndex->isUnique()) { - $type = 'UNIQUE '; + $indexClause = 'INDEX ' . $addIndex->getName(); + + if ($addIndex->isPrimary()) { + $indexClause = 'PRIMARY KEY'; + } elseif ($addIndex->isUnique()) { + $indexClause = 'UNIQUE INDEX ' . $addIndex->getName(); } - $query = 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP INDEX ' . $remIndex->getName() . ', '; - $query .= 'ADD ' . $type . 'INDEX ' . $addIndex->getName(); + $query = 'ALTER TABLE ' . $table . ' DROP INDEX ' . $remIndex->getName() . ', '; + $query .= 'ADD ' . $indexClause; $query .= ' (' . $this->getIndexFieldDeclarationListSQL($addIndex->getQuotedColumns($this)) . ')'; $sql[] = $query; @@ -704,7 +739,7 @@ class MySqlPlatform extends AbstractPlatform return $this->getDropPrimaryKeySQL($table); } - return 'DROP INDEX ' . $indexName . ' ON ' . $this->espoQuote($table); + return 'DROP INDEX ' . $indexName . ' ON ' . $table; } /** @@ -714,7 +749,7 @@ class MySqlPlatform extends AbstractPlatform */ protected function getDropPrimaryKeySQL($table) { - return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP PRIMARY KEY'; + return 'ALTER TABLE ' . $table . ' DROP PRIMARY KEY'; } /** @@ -810,7 +845,7 @@ class MySqlPlatform extends AbstractPlatform throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); } - return 'DROP TEMPORARY TABLE ' . $this->espoQuote($table); + return 'DROP TEMPORARY TABLE ' . $table; } /** @@ -844,95 +879,4 @@ class MySqlPlatform extends AbstractPlatform return 'LONGBLOB'; } - - //ESPO: fix problem with quoting table name - public function espoQuote($name) - { - if ($name instanceof Table) { - $name = $name->getQuotedName($this); - } - - if (isset($name[0]) && $name[0] != '`') { - $name = $this->quoteIdentifier($name); - } - return $name; - } - - public function getCreateForeignKeySQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey, $table) - { - $query = 'ALTER TABLE ' . $this->espoQuote($table) . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey); - - return $query; - } - - public function getIndexDeclarationSQL($name, Index $index) - { - $columns = $index->getQuotedColumns($this); - - if (count($columns) === 0) { - throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); - } - - return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $this->espoQuote($name) . ' (' - . $this->getIndexFieldDeclarationListSQL($columns) - . ')'; - } - - public function getCreateIndexSQL(Index $index, $table) - { - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } - $name = $index->getQuotedName($this); - $columns = $index->getQuotedColumns($this); - - if (count($columns) == 0) { - throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); - } - - if ($index->isPrimary()) { - return $this->getCreatePrimaryKeySQL($index, $table); - } - - $query = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $this->espoQuote($table); - $query .= ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')'; - - return $query; - } - - public function getDropConstraintSQL($constraint, $table) - { - if ($constraint instanceof Constraint) { - $constraint = $constraint->getQuotedName($this); - } - - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } - - return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP CONSTRAINT ' . $constraint; - } - - public function getDropForeignKeySQL($foreignKey, $table) - { - if ($foreignKey instanceof ForeignKeyConstraint) { - $foreignKey = $foreignKey->getQuotedName($this); - } - - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } - - return 'ALTER TABLE ' . $this->espoQuote($table) . ' DROP FOREIGN KEY ' . $foreignKey; - } - - public function getCreatePrimaryKeySQL(Index $index, $table) - { - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } - - return 'ALTER TABLE ' . $this->espoQuote($table) . ' ADD PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index->getQuotedColumns($this)) . ')'; - } - //end: ESPO } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index eea1498c04..52ab64a0be 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -505,7 +505,8 @@ LEFT JOIN user_cons_columns r_cols AND cols.position = r_cols.position WHERE alc.constraint_name = cols.constraint_name AND alc.constraint_type = 'R' - AND alc.table_name = '".$table."'"; + AND alc.table_name = '".$table."' + ORDER BY alc.constraint_name ASC, cols.position ASC"; } /** @@ -613,7 +614,13 @@ LEFT JOIN user_cons_columns r_cols * Do not add query part if only comment has changed */ if ( ! ($columnHasChangedComment && count($columnDiff->changedProperties) === 1)) { - $fields[] = $column->getQuotedName($this). ' ' . $this->getColumnDeclarationSQL('', $column->toArray()); + $columnInfo = $column->toArray(); + + if ( ! $columnDiff->hasChanged('notnull')) { + $columnInfo['notnull'] = false; + } + + $fields[] = $column->getQuotedName($this) . ' ' . $this->getColumnDeclarationSQL('', $columnInfo); } if ($columnHasChangedComment) { diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index 2e161d34c1..acebdf47e2 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -418,10 +418,10 @@ class PostgreSqlPlatform extends AbstractPlatform continue; } - $oldColumnName = $columnDiff->oldColumnName; + $oldColumnName = $columnDiff->getOldColumnName()->getQuotedName($this); $column = $columnDiff->column; - if ($columnDiff->hasChanged('type')) { + if ($columnDiff->hasChanged('type') || $columnDiff->hasChanged('precision') || $columnDiff->hasChanged('scale')) { $type = $column->getType(); // here was a server version check before, but DBAL API does not support this anymore. @@ -430,7 +430,10 @@ class PostgreSqlPlatform extends AbstractPlatform } if ($columnDiff->hasChanged('default')) { - $query = 'ALTER ' . $oldColumnName . ' SET ' . $this->getDefaultValueDeclarationSQL($column->toArray()); + $defaultClause = null === $column->getDefault() + ? ' DROP DEFAULT' + : ' SET' . $this->getDefaultValueDeclarationSQL($column->toArray()); + $query = 'ALTER ' . $oldColumnName . $defaultClause; $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; } @@ -484,7 +487,7 @@ class PostgreSqlPlatform extends AbstractPlatform $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME TO ' . $diff->newName; } - $sql = array_merge($sql, $this->_getAlterTableIndexForeignKeySQL($diff), $commentsSQL); + $sql = array_merge($this->getPreAlterTableIndexForeignKeySQL($diff), $sql, $this->getPostAlterTableIndexForeignKeySQL($diff), $commentsSQL); } return array_merge($sql, $tableSql, $columnSql); diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php index c9af278c75..d93b92178f 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php @@ -202,10 +202,8 @@ class SQLServerPlatform extends AbstractPlatform $column['notnull'] = true; } - /** - * Build default constraints SQL statements - */ - if ( ! empty($column['default']) || is_numeric($column['default'])) { + // Build default constraints SQL statements. + if (isset($column['default'])) { $defaultConstraintsSql[] = 'ALTER TABLE ' . $tableName . ' ADD' . $this->getDefaultConstraintDeclarationSQL($tableName, $column); } @@ -276,7 +274,7 @@ class SQLServerPlatform extends AbstractPlatform */ public function getDefaultConstraintDeclarationSQL($table, array $column) { - if (empty($column['default']) && ! is_numeric($column['default'])) { + if ( ! isset($column['default'])) { throw new \InvalidArgumentException("Incomplete column definition. 'default' required."); } @@ -369,7 +367,7 @@ class SQLServerPlatform extends AbstractPlatform $columnDef = $column->toArray(); $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnDef); - if ( ! empty($columnDef['default']) || is_numeric($columnDef['default'])) { + if (isset($columnDef['default'])) { $columnDef['name'] = $column->getQuotedName($this); $queryParts[] = 'ADD' . $this->getDefaultConstraintDeclarationSQL($diff->name, $columnDef); } @@ -400,7 +398,7 @@ class SQLServerPlatform extends AbstractPlatform * if default value has changed and another * default constraint already exists for the column. */ - if ($columnDefaultHasChanged && ( ! empty($fromColumnDefault) || is_numeric($fromColumnDefault))) { + if ($columnDefaultHasChanged && null !== $fromColumnDefault) { $queryParts[] = 'DROP CONSTRAINT ' . $this->generateDefaultConstraintName($diff->name, $columnDiff->oldColumnName); } @@ -408,7 +406,7 @@ class SQLServerPlatform extends AbstractPlatform $queryParts[] = 'ALTER COLUMN ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnDef); - if ($columnDefaultHasChanged && (! empty($columnDef['default']) || is_numeric($columnDef['default']))) { + if ($columnDefaultHasChanged && isset($columnDef['default'])) { $columnDef['name'] = $column->getQuotedName($this); $queryParts[] = 'ADD' . $this->getDefaultConstraintDeclarationSQL($diff->name, $columnDef); } @@ -427,7 +425,7 @@ class SQLServerPlatform extends AbstractPlatform * Drop existing default constraint for the old column name * if column has default value. */ - if ( ! empty($columnDef['default']) || is_numeric($columnDef['default'])) { + if (isset($columnDef['default'])) { $queryParts[] = 'DROP CONSTRAINT ' . $this->generateDefaultConstraintName($diff->name, $oldColumnName); } @@ -438,7 +436,7 @@ class SQLServerPlatform extends AbstractPlatform /** * Readd default constraint for the new column name. */ - if ( ! empty($columnDef['default']) || is_numeric($columnDef['default'])) { + if (isset($columnDef['default'])) { $columnDef['name'] = $column->getQuotedName($this); $queryParts[] = 'ADD' . $this->getDefaultConstraintDeclarationSQL($diff->name, $columnDef); } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index 66221342c1..ac3e3f425c 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -543,7 +543,6 @@ class SqlitePlatform extends AbstractPlatform 'decimal' => 'decimal', 'numeric' => 'decimal', 'blob' => 'blob', - 'integer unsigned' => 'integer', ); } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php index 512408da30..cd1e0c7795 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php @@ -19,8 +19,6 @@ namespace Doctrine\DBAL; -use Doctrine\DBAL\Connection; - /** * Utility class that parses sql statements with regard to types and parameters. * @@ -34,8 +32,9 @@ class SQLParserUtils const NAMED_TOKEN = '(?_unique = (bool)$unique; - - return $this; - } - /** * @param mixed $default * @@ -504,7 +487,6 @@ class Column extends AbstractAsset 'fixed' => $this->_fixed, 'unsigned' => $this->_unsigned, 'autoincrement' => $this->_autoincrement, - 'unique' => $this->_unique, //espo 'columnDefinition' => $this->_columnDefinition, 'comment' => $this->_comment, ), $this->_platformOptions, $this->_customSchemaOptions); diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php index 18068b0a6f..150f44e3fe 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php @@ -71,4 +71,12 @@ class ColumnDiff { return in_array($propertyName, $this->changedProperties); } + + /** + * @return \Doctrine\DBAL\Schema\Identifier + */ + public function getOldColumnName() + { + return new Identifier($this->oldColumnName); + } } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php index ae2e16c65a..e4a01d3f29 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php @@ -322,11 +322,11 @@ class Comparator */ public function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstraint $key2) { - if (array_map('strtolower', $key1->getLocalColumns()) != array_map('strtolower', $key2->getLocalColumns())) { + if (array_map('strtolower', $key1->getUnquotedLocalColumns()) != array_map('strtolower', $key2->getUnquotedLocalColumns())) { return true; } - if (array_map('strtolower', $key1->getForeignColumns()) != array_map('strtolower', $key2->getForeignColumns())) { + if (array_map('strtolower', $key1->getUnquotedForeignColumns()) != array_map('strtolower', $key2->getUnquotedForeignColumns())) { return true; } @@ -360,23 +360,22 @@ class Comparator { $changedProperties = array(); if ( $column1->getType() != $column2->getType() ) { - - //espo: fix problem with executing query for custom types - $column1DbTypeName = method_exists($column1->getType(), 'getDbTypeName') ? $column1->getType()->getDbTypeName() : $column1->getType()->getName(); - $column2DbTypeName = method_exists($column2->getType(), 'getDbTypeName') ? $column2->getType()->getDbTypeName() : $column2->getType()->getName(); - - if (strtolower($column1DbTypeName) != strtolower($column2DbTypeName)) { - $changedProperties[] = 'type'; - } - //$changedProperties[] = 'type'; - //END: espo + $changedProperties[] = 'type'; } if ($column1->getNotnull() != $column2->getNotnull()) { $changedProperties[] = 'notnull'; } - if ($column1->getDefault() != $column2->getDefault()) { + $column1Default = $column1->getDefault(); + $column2Default = $column2->getDefault(); + + if ($column1Default != $column2Default || + // Null values need to be checked additionally as they tell whether to create or drop a default value. + // null != 0, null != false, null != '' etc. This affects platform's table alteration SQL generation. + (null === $column1Default && null !== $column2Default) || + (null === $column2Default && null !== $column1Default) + ) { $changedProperties[] = 'default'; } diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php index cffd40e067..fa97898377 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php @@ -41,7 +41,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager $options = array( 'notnull' => !(bool)$tableColumn['IS_NULLABLE'], 'length' => (int)$tableColumn['CHARACTER_MAXIMUM_LENGTH'], - 'default' => empty($tableColumn['COLUMN_DEFAULT']) ? null : $tableColumn['COLUMN_DEFAULT'], + 'default' => isset($tableColumn['COLUMN_DEFAULT']) ? $tableColumn['COLUMN_DEFAULT'] : null, 'autoincrement' => (bool)$tableColumn['IS_AUTO_INCREMENT'], 'scale' => (int)$tableColumn['NUMERIC_SCALE'], 'precision' => (int)$tableColumn['NUMERIC_PRECISION'], diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php index 9eac562ec8..7999cb5e12 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php @@ -163,6 +163,26 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint return $columns; } + /** + * Returns unquoted representation of local table column names for comparison with other FK + * + * @return array + */ + public function getUnquotedLocalColumns() + { + return array_map(array($this, 'trimQuotes'), $this->getLocalColumns()); + } + + /** + * Returns unquoted representation of foreign table column names for comparison with other FK + * + * @return array + */ + public function getUnquotedForeignColumns() + { + return array_map(array($this, 'trimQuotes'), $this->getForeignColumns()); + } + /** * {@inheritdoc} * diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php index 7fd306439d..f37bcf81bd 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php @@ -113,10 +113,16 @@ class OracleSchemaManager extends AbstractSchemaManager $tableColumn['column_name'] = ''; } - if (stripos($tableColumn['data_default'], 'NULL') !== null) { + if ($tableColumn['data_default'] === 'NULL') { $tableColumn['data_default'] = null; } + if (null !== $tableColumn['data_default']) { + // Default values returned from database are enclosed in single quotes. + // Sometimes trailing spaces are also encountered. + $tableColumn['data_default'] = trim(trim($tableColumn['data_default']), "'"); + } + $precision = null; $scale = null; diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php index f6955074fa..ba593791b3 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php @@ -343,6 +343,14 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager break; case 'bool': case 'boolean': + if ($tableColumn['default'] === 'true') { + $tableColumn['default'] = true; + } + + if ($tableColumn['default'] === 'false') { + $tableColumn['default'] = false; + } + $length = null; break; case 'text': diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php index e67f41df07..a30fafbe44 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php @@ -244,16 +244,22 @@ class SqliteSchemaManager extends AbstractSchemaManager */ protected function _getPortableTableColumnDefinition($tableColumn) { - $e = explode('(', $tableColumn['type']); - $tableColumn['type'] = $e[0]; - if (isset($e[1])) { - $length = trim($e[1], ')'); + $parts = explode('(', $tableColumn['type']); + $tableColumn['type'] = $parts[0]; + if (isset($parts[1])) { + $length = trim($parts[1], ')'); $tableColumn['length'] = $length; } $dbType = strtolower($tableColumn['type']); $length = isset($tableColumn['length']) ? $tableColumn['length'] : null; - $unsigned = (boolean) isset($tableColumn['unsigned']) ? $tableColumn['unsigned'] : false; + $unsigned = false; + + if (strpos($dbType, ' unsigned') !== false) { + $dbType = str_replace(' unsigned', '', $dbType); + $unsigned = true; + } + $fixed = false; $type = $this->_platform->getDoctrineTypeMapping($dbType); $default = $tableColumn['dflt_value']; diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/JsonArrayType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/JsonArrayType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SimpleArrayType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SimpleArrayType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php index 5a94c1e874..1aa9fc8644 100644 --- a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php +++ b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php @@ -34,7 +34,7 @@ class Version /** * Current Doctrine Version. */ - const VERSION = '2.4.1'; + const VERSION = '2.4.2'; /** * Compares a Doctrine version with the current one. diff --git a/vendor/phpunit/phpunit/.gitignore b/vendor/phpunit/phpunit/.gitignore index 66eeede0b1..72fc6d5c9b 100644 --- a/vendor/phpunit/phpunit/.gitignore +++ b/vendor/phpunit/phpunit/.gitignore @@ -11,6 +11,7 @@ Tests/TextUI/*.exp Tests/TextUI/*.log Tests/TextUI/*.out Tests/TextUI/*.php +/bin /vendor /composer.lock /composer.phar diff --git a/vendor/phpunit/phpunit/.travis.yml b/vendor/phpunit/phpunit/.travis.yml index e0696e42eb..426a13f8f7 100644 --- a/vendor/phpunit/phpunit/.travis.yml +++ b/vendor/phpunit/phpunit/.travis.yml @@ -3,6 +3,7 @@ language: php php: - 5.3 - 5.4 + - hhvm env: - INSTALL_PHP_INVOKER=0 @@ -13,6 +14,10 @@ before_script: script: ./phpunit.php --configuration ./build/travis-ci.xml +matrix: + allow_failures: + - php: hhvm + notifications: email: false irc: diff --git a/vendor/phpunit/phpunit/CONTRIBUTING.md b/vendor/phpunit/phpunit/CONTRIBUTING.md index 156d2f092d..f36534527c 100644 --- a/vendor/phpunit/phpunit/CONTRIBUTING.md +++ b/vendor/phpunit/phpunit/CONTRIBUTING.md @@ -1,55 +1,29 @@ Contributing to PHPUnit ======================= -Contributions to PHPUnit, its related modules, and its documentation are always welcome. You make our lifes easier by sending us your contributions through GitHub pull requests. +Contributions to PHPUnit, its related modules, and its documentation are always welcome. You make our lives easier by sending us your contributions through GitHub pull requests. -Please note that the `3.6.` branch is closed for features and that pull requests should to be based on `master` or the `3.7.` once it exists. +Pull requests for bug fixes must be based on the current stable branch whereas pull requests for new features must be based on `master`. -We are trying to keep backwards compatibility breaks in PHPUnit 3.7 to an absolute minimum so please take this into account when proposing changes. +We are trying to keep backwards compatibility breaks in PHPUnit to an absolute minimum. Please take this into account when proposing changes. Due to time constraints, we are not always able to respond as quickly as we would like. Please do not take delays personal and feel free to remind us here or on IRC if you feel that we forgot to respond. Using PHPUnit From a Git Checkout --------------------------------- -The following commands can be used to perform the initial checkout of PHPUnit and its dependencies from Git: +The following commands can be used to perform the initial checkout of PHPUnit: - mkdir phpunit && cd phpunit git clone git://github.com/sebastianbergmann/phpunit.git - git clone git://github.com/sebastianbergmann/dbunit.git - git clone git://github.com/sebastianbergmann/php-file-iterator.git - git clone git://github.com/sebastianbergmann/php-text-template.git - git clone git://github.com/sebastianbergmann/php-code-coverage.git - git clone git://github.com/sebastianbergmann/php-token-stream.git - git clone git://github.com/sebastianbergmann/php-timer.git - git clone git://github.com/sebastianbergmann/phpunit-mock-objects.git - git clone git://github.com/sebastianbergmann/phpunit-selenium.git - git clone git://github.com/sebastianbergmann/phpunit-story.git - git clone git://github.com/sebastianbergmann/php-invoker.git + cd phpunit -The `dbunit`, `php-code-coverage`, `php-file-iterator`, `php-text-template`, `php-timer`, `php-token-stream`, `phpunit`, `phpunit-mock-objects`, `phpunit-selenium`, `phpunit-story`, and `php-invoker` directories need to be added to the `include_path`. +To retrieve PHPUnit's dependencies, you can use [Composer](http://getcomposer.org/download/). If you do not have Composer installed, you can download the latest PHAR with the following command: -In addition to the checkouts listed above, the YAML component that is provided by the Symfony project is required: + curl -O http://getcomposer.org/composer.phar - pear install pear.symfony.com/Yaml +Once Composer is installed, you can fetch PHPUnit's dependencies with the following command: -The `phpunit/phpunit.php` script can be used to invoke the PHPUnit test runner. + php composer.phar install --dev -Running the test suite(s) -------------------------- +The `phpunit.php` script can be used to invoke the PHPUnit test runner. -It is not possible to use a system-wide installed version of PHPUnit to run the test suite of a Git checkout. Because of that is is necessary to change the `include_paths` as described below. - -This can be achieved with a small wrapper script designed to work with every module in the PHPUnit stack. - -Note that you might have to change the path to your PEAR installation here pointing to `/usr/local/lib/php`. You can find it using `pear config-show | grep php_dir`. - -### Linux / MacOS X - - #!/bin/bash - php -d include_path='.:../phpunit/:../dbunit/:../php-code-coverage/:../php-file-iterator/:../php-invoker/:../php-text-template/:../php-timer:../php-token-stream:../phpunit-mock-objects/:../phpunit-selenium/:../phpunit-story/:/usr/local/lib/php' ../phpunit/phpunit.php $* - -### Windows - - @echo off - php -d include_path='.;../phpunit/;../dbunit/;../php-code-coverage/;../php-file-iterator/;../php-invoker/;../php-text-template/;../php-timer;../php-token-stream;../phpunit-mock-objects/;../phpunit-selenium/;../phpunit-story/;C:/Program Files/PHP/pear' ../phpunit/phpunit.php %* diff --git a/vendor/phpunit/phpunit/LICENSE b/vendor/phpunit/phpunit/LICENSE index 7501237f63..05aaf21cbb 100644 --- a/vendor/phpunit/phpunit/LICENSE +++ b/vendor/phpunit/phpunit/LICENSE @@ -1,6 +1,6 @@ PHPUnit -Copyright (c) 2002-2013, Sebastian Bergmann . +Copyright (c) 2001-2013, Sebastian Bergmann . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/phpunit/phpunit/PHPUnit/Autoload.php b/vendor/phpunit/phpunit/PHPUnit/Autoload.php index f1bd633a26..16e3184b6a 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Autoload.php +++ b/vendor/phpunit/phpunit/PHPUnit/Autoload.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Autoload.php.in b/vendor/phpunit/phpunit/PHPUnit/Autoload.php.in index 2072e7678b..cfcb4aacb9 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Autoload.php.in +++ b/vendor/phpunit/phpunit/PHPUnit/Autoload.php.in @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php b/vendor/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php index c66112bec0..d79b5da755 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php +++ b/vendor/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Extensions * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -58,7 +58,7 @@ * @package PHPUnit * @subpackage Extensions * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php b/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php index 61784bec30..057eee28b0 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php +++ b/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Extensions_PhptTestCase * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.4 @@ -55,7 +55,7 @@ if (stream_resolve_include_path('PEAR/RunTest.php')) { * @package PHPUnit * @subpackage Extensions_PhptTestCase * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.4 diff --git a/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php b/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php index f8eda20c1b..34a0795fa9 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php +++ b/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestCase/Logger.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Extensions_PhptTestCase * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.4 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Extensions_PhptTestCase * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.4 diff --git a/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php b/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php index e07227e1e8..179f2a83f9 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php +++ b/vendor/phpunit/phpunit/PHPUnit/Extensions/PhptTestSuite.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Extensions_PhptTestCase * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.4 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Extensions_PhptTestCase * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.4 diff --git a/vendor/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php b/vendor/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php index ab661a688e..5cc6baeab1 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php +++ b/vendor/phpunit/phpunit/PHPUnit/Extensions/RepeatedTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -47,7 +47,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php b/vendor/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php index 37fb9d16ce..0c954d2449 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php +++ b/vendor/phpunit/phpunit/PHPUnit/Extensions/TestDecorator.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Extensions * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -53,7 +53,7 @@ * @package PHPUnit * @subpackage Extensions * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php b/vendor/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php index d7d468a43f..fd8683e2c5 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php +++ b/vendor/phpunit/phpunit/PHPUnit/Extensions/TicketListener.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,7 @@ * @author Sean Coates * @author Raphael Stolt * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -52,7 +52,7 @@ * @subpackage Extensions_TicketListener * @author Sean Coates * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php index e6f8dceb5e..1c7ee1bd48 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php index 27d13b5946..2500a5aa30 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php.in b/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php.in index 6063abafa3..3e98243f47 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php.in +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Assert/Functions.php.in @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php b/vendor/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php index 77728e029e..27ca6c9258 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/AssertionFailedError.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator.php index 2cdc21c070..51f656995b 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php index ebbf928afd..eca8e24774 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php index 620834a94c..562b8fbcc2 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/DOMDocument.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php index 6c1f406000..91e8146fe3 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Double.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php index 0315495307..ca2db603e1 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Exception.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php index 4ae8bdf842..3dcbeeabaf 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/MockObject.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php index 63c2847d83..4e922ec07b 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -50,7 +50,7 @@ * @subpackage Framework_Comparator * @author Bernhard Schussek * @author Alexander - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php index 8e564730ad..baad5c788b 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php index 440fd7e8db..58a969248f 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php index 451341d0e7..a3b159b6e8 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php index e2ecd39294..aebb7cfec4 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/SplObjectStorage.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php index 7e6e59c74a..7efc5b99d5 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Type.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Comparator * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php b/vendor/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php index 2aa7be5cf1..059ff08ab1 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/ComparatorFactory.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php b/vendor/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php index 7d8f128af2..27e0f97105 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/ComparisonFailure.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -51,7 +51,7 @@ * @subpackage Framework * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php index ab239b1090..6081c7829c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -51,7 +51,7 @@ * @subpackage Framework * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Interface available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php index 4948fe2356..6333d3f7b1 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/And.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php index e6f3faf15e..955e72637e 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ArrayHasKey.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -56,7 +56,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 @@ -85,7 +85,15 @@ class PHPUnit_Framework_Constraint_ArrayHasKey extends PHPUnit_Framework_Constra */ protected function matches($other) { - return array_key_exists($this->key, $other); + if (is_array($other)) { + return array_key_exists($this->key, $other); + } + + if ($other instanceof ArrayAccess) { + return $other->offsetExists($this->key); + } + + return FALSE; } /** diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php index fefcd2798f..a03033735f 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Attribute.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php index 57226ba0fb..7d181f28c0 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Callback.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2002-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2002-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ */ @@ -49,7 +49,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Timon Rapp - * @copyright 2002-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ */ diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php index 5fa5411c57..748a7b2616 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasAttribute.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.0 @@ -54,7 +54,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php index 2c57675760..20404ff6c8 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ClassHasStaticAttribute.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.0 @@ -54,7 +54,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php index d2fdac56e1..84395167c6 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Composite.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php index 5fde27cfe1..976ce54349 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Count.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php index 2957f0ee60..34be58b31c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Exception.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.6 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.6 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php index a588c4e145..11858b77a4 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionCode.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.6 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.6 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php index ec84bff1bc..54121be2a9 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ExceptionMessage.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.6 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.6 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php index fc57f5c3c1..1c673573f8 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/FileExists.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -53,7 +53,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php index 1842710f1d..1c3903e48c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/GreaterThan.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -52,7 +52,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php index 47ae576dc9..9d8f35e7d0 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsAnything.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php index c03cc2457e..49ed23815d 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEmpty.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.5.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php index 2b1c162250..5855f9e02e 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsEqual.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,7 @@ * @author Kore Nordmann * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -59,7 +59,7 @@ * @author Kore Nordmann * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php index 2a2b593435..85a36e85ac 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsFalse.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php index a06dfc001e..0cc1223554 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsIdentical.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -59,7 +59,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php index 363594ac78..183251f413 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsInstanceOf.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -54,7 +54,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php index c75d093436..4a4ae0d34f 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsJson.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.7.20 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.7.20 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php index 07f99d363f..7ecdd9482f 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsNull.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php index aa9ae60cfc..726402d17e 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsTrue.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php index 0d26a68889..658811a668 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/IsType.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -54,7 +54,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php index 426af9ec83..eb5cb86145 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2002-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Bastian Feder - * @copyright 2002-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause * @link http://www.phpunit.de/ * @since File available since Release 3.7.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Bastian Feder - * @copyright 2011 Bastian Feder + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause * @link http://www.phpunit.de/ * @since Class available since Release 3.7.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php index fe6e16a4cb..158bec5723 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/JsonMatches/ErrorMessageProvider.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2002-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Bastian Feder - * @copyright 2002-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause * @link http://www.phpunit.de/ * @since File available since Release 3.7.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_Constraint * @author Bastian Feder - * @copyright 2011 Bastian Feder + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause * @link http://www.phpunit.de/ * @since Class available since Release 3.7.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php index adac4250c5..402080c9a8 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/LessThan.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -52,7 +52,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php index fbf1a5a0f2..2d408e7cc2 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Not.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php index 48dd1fce81..4590af1da1 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -54,7 +54,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php index cb56f5fa1d..c55088e2bf 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Or.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php index 0120396e6c..95037c59d9 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/PCREMatch.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -57,7 +57,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php index 32ce8bef3b..f0a478aec4 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/SameSize.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php index 6cc94122ee..8e7ffae846 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringContains.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -57,7 +57,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php index 9b4380825b..9e8d6cc029 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringEndsWith.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -52,7 +52,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php index 5d9a4171ef..f01781fe45 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringMatches.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.5.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php index 6e2cda3238..e9a798ee80 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/StringStartsWith.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -52,7 +52,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php index a0c6966483..aa00b2dc3e 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContains.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -52,7 +52,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php index b905823e9c..4de46b4d3c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/TraversableContainsOnly.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.4 @@ -52,7 +52,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.4 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php index 98ac48ed21..33a3427324 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/Xor.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -51,7 +51,7 @@ * @subpackage Framework_Constraint * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Error.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Error.php index c286f5edbb..c599e18d2e 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Error.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Error.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.2.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.2.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php index 9ca841bfeb..3bb7fd738c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Deprecated.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Error * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -54,7 +54,7 @@ * @package PHPUnit * @subpackage Framework_Error * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php index a6c53e8c51..f0bc1177e8 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Notice.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Error * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -54,7 +54,7 @@ * @package PHPUnit * @subpackage Framework_Error * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php index 0e7c09743f..3a6999089a 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Error/Warning.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_Error * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -54,7 +54,7 @@ * @package PHPUnit * @subpackage Framework_Error * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Exception.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Exception.php index cad14f777b..79172e493e 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Exception.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Exception.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php b/vendor/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php index 7d1e50af72..cdb48cbba3 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/ExpectationFailedException.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -53,7 +53,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php b/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php index 1603e04e10..ed92f8a2b4 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Interface available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php b/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php index 37ef30cc35..838b9858b4 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/IncompleteTestError.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/OutputError.php b/vendor/phpunit/phpunit/PHPUnit/Framework/OutputError.php index b33014a85e..e198887b96 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/OutputError.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/OutputError.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php b/vendor/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php index 8661b33cd8..033ae85ac9 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/SelfDescribing.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Interface available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php b/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php index dd9b3762a5..fa75648e63 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Interface available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php b/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php index aa3cab3814..1f75c7bd49 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestError.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php b/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php index eec1b3f4af..7e8added81 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/SkippedTestSuiteError.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php b/vendor/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php index f69361e229..0bf0152173 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/SyntheticError.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.5.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Test.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Test.php index 2907270720..d77af35941 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Test.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Test.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Interface available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php b/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php index ebd5f579ca..f7a59ab6f6 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -90,7 +90,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 @@ -388,7 +388,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple } /** - * @return string + * @return boolean * @since Method available since Release 3.6.0 */ public function hasOutput() @@ -1299,14 +1299,17 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple /** * Returns a mock object for the specified class. * - * @param string $originalClassName - * @param array $methods - * @param array $arguments - * @param string $mockClassName - * @param boolean $callOriginalConstructor - * @param boolean $callOriginalClone - * @param boolean $callAutoload - * @param boolean $cloneArguments + * @param string $originalClassName Name of the class to mock. + * @param array|null $methods When provided, only methods whose names are in the array + * are replaced with a configurable test double. The behavior + * of the other methods is not changed. + * Providing null means that no methods will be replaced. + * @param array $arguments Parameters to pass to the original class' constructor. + * @param string $mockClassName Class name for the generated test double class. + * @param boolean $callOriginalConstructor Can be used to disable the call to the original class' constructor. + * @param boolean $callOriginalClone Can be used to disable the call to the original class' clone constructor. + * @param boolean $callAutoload Can be used to disable __autoload() during the generation of the test double class. + * @param boolean $cloneArguments * @return PHPUnit_Framework_MockObject_MockObject * @throws PHPUnit_Framework_Exception * @since Method available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/TestFailure.php b/vendor/phpunit/phpunit/PHPUnit/Framework/TestFailure.php index 6774c7524f..5a76437e54 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/TestFailure.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/TestFailure.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/TestListener.php b/vendor/phpunit/phpunit/PHPUnit/Framework/TestListener.php index e64ef24c47..033d11fa76 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/TestListener.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/TestListener.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Interface available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php b/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php index 8e0c49e36a..47ae3a1623 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php b/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php index 70e4eb54f9..8109115cb4 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -74,7 +74,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php b/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php index b0ebf10e1e..a8e28a9472 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite/DataProvider.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework_TestSuite * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework_TestSuite * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Framework/Warning.php b/vendor/phpunit/phpunit/PHPUnit/Framework/Warning.php index b2516e7b4e..ddd62f7f84 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Framework/Warning.php +++ b/vendor/phpunit/phpunit/PHPUnit/Framework/Warning.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Framework * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php b/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php index d6663f6ac1..2d13c2f9a6 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php +++ b/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Runner * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Runner * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php b/vendor/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php index eef656cd8a..970be98c6c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php +++ b/vendor/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Runner * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Runner * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php b/vendor/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php index 43d6a5d461..8567ffbae0 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php +++ b/vendor/phpunit/phpunit/PHPUnit/Runner/TestSuiteLoader.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Runner * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Runner * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Interface available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php b/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php index 8709390543..20642045cd 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php +++ b/vendor/phpunit/phpunit/PHPUnit/Runner/Version.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Runner * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,14 +49,14 @@ * @package PHPUnit * @subpackage Runner * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 */ class PHPUnit_Runner_Version { - const VERSION = '3.7.28'; + const VERSION = '3.7.29'; protected static $version; /** diff --git a/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php b/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php index 6c11130da6..ba80cb2790 100644 --- a/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php +++ b/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage TextUI * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage TextUI * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php b/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php index 13cca92730..4a29e9152a 100644 --- a/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php +++ b/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage TextUI * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage TextUI * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php b/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php index ca4ceb0a91..7de80b6dbf 100644 --- a/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php +++ b/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage TextUI * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage TextUI * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Class.php b/vendor/phpunit/phpunit/PHPUnit/Util/Class.php index 20500692ad..af4f133b20 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Class.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Class.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Configuration.php b/vendor/phpunit/phpunit/PHPUnit/Util/Configuration.php index 8b52e3abfb..8405922d73 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Configuration.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Configuration.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.2.0 @@ -168,7 +168,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.2.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php b/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php index ee3f0329d3..e6b694e84c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2002-2010, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework * @author Ralph Schindler * @author Sebastian Bergmann - * @copyright 2002-2010 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.7 @@ -51,7 +51,7 @@ * @subpackage Framework * @author Ralph Schindler * @author Sebastian Bergmann - * @copyright 2002-2010 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Interface available since Release 3.5.7 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php b/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php index 721bdffec6..d04dc2c010 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/DeprecatedFeature/Logger.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2002-2010, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Framework * @author Ralph Schindler * @author Sebastian Bergmann - * @copyright 2002-2010 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.7 @@ -51,7 +51,7 @@ * @subpackage Framework * @author Ralph Schindler * @author Sebastian Bergmann - * @copyright 2002-2010 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.5.7 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Diff.php b/vendor/phpunit/phpunit/PHPUnit/Util/Diff.php index e2c70529b0..d370f6897a 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Diff.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Diff.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @subpackage Util * @author Sebastian Bergmann * @author Kore Nordmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -51,7 +51,7 @@ * @subpackage Util * @author Sebastian Bergmann * @author Kore Nordmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php b/vendor/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php index 2b419a6e3f..be311b0429 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/ErrorHandler.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -56,7 +56,7 @@ require_once __DIR__ . '/../Framework/Error/Deprecated.php'; * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php b/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php index 0c5d216144..94c3321f77 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.3.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Filesystem.php b/vendor/phpunit/phpunit/PHPUnit/Util/Filesystem.php index 63b60457b9..d5f8feefaf 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Filesystem.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Filesystem.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Filter.php b/vendor/phpunit/phpunit/PHPUnit/Util/Filter.php index f6dd7e4949..6d8ca8589c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Filter.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Filter.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 @@ -107,7 +107,7 @@ class PHPUnit_Util_Filter foreach ($eTrace as $frame) { if (isset($frame['file']) && is_file($frame['file']) && !isset($blacklist[$frame['file']]) && - strpos($frame['file'], $prefix) !== 0 && + ($prefix === FALSE || strpos($frame['file'], $prefix) !== 0) && $frame['file'] !== $script) { if ($asString === TRUE) { $filteredStacktrace .= sprintf( diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Getopt.php b/vendor/phpunit/phpunit/PHPUnit/Util/Getopt.php index be8682308e..41ec26c02d 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Getopt.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Getopt.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -50,7 +50,7 @@ * @subpackage Util * @author Andrei Zmievski * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php b/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php index 4697c9dec8..7065a0d748 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php b/vendor/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php index 7848b82510..64ec4a26f5 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/InvalidArgumentHelper.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Log/JSON.php b/vendor/phpunit/phpunit/PHPUnit/Util/Log/JSON.php index ed6491c88a..a0cafb18a7 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Log/JSON.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Log/JSON.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util_Log * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util_Log * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 @@ -223,7 +223,8 @@ class PHPUnit_Util_Log_JSON extends PHPUnit_Util_Printer implements PHPUnit_Fram protected function writeCase($status, $time, array $trace = array(), $message = '', $test = NULL) { $output = ''; - if ($test !== NULL && $test->hasOutput()) { + // take care of TestSuite producing error (e.g. by running into exception) as TestSuite doesn't have hasOutput + if ($test !== NULL && method_exists($test, 'hasOutput') && $test->hasOutput()) { $output = $test->getActualOutput(); } $this->write( diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php b/vendor/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php index 54085e2da4..2ec8d95927 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util_Log * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -51,7 +51,7 @@ * @package PHPUnit * @subpackage Util_Log * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php b/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php index b2050cda53..1fd6051562 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util_Log * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -50,7 +50,7 @@ * @package PHPUnit * @subpackage Util_Log * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/PHP.php b/vendor/phpunit/phpunit/PHPUnit/Util/PHP.php index f6cb338bbe..27b7f3790f 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/PHP.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/PHP.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.4.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.4.0 @@ -92,7 +92,10 @@ abstract class PHPUnit_Util_PHP protected function getPhpBinary() { if ($this->phpBinary === NULL) { - if (defined("PHP_BINARY")) { + if (($e = getenv("PHP_BINARY")) !== false) { + $this->phpBinary = $e; + } + else if (defined("PHP_BINARY")) { $this->phpBinary = PHP_BINARY; } else if (PHP_SAPI == 'cli' && isset($_SERVER['_'])) { if (strpos($_SERVER['_'], 'phpunit') !== FALSE) { diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Default.php b/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Default.php index c8b53a7937..4c956dc093 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Default.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Default.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.12 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.5.12 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php b/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php index 058f10d25f..a32153e559 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/PHP/Windows.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.12 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.5.12 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Printer.php b/vendor/phpunit/phpunit/PHPUnit/Util/Printer.php index ec66afb929..810c1e1aed 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Printer.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Printer.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/String.php b/vendor/phpunit/phpunit/PHPUnit/Util/String.php index 38d934aaf6..4208e39a9c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/String.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/String.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Test.php b/vendor/phpunit/phpunit/PHPUnit/Util/Test.php index 819060cdb5..98392a5164 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Test.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Test.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php b/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php index 2be7934fbd..509165645c 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/NamePrettifier.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util_TestDox * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util_TestDox * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php b/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php index 9e28b71e4a..28f5edada7 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util_TestDox * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util_TestDox * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php b/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php index 0325ae25a1..38e0b3ab58 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/HTML.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util_TestDox * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util_TestDox * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php b/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php index 56c60e8a5e..b5cfbce307 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/TestDox/ResultPrinter/Text.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util_TestDox * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util_TestDox * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php b/vendor/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php index 82cc74d095..4e7cf89957 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/TestSuiteIterator.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.1.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.1.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/Type.php b/vendor/phpunit/phpunit/PHPUnit/Util/Type.php index f162f33060..10f0e81dc2 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/Type.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/Type.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/PHPUnit/Util/XML.php b/vendor/phpunit/phpunit/PHPUnit/Util/XML.php index 3016312e52..567f749e13 100644 --- a/vendor/phpunit/phpunit/PHPUnit/Util/XML.php +++ b/vendor/phpunit/phpunit/PHPUnit/Util/XML.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.2.0 @@ -49,7 +49,7 @@ * @package PHPUnit * @subpackage Util * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.2.0 diff --git a/vendor/phpunit/phpunit/README.md b/vendor/phpunit/phpunit/README.md index cce2782733..0a72070622 100644 --- a/vendor/phpunit/phpunit/README.md +++ b/vendor/phpunit/phpunit/README.md @@ -1,19 +1,14 @@ # PHPUnit -PHPUnit is the de-facto standard for unit testing in PHP projects. It provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results. +PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks. +[![Latest Stable Version](https://poser.pugx.org/phpunit/phpunit/v/stable.png)](https://packagist.org/packages/phpunit/phpunit) [![Build Status](https://travis-ci.org/sebastianbergmann/phpunit.png?branch=3.7)](https://travis-ci.org/sebastianbergmann/phpunit) - -## Requirements - -* PHPUnit 3.7 requires PHP 5.3.3 (or later) but PHP 5.4.6 (or later) is highly recommended. -* [PHP_CodeCoverage](http://github.com/sebastianbergmann/php-code-coverage), the library that is used by PHPUnit to collect and process code coverage information, depends on [Xdebug](http://xdebug.org/) 2.0.5 (or later) but Xdebug 2.2.1 (or later) is highly recommended. +[![Dependency Status](https://www.versioneye.com/php/phpunit:phpunit/3.7.28/badge.png)](https://www.versioneye.com/php/phpunit:phpunit/3.7.28) ## Installation -### PHP Archive (PHAR) - -The easiest way to obtain PHPUnit is to download a [PHP Archive (PHAR)](http://php.net/phar) that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file: +We distribute a [PHP Archive (PHAR)](http://php.net/phar) that has all required (as well as some optional) dependencies of PHPUnit bundled in a single file: wget https://phar.phpunit.de/phpunit.phar chmod +x phpunit.phar @@ -24,62 +19,13 @@ You can also immediately use the PHAR after you have downloaded it, of course: wget https://phar.phpunit.de/phpunit.phar php phpunit.phar -### Composer +Alternatively, you may use [Composer](http://getcomposer.org/) or the [PEAR Installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php) to download and install PHPUnit as well as its dependencies. Please refer to the [documentation](http://phpunit.de/documentation.html) for details on how to do this. -Simply add a dependency on `phpunit/phpunit` to your project's `composer.json` file if you use [Composer](http://getcomposer.org/) to manage the dependencies of your project. Here is a minimal example of a `composer.json` file that just defines a development-time dependency on PHPUnit 3.7: +## Contribute - { - "require-dev": { - "phpunit/phpunit": "3.7.*" - } - } +Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. -For a system-wide installation via Composer, you can run: - - composer global require 'phpunit/phpunit=3.7.*' - -Make sure you have `~/.composer/vendor/bin/` in your path. - -### PEAR Installer - -The following two commands (which you may have to run as `root`) are all that is required to install PHPUnit using the PEAR Installer: - - pear config-set auto_discover 1 - pear install pear.phpunit.de/PHPUnit - -## Documentation - -The documentation for PHPUnit is available in different formats: - -* [English, multiple HTML files](http://www.phpunit.de/manual/3.7/en/index.html) -* [English, single HTML file](http://www.phpunit.de/manual/3.7/en/phpunit-book.html) -* [English, PDF](http://www.phpunit.de/manual/3.7/en/phpunit-book.pdf) -* [English, ePub](http://www.phpunit.de/manual/3.7/en/phpunit-book.epub) -* [Brazilian Portuguese, multiple HTML files](http://www.phpunit.de/manual/3.7/pt_br/index.html) -* [Brazilian Portuguese, single HTML file](http://www.phpunit.de/manual/3.7/pt_br/phpunit-book.html) -* [Brazilian Portuguese, PDF](http://www.phpunit.de/manual/3.7/pt_br/phpunit-book.pdf) -* [Brazilian Portuguese, ePub](http://www.phpunit.de/manual/3.7/pt_br/phpunit-book.epub) -* [French, multiple HTML files](http://www.phpunit.de/manual/3.7/fr/index.html) -* [French, single HTML file](http://www.phpunit.de/manual/3.7/fr/phpunit-book.html) -* [French, PDF](http://www.phpunit.de/manual/3.7/fr/phpunit-book.pdf) -* [French, ePub](http://www.phpunit.de/manual/3.7/fr/phpunit-book.epub) -* [Japanese, multiple HTML files](http://www.phpunit.de/manual/3.7/ja/index.html) -* [Japanese, single HTML file](http://www.phpunit.de/manual/3.7/ja/phpunit-book.html) -* [Japanese, PDF](http://www.phpunit.de/manual/3.7/ja/phpunit-book.pdf) -* [Japanese, ePub](http://www.phpunit.de/manual/3.7/ja/phpunit-book.epub) -* [Simplified Chinese, multiple HTML files](http://www.phpunit.de/manual/3.7/zh_cn/index.html) -* [Simplified Chinese, single HTML file](http://www.phpunit.de/manual/3.7/zh_cn/phpunit-book.html) -* [Simplified Chinese, PDF](http://www.phpunit.de/manual/3.7/zh_cn/phpunit-book.pdf) -* [Simplified Chinese, ePub](http://www.phpunit.de/manual/3.7/zh_cn/phpunit-book.epub) - -## Mailing Lists - -* [dev@phpunit.de](mailto:dev-subscribe@phpunit.de) is a list for those who want to help out with the development of PHPUnit -* [user@phpunit.de](mailto:user-subscribe@phpunit.de) is a list for general PHPUnit support; ask PHPUnit questions here - -## IRC - -The [#phpunit channel on the Freenode IRC network](irc://irc.freenode.net/phpunit) is a place to chat about PHPUnit. +The development of PHPUnit is discussed on the [dev@phpunit.de](mailto:dev-subscribe@phpunit.de) mailing list as well as on the [#phpunit channel on the Freenode IRC network](irc://irc.freenode.net/phpunit). ## List of Contributors @@ -93,4 +39,3 @@ A very special thanks to everyone who has contributed to the documentation and h * [PHPUnit Documentation](https://github.com/sebastianbergmann/phpunit-documentation/graphs/contributors) -Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. diff --git a/vendor/phpunit/phpunit/Tests/Extensions/RepeatedTestTest.php b/vendor/phpunit/phpunit/Tests/Extensions/RepeatedTestTest.php index 2646f3dd2c..b48f1122a1 100644 --- a/vendor/phpunit/phpunit/Tests/Extensions/RepeatedTestTest.php +++ b/vendor/phpunit/phpunit/Tests/Extensions/RepeatedTestTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -49,7 +49,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/Tests/Framework/Assert/FunctionsTest.php b/vendor/phpunit/phpunit/Tests/Framework/Assert/FunctionsTest.php index 2903e49b32..0177d29bdb 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/Assert/FunctionsTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/Assert/FunctionsTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Kuzuha SHINODA - * @copyright 2013-2013 Kuzuha SHINODA + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.7.20 @@ -49,7 +49,7 @@ require_once dirname(dirname(dirname(__DIR__))) . '/PHPUnit/Framework/Assert/Fun * * @package PHPUnit * @author Kuzuha SHINODA - * @copyright 2013-2013 Kuzuha SHINODA + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.7.20 diff --git a/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php b/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php index a85818edf4..093db1230c 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -50,6 +50,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Author.php'; require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Book.php'; require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithToString.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'SampleArrayAccess.php'; /** * @@ -57,7 +58,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR * @package PHPUnit * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 @@ -268,7 +269,7 @@ class Framework_AssertTest extends PHPUnit_Framework_TestCase /** * @covers PHPUnit_Framework_Assert::assertArrayHasKey */ - public function testAssertArrayHasKeyAcceptsArrayAccessValue() + public function testAssertArrayHasKeyAcceptsArrayObjectValue() { $array = new ArrayObject(); $array['foo'] = 'bar'; @@ -279,13 +280,34 @@ class Framework_AssertTest extends PHPUnit_Framework_TestCase * @covers PHPUnit_Framework_Assert::assertArrayHasKey * @expectedException PHPUnit_Framework_AssertionFailedError */ - public function testAssertArrayHasKeyProperlyFailsWithArrayAccessValue() + public function testAssertArrayHasKeyProperlyFailsWithArrayObjectValue() { $array = new ArrayObject(); $array['bar'] = 'bar'; $this->assertArrayHasKey('foo', $array); } + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + */ + public function testAssertArrayHasKeyAcceptsArrayAccessValue() + { + $array = new SampleArrayAccess(); + $array['foo'] = 'bar'; + $this->assertArrayHasKey('foo', $array); + } + + /** + * @covers PHPUnit_Framework_Assert::assertArrayHasKey + * @expectedException PHPUnit_Framework_AssertionFailedError + */ + public function testAssertArrayHasKeyProperlyFailsWithArrayAccessValue() + { + $array = new SampleArrayAccess(); + $array['bar'] = 'bar'; + $this->assertArrayHasKey('foo', $array); + } + /** * @covers PHPUnit_Framework_Assert::assertArrayNotHasKey */ diff --git a/vendor/phpunit/phpunit/Tests/Framework/ComparatorTest.php b/vendor/phpunit/phpunit/Tests/Framework/ComparatorTest.php index c5c1dbb969..8cf65300e8 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/ComparatorTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/ComparatorTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -52,7 +52,7 @@ class TestClassComparator extends PHPUnit_Framework_Comparator_Object {} * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php b/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php index 1990ddce28..b0fee9ed46 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2002-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Bastian Feder - * @copyright 2002-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause * @link http://www.phpunit.de/ * @since File available since Release 3.7.0 @@ -45,7 +45,7 @@ /** * @package PHPUnit * @author Bastian Feder - * @copyright 2011-2013 Bastian Feder + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause * @link http://www.phpunit.de/ * @since File available since Release 3.7.0 diff --git a/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatchesTest.php b/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatchesTest.php index 402675666b..dedadd6a3a 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatchesTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/Constraint/JsonMatchesTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2002-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Bastian Feder - * @copyright 2002-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause * @link http://www.phpunit.de/ * @since File available since Release 3.7.0 @@ -45,7 +45,7 @@ /** * @package PHPUnit * @author Bastian Feder - * @copyright 2011 Bastian Feder + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause * @link http://www.phpunit.de/ * @since File available since Release 3.7.0 diff --git a/vendor/phpunit/phpunit/Tests/Framework/ConstraintTest.php b/vendor/phpunit/phpunit/Tests/Framework/ConstraintTest.php index 3f0375a645..40813e32cc 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/ConstraintTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/ConstraintTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.0.0 @@ -52,7 +52,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR * @package PHPUnit * @author Sebastian Bergmann * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.0.0 diff --git a/vendor/phpunit/phpunit/Tests/Framework/SuiteTest.php b/vendor/phpunit/phpunit/Tests/Framework/SuiteTest.php index 5b61f7338f..8f0dc7d810 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/SuiteTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/SuiteTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -55,7 +55,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/Tests/Framework/TestCaseTest.php b/vendor/phpunit/phpunit/Tests/Framework/TestCaseTest.php index 5bbd04a93e..417d57cb18 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/TestCaseTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/TestCaseTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -74,7 +74,7 @@ $GLOBALS['i'] = 'i'; * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/Tests/Framework/TestFailureTest.php b/vendor/phpunit/phpunit/Tests/Framework/TestFailureTest.php index 1257100dff..ba9b28d4aa 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/TestFailureTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/TestFailureTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.7.20 @@ -47,7 +47,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.7.20 @@ -65,4 +65,4 @@ class Framework_TestFailureTest extends PHPUnit_Framework_TestCase $this->assertEquals(__METHOD__ . ': message', $failure->toString()); } -} \ No newline at end of file +} diff --git a/vendor/phpunit/phpunit/Tests/Framework/TestImplementorTest.php b/vendor/phpunit/phpunit/Tests/Framework/TestImplementorTest.php index 4f8d9e1f5a..aab21f6a64 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/TestImplementorTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/TestImplementorTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -50,7 +50,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/Tests/Framework/TestListenerTest.php b/vendor/phpunit/phpunit/Tests/Framework/TestListenerTest.php index c242aff3e2..df2c1ead0c 100644 --- a/vendor/phpunit/phpunit/Tests/Framework/TestListenerTest.php +++ b/vendor/phpunit/phpunit/Tests/Framework/TestListenerTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -51,7 +51,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/phpunit322.xml b/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/phpunit322.xml index 5a95002f22..e3b2948393 100644 --- a/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/phpunit322.xml +++ b/vendor/phpunit/phpunit/Tests/Regression/GitHub/322/phpunit322.xml @@ -8,4 +8,4 @@ one - \ No newline at end of file + diff --git a/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/Issue74Test.php b/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/Issue74Test.php index 4d68c5519e..72f35928a9 100644 --- a/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/Issue74Test.php +++ b/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/Issue74Test.php @@ -6,4 +6,4 @@ class Issue74Test extends PHPUnit_Framework_TestCase require_once __DIR__ . '/NewException.php'; throw new NewException('Testing GH-74'); } -} \ No newline at end of file +} diff --git a/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/NewException.php b/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/NewException.php index e81c0b5a58..abe2f7119a 100644 --- a/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/NewException.php +++ b/vendor/phpunit/phpunit/Tests/Regression/GitHub/74/NewException.php @@ -1,4 +1,4 @@ . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.0.0 @@ -50,7 +50,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.0.0 diff --git a/vendor/phpunit/phpunit/Tests/Util/ClassTest.php b/vendor/phpunit/phpunit/Tests/Util/ClassTest.php index 9b0f3ccafe..b77eb31b10 100644 --- a/vendor/phpunit/phpunit/Tests/Util/ClassTest.php +++ b/vendor/phpunit/phpunit/Tests/Util/ClassTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * @package PHPUnit * @author Sebastian Bergmann * @author Ben Selby - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.5.6 @@ -53,7 +53,7 @@ require_once 'PHPUnit/Util/Class.php'; * @package PHPUnit * @author Sebastian Bergmann * @author Ben Selby - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.5.6 diff --git a/vendor/phpunit/phpunit/Tests/Util/ConfigurationTest.php b/vendor/phpunit/phpunit/Tests/Util/ConfigurationTest.php index 7726496ef4..ad017cece4 100644 --- a/vendor/phpunit/phpunit/Tests/Util/ConfigurationTest.php +++ b/vendor/phpunit/phpunit/Tests/Util/ConfigurationTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -47,7 +47,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/Tests/Util/DiffTest.php b/vendor/phpunit/phpunit/Tests/Util/DiffTest.php index 92b0cf00c3..408ff61039 100644 --- a/vendor/phpunit/phpunit/Tests/Util/DiffTest.php +++ b/vendor/phpunit/phpunit/Tests/Util/DiffTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -47,7 +47,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/Tests/Util/TestDox/NamePrettifierTest.php b/vendor/phpunit/phpunit/Tests/Util/TestDox/NamePrettifierTest.php index f87ff769c9..1c1c4242ce 100644 --- a/vendor/phpunit/phpunit/Tests/Util/TestDox/NamePrettifierTest.php +++ b/vendor/phpunit/phpunit/Tests/Util/TestDox/NamePrettifierTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -47,7 +47,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.1.0 diff --git a/vendor/phpunit/phpunit/Tests/Util/TestTest.php b/vendor/phpunit/phpunit/Tests/Util/TestTest.php index f57e4e7226..75508f1fc2 100644 --- a/vendor/phpunit/phpunit/Tests/Util/TestTest.php +++ b/vendor/phpunit/phpunit/Tests/Util/TestTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.6 @@ -52,7 +52,7 @@ require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPAR * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.6 diff --git a/vendor/phpunit/phpunit/Tests/Util/TypeTest.php b/vendor/phpunit/phpunit/Tests/Util/TypeTest.php index 7a7056ef43..1c47a6cf77 100644 --- a/vendor/phpunit/phpunit/Tests/Util/TypeTest.php +++ b/vendor/phpunit/phpunit/Tests/Util/TypeTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -51,7 +51,7 @@ require_once 'PHPUnit/Util/Type.php'; * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/Tests/Util/XMLTest.php b/vendor/phpunit/phpunit/Tests/Util/XMLTest.php index e9e003960b..a41854273a 100644 --- a/vendor/phpunit/phpunit/Tests/Util/XMLTest.php +++ b/vendor/phpunit/phpunit/Tests/Util/XMLTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ * @author Mike Naberezny * @author Derek DeVries * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.3.0 @@ -51,7 +51,7 @@ * @author Mike Naberezny * @author Derek DeVries * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.3.0 diff --git a/vendor/phpunit/phpunit/Tests/_files/Author.php b/vendor/phpunit/phpunit/Tests/_files/Author.php index 426d5db662..54c67cde7c 100644 --- a/vendor/phpunit/phpunit/Tests/_files/Author.php +++ b/vendor/phpunit/phpunit/Tests/_files/Author.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -47,7 +47,7 @@ * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 @@ -63,4 +63,4 @@ class Author { $this->name = $name; } -} \ No newline at end of file +} diff --git a/vendor/phpunit/phpunit/Tests/_files/BankAccount.php b/vendor/phpunit/phpunit/Tests/_files/BankAccount.php index 2560dd2359..e35831c36f 100644 --- a/vendor/phpunit/phpunit/Tests/_files/BankAccount.php +++ b/vendor/phpunit/phpunit/Tests/_files/BankAccount.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -49,7 +49,7 @@ class BankAccountException extends RuntimeException {} * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.3.0 diff --git a/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php b/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php index f4cfd783e0..ba965c9e55 100644 --- a/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php +++ b/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -50,7 +50,7 @@ require_once 'BankAccount.php'; * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.3.0 diff --git a/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.test.php b/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.test.php index 18bda4ff44..c33a2928ea 100644 --- a/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.test.php +++ b/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.test.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2002-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2002-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 2.3.0 @@ -50,7 +50,7 @@ require_once 'BankAccount.php'; * * @package PHPUnit * @author Sebastian Bergmann - * @copyright 2002-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 2.3.0 diff --git a/vendor/phpunit/phpunit/Tests/_files/Book.php b/vendor/phpunit/phpunit/Tests/_files/Book.php index b515a6ca5b..d96890207b 100644 --- a/vendor/phpunit/phpunit/Tests/_files/Book.php +++ b/vendor/phpunit/phpunit/Tests/_files/Book.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -47,7 +47,7 @@ * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 diff --git a/vendor/phpunit/phpunit/Tests/_files/ClassWithToString.php b/vendor/phpunit/phpunit/Tests/_files/ClassWithToString.php index cfd4fd099a..4481abec5e 100644 --- a/vendor/phpunit/phpunit/Tests/_files/ClassWithToString.php +++ b/vendor/phpunit/phpunit/Tests/_files/ClassWithToString.php @@ -2,7 +2,7 @@ /** * PHPUnit * - * Copyright (c) 2001-2013, Sebastian Bergmann . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,7 @@ * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since File available since Release 3.6.0 @@ -47,7 +47,7 @@ * * @package PHPUnit * @author Bernhard Schussek - * @copyright 2001-2013 Sebastian Bergmann + * @copyright 2001-2014 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://www.phpunit.de/ * @since Class available since Release 3.6.0 @@ -58,4 +58,4 @@ class ClassWithToString { return 'string representation'; } -} \ No newline at end of file +} diff --git a/vendor/phpunit/phpunit/Tests/_files/SampleArrayAccess.php b/vendor/phpunit/phpunit/Tests/_files/SampleArrayAccess.php new file mode 100644 index 0000000000..0d97d7803d --- /dev/null +++ b/vendor/phpunit/phpunit/Tests/_files/SampleArrayAccess.php @@ -0,0 +1,32 @@ +container = array(); + } + public function offsetSet($offset, $value) { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + public function offsetExists($offset) { + return isset($this->container[$offset]); + } + public function offsetUnset($offset) { + unset($this->container[$offset]); + } + public function offsetGet($offset) { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } +} diff --git a/vendor/phpunit/phpunit/build.xml b/vendor/phpunit/phpunit/build.xml index d7a3a1e7a1..790b2d2de2 100644 --- a/vendor/phpunit/phpunit/build.xml +++ b/vendor/phpunit/phpunit/build.xml @@ -4,23 +4,7 @@ - - - - - - - - - - - - - - + depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpdox"/> @@ -83,6 +67,8 @@ + + @@ -155,16 +141,9 @@ - - - - - - - - - + + . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/vendor/phpunit/phpunit/package.xml b/vendor/phpunit/phpunit/package.xml index 49ad43f93f..14decb05d7 100644 --- a/vendor/phpunit/phpunit/package.xml +++ b/vendor/phpunit/phpunit/package.xml @@ -17,9 +17,9 @@ sebastian@phpunit.de yes - 2013-10-17 + 2014-01-15 - 3.7.28 + 3.7.29 3.7.0 diff --git a/vendor/phpunit/phpunit/phpdox.xml.dist b/vendor/phpunit/phpunit/phpdox.xml.dist index b6312210ba..929fd68b5f 100644 --- a/vendor/phpunit/phpunit/phpdox.xml.dist +++ b/vendor/phpunit/phpunit/phpdox.xml.dist @@ -1,6 +1,5 @@ - - + @@ -8,9 +7,18 @@ + + + + + + + + + diff --git a/vendor/phpunit/phpunit/phpunit.bat b/vendor/phpunit/phpunit/phpunit.bat index 29208ec8eb..63e720094f 100644 --- a/vendor/phpunit/phpunit/phpunit.bat +++ b/vendor/phpunit/phpunit/phpunit.bat @@ -1,7 +1,7 @@ @echo off REM PHPUnit REM -REM Copyright (c) 2002-2010, Sebastian Bergmann . +REM Copyright (c) 2001-2014, Sebastian Bergmann . REM All rights reserved. REM REM Redistribution and use in source and binary forms, with or without diff --git a/vendor/phpunit/phpunit/phpunit.php b/vendor/phpunit/phpunit/phpunit.php old mode 100644 new mode 100755 index e3ecc8622e..688ffd8d3b --- a/vendor/phpunit/phpunit/phpunit.php +++ b/vendor/phpunit/phpunit/phpunit.php @@ -2,7 +2,7 @@ . + * Copyright (c) 2001-2014, Sebastian Bergmann . * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/vendor/symfony/console/Symfony/Component/Console/Application.php b/vendor/symfony/console/Symfony/Component/Console/Application.php index 6806f06b11..fcfa48fe8a 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Application.php +++ b/vendor/symfony/console/Symfony/Component/Console/Application.php @@ -1038,7 +1038,8 @@ class Application } /** - * Finds alternative of $name among $collection + * Finds alternative of $name among $collection, + * if nothing is found in $collection, try in $abbrevs * * @param string $name The string * @param array|Traversable $collection The collection diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php index 20382d0166..570b601234 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php @@ -337,7 +337,7 @@ class DialogHelper extends InputAwareHelper { $that = $this; - $interviewer = function() use ($output, $question, $default, $autocomplete, $that) { + $interviewer = function () use ($output, $question, $default, $autocomplete, $that) { return $that->ask($output, $question, $default, $autocomplete); }; @@ -367,7 +367,7 @@ class DialogHelper extends InputAwareHelper { $that = $this; - $interviewer = function() use ($output, $question, $fallback, $that) { + $interviewer = function () use ($output, $question, $fallback, $that) { return $that->askHiddenResponse($output, $question, $fallback); }; @@ -405,7 +405,7 @@ class DialogHelper extends InputAwareHelper } /** - * Return a valid unix shell + * Return a valid Unix shell * * @return string|Boolean The valid shell name, false in case no valid shell is found */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php index e1b1e149a1..d6ad0e9e01 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php @@ -161,6 +161,29 @@ class TableHelper extends Helper { $this->rows[] = array_values($row); + $keys = array_keys($this->rows); + $rowKey = array_pop($keys); + + foreach ($row as $key => $cellValue) { + if (!strstr($cellValue, "\n")) { + continue; + } + + $lines = explode("\n", $cellValue); + $this->rows[$rowKey][$key] = $lines[0]; + unset($lines[0]); + + foreach ($lines as $lineKey => $line) { + $nextRowKey = $rowKey + $lineKey + 1; + + if (isset($this->rows[$nextRowKey])) { + $this->rows[$nextRowKey][$key] = $line; + } else { + $this->rows[$nextRowKey] = array($key => $line); + } + } + } + return $this; } @@ -404,6 +427,8 @@ class TableHelper extends Helper $width += strlen($cell) - mb_strlen($cell, $encoding); } + $width += $this->strlen($cell) - $this->computeLengthWithoutDecoration($cell); + $content = sprintf($this->cellRowContentFormat, $cell); $this->output->write(sprintf($cellFormat, str_pad($content, $width, $this->paddingChar, $this->padType))); @@ -461,15 +486,7 @@ class TableHelper extends Helper */ private function getCellWidth(array $row, $column) { - if ($column < 0) { - return 0; - } - - if (isset($row[$column])) { - return $this->strlen($row[$column]); - } - - return $this->getCellWidth($row, $column - 1); + return isset($row[$column]) ? $this->computeLengthWithoutDecoration($row[$column]) : 0; } /** @@ -481,6 +498,18 @@ class TableHelper extends Helper $this->numberOfColumns = null; } + private function computeLengthWithoutDecoration($string) + { + $formatter = $this->output->getFormatter(); + $isDecorated = $formatter->isDecorated(); + $formatter->setDecorated(false); + + $string = $formatter->format($string); + $formatter->setDecorated($isDecorated); + + return $this->strlen($string); + } + /** * {@inheritDoc} */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php b/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php index 6dad744606..b305ab0005 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php +++ b/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Console\Output; use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; /** * ConsoleOutput is the default class for all CLI output. It uses STDOUT. diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php b/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php index c63bd157be..5eb4fc7acd 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php +++ b/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Console\Output; -use Symfony\Component\Console\Output\OutputInterface; - /** * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. * This adds information about stderr output stream. diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php b/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php index 09a5ca38b6..4194ed3d1e 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php +++ b/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php @@ -89,7 +89,7 @@ class StreamOutput extends Output * * Colorization is disabled if not supported by the stream: * - * - windows without ansicon and ConEmu + * - Windows without Ansicon and ConEmu * - non tty consoles * * @return Boolean true if the stream supports colorization, false otherwise diff --git a/vendor/symfony/console/Symfony/Component/Console/Shell.php b/vendor/symfony/console/Symfony/Component/Console/Shell.php index 5ddbd27536..3ea11dc371 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Shell.php +++ b/vendor/symfony/console/Symfony/Component/Console/Shell.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Console; -use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\StringInput; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Process\ProcessBuilder; @@ -104,7 +103,7 @@ EOF ; $output = $this->output; - $process->run(function($type, $data) use ($output) { + $process->run(function ($type, $data) use ($output) { $output->writeln($data); }); diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php index 08bd02e852..e8e4d61e35 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php @@ -14,7 +14,7 @@ namespace Symfony\Component\Console\Tests\Formatter; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Formatter\OutputFormatterStyle; -class FormatterStyleTest extends \PHPUnit_Framework_TestCase +class OutputFormatterTest extends \PHPUnit_Framework_TestCase { public function testEmptyTag() { diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php index 7b21e4913c..5364f38cab 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php @@ -157,7 +157,7 @@ class DialogHelperTest extends \PHPUnit_Framework_TestCase } } - public function testNoInteration() + public function testNoInteraction() { $dialog = new DialogHelper(); diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php index 0c9629aa90..f3cda0dabf 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php @@ -172,6 +172,31 @@ TABLE | 80-902734-1-6 | And Then There Were None | Agatha Christie | +---------------+--------------------------+------------------+ +TABLE + ), + array( + array('ISBN', 'Title', 'Author'), + array( + array("99921-58-10-7", "Divine\nComedy", "Dante Alighieri"), + array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), + array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), + array("960-425-059-0", "The Lord of the Rings", "J. R. R.\nTolkien"), + ), + TableHelper::LAYOUT_DEFAULT, +<< array( + array('ISBN', 'Title', 'Author'), + array( + array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), + array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), + ), + TableHelper::LAYOUT_DEFAULT, +<<
array( + array('ISBN', 'Title', 'Author'), + array( + array('99921-58-10-700', 'Divine Com', 'Dante Alighieri'), + array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), + ), + TableHelper::LAYOUT_DEFAULT, +<<
99921-58-10-700 | Divine Com | Dante Alighieri | +| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | ++----------------------------------+----------------------+-----------------+ + +TABLE + ), ); } diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php index 7409ebfe2c..3576e9ae6f 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php @@ -2,6 +2,7 @@ /* * This file is part of the Symfony package. + * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php index 45978a1255..45efced3c8 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php @@ -2,6 +2,7 @@ /* * This file is part of the Symfony package. + * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php index d852cbf9bc..e8fe91848e 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php @@ -2,6 +2,7 @@ /* * This file is part of the Symfony package. + * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php index ac3a576b67..1b8eeed57a 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php @@ -2,6 +2,7 @@ /* * This file is part of the Symfony package. + * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE @@ -48,7 +49,7 @@ class Unescaper public function unescapeDoubleQuotedString($value) { $self = $this; - $callback = function($match) use ($self) { + $callback = function ($match) use ($self) { return $self->unescapeCharacter($match[0]); }; diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/BlockCipher.php b/vendor/zendframework/zend-crypt/Zend/Crypt/BlockCipher.php new file mode 100644 index 0000000000..25d2ab5367 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/BlockCipher.php @@ -0,0 +1,446 @@ +cipher = $cipher; + } + + /** + * Factory. + * + * @param string $adapter + * @param array $options + * @return BlockCipher + */ + public static function factory($adapter, $options = array()) + { + $plugins = static::getSymmetricPluginManager(); + $adapter = $plugins->get($adapter, (array) $options); + + return new static($adapter); + } + + /** + * Returns the symmetric cipher plugin manager. If it doesn't exist it's created. + * + * @return SymmetricPluginManager + */ + public static function getSymmetricPluginManager() + { + if (static::$symmetricPlugins === null) { + static::setSymmetricPluginManager(new SymmetricPluginManager()); + } + + return static::$symmetricPlugins; + } + + /** + * Set the symmetric cipher plugin manager + * + * @param string|SymmetricPluginManager $plugins + * @throws Exception\InvalidArgumentException + */ + public static function setSymmetricPluginManager($plugins) + { + if (is_string($plugins)) { + if (!class_exists($plugins)) { + throw new Exception\InvalidArgumentException(sprintf( + 'Unable to locate symmetric cipher plugins using class "%s"; class does not exist', + $plugins + )); + } + $plugins = new $plugins(); + } + if (!$plugins instanceof SymmetricPluginManager) { + throw new Exception\InvalidArgumentException(sprintf( + 'Expected an instance or extension of %s\SymmetricPluginManager; received "%s"', + __NAMESPACE__, + (is_object($plugins) ? get_class($plugins) : gettype($plugins)) + )); + } + static::$symmetricPlugins = $plugins; + } + + /** + * Set the symmetric cipher + * + * @param SymmetricInterface $cipher + * @return BlockCipher + */ + public function setCipher(SymmetricInterface $cipher) + { + $this->cipher = $cipher; + return $this; + } + + /** + * Get symmetric cipher + * + * @return SymmetricInterface + */ + public function getCipher() + { + return $this->cipher; + } + + /** + * Set the number of iterations for Pbkdf2 + * + * @param int $num + * @return BlockCipher + */ + public function setKeyIteration($num) + { + $this->keyIteration = (int) $num; + + return $this; + } + + /** + * Get the number of iterations for Pbkdf2 + * + * @return int + */ + public function getKeyIteration() + { + return $this->keyIteration; + } + + /** + * Set the salt (IV) + * + * @param string $salt + * @return BlockCipher + * @throws Exception\InvalidArgumentException + */ + public function setSalt($salt) + { + try { + $this->cipher->setSalt($salt); + } catch (Symmetric\Exception\InvalidArgumentException $e) { + throw new Exception\InvalidArgumentException("The salt is not valid: " . $e->getMessage()); + } + $this->saltSetted = true; + + return $this; + } + + /** + * Get the salt (IV) according to the size requested by the algorithm + * + * @return string + */ + public function getSalt() + { + return $this->cipher->getSalt(); + } + + /** + * Get the original salt value + * + * @return string + */ + public function getOriginalSalt() + { + return $this->cipher->getOriginalSalt(); + } + + /** + * Enable/disable the binary output + * + * @param bool $value + * @return BlockCipher + */ + public function setBinaryOutput($value) + { + $this->binaryOutput = (bool) $value; + + return $this; + } + + /** + * Get the value of binary output + * + * @return bool + */ + public function getBinaryOutput() + { + return $this->binaryOutput; + } + + /** + * Set the encryption/decryption key + * + * @param string $key + * @return BlockCipher + * @throws Exception\InvalidArgumentException + */ + public function setKey($key) + { + if (empty($key)) { + throw new Exception\InvalidArgumentException('The key cannot be empty'); + } + $this->key = $key; + + return $this; + } + + /** + * Get the key + * + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Set algorithm of the symmetric cipher + * + * @param string $algo + * @return BlockCipher + * @throws Exception\InvalidArgumentException + */ + public function setCipherAlgorithm($algo) + { + if (empty($this->cipher)) { + throw new Exception\InvalidArgumentException('No symmetric cipher specified'); + } + try { + $this->cipher->setAlgorithm($algo); + } catch (Symmetric\Exception\InvalidArgumentException $e) { + throw new Exception\InvalidArgumentException($e->getMessage()); + } + + return $this; + } + + /** + * Get the cipher algorithm + * + * @return string|bool + */ + public function getCipherAlgorithm() + { + if (!empty($this->cipher)) { + return $this->cipher->getAlgorithm(); + } + + return false; + } + + /** + * Get the supported algorithms of the symmetric cipher + * + * @return array + */ + public function getCipherSupportedAlgorithms() + { + if (!empty($this->cipher)) { + return $this->cipher->getSupportedAlgorithms(); + } + + return array(); + } + + /** + * Set the hash algorithm for HMAC authentication + * + * @param string $hash + * @return BlockCipher + * @throws Exception\InvalidArgumentException + */ + public function setHashAlgorithm($hash) + { + if (!Hash::isSupported($hash)) { + throw new Exception\InvalidArgumentException( + "The specified hash algorithm '{$hash}' is not supported by Zend\Crypt\Hash" + ); + } + $this->hash = $hash; + + return $this; + } + + /** + * Get the hash algorithm for HMAC authentication + * + * @return string + */ + public function getHashAlgorithm() + { + return $this->hash; + } + + /** + * Encrypt then authenticate using HMAC + * + * @param string $data + * @return string + * @throws Exception\InvalidArgumentException + */ + public function encrypt($data) + { + if (empty($data)) { + throw new Exception\InvalidArgumentException('The data to encrypt cannot be empty'); + } + if (empty($this->cipher)) { + throw new Exception\InvalidArgumentException('No symmetric cipher specified'); + } + if (empty($this->key)) { + throw new Exception\InvalidArgumentException('No key specified for the encryption'); + } + $keySize = $this->cipher->getKeySize(); + // generate a random salt (IV) if the salt has not been set + if (!$this->saltSetted) { + $this->cipher->setSalt(Rand::getBytes($this->cipher->getSaltSize(), true)); + } + // generate the encryption key and the HMAC key for the authentication + $hash = Pbkdf2::calc(self::KEY_DERIV_HMAC, + $this->getKey(), + $this->getSalt(), + $this->keyIteration, + $keySize * 2); + // set the encryption key + $this->cipher->setKey(substr($hash, 0, $keySize)); + // set the key for HMAC + $keyHmac = substr($hash, $keySize); + // encryption + $ciphertext = $this->cipher->encrypt($data); + // HMAC + $hmac = Hmac::compute($keyHmac, + $this->hash, + $this->cipher->getAlgorithm() . $ciphertext); + if (!$this->binaryOutput) { + $ciphertext = base64_encode($ciphertext); + } + + return $hmac . $ciphertext; + } + + /** + * Decrypt + * + * @param string $data + * @return string|bool + * @throws Exception\InvalidArgumentException + */ + public function decrypt($data) + { + if (!is_string($data)) { + throw new Exception\InvalidArgumentException('The data to decrypt must be a string'); + } + if ('' === $data) { + throw new Exception\InvalidArgumentException('The data to decrypt cannot be empty'); + } + if (empty($this->key)) { + throw new Exception\InvalidArgumentException('No key specified for the decryption'); + } + if (empty($this->cipher)) { + throw new Exception\InvalidArgumentException('No symmetric cipher specified'); + } + $hmacSize = Hmac::getOutputSize($this->hash); + $hmac = substr($data, 0, $hmacSize); + $ciphertext = substr($data, $hmacSize); + if (!$this->binaryOutput) { + $ciphertext = base64_decode($ciphertext); + } + $iv = substr($ciphertext, 0, $this->cipher->getSaltSize()); + $keySize = $this->cipher->getKeySize(); + // generate the encryption key and the HMAC key for the authentication + $hash = Pbkdf2::calc(self::KEY_DERIV_HMAC, + $this->getKey(), + $iv, + $this->keyIteration, + $keySize * 2); + // set the decryption key + $this->cipher->setKey(substr($hash, 0, $keySize)); + // set the key for HMAC + $keyHmac = substr($hash, $keySize); + $hmacNew = Hmac::compute($keyHmac, + $this->hash, + $this->cipher->getAlgorithm() . $ciphertext); + if (!Utils::compareStrings($hmacNew, $hmac)) { + return false; + } + + return $this->cipher->decrypt($ciphertext); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Exception/ExceptionInterface.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..eeecc5e5d1 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Exception/ExceptionInterface.php @@ -0,0 +1,14 @@ + MHASH_MD2, + 'md4' => MHASH_MD4, + 'md5' => MHASH_MD5, + 'sha1' => MHASH_SHA1, + 'sha224' => MHASH_SHA224, + 'sha256' => MHASH_SHA256, + 'sha384' => MHASH_SHA384, + 'sha512' => MHASH_SHA512, + 'ripemd128' => MHASH_RIPEMD128, + 'ripemd256' => MHASH_RIPEMD256, + 'ripemd320' => MHASH_RIPEMD320, + 'haval128,3' => MHASH_HAVAL128, + 'haval160,3' => MHASH_HAVAL160, + 'haval192,3' => MHASH_HAVAL192, + 'haval224,3' => MHASH_HAVAL224, + 'haval256,3' => MHASH_HAVAL256, + 'tiger128,3' => MHASH_TIGER128, + 'riger160,3' => MHASH_TIGER160, + 'whirpool' => MHASH_WHIRLPOOL, + 'snefru256' => MHASH_SNEFRU256, + 'gost' => MHASH_GOST, + 'crc32' => MHASH_CRC32, + 'crc32b' => MHASH_CRC32B + ); + + /** + * Generate the new key + * + * @param string $hash The hash algorithm to be used by HMAC + * @param string $password The source password/key + * @param int $bytes The output size in bytes + * @param string $salt The salt of the algorithm + * @throws Exception\InvalidArgumentException + * @return string + */ + public static function calc($hash, $password, $salt, $bytes) + { + if (!in_array($hash, array_keys(static::$supportedMhashAlgos))) { + throw new Exception\InvalidArgumentException("The hash algorihtm $hash is not supported by " . __CLASS__); + } + if (strlen($salt)<8) { + throw new Exception\InvalidArgumentException('The salt size must be at least of 8 bytes'); + } + return mhash_keygen_s2k(static::$supportedMhashAlgos[$hash], $password, $salt, $bytes); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Key/Derivation/Scrypt.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Key/Derivation/Scrypt.php new file mode 100644 index 0000000000..af04a4c9ae --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Key/Derivation/Scrypt.php @@ -0,0 +1,342 @@ + 0 and a power of 2"); + } + if ($n > PHP_INT_MAX / 128 / $r) { + throw new Exception\InvalidArgumentException("Parameter n is too large"); + } + if ($r > PHP_INT_MAX / 128 / $p) { + throw new Exception\InvalidArgumentException("Parameter r is too large"); + } + + if (extension_loaded('Scrypt')) { + if ($length < 16) { + throw new Exception\InvalidArgumentException("Key length is too low, must be greater or equal to 16"); + } + return self::hex2bin(scrypt($password, $salt, $n, $r, $p, $length)); + } + + $b = Pbkdf2::calc('sha256', $password, $salt, 1, $p * 128 * $r); + + $s = ''; + for ($i = 0; $i < $p; $i++) { + $s .= self::scryptROMix(substr($b, $i * 128 * $r, 128 * $r), $n, $r); + } + + return Pbkdf2::calc('sha256', $password, $s, 1, $length); + } + + /** + * scryptROMix + * + * @param string $b + * @param int $n + * @param int $r + * @return string + * @see https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-4 + */ + protected static function scryptROMix($b, $n, $r) + { + $x = $b; + $v = array(); + for ($i = 0; $i < $n; $i++) { + $v[$i] = $x; + $x = self::scryptBlockMix($x, $r); + } + for ($i = 0; $i < $n; $i++) { + $j = self::integerify($x) % $n; + $t = $x ^ $v[$j]; + $x = self::scryptBlockMix($t, $r); + } + return $x; + } + + /** + * scryptBlockMix + * + * @param string $b + * @param int $r + * @return string + * @see https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-3 + */ + protected static function scryptBlockMix($b, $r) + { + $x = substr($b, -64); + $even = ''; + $odd = ''; + $len = 2 * $r; + + for ($i = 0; $i < $len; $i++) { + if (PHP_INT_SIZE === 4) { + $x = self::salsa208Core32($x ^ substr($b, 64 * $i, 64)); + } else { + $x = self::salsa208Core64($x ^ substr($b, 64 * $i, 64)); + } + if ($i % 2 == 0) { + $even .= $x; + } else { + $odd .= $x; + } + } + return $even . $odd; + } + + /** + * Salsa 20/8 core (32 bit version) + * + * @param string $b + * @return string + * @see https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-2 + * @see http://cr.yp.to/salsa20.html + */ + protected static function salsa208Core32($b) + { + $b32 = array(); + for ($i = 0; $i < 16; $i++) { + list(, $b32[$i]) = unpack("V", substr($b, $i * 4, 4)); + } + + $x = $b32; + for ($i = 0; $i < 8; $i += 2) { + $a = ($x[ 0] + $x[12]); + $x[ 4] ^= ($a << 7) | ($a >> 25) & 0x7f; + $a = ($x[ 4] + $x[ 0]); + $x[ 8] ^= ($a << 9) | ($a >> 23) & 0x1ff; + $a = ($x[ 8] + $x[ 4]); + $x[12] ^= ($a << 13) | ($a >> 19) & 0x1fff; + $a = ($x[12] + $x[ 8]); + $x[ 0] ^= ($a << 18) | ($a >> 14) & 0x3ffff; + $a = ($x[ 5] + $x[ 1]); + $x[ 9] ^= ($a << 7) | ($a >> 25) & 0x7f; + $a = ($x[ 9] + $x[ 5]); + $x[13] ^= ($a << 9) | ($a >> 23) & 0x1ff; + $a = ($x[13] + $x[ 9]); + $x[ 1] ^= ($a << 13) | ($a >> 19) & 0x1fff; + $a = ($x[ 1] + $x[13]); + $x[ 5] ^= ($a << 18) | ($a >> 14) & 0x3ffff; + $a = ($x[10] + $x[ 6]); + $x[14] ^= ($a << 7) | ($a >> 25) & 0x7f; + $a = ($x[14] + $x[10]); + $x[ 2] ^= ($a << 9) | ($a >> 23) & 0x1ff; + $a = ($x[ 2] + $x[14]); + $x[ 6] ^= ($a << 13) | ($a >> 19) & 0x1fff; + $a = ($x[ 6] + $x[ 2]); + $x[10] ^= ($a << 18) | ($a >> 14) & 0x3ffff; + $a = ($x[15] + $x[11]); + $x[ 3] ^= ($a << 7) | ($a >> 25) & 0x7f; + $a = ($x[ 3] + $x[15]); + $x[ 7] ^= ($a << 9) | ($a >> 23) & 0x1ff; + $a = ($x[ 7] + $x[ 3]); + $x[11] ^= ($a << 13) | ($a >> 19) & 0x1fff; + $a = ($x[11] + $x[ 7]); + $x[15] ^= ($a << 18) | ($a >> 14) & 0x3ffff; + $a = ($x[ 0] + $x[ 3]); + $x[ 1] ^= ($a << 7) | ($a >> 25) & 0x7f; + $a = ($x[ 1] + $x[ 0]); + $x[ 2] ^= ($a << 9) | ($a >> 23) & 0x1ff; + $a = ($x[ 2] + $x[ 1]); + $x[ 3] ^= ($a << 13) | ($a >> 19) & 0x1fff; + $a = ($x[ 3] + $x[ 2]); + $x[ 0] ^= ($a << 18) | ($a >> 14) & 0x3ffff; + $a = ($x[ 5] + $x[ 4]); + $x[ 6] ^= ($a << 7) | ($a >> 25) & 0x7f; + $a = ($x[ 6] + $x[ 5]); + $x[ 7] ^= ($a << 9) | ($a >> 23) & 0x1ff; + $a = ($x[ 7] + $x[ 6]); + $x[ 4] ^= ($a << 13) | ($a >> 19) & 0x1fff; + $a = ($x[ 4] + $x[ 7]); + $x[ 5] ^= ($a << 18) | ($a >> 14) & 0x3ffff; + $a = ($x[10] + $x[ 9]); + $x[11] ^= ($a << 7) | ($a >> 25) & 0x7f; + $a = ($x[11] + $x[10]); + $x[ 8] ^= ($a << 9) | ($a >> 23) & 0x1ff; + $a = ($x[ 8] + $x[11]); + $x[ 9] ^= ($a << 13) | ($a >> 19) & 0x1fff; + $a = ($x[ 9] + $x[ 8]); + $x[10] ^= ($a << 18) | ($a >> 14) & 0x3ffff; + $a = ($x[15] + $x[14]); + $x[12] ^= ($a << 7) | ($a >> 25) & 0x7f; + $a = ($x[12] + $x[15]); + $x[13] ^= ($a << 9) | ($a >> 23) & 0x1ff; + $a = ($x[13] + $x[12]); + $x[14] ^= ($a << 13) | ($a >> 19) & 0x1fff; + $a = ($x[14] + $x[13]); + $x[15] ^= ($a << 18) | ($a >> 14) & 0x3ffff; + } + for ($i = 0; $i < 16; $i++) { + $b32[$i] = $b32[$i] + $x[$i]; + } + $result = ''; + for ($i = 0; $i < 16; $i++) { + $result .= pack("V", $b32[$i]); + } + + return $result; + } + + /** + * Salsa 20/8 core (64 bit version) + * + * @param string $b + * @return string + * @see https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-2 + * @see http://cr.yp.to/salsa20.html + */ + protected static function salsa208Core64($b) + { + $b32 = array(); + for ($i = 0; $i < 16; $i++) { + list(, $b32[$i]) = unpack("V", substr($b, $i * 4, 4)); + } + + $x = $b32; + for ($i = 0; $i < 8; $i += 2) { + $a = ($x[ 0] + $x[12]) & 0xffffffff; + $x[ 4] ^= ($a << 7) | ($a >> 25); + $a = ($x[ 4] + $x[ 0]) & 0xffffffff; + $x[ 8] ^= ($a << 9) | ($a >> 23); + $a = ($x[ 8] + $x[ 4]) & 0xffffffff; + $x[12] ^= ($a << 13) | ($a >> 19); + $a = ($x[12] + $x[ 8]) & 0xffffffff; + $x[ 0] ^= ($a << 18) | ($a >> 14); + $a = ($x[ 5] + $x[ 1]) & 0xffffffff; + $x[ 9] ^= ($a << 7) | ($a >> 25); + $a = ($x[ 9] + $x[ 5]) & 0xffffffff; + $x[13] ^= ($a << 9) | ($a >> 23); + $a = ($x[13] + $x[ 9]) & 0xffffffff; + $x[ 1] ^= ($a << 13) | ($a >> 19); + $a = ($x[ 1] + $x[13]) & 0xffffffff; + $x[ 5] ^= ($a << 18) | ($a >> 14); + $a = ($x[10] + $x[ 6]) & 0xffffffff; + $x[14] ^= ($a << 7) | ($a >> 25); + $a = ($x[14] + $x[10]) & 0xffffffff; + $x[ 2] ^= ($a << 9) | ($a >> 23); + $a = ($x[ 2] + $x[14]) & 0xffffffff; + $x[ 6] ^= ($a << 13) | ($a >> 19); + $a = ($x[ 6] + $x[ 2]) & 0xffffffff; + $x[10] ^= ($a << 18) | ($a >> 14); + $a = ($x[15] + $x[11]) & 0xffffffff; + $x[ 3] ^= ($a << 7) | ($a >> 25); + $a = ($x[ 3] + $x[15]) & 0xffffffff; + $x[ 7] ^= ($a << 9) | ($a >> 23); + $a = ($x[ 7] + $x[ 3]) & 0xffffffff; + $x[11] ^= ($a << 13) | ($a >> 19); + $a = ($x[11] + $x[ 7]) & 0xffffffff; + $x[15] ^= ($a << 18) | ($a >> 14); + $a = ($x[ 0] + $x[ 3]) & 0xffffffff; + $x[ 1] ^= ($a << 7) | ($a >> 25); + $a = ($x[ 1] + $x[ 0]) & 0xffffffff; + $x[ 2] ^= ($a << 9) | ($a >> 23); + $a = ($x[ 2] + $x[ 1]) & 0xffffffff; + $x[ 3] ^= ($a << 13) | ($a >> 19); + $a = ($x[ 3] + $x[ 2]) & 0xffffffff; + $x[ 0] ^= ($a << 18) | ($a >> 14); + $a = ($x[ 5] + $x[ 4]) & 0xffffffff; + $x[ 6] ^= ($a << 7) | ($a >> 25); + $a = ($x[ 6] + $x[ 5]) & 0xffffffff; + $x[ 7] ^= ($a << 9) | ($a >> 23); + $a = ($x[ 7] + $x[ 6]) & 0xffffffff; + $x[ 4] ^= ($a << 13) | ($a >> 19); + $a = ($x[ 4] + $x[ 7]) & 0xffffffff; + $x[ 5] ^= ($a << 18) | ($a >> 14); + $a = ($x[10] + $x[ 9]) & 0xffffffff; + $x[11] ^= ($a << 7) | ($a >> 25); + $a = ($x[11] + $x[10]) & 0xffffffff; + $x[ 8] ^= ($a << 9) | ($a >> 23); + $a = ($x[ 8] + $x[11]) & 0xffffffff; + $x[ 9] ^= ($a << 13) | ($a >> 19); + $a = ($x[ 9] + $x[ 8]) & 0xffffffff; + $x[10] ^= ($a << 18) | ($a >> 14); + $a = ($x[15] + $x[14]) & 0xffffffff; + $x[12] ^= ($a << 7) | ($a >> 25); + $a = ($x[12] + $x[15]) & 0xffffffff; + $x[13] ^= ($a << 9) | ($a >> 23); + $a = ($x[13] + $x[12]) & 0xffffffff; + $x[14] ^= ($a << 13) | ($a >> 19); + $a = ($x[14] + $x[13]) & 0xffffffff; + $x[15] ^= ($a << 18) | ($a >> 14); + } + for ($i = 0; $i < 16; $i++) { + $b32[$i] = ($b32[$i] + $x[$i]) & 0xffffffff; + } + $result = ''; + for ($i = 0; $i < 16; $i++) { + $result .= pack("V", $b32[$i]); + } + + return $result; + } + + /** + * Integerify + * + * Integerify (B[0] ... B[2 * r - 1]) is defined as the result + * of interpreting B[2 * r - 1] as a little-endian integer. + * Each block B is a string of 64 bytes. + * + * @param string $b + * @return int + * @see https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01#section-4 + */ + protected static function integerify($b) + { + $v = 'v'; + if (PHP_INT_SIZE === 8) { + $v = 'V'; + } + list(,$n) = unpack($v, substr($b, -64)); + return $n; + } + + /** + * Convert hex string in a binary string + * + * @param string $hex + * @return string + */ + protected static function hex2bin($hex) + { + if (version_compare(PHP_VERSION, '5.4') >= 0) { + return hex2bin($hex); + } + $len = strlen($hex); + $result = ''; + for ($i = 0; $i < $len; $i+=2) { + $result .= chr(hexdec($hex[$i] . $hex[$i+1])); + } + return $result; + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Apache.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Apache.php new file mode 100644 index 0000000000..63b39b9d07 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Apache.php @@ -0,0 +1,299 @@ + $value) { + switch (strtolower($key)) { + case 'format': + $this->setFormat($value); + break; + case 'authname': + $this->setAuthName($value); + break; + case 'username': + $this->setUserName($value); + break; + } + } + } + + /** + * Generate the hash of a password + * + * @param string $password + * @throws Exception\RuntimeException + * @return string + */ + public function create($password) + { + if (empty($this->format)) { + throw new Exception\RuntimeException( + 'You must specify a password format' + ); + } + switch ($this->format) { + case 'crypt' : + $hash = crypt($password, Rand::getString(2, self::ALPHA64)); + break; + case 'sha1' : + $hash = '{SHA}' . base64_encode(sha1($password, true)); + break; + case 'md5' : + $hash = $this->apr1Md5($password); + break; + case 'digest': + if (empty($this->userName) || empty($this->authName)) { + throw new Exception\RuntimeException( + 'You must specify UserName and AuthName (realm) to generate the digest' + ); + } + $hash = md5($this->userName . ':' . $this->authName . ':' .$password); + break; + } + + return $hash; + } + + /** + * Verify if a password is correct against an hash value + * + * @param string $password + * @param string $hash + * @return bool + */ + public function verify($password, $hash) + { + if (substr($hash, 0, 5) === '{SHA}') { + $hash2 = '{SHA}' . base64_encode(sha1($password, true)); + return ($hash === $hash2); + } + if (substr($hash, 0, 6) === '$apr1$') { + $token = explode('$', $hash); + if (empty($token[2])) { + throw new Exception\InvalidArgumentException( + 'The APR1 password format is not valid' + ); + } + $hash2 = $this->apr1Md5($password, $token[2]); + return ($hash === $hash2); + } + if (strlen($hash) > 13) { // digest + if (empty($this->userName) || empty($this->authName)) { + throw new Exception\RuntimeException( + 'You must specify UserName and AuthName (realm) to verify the digest' + ); + } + $hash2 = md5($this->userName . ':' . $this->authName . ':' .$password); + return ($hash === $hash2); + } + return (crypt($password, $hash) === $hash); + } + + /** + * Set the format of the password + * + * @param string $format + * @throws Exception\InvalidArgumentException + * @return Apache + */ + public function setFormat($format) + { + $format = strtolower($format); + if (!in_array($format, $this->supportedFormat)) { + throw new Exception\InvalidArgumentException(sprintf( + 'The format %s specified is not valid. The supported formats are: %s', + $format, implode(',', $this->supportedFormat) + )); + } + $this->format = $format; + + return $this; + } + + /** + * Get the format of the password + * + * @return string + */ + public function getFormat() + { + return $this->format; + } + + /** + * Set the AuthName (for digest authentication) + * + * @param string $name + * @return Apache + */ + public function setAuthName($name) + { + $this->authName = $name; + + return $this; + } + + /** + * Get the AuthName (for digest authentication) + * + * @return string + */ + public function getAuthName() + { + return $this->authName; + } + + /** + * Set the username + * + * @param string $name + * @return Apache + */ + public function setUserName($name) + { + $this->userName = $name; + + return $this; + } + + /** + * Get the username + * + * @return string + */ + public function getUserName() + { + return $this->userName; + } + + /** + * Convert a binary string using the alphabet "./0-9A-Za-z" + * + * @param string $value + * @return string + */ + protected function toAlphabet64($value) + { + return strtr(strrev(substr(base64_encode($value), 2)), self::BASE64, self::ALPHA64); + } + + /** + * APR1 MD5 algorithm + * + * @param string $password + * @param null|string $salt + * @return string + */ + protected function apr1Md5($password, $salt = null) + { + if (null === $salt) { + $salt = Rand::getString(8, self::ALPHA64); + } else { + if (strlen($salt) !== 8) { + throw new Exception\InvalidArgumentException( + 'The salt value for APR1 algorithm must be 8 characters long' + ); + } + for ($i = 0; $i < 8; $i++) { + if (strpos(self::ALPHA64, $salt[$i]) === false) { + throw new Exception\InvalidArgumentException( + 'The salt value must be a string in the alphabet "./0-9A-Za-z"' + ); + } + } + } + $len = strlen($password); + $text = $password . '$apr1$' . $salt; + $bin = pack("H32", md5($password . $salt . $password)); + for ($i = $len; $i > 0; $i -= 16) { + $text .= substr($bin, 0, min(16, $i)); + } + for ($i = $len; $i > 0; $i >>= 1) { + $text .= ($i & 1) ? chr(0) : $password[0]; + } + $bin = pack("H32", md5($text)); + for ($i = 0; $i < 1000; $i++) { + $new = ($i & 1) ? $password : $bin; + if ($i % 3) { + $new .= $salt; + } + if ($i % 7) { + $new .= $password; + } + $new .= ($i & 1) ? $bin : $password; + $bin = pack("H32", md5($new)); + } + $tmp = ''; + for ($i = 0; $i < 5; $i++) { + $k = $i + 6; + $j = $i + 12; + if ($j == 16) $j = 5; + $tmp = $bin[$i] . $bin[$k] . $bin[$j] . $tmp; + } + $tmp = chr(0) . chr(0) . $bin[11] . $tmp; + + return '$apr1$' . $salt . '$' . $this->toAlphabet64($tmp); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Bcrypt.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Bcrypt.php new file mode 100644 index 0000000000..45b3370443 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Bcrypt.php @@ -0,0 +1,219 @@ + $value) { + switch (strtolower($key)) { + case 'salt': + $this->setSalt($value); + break; + case 'cost': + $this->setCost($value); + break; + } + } + } + } + + /** + * Bcrypt + * + * @param string $password + * @throws Exception\RuntimeException + * @return string + */ + public function create($password) + { + if (empty($this->salt)) { + $salt = Rand::getBytes(self::MIN_SALT_SIZE); + } else { + $salt = $this->salt; + } + $salt64 = substr(str_replace('+', '.', base64_encode($salt)), 0, 22); + /** + * Check for security flaw in the bcrypt implementation used by crypt() + * @see http://php.net/security/crypt_blowfish.php + */ + if ((version_compare(PHP_VERSION, '5.3.7') >= 0) && !$this->backwardCompatibility) { + $prefix = '$2y$'; + } else { + $prefix = '$2a$'; + // check if the password contains 8-bit character + if (preg_match('/[\x80-\xFF]/', $password)) { + throw new Exception\RuntimeException( + 'The bcrypt implementation used by PHP can contains a security flaw ' . + 'using password with 8-bit character. ' . + 'We suggest to upgrade to PHP 5.3.7+ or use passwords with only 7-bit characters' + ); + } + } + $hash = crypt($password, $prefix . $this->cost . '$' . $salt64); + if (strlen($hash) < 13) { + throw new Exception\RuntimeException('Error during the bcrypt generation'); + } + return $hash; + } + + /** + * Verify if a password is correct against an hash value + * + * @param string $password + * @param string $hash + * @throws Exception\RuntimeException when the hash is unable to be processed + * @return bool + */ + public function verify($password, $hash) + { + $result = crypt($password, $hash); + if ($result === $hash) { + return true; + } + if (strlen($result) <= 13) { + /* This should only happen if the algorithm that generated hash is + * either unsupported by this version of crypt(), or is invalid. + * + * An example of when this can happen, is if you generate + * non-backwards-compatible hashes on 5.3.7+, and then try to verify + * them on < 5.3.7. + * + * This is needed, because version comparisons are not possible due + * to back-ported functionality by some distributions. + */ + throw new Exception\RuntimeException( + 'The supplied password hash could not be verified. Please check ' . + 'backwards compatibility settings.' + ); + } + return false; + } + + /** + * Set the cost parameter + * + * @param int|string $cost + * @throws Exception\InvalidArgumentException + * @return Bcrypt + */ + public function setCost($cost) + { + if (!empty($cost)) { + $cost = (int) $cost; + if ($cost < 4 || $cost > 31) { + throw new Exception\InvalidArgumentException( + 'The cost parameter of bcrypt must be in range 04-31' + ); + } + $this->cost = sprintf('%1$02d', $cost); + } + return $this; + } + + /** + * Get the cost parameter + * + * @return string + */ + public function getCost() + { + return $this->cost; + } + + /** + * Set the salt value + * + * @param string $salt + * @throws Exception\InvalidArgumentException + * @return Bcrypt + */ + public function setSalt($salt) + { + if (strlen($salt) < self::MIN_SALT_SIZE) { + throw new Exception\InvalidArgumentException( + 'The length of the salt must be at least ' . self::MIN_SALT_SIZE . ' bytes' + ); + } + $this->salt = $salt; + return $this; + } + + /** + * Get the salt value + * + * @return string + */ + public function getSalt() + { + return $this->salt; + } + + /** + * Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+ + * + * @param bool $value + * @return Bcrypt + */ + public function setBackwardCompatibility($value) + { + $this->backwardCompatibility = (bool) $value; + return $this; + } + + /** + * Get the backward compatibility + * + * @return bool + */ + public function getBackwardCompatibility() + { + return $this->backwardCompatibility; + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Exception/ExceptionInterface.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..a8ae021e30 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Password/Exception/ExceptionInterface.php @@ -0,0 +1,15 @@ +setPrime($prime); + $this->setGenerator($generator); + if ($privateKey !== null) { + $this->setPrivateKey($privateKey, $privateKeyFormat); + } + + // set up BigInteger adapter + $this->math = Math\BigInteger\BigInteger::factory(); + } + + /** + * Set whether to use openssl extension + * + * @static + * @param bool $flag + */ + public static function useOpensslExtension($flag = true) + { + static::$useOpenssl = (bool) $flag; + } + + /** + * Generate own public key. If a private number has not already been set, + * one will be generated at this stage. + * + * @return DiffieHellman + * @throws \Zend\Crypt\Exception\RuntimeException + */ + public function generateKeys() + { + if (function_exists('openssl_dh_compute_key') && static::$useOpenssl !== false) { + $details = array( + 'p' => $this->convert($this->getPrime(), self::FORMAT_NUMBER, self::FORMAT_BINARY), + 'g' => $this->convert($this->getGenerator(), self::FORMAT_NUMBER, self::FORMAT_BINARY) + ); + if ($this->hasPrivateKey()) { + $details['priv_key'] = $this->convert( + $this->privateKey, self::FORMAT_NUMBER, self::FORMAT_BINARY + ); + $opensslKeyResource = openssl_pkey_new(array('dh' => $details)); + } else { + $opensslKeyResource = openssl_pkey_new(array( + 'dh' => $details, + 'private_key_bits' => self::DEFAULT_KEY_SIZE, + 'private_key_type' => OPENSSL_KEYTYPE_DH + )); + } + + if (false === $opensslKeyResource) { + throw new Exception\RuntimeException( + 'Can not generate new key; openssl ' . openssl_error_string() + ); + } + + $data = openssl_pkey_get_details($opensslKeyResource); + + $this->setPrivateKey($data['dh']['priv_key'], self::FORMAT_BINARY); + $this->setPublicKey($data['dh']['pub_key'], self::FORMAT_BINARY); + + $this->opensslKeyResource = $opensslKeyResource; + } else { + // Private key is lazy generated in the absence of ext/openssl + $publicKey = $this->math->powmod($this->getGenerator(), $this->getPrivateKey(), $this->getPrime()); + $this->setPublicKey($publicKey); + } + + return $this; + } + + /** + * Setter for the value of the public number + * + * @param string $number + * @param string $format + * @return DiffieHellman + * @throws \Zend\Crypt\Exception\InvalidArgumentException + */ + public function setPublicKey($number, $format = self::FORMAT_NUMBER) + { + $number = $this->convert($number, $format, self::FORMAT_NUMBER); + if (!preg_match('/^\d+$/', $number)) { + throw new Exception\InvalidArgumentException('Invalid parameter; not a positive natural number'); + } + $this->publicKey = (string) $number; + + return $this; + } + + /** + * Returns own public key for communication to the second party to this transaction + * + * @param string $format + * @return string + * @throws \Zend\Crypt\Exception\InvalidArgumentException + */ + public function getPublicKey($format = self::FORMAT_NUMBER) + { + if ($this->publicKey === null) { + throw new Exception\InvalidArgumentException( + 'A public key has not yet been generated using a prior call to generateKeys()' + ); + } + + return $this->convert($this->publicKey, self::FORMAT_NUMBER, $format); + } + + /** + * Compute the shared secret key based on the public key received from the + * the second party to this transaction. This should agree to the secret + * key the second party computes on our own public key. + * Once in agreement, the key is known to only to both parties. + * By default, the function expects the public key to be in binary form + * which is the typical format when being transmitted. + * + * If you need the binary form of the shared secret key, call + * getSharedSecretKey() with the optional parameter for Binary output. + * + * @param string $publicKey + * @param string $publicKeyFormat + * @param string $secretKeyFormat + * @return string + * @throws \Zend\Crypt\Exception\InvalidArgumentException + * @throws \Zend\Crypt\Exception\RuntimeException + */ + public function computeSecretKey($publicKey, $publicKeyFormat = self::FORMAT_NUMBER, + $secretKeyFormat = self::FORMAT_NUMBER) + { + if (function_exists('openssl_dh_compute_key') && static::$useOpenssl !== false) { + $publicKey = $this->convert($publicKey, $publicKeyFormat, self::FORMAT_BINARY); + $secretKey = openssl_dh_compute_key($publicKey, $this->opensslKeyResource); + if (false === $secretKey) { + throw new Exception\RuntimeException( + 'Can not compute key; openssl ' . openssl_error_string() + ); + } + $this->secretKey = $this->convert($secretKey, self::FORMAT_BINARY, self::FORMAT_NUMBER); + } else { + $publicKey = $this->convert($publicKey, $publicKeyFormat, self::FORMAT_NUMBER); + if (!preg_match('/^\d+$/', $publicKey)) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter; not a positive natural number' + ); + } + $this->secretKey = $this->math->powmod($publicKey, $this->getPrivateKey(), $this->getPrime()); + } + + return $this->getSharedSecretKey($secretKeyFormat); + } + + /** + * Return the computed shared secret key from the DiffieHellman transaction + * + * @param string $format + * @return string + * @throws \Zend\Crypt\Exception\InvalidArgumentException + */ + public function getSharedSecretKey($format = self::FORMAT_NUMBER) + { + if (!isset($this->secretKey)) { + throw new Exception\InvalidArgumentException( + 'A secret key has not yet been computed; call computeSecretKey() first' + ); + } + + return $this->convert($this->secretKey, self::FORMAT_NUMBER, $format); + } + + /** + * Setter for the value of the prime number + * + * @param string $number + * @return DiffieHellman + * @throws \Zend\Crypt\Exception\InvalidArgumentException + */ + public function setPrime($number) + { + if (!preg_match('/^\d+$/', $number) || $number < 11) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter; not a positive natural number or too small: ' . + 'should be a large natural number prime' + ); + } + $this->prime = (string) $number; + + return $this; + } + + /** + * Getter for the value of the prime number + * + * @param string $format + * @return string + * @throws \Zend\Crypt\Exception\InvalidArgumentException + */ + public function getPrime($format = self::FORMAT_NUMBER) + { + if (!isset($this->prime)) { + throw new Exception\InvalidArgumentException('No prime number has been set'); + } + + return $this->convert($this->prime, self::FORMAT_NUMBER, $format); + } + + + /** + * Setter for the value of the generator number + * + * @param string $number + * @return DiffieHellman + * @throws \Zend\Crypt\Exception\InvalidArgumentException + */ + public function setGenerator($number) + { + if (!preg_match('/^\d+$/', $number) || $number < 2) { + throw new Exception\InvalidArgumentException( + 'Invalid parameter; not a positive natural number greater than 1' + ); + } + $this->generator = (string) $number; + + return $this; + } + + /** + * Getter for the value of the generator number + * + * @param string $format + * @return string + * @throws \Zend\Crypt\Exception\InvalidArgumentException + */ + public function getGenerator($format = self::FORMAT_NUMBER) + { + if (!isset($this->generator)) { + throw new Exception\InvalidArgumentException('No generator number has been set'); + } + + return $this->convert($this->generator, self::FORMAT_NUMBER, $format); + } + + /** + * Setter for the value of the private number + * + * @param string $number + * @param string $format + * @return DiffieHellman + * @throws \Zend\Crypt\Exception\InvalidArgumentException + */ + public function setPrivateKey($number, $format = self::FORMAT_NUMBER) + { + $number = $this->convert($number, $format, self::FORMAT_NUMBER); + if (!preg_match('/^\d+$/', $number)) { + throw new Exception\InvalidArgumentException('Invalid parameter; not a positive natural number'); + } + $this->privateKey = (string) $number; + + return $this; + } + + /** + * Getter for the value of the private number + * + * @param string $format + * @return string + */ + public function getPrivateKey($format = self::FORMAT_NUMBER) + { + if (!$this->hasPrivateKey()) { + $this->setPrivateKey($this->generatePrivateKey(), self::FORMAT_BINARY); + } + + return $this->convert($this->privateKey, self::FORMAT_NUMBER, $format); + } + + /** + * Check whether a private key currently exists. + * + * @return bool + */ + public function hasPrivateKey() + { + return isset($this->privateKey); + } + + /** + * Convert number between formats + * + * @param $number + * @param string $inputFormat + * @param string $outputFormat + * @return string + */ + protected function convert($number, $inputFormat = self::FORMAT_NUMBER, + $outputFormat = self::FORMAT_BINARY) + { + if ($inputFormat == $outputFormat) { + return $number; + } + + // convert to number + switch ($inputFormat) { + case self::FORMAT_BINARY: + case self::FORMAT_BTWOC: + $number = $this->math->binToInt($number); + break; + case self::FORMAT_NUMBER: + default: + // do nothing + break; + } + + // convert to output format + switch ($outputFormat) { + case self::FORMAT_BINARY: + return $this->math->intToBin($number); + break; + case self::FORMAT_BTWOC: + return $this->math->intToBin($number, true); + break; + case self::FORMAT_NUMBER: + default: + return $number; + break; + } + } + + /** + * In the event a private number/key has not been set by the user, + * or generated by ext/openssl, a best attempt will be made to + * generate a random key. Having a random number generator installed + * on linux/bsd is highly recommended! The alternative is not recommended + * for production unless without any other option. + * + * @return string + */ + protected function generatePrivateKey() + { + return Math\Rand::getBytes(strlen($this->getPrime()), true); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa.php b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa.php new file mode 100644 index 0000000000..03b1f17751 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa.php @@ -0,0 +1,334 @@ +setPrivateKey($privateKey); + } + if ($publicKey instanceof Rsa\PublicKey) { + $options->setPublicKey($publicKey); + } + + return new Rsa($options); + } + + /** + * Class constructor + * + * @param RsaOptions $options + * @throws Rsa\Exception\RuntimeException + */ + public function __construct(RsaOptions $options = null) + { + if (!extension_loaded('openssl')) { + throw new Exception\RuntimeException( + 'Zend\Crypt\PublicKey\Rsa requires openssl extension to be loaded' + ); + } + + if ($options === null) { + $this->options = new RsaOptions(); + } else { + $this->options = $options; + } + } + + /** + * Set options + * + * @param RsaOptions $options + * @return Rsa + */ + public function setOptions(RsaOptions $options) + { + $this->options = $options; + return $this; + } + + /** + * Get options + * + * @return RsaOptions + */ + public function getOptions() + { + return $this->options; + } + + /** + * Return last openssl error(s) + * + * @return string + */ + public function getOpensslErrorString() + { + $message = ''; + while (false !== ($error = openssl_error_string())) { + $message .= $error . "\n"; + } + return trim($message); + } + + /** + * Sign with private key + * + * @param string $data + * @param Rsa\PrivateKey $privateKey + * @return string + * @throws Rsa\Exception\RuntimeException + */ + public function sign($data, Rsa\PrivateKey $privateKey = null) + { + $signature = ''; + if (null === $privateKey) { + $privateKey = $this->options->getPrivateKey(); + } + + $result = openssl_sign( + $data, + $signature, + $privateKey->getOpensslKeyResource(), + $this->options->getOpensslSignatureAlgorithm() + ); + if (false === $result) { + throw new Exception\RuntimeException( + 'Can not generate signature; openssl ' . $this->getOpensslErrorString() + ); + } + + if ($this->options->getBinaryOutput()) { + return $signature; + } + + return base64_encode($signature); + } + + /** + * Verify signature with public key + * + * $signature can be encoded in base64 or not. $mode sets how the input must be processed: + * - MODE_AUTO: Check if the $signature is encoded in base64. Not recommended for performance. + * - MODE_BASE64: Decode $signature using base64 algorithm. + * - MODE_RAW: $signature is not encoded. + * + * @param string $data + * @param string $signature + * @param null|Rsa\PublicKey $publicKey + * @param int $mode Input encoding + * @return bool + * @throws Rsa\Exception\RuntimeException + * @see Rsa::MODE_AUTO + * @see Rsa::MODE_BASE64 + * @see Rsa::MODE_RAW + */ + public function verify( + $data, + $signature, + Rsa\PublicKey $publicKey = null, + $mode = self::MODE_AUTO + ) { + if (null === $publicKey) { + $publicKey = $this->options->getPublicKey(); + } + + switch ($mode) { + case self::MODE_AUTO: + // check if data is encoded in Base64 + $output = base64_decode($signature, true); + if ((false !== $output) && ($signature === base64_encode($output))) { + $signature = $output; + } + break; + case self::MODE_BASE64: + $signature = base64_decode($signature); + break; + case self::MODE_RAW: + default: + break; + } + + $result = openssl_verify( + $data, + $signature, + $publicKey->getOpensslKeyResource(), + $this->options->getOpensslSignatureAlgorithm() + ); + if (-1 === $result) { + throw new Exception\RuntimeException( + 'Can not verify signature; openssl ' . $this->getOpensslErrorString() + ); + } + + return ($result === 1); + } + + /** + * Encrypt with private/public key + * + * @param string $data + * @param Rsa\AbstractKey $key + * @return string + * @throws Rsa\Exception\InvalidArgumentException + */ + public function encrypt($data, Rsa\AbstractKey $key = null) + { + if (null === $key) { + $key = $this->options->getPublicKey(); + } + + if (null === $key) { + throw new Exception\InvalidArgumentException('No key specified for the decryption'); + } + + $encrypted = $key->encrypt($data); + + if ($this->options->getBinaryOutput()) { + return $encrypted; + } + + return base64_encode($encrypted); + } + + /** + * Decrypt with private/public key + * + * $data can be encoded in base64 or not. $mode sets how the input must be processed: + * - MODE_AUTO: Check if the $signature is encoded in base64. Not recommended for performance. + * - MODE_BASE64: Decode $data using base64 algorithm. + * - MODE_RAW: $data is not encoded. + * + * @param string $data + * @param Rsa\AbstractKey $key + * @param int $mode Input encoding + * @return string + * @throws Rsa\Exception\InvalidArgumentException + * @see Rsa::MODE_AUTO + * @see Rsa::MODE_BASE64 + * @see Rsa::MODE_RAW + */ + public function decrypt( + $data, + Rsa\AbstractKey $key = null, + $mode = self::MODE_AUTO + ) { + if (null === $key) { + $key = $this->options->getPrivateKey(); + } + + if (null === $key) { + throw new Exception\InvalidArgumentException('No key specified for the decryption'); + } + + switch ($mode) { + case self::MODE_AUTO: + // check if data is encoded in Base64 + $output = base64_decode($data, true); + if ((false !== $output) && ($data === base64_encode($output))) { + $data = $output; + } + break; + case self::MODE_BASE64: + $data = base64_decode($data); + break; + case self::MODE_RAW: + default: + break; + } + + return $key->decrypt($data); + } + + /** + * Generate new private/public key pair + * @see RsaOptions::generateKeys() + * + * @param array $opensslConfig + * @return Rsa + * @throws Rsa\Exception\RuntimeException + */ + public function generateKeys(array $opensslConfig = array()) + { + $this->options->generateKeys($opensslConfig); + return $this; + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/AbstractKey.php b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/AbstractKey.php new file mode 100644 index 0000000000..9777f5458e --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/AbstractKey.php @@ -0,0 +1,90 @@ +details['bits']; + } + + /** + * Retrieve openssl key resource + * + * @return resource + */ + public function getOpensslKeyResource() + { + return $this->opensslKeyResource; + } + + /** + * Encrypt using this key + * + * @abstract + * @param string $data + * @return string + */ + abstract public function encrypt($data); + + /** + * Decrypt using this key + * + * @abstract + * @param string $data + * @return string + */ + abstract public function decrypt($data); + + /** + * Get string representation of this key + * + * @abstract + * @return string + */ + abstract public function toString(); + + /** + * @return string + */ + public function __toString() + { + return $this->toString(); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/Exception/ExceptionInterface.php b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..bfca848095 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/Exception/ExceptionInterface.php @@ -0,0 +1,15 @@ +pemString = $pemString; + $this->opensslKeyResource = $result; + $this->details = openssl_pkey_get_details($this->opensslKeyResource); + } + + /** + * Get the public key + * + * @return PublicKey + */ + public function getPublicKey() + { + if ($this->publicKey === null) { + $this->publicKey = new PublicKey($this->details['key']); + } + + return $this->publicKey; + } + + /** + * Encrypt using this key + * + * @param string $data + * @return string + * @throws Exception\RuntimeException + * @throws Exception\InvalidArgumentException + */ + public function encrypt($data) + { + if (empty($data)) { + throw new Exception\InvalidArgumentException('The data to encrypt cannot be empty'); + } + + $encrypted = ''; + $result = openssl_private_encrypt($data, $encrypted, $this->getOpensslKeyResource()); + if (false === $result) { + throw new Exception\RuntimeException( + 'Can not encrypt; openssl ' . openssl_error_string() + ); + } + + return $encrypted; + } + + /** + * Decrypt using this key + * + * @param string $data + * @return string + * @throws Exception\RuntimeException + * @throws Exception\InvalidArgumentException + */ + public function decrypt($data) + { + if (!is_string($data)) { + throw new Exception\InvalidArgumentException('The data to decrypt must be a string'); + } + if ('' === $data) { + throw new Exception\InvalidArgumentException('The data to decrypt cannot be empty'); + } + + $decrypted = ''; + $result = openssl_private_decrypt($data, $decrypted, $this->getOpensslKeyResource()); + if (false === $result) { + throw new Exception\RuntimeException( + 'Can not decrypt; openssl ' . openssl_error_string() + ); + } + + return $decrypted; + } + + /** + * @return string + */ + public function toString() + { + return $this->pemString; + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/PublicKey.php b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/PublicKey.php new file mode 100644 index 0000000000..1fce4b13e0 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/Rsa/PublicKey.php @@ -0,0 +1,147 @@ +certificateString = $pemStringOrCertificate; + } else { + $this->pemString = $pemStringOrCertificate; + } + + $this->opensslKeyResource = $result; + $this->details = openssl_pkey_get_details($this->opensslKeyResource); + } + + /** + * Encrypt using this key + * + * @param string $data + * @throws Exception\InvalidArgumentException + * @throws Exception\RuntimeException + * @return string + */ + public function encrypt($data) + { + if (empty($data)) { + throw new Exception\InvalidArgumentException('The data to encrypt cannot be empty'); + } + + $encrypted = ''; + $result = openssl_public_encrypt($data, $encrypted, $this->getOpensslKeyResource()); + if (false === $result) { + throw new Exception\RuntimeException( + 'Can not encrypt; openssl ' . openssl_error_string() + ); + } + + return $encrypted; + } + + + /** + * Decrypt using this key + * + * @param string $data + * @throws Exception\InvalidArgumentException + * @throws Exception\RuntimeException + * @return string + */ + public function decrypt($data) + { + if (!is_string($data)) { + throw new Exception\InvalidArgumentException('The data to decrypt must be a string'); + } + if ('' === $data) { + throw new Exception\InvalidArgumentException('The data to decrypt cannot be empty'); + } + + $decrypted = ''; + $result = openssl_public_decrypt($data, $decrypted, $this->getOpensslKeyResource()); + if (false === $result) { + throw new Exception\RuntimeException( + 'Can not decrypt; openssl ' . openssl_error_string() + ); + } + + return $decrypted; + } + + /** + * Get certificate string + * + * @return string + */ + public function getCertificate() + { + return $this->certificateString; + } + + /** + * To string + * + * @return string + * @throws Exception\RuntimeException + */ + public function toString() + { + if (!empty($this->certificateString)) { + return $this->certificateString; + } elseif (!empty($this->pemString)) { + return $this->pemString; + } + throw new Exception\RuntimeException('No public key string representation is available'); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/RsaOptions.php b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/RsaOptions.php new file mode 100644 index 0000000000..6e883f103e --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/PublicKey/RsaOptions.php @@ -0,0 +1,221 @@ +privateKey = $key; + $this->publicKey = $this->privateKey->getPublicKey(); + return $this; + } + + /** + * Get private key + * + * @return null|Rsa\PrivateKey + */ + public function getPrivateKey() + { + return $this->privateKey; + } + + /** + * Set public key + * + * @param Rsa\PublicKey $key + * @return RsaOptions + */ + public function setPublicKey(Rsa\PublicKey $key) + { + $this->publicKey = $key; + return $this; + } + + /** + * Get public key + * + * @return null|Rsa\PublicKey + */ + public function getPublicKey() + { + return $this->publicKey; + } + + /** + * Set pass phrase + * + * @param string $phrase + * @return RsaOptions + */ + public function setPassPhrase($phrase) + { + $this->passPhrase = (string) $phrase; + return $this; + } + + /** + * Get pass phrase + * + * @return string + */ + public function getPassPhrase() + { + return $this->passPhrase; + } + + /** + * Set hash algorithm + * + * @param string $hash + * @return RsaOptions + * @throws Rsa\Exception\RuntimeException + * @throws Rsa\Exception\InvalidArgumentException + */ + public function setHashAlgorithm($hash) + { + $hashUpper = strtoupper($hash); + if (!defined('OPENSSL_ALGO_' . $hashUpper)) { + throw new Exception\InvalidArgumentException( + "Hash algorithm '{$hash}' is not supported" + ); + } + + $this->hashAlgorithm = strtolower($hash); + $this->opensslSignatureAlgorithm = constant('OPENSSL_ALGO_' . $hashUpper); + return $this; + } + + /** + * Get hash algorithm + * + * @return string + */ + public function getHashAlgorithm() + { + return $this->hashAlgorithm; + } + + public function getOpensslSignatureAlgorithm() + { + if (!isset($this->opensslSignatureAlgorithm)) { + $this->opensslSignatureAlgorithm = constant('OPENSSL_ALGO_' . strtoupper($this->hashAlgorithm)); + } + return $this->opensslSignatureAlgorithm; + } + + /** + * Enable/disable the binary output + * + * @param bool $value + * @return RsaOptions + */ + public function setBinaryOutput($value) + { + $this->binaryOutput = (bool) $value; + return $this; + } + + /** + * Get the value of binary output + * + * @return bool + */ + public function getBinaryOutput() + { + return $this->binaryOutput; + } + + /** + * Generate new private/public key pair + * + * @param array $opensslConfig + * @return RsaOptions + * @throws Rsa\Exception\RuntimeException + */ + public function generateKeys(array $opensslConfig = array()) + { + $opensslConfig = array_replace(array( + 'private_key_type' => OPENSSL_KEYTYPE_RSA, + 'private_key_bits' => Rsa\PrivateKey::DEFAULT_KEY_SIZE, + 'digest_alg' => $this->getHashAlgorithm() + ), $opensslConfig); + + // generate + $resource = openssl_pkey_new($opensslConfig); + if (false === $resource) { + throw new Exception\RuntimeException( + 'Can not generate keys; openssl ' . openssl_error_string() + ); + } + + // export key + $passPhrase = $this->getPassPhrase(); + $result = openssl_pkey_export($resource, $private, $passPhrase, $opensslConfig); + if (false === $result) { + throw new Exception\RuntimeException( + 'Can not export key; openssl ' . openssl_error_string() + ); + } + + $details = openssl_pkey_get_details($resource); + $this->privateKey = new Rsa\PrivateKey($private, $passPhrase); + $this->publicKey = new Rsa\PublicKey($details['key']); + + return $this; + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/README.md b/vendor/zendframework/zend-crypt/Zend/Crypt/README.md new file mode 100644 index 0000000000..1e2e5af919 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/README.md @@ -0,0 +1,15 @@ +Crypt Component from ZF2 +======================== + +This is the Crypt component for ZF2. + +- File issues at https://github.com/zendframework/zf2/issues +- Create pull requests against https://github.com/zendframework/zf2 +- Documentation is at http://framework.zend.com/docs + +LICENSE +------- + +The files in this archive are released under the [Zend Framework +license](http://framework.zend.com/license), which is a 3-clause BSD license. + diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/Exception/ExceptionInterface.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..8d604f3197 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/Exception/ExceptionInterface.php @@ -0,0 +1,15 @@ + 'rijndael-128', + 'blowfish' => 'blowfish', + 'des' => 'des', + '3des' => 'tripledes', + 'tripledes' => 'tripledes', + 'cast-128' => 'cast-128', + 'cast-256' => 'cast-256', + 'rijndael-128' => 'rijndael-128', + 'rijndael-192' => 'rijndael-192', + 'rijndael-256' => 'rijndael-256', + 'saferplus' => 'saferplus', + 'serpent' => 'serpent', + 'twofish' => 'twofish' + ); + + /** + * Supported encryption modes + * + * @var array + */ + protected $supportedModes = array( + 'cbc' => 'cbc', + 'cfb' => 'cfb', + 'ctr' => 'ctr', + 'ofb' => 'ofb', + 'nofb' => 'nofb', + 'ncfb' => 'ncfb' + ); + + /** + * Constructor + * + * @param array|Traversable $options + * @throws Exception\RuntimeException + * @throws Exception\InvalidArgumentException + */ + public function __construct($options = array()) + { + if (!extension_loaded('mcrypt')) { + throw new Exception\RuntimeException( + 'You cannot use ' . __CLASS__ . ' without the Mcrypt extension' + ); + } + if (!empty($options)) { + if ($options instanceof Traversable) { + $options = ArrayUtils::iteratorToArray($options); + } elseif (!is_array($options)) { + throw new Exception\InvalidArgumentException( + 'The options parameter must be an array, a Zend\Config\Config object or a Traversable' + ); + } + foreach ($options as $key => $value) { + switch (strtolower($key)) { + case 'algo': + case 'algorithm': + $this->setAlgorithm($value); + break; + case 'mode': + $this->setMode($value); + break; + case 'key': + $this->setKey($value); + break; + case 'iv': + case 'salt': + $this->setSalt($value); + break; + case 'padding': + $plugins = static::getPaddingPluginManager(); + $padding = $plugins->get($value); + $this->padding = $padding; + break; + } + } + } + $this->setDefaultOptions($options); + } + + /** + * Set default options + * + * @param array $options + * @return void + */ + protected function setDefaultOptions($options = array()) + { + if (!isset($options['padding'])) { + $plugins = static::getPaddingPluginManager(); + $padding = $plugins->get(self::DEFAULT_PADDING); + $this->padding = $padding; + } + } + + /** + * Returns the padding plugin manager. If it doesn't exist it's created. + * + * @return PaddingPluginManager + */ + public static function getPaddingPluginManager() + { + if (static::$paddingPlugins === null) { + self::setPaddingPluginManager(new PaddingPluginManager()); + } + + return static::$paddingPlugins; + } + + /** + * Set the padding plugin manager + * + * @param string|PaddingPluginManager $plugins + * @throws Exception\InvalidArgumentException + * @return void + */ + public static function setPaddingPluginManager($plugins) + { + if (is_string($plugins)) { + if (!class_exists($plugins)) { + throw new Exception\InvalidArgumentException(sprintf( + 'Unable to locate padding plugin manager via class "%s"; class does not exist', + $plugins + )); + } + $plugins = new $plugins(); + } + if (!$plugins instanceof PaddingPluginManager) { + throw new Exception\InvalidArgumentException(sprintf( + 'Padding plugins must extend %s\PaddingPluginManager; received "%s"', + __NAMESPACE__, + (is_object($plugins) ? get_class($plugins) : gettype($plugins)) + )); + } + static::$paddingPlugins = $plugins; + } + + /** + * Get the maximum key size for the selected cipher and mode of operation + * + * @return int + */ + public function getKeySize() + { + return mcrypt_get_key_size($this->supportedAlgos[$this->algo], + $this->supportedModes[$this->mode]); + } + + /** + * Set the encryption key + * + * @param string $key + * @throws Exception\InvalidArgumentException + * @return Mcrypt + */ + public function setKey($key) + { + if (empty($key)) { + throw new Exception\InvalidArgumentException('The key cannot be empty'); + } + if (strlen($key) < $this->getKeySize()) { + throw new Exception\InvalidArgumentException( + 'The size of the key must be at least of ' . $this->getKeySize() . ' bytes' + ); + } + $this->key = $key; + + return $this; + } + + /** + * Get the encryption key + * + * @return string + */ + public function getKey() + { + if (empty($this->key)) { + return null; + } + return substr($this->key, 0, $this->getKeySize()); + } + + /** + * Set the encryption algorithm (cipher) + * + * @param string $algo + * @throws Exception\InvalidArgumentException + * @return Mcrypt + */ + public function setAlgorithm($algo) + { + if (!array_key_exists($algo, $this->supportedAlgos)) { + throw new Exception\InvalidArgumentException( + "The algorithm $algo is not supported by " . __CLASS__ + ); + } + $this->algo = $algo; + + return $this; + } + + /** + * Get the encryption algorithm + * + * @return string + */ + public function getAlgorithm() + { + return $this->algo; + } + + /** + * Set the padding object + * + * @param Padding\PaddingInterface $padding + * @return Mcrypt + */ + public function setPadding(Padding\PaddingInterface $padding) + { + $this->padding = $padding; + + return $this; + } + + /** + * Get the padding object + * + * @return Padding\PaddingInterface + */ + public function getPadding() + { + return $this->padding; + } + + /** + * Encrypt + * + * @param string $data + * @throws Exception\InvalidArgumentException + * @return string + */ + public function encrypt($data) + { + if (empty($data)) { + throw new Exception\InvalidArgumentException('The data to encrypt cannot be empty'); + } + if (null === $this->getKey()) { + throw new Exception\InvalidArgumentException('No key specified for the encryption'); + } + if (null === $this->getSalt()) { + throw new Exception\InvalidArgumentException('The salt (IV) cannot be empty'); + } + if (null === $this->getPadding()) { + throw new Exception\InvalidArgumentException('You have to specify a padding method'); + } + // padding + $data = $this->padding->pad($data, $this->getBlockSize()); + $iv = $this->getSalt(); + // encryption + $result = mcrypt_encrypt( + $this->supportedAlgos[$this->algo], + $this->getKey(), + $data, + $this->supportedModes[$this->mode], + $iv + ); + + return $iv . $result; + } + + /** + * Decrypt + * + * @param string $data + * @throws Exception\InvalidArgumentException + * @return string + */ + public function decrypt($data) + { + if (empty($data)) { + throw new Exception\InvalidArgumentException('The data to decrypt cannot be empty'); + } + if (null === $this->getKey()) { + throw new Exception\InvalidArgumentException('No key specified for the decryption'); + } + if (null === $this->getPadding()) { + throw new Exception\InvalidArgumentException('You have to specify a padding method'); + } + $iv = substr($data, 0, $this->getSaltSize()); + $ciphertext = substr($data, $this->getSaltSize()); + $result = mcrypt_decrypt( + $this->supportedAlgos[$this->algo], + $this->getKey(), + $ciphertext, + $this->supportedModes[$this->mode], + $iv + ); + // unpadding + return $this->padding->strip($result); + } + + /** + * Get the salt (IV) size + * + * @return int + */ + public function getSaltSize() + { + return mcrypt_get_iv_size($this->supportedAlgos[$this->algo], + $this->supportedModes[$this->mode]); + } + + /** + * Get the supported algorithms + * + * @return array + */ + public function getSupportedAlgorithms() + { + return array_keys($this->supportedAlgos); + } + + /** + * Set the salt (IV) + * + * @param string $salt + * @throws Exception\InvalidArgumentException + * @return Mcrypt + */ + public function setSalt($salt) + { + if (empty($salt)) { + throw new Exception\InvalidArgumentException('The salt (IV) cannot be empty'); + } + if (strlen($salt) < $this->getSaltSize()) { + throw new Exception\InvalidArgumentException( + 'The size of the salt (IV) must be at least ' . $this->getSaltSize() . ' bytes' + ); + } + $this->iv = $salt; + + return $this; + } + + /** + * Get the salt (IV) according to the size requested by the algorithm + * + * @return string + */ + public function getSalt() + { + if (empty($this->iv)) { + return null; + } + if (strlen($this->iv) < $this->getSaltSize()) { + throw new Exception\RuntimeException( + 'The size of the salt (IV) must be at least ' . $this->getSaltSize() . ' bytes' + ); + } + + return substr($this->iv, 0, $this->getSaltSize()); + } + + /** + * Get the original salt value + * + * @return string + */ + public function getOriginalSalt() + { + return $this->iv; + } + + /** + * Set the cipher mode + * + * @param string $mode + * @throws Exception\InvalidArgumentException + * @return Mcrypt + */ + public function setMode($mode) + { + if (!empty($mode)) { + $mode = strtolower($mode); + if (!array_key_exists($mode, $this->supportedModes)) { + throw new Exception\InvalidArgumentException( + "The mode $mode is not supported by " . __CLASS__ + ); + } + $this->mode = $mode; + } + + return $this; + } + + /** + * Get the cipher mode + * + * @return string + */ + public function getMode() + { + return $this->mode; + } + + /** + * Get all supported encryption modes + * + * @return array + */ + public function getSupportedModes() + { + return array_keys($this->supportedModes); + } + + /** + * Get the block size + * + * @return int + */ + public function getBlockSize() + { + return mcrypt_get_block_size($this->supportedAlgos[$this->algo], + $this->supportedModes[$this->mode]); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/Padding/PaddingInterface.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/Padding/PaddingInterface.php new file mode 100644 index 0000000000..24924a7b90 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/Padding/PaddingInterface.php @@ -0,0 +1,30 @@ + 'Zend\Crypt\Symmetric\Padding\Pkcs7' + ); + + /** + * Do not share by default + * + * @var bool + */ + protected $shareByDefault = false; + + /** + * Validate the plugin + * + * Checks that the padding adapter loaded is an instance of Padding\PaddingInterface. + * + * @param mixed $plugin + * @return void + * @throws Exception\InvalidArgumentException if invalid + */ + public function validatePlugin($plugin) + { + if ($plugin instanceof Padding\PaddingInterface) { + // we're okay + return; + } + + throw new Exception\InvalidArgumentException(sprintf( + 'Plugin of type %s is invalid; must implement %s\Padding\PaddingInterface', + (is_object($plugin) ? get_class($plugin) : gettype($plugin)), + __NAMESPACE__ + )); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/SymmetricInterface.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/SymmetricInterface.php new file mode 100644 index 0000000000..2410dd9c02 --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Symmetric/SymmetricInterface.php @@ -0,0 +1,43 @@ + 'Zend\Crypt\Symmetric\Mcrypt', + ); + + /** + * Do not share by default + * + * @var bool + */ + protected $shareByDefault = false; + + /** + * Validate the plugin + * + * Checks that the adapter loaded is an instance + * of Symmetric\SymmetricInterface. + * + * @param mixed $plugin + * @return void + * @throws Exception\InvalidArgumentException if invalid + */ + public function validatePlugin($plugin) + { + if ($plugin instanceof Symmetric\SymmetricInterface) { + // we're okay + return; + } + + throw new Exception\InvalidArgumentException(sprintf( + 'Plugin of type %s is invalid; must implement %s\Symmetric\SymmetricInterface', + (is_object($plugin) ? get_class($plugin) : gettype($plugin)), + __NAMESPACE__ + )); + } +} diff --git a/vendor/zendframework/zend-crypt/Zend/Crypt/Utils.php b/vendor/zendframework/zend-crypt/Zend/Crypt/Utils.php new file mode 100644 index 0000000000..b9663363ae --- /dev/null +++ b/vendor/zendframework/zend-crypt/Zend/Crypt/Utils.php @@ -0,0 +1,45 @@ +=5.3.3", + "zendframework/zend-math": "self.version", + "zendframework/zend-stdlib": "self.version", + "zendframework/zend-servicemanager": "self.version" + }, + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + } +} diff --git a/vendor/zendframework/zend-loader/Zend/Loader/AutoloaderFactory.php b/vendor/zendframework/zend-loader/Zend/Loader/AutoloaderFactory.php new file mode 100644 index 0000000000..27ab200f3c --- /dev/null +++ b/vendor/zendframework/zend-loader/Zend/Loader/AutoloaderFactory.php @@ -0,0 +1,220 @@ + + * array( + * '' => $autoloaderOptions, + * ) + * + * + * The factory will then loop through and instantiate each autoloader with + * the specified options, and register each with the spl_autoloader. + * + * You may retrieve the concrete autoloader instances later using + * {@link getRegisteredAutoloaders()}. + * + * Note that the class names must be resolvable on the include_path or via + * the Zend library, using PSR-0 rules (unless the class has already been + * loaded). + * + * @param array|Traversable $options (optional) options to use. Defaults to Zend\Loader\StandardAutoloader + * @return void + * @throws Exception\InvalidArgumentException for invalid options + * @throws Exception\InvalidArgumentException for unloadable autoloader classes + * @throws Exception\DomainException for autoloader classes not implementing SplAutoloader + */ + public static function factory($options = null) + { + if (null === $options) { + if (!isset(static::$loaders[static::STANDARD_AUTOLOADER])) { + $autoloader = static::getStandardAutoloader(); + $autoloader->register(); + static::$loaders[static::STANDARD_AUTOLOADER] = $autoloader; + } + + // Return so we don't hit the next check's exception (we're done here anyway) + return; + } + + if (!is_array($options) && !($options instanceof Traversable)) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException( + 'Options provided must be an array or Traversable' + ); + } + + foreach ($options as $class => $autoloaderOptions) { + if (!isset(static::$loaders[$class])) { + $autoloader = static::getStandardAutoloader(); + if (!class_exists($class) && !$autoloader->autoload($class)) { + require_once 'Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException( + sprintf('Autoloader class "%s" not loaded', $class) + ); + } + + if (!static::isSubclassOf($class, 'Zend\Loader\SplAutoloader')) { + require_once 'Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException( + sprintf('Autoloader class %s must implement Zend\\Loader\\SplAutoloader', $class) + ); + } + + if ($class === static::STANDARD_AUTOLOADER) { + $autoloader->setOptions($autoloaderOptions); + } else { + $autoloader = new $class($autoloaderOptions); + } + $autoloader->register(); + static::$loaders[$class] = $autoloader; + } else { + static::$loaders[$class]->setOptions($autoloaderOptions); + } + } + } + + /** + * Get an list of all autoloaders registered with the factory + * + * Returns an array of autoloader instances. + * + * @return array + */ + public static function getRegisteredAutoloaders() + { + return static::$loaders; + } + + /** + * Retrieves an autoloader by class name + * + * @param string $class + * @return SplAutoloader + * @throws Exception\InvalidArgumentException for non-registered class + */ + public static function getRegisteredAutoloader($class) + { + if (!isset(static::$loaders[$class])) { + require_once 'Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException(sprintf('Autoloader class "%s" not loaded', $class)); + } + return static::$loaders[$class]; + } + + /** + * Unregisters all autoloaders that have been registered via the factory. + * This will NOT unregister autoloaders registered outside of the fctory. + * + * @return void + */ + public static function unregisterAutoloaders() + { + foreach (static::getRegisteredAutoloaders() as $class => $autoloader) { + spl_autoload_unregister(array($autoloader, 'autoload')); + unset(static::$loaders[$class]); + } + } + + /** + * Unregister a single autoloader by class name + * + * @param string $autoloaderClass + * @return bool + */ + public static function unregisterAutoloader($autoloaderClass) + { + if (!isset(static::$loaders[$autoloaderClass])) { + return false; + } + + $autoloader = static::$loaders[$autoloaderClass]; + spl_autoload_unregister(array($autoloader, 'autoload')); + unset(static::$loaders[$autoloaderClass]); + return true; + } + + /** + * Get an instance of the standard autoloader + * + * Used to attempt to resolve autoloader classes, using the + * StandardAutoloader. The instance is marked as a fallback autoloader, to + * allow resolving autoloaders not under the "Zend" namespace. + * + * @return SplAutoloader + */ + protected static function getStandardAutoloader() + { + if (null !== static::$standardAutoloader) { + return static::$standardAutoloader; + } + + + if (!class_exists(static::STANDARD_AUTOLOADER)) { + // Extract the filename from the classname + $stdAutoloader = substr(strrchr(static::STANDARD_AUTOLOADER, '\\'), 1); + require_once __DIR__ . "/$stdAutoloader.php"; + } + $loader = new StandardAutoloader(); + static::$standardAutoloader = $loader; + return static::$standardAutoloader; + } + + /** + * Checks if the object has this class as one of its parents + * + * @see https://bugs.php.net/bug.php?id=53727 + * @see https://github.com/zendframework/zf2/pull/1807 + * + * @param string $className + * @param string $type + * @return bool + */ + protected static function isSubclassOf($className, $type) + { + if (is_subclass_of($className, $type)) { + return true; + } + if (version_compare(PHP_VERSION, '5.3.7', '>=')) { + return false; + } + if (!interface_exists($type)) { + return false; + } + $r = new ReflectionClass($className); + return $r->implementsInterface($type); + } +} diff --git a/vendor/zendframework/zend-loader/Zend/Loader/ClassMapAutoloader.php b/vendor/zendframework/zend-loader/Zend/Loader/ClassMapAutoloader.php new file mode 100644 index 0000000000..216aae6f73 --- /dev/null +++ b/vendor/zendframework/zend-loader/Zend/Loader/ClassMapAutoloader.php @@ -0,0 +1,220 @@ +setOptions($options); + } + } + + /** + * Configure the autoloader + * + * Proxies to {@link registerAutoloadMaps()}. + * + * @param array|Traversable $options + * @return ClassMapAutoloader + */ + public function setOptions($options) + { + $this->registerAutoloadMaps($options); + return $this; + } + + /** + * Register an autoload map + * + * An autoload map may be either an associative array, or a file returning + * an associative array. + * + * An autoload map should be an associative array containing + * classname/file pairs. + * + * @param string|array $map + * @throws Exception\InvalidArgumentException + * @return ClassMapAutoloader + */ + public function registerAutoloadMap($map) + { + if (is_string($map)) { + $location = $map; + if ($this === ($map = $this->loadMapFromFile($location))) { + return $this; + } + } + + if (!is_array($map)) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException(sprintf( + 'Map file provided does not return a map. Map file: "%s"', + (isset($location) && is_string($location) ? $location : 'unexpected type: ' . gettype($map)) + )); + } + + $this->map = array_merge($this->map, $map); + + if (isset($location)) { + $this->mapsLoaded[] = $location; + } + + return $this; + } + + /** + * Register many autoload maps at once + * + * @param array $locations + * @throws Exception\InvalidArgumentException + * @return ClassMapAutoloader + */ + public function registerAutoloadMaps($locations) + { + if (!is_array($locations) && !($locations instanceof Traversable)) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException('Map list must be an array or implement Traversable'); + } + foreach ($locations as $location) { + $this->registerAutoloadMap($location); + } + return $this; + } + + /** + * Retrieve current autoload map + * + * @return array + */ + public function getAutoloadMap() + { + return $this->map; + } + + /** + * {@inheritDoc} + */ + public function autoload($class) + { + if (isset($this->map[$class])) { + require_once $this->map[$class]; + + return $class; + } + + return false; + } + + /** + * Register the autoloader with spl_autoload registry + * + * @return void + */ + public function register() + { + spl_autoload_register(array($this, 'autoload'), true, true); + } + + /** + * Load a map from a file + * + * If the map has been previously loaded, returns the current instance; + * otherwise, returns whatever was returned by calling include() on the + * location. + * + * @param string $location + * @return ClassMapAutoloader|mixed + * @throws Exception\InvalidArgumentException for nonexistent locations + */ + protected function loadMapFromFile($location) + { + if (!file_exists($location)) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException(sprintf( + 'Map file provided does not exist. Map file: "%s"', + (is_string($location) ? $location : 'unexpected type: ' . gettype($location)) + )); + } + + if (!$path = static::realPharPath($location)) { + $path = realpath($location); + } + + if (in_array($path, $this->mapsLoaded)) { + // Already loaded this map + return $this; + } + + $map = include $path; + + return $map; + } + + /** + * Resolve the real_path() to a file within a phar. + * + * @see https://bugs.php.net/bug.php?id=52769 + * @param string $path + * @return string + */ + public static function realPharPath($path) + { + if (strpos($path, 'phar:///') !== 0) { + return; + } + + $parts = explode('/', str_replace(array('/', '\\'), '/', substr($path, 8))); + $parts = array_values(array_filter($parts, function ($p) { + return ($p !== '' && $p !== '.'); + })); + + array_walk($parts, function ($value, $key) use (&$parts) { + if ($value === '..') { + unset($parts[$key], $parts[$key-1]); + $parts = array_values($parts); + } + }); + + if (file_exists($realPath = 'phar:///' . implode('/', $parts))) { + return $realPath; + } + } +} diff --git a/vendor/zendframework/zend-loader/Zend/Loader/Exception/BadMethodCallException.php b/vendor/zendframework/zend-loader/Zend/Loader/Exception/BadMethodCallException.php new file mode 100644 index 0000000000..b81099ad9b --- /dev/null +++ b/vendor/zendframework/zend-loader/Zend/Loader/Exception/BadMethodCallException.php @@ -0,0 +1,17 @@ + path + */ + protected $explicitPaths = array(); + + /** + * @var array An array of namespaceName => namespacePath + */ + protected $namespacedPaths = array(); + + /** + * @var array An array of supported phar extensions (filled on constructor) + */ + protected $pharExtensions = array(); + + /** + * @var array An array of module classes to their containing files + */ + protected $moduleClassMap = array(); + + /** + * Constructor + * + * Allow configuration of the autoloader via the constructor. + * + * @param null|array|Traversable $options + */ + public function __construct($options = null) + { + if (extension_loaded('phar')) { + $this->pharExtensions = array( + 'phar', + 'phar.tar', + 'tar', + ); + + // ext/zlib enabled -> phar can read gzip & zip compressed files + if (extension_loaded('zlib')) { + $this->pharExtensions[] = 'phar.gz'; + $this->pharExtensions[] = 'phar.tar.gz'; + $this->pharExtensions[] = 'tar.gz'; + + $this->pharExtensions[] = 'phar.zip'; + $this->pharExtensions[] = 'zip'; + } + + // ext/bzip2 enabled -> phar can read bz2 compressed files + if (extension_loaded('bzip2')) { + $this->pharExtensions[] = 'phar.bz2'; + $this->pharExtensions[] = 'phar.tar.bz2'; + $this->pharExtensions[] = 'tar.bz2'; + } + } + + if (null !== $options) { + $this->setOptions($options); + } + } + + /** + * Configure the autoloader + * + * In most cases, $options should be either an associative array or + * Traversable object. + * + * @param array|Traversable $options + * @return ModuleAutoloader + */ + public function setOptions($options) + { + $this->registerPaths($options); + return $this; + } + + /** + * Retrieves the class map for all loaded modules. + * + * @return array + */ + public function getModuleClassMap() + { + return $this->moduleClassMap; + } + + /** + * Sets the class map used to speed up the module autoloading. + * + * @param array $classmap + * @return ModuleAutoloader + */ + public function setModuleClassMap(array $classmap) + { + $this->moduleClassMap = $classmap; + + return $this; + } + + /** + * Autoload a class + * + * @param $class + * @return mixed + * False [if unable to load $class] + * get_class($class) [if $class is successfully loaded] + */ + public function autoload($class) + { + // Limit scope of this autoloader + if (substr($class, -7) !== '\Module') { + return false; + } + + if (isset($this->moduleClassMap[$class])) { + require_once $this->moduleClassMap[$class]; + return $class; + } + + $moduleName = substr($class, 0, -7); + if (isset($this->explicitPaths[$moduleName])) { + $classLoaded = $this->loadModuleFromDir($this->explicitPaths[$moduleName], $class); + if ($classLoaded) { + return $classLoaded; + } + + $classLoaded = $this->loadModuleFromPhar($this->explicitPaths[$moduleName], $class); + if ($classLoaded) { + return $classLoaded; + } + } + + if (count($this->namespacedPaths) >= 1) { + foreach ($this->namespacedPaths as $namespace => $path) { + if (false === strpos($moduleName, $namespace)) { + continue; + } + + $moduleNameBuffer = str_replace($namespace . "\\", "", $moduleName ); + $path .= DIRECTORY_SEPARATOR . $moduleNameBuffer . DIRECTORY_SEPARATOR; + + $classLoaded = $this->loadModuleFromDir($path, $class); + if ($classLoaded) { + return $classLoaded; + } + + $classLoaded = $this->loadModuleFromPhar($path, $class); + if ($classLoaded) { + return $classLoaded; + } + } + } + + + $moduleClassPath = str_replace('\\', DIRECTORY_SEPARATOR, $moduleName); + + $pharSuffixPattern = null; + if ($this->pharExtensions) { + $pharSuffixPattern = '(' . implode('|', array_map('preg_quote', $this->pharExtensions)) . ')'; + } + + foreach ($this->paths as $path) { + $path = $path . $moduleClassPath; + + $classLoaded = $this->loadModuleFromDir($path, $class); + if ($classLoaded) { + return $classLoaded; + } + + // No directory with Module.php, searching for phars + if ($pharSuffixPattern) { + foreach (new GlobIterator($path . '.*') as $entry) { + if ($entry->isDir()) { + continue; + } + + if (!preg_match('#.+\.' . $pharSuffixPattern . '$#', $entry->getPathname())) { + continue; + } + + $classLoaded = $this->loadModuleFromPhar($entry->getPathname(), $class); + if ($classLoaded) { + return $classLoaded; + } + } + } + } + + return false; + } + + /** + * loadModuleFromDir + * + * @param string $dirPath + * @param string $class + * @return mixed + * False [if unable to load $class] + * get_class($class) [if $class is successfully loaded] + */ + protected function loadModuleFromDir($dirPath, $class) + { + $file = new SplFileInfo($dirPath . '/Module.php'); + if ($file->isReadable() && $file->isFile()) { + // Found directory with Module.php in it + require_once $file->getRealPath(); + if (class_exists($class)) { + $this->moduleClassMap[$class] = $file->getRealPath(); + return $class; + } + } + return false; + } + + /** + * loadModuleFromPhar + * + * @param string $pharPath + * @param string $class + * @return mixed + * False [if unable to load $class] + * get_class($class) [if $class is successfully loaded] + */ + protected function loadModuleFromPhar($pharPath, $class) + { + $pharPath = static::normalizePath($pharPath, false); + $file = new SplFileInfo($pharPath); + if (!$file->isReadable() || !$file->isFile()) { + return false; + } + + $fileRealPath = $file->getRealPath(); + + // Phase 0: Check for executable phar with Module class in stub + if (strpos($fileRealPath, '.phar') !== false) { + // First see if the stub makes the Module class available + require_once $fileRealPath; + if (class_exists($class)) { + $this->moduleClassMap[$class] = $fileRealPath; + return $class; + } + } + + // Phase 1: Not executable phar, no stub, or stub did not provide Module class; try Module.php directly + $moduleClassFile = 'phar://' . $fileRealPath . '/Module.php'; + $moduleFile = new SplFileInfo($moduleClassFile); + if ($moduleFile->isReadable() && $moduleFile->isFile()) { + require_once $moduleClassFile; + if (class_exists($class)) { + $this->moduleClassMap[$class] = $moduleClassFile; + return $class; + } + } + + // Phase 2: Check for nested module directory within archive + // Checks for /path/to/MyModule.tar/MyModule/Module.php + // (shell-integrated zip/tar utilities wrap directories like this) + $pharBaseName = $this->pharFileToModuleName($fileRealPath); + $moduleClassFile = 'phar://' . $fileRealPath . '/' . $pharBaseName . '/Module.php'; + $moduleFile = new SplFileInfo($moduleClassFile); + if ($moduleFile->isReadable() && $moduleFile->isFile()) { + require_once $moduleClassFile; + if (class_exists($class)) { + $this->moduleClassMap[$class] = $moduleClassFile; + return $class; + } + } + + return false; + } + + /** + * Register the autoloader with spl_autoload registry + * + * @return void + */ + public function register() + { + spl_autoload_register(array($this, 'autoload')); + } + + /** + * Unregister the autoloader with spl_autoload registry + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'autoload')); + } + + /** + * registerPaths + * + * @param array|Traversable $paths + * @throws \InvalidArgumentException + * @return ModuleAutoloader + */ + public function registerPaths($paths) + { + if (!is_array($paths) && !$paths instanceof Traversable) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException( + 'Parameter to \\Zend\\Loader\\ModuleAutoloader\'s ' + . 'registerPaths method must be an array or ' + . 'implement the Traversable interface' + ); + } + + foreach ($paths as $module => $path) { + if (is_string($module)) { + $this->registerPath($path, $module); + } else { + $this->registerPath($path); + } + } + + return $this; + } + + /** + * registerPath + * + * @param string $path + * @param bool|string $moduleName + * @throws \InvalidArgumentException + * @return ModuleAutoloader + */ + public function registerPath($path, $moduleName = false) + { + if (!is_string($path)) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException(sprintf( + 'Invalid path provided; must be a string, received %s', + gettype($path) + )); + } + if ($moduleName) { + if (in_array( substr($moduleName, -2), array('\\*', '\\%'))) { + $this->namespacedPaths[substr($moduleName, 0, -2)] = static::normalizePath($path); + } else { + $this->explicitPaths[$moduleName] = static::normalizePath($path); + } + } else { + $this->paths[] = static::normalizePath($path); + } + return $this; + } + + /** + * getPaths + * + * This is primarily for unit testing, but could have other uses. + * + * @return array + */ + public function getPaths() + { + return $this->paths; + } + + /** + * Returns the base module name from the path to a phar + * + * @param string $pharPath + * @return string + */ + protected function pharFileToModuleName($pharPath) + { + do { + $pathinfo = pathinfo($pharPath); + $pharPath = $pathinfo['filename']; + } while (isset($pathinfo['extension'])); + return $pathinfo['filename']; + } + + /** + * Normalize a path for insertion in the stack + * + * @param string $path + * @param bool $trailingSlash Whether trailing slash should be included + * @return string + */ + public static function normalizePath($path, $trailingSlash = true) + { + $path = rtrim($path, '/'); + $path = rtrim($path, '\\'); + if ($trailingSlash) { + $path .= DIRECTORY_SEPARATOR; + } + return $path; + } +} diff --git a/vendor/zendframework/zend-loader/Zend/Loader/PluginClassLoader.php b/vendor/zendframework/zend-loader/Zend/Loader/PluginClassLoader.php new file mode 100644 index 0000000000..a2223d5305 --- /dev/null +++ b/vendor/zendframework/zend-loader/Zend/Loader/PluginClassLoader.php @@ -0,0 +1,217 @@ + class name pairs + * @var array + */ + protected $plugins = array(); + + /** + * Static map allow global seeding of plugin loader + * @var array + */ + protected static $staticMap = array(); + + /** + * Constructor + * + * @param null|array|Traversable $map If provided, seeds the loader with a map + */ + public function __construct($map = null) + { + // Merge in static overrides + if (!empty(static::$staticMap)) { + $this->registerPlugins(static::$staticMap); + } + + // Merge in constructor arguments + if ($map !== null) { + $this->registerPlugins($map); + } + } + + /** + * Add a static map of plugins + * + * A null value will clear the static map. + * + * @param null|array|Traversable $map + * @throws Exception\InvalidArgumentException + * @return void + */ + public static function addStaticMap($map) + { + if (null === $map) { + static::$staticMap = array(); + return; + } + + if (!is_array($map) && !$map instanceof Traversable) { + throw new Exception\InvalidArgumentException('Expects an array or Traversable object'); + } + foreach ($map as $key => $value) { + static::$staticMap[$key] = $value; + } + } + + /** + * Register a class to a given short name + * + * @param string $shortName + * @param string $className + * @return PluginClassLoader + */ + public function registerPlugin($shortName, $className) + { + $this->plugins[strtolower($shortName)] = $className; + return $this; + } + + /** + * Register many plugins at once + * + * If $map is a string, assumes that the map is the class name of a + * Traversable object (likely a ShortNameLocator); it will then instantiate + * this class and use it to register plugins. + * + * If $map is an array or Traversable object, it will iterate it to + * register plugin names/classes. + * + * For all other arguments, or if the string $map is not a class or not a + * Traversable class, an exception will be raised. + * + * @param string|array|Traversable $map + * @return PluginClassLoader + * @throws Exception\InvalidArgumentException + */ + public function registerPlugins($map) + { + if (is_string($map)) { + if (!class_exists($map)) { + throw new Exception\InvalidArgumentException('Map class provided is invalid'); + } + $map = new $map; + } + if (is_array($map)) { + $map = new ArrayIterator($map); + } + if (!$map instanceof Traversable) { + throw new Exception\InvalidArgumentException('Map provided is invalid; must be traversable'); + } + + // iterator_apply doesn't work as expected with IteratorAggregate + if ($map instanceof IteratorAggregate) { + $map = $map->getIterator(); + } + + foreach ($map as $name => $class) { + if (is_int($name) || is_numeric($name)) { + if (!is_object($class) && class_exists($class)) { + $class = new $class(); + } + + if ($class instanceof Traversable) { + $this->registerPlugins($class); + continue; + } + } + + $this->registerPlugin($name, $class); + } + + return $this; + } + + /** + * Unregister a short name lookup + * + * @param mixed $shortName + * @return PluginClassLoader + */ + public function unregisterPlugin($shortName) + { + $lookup = strtolower($shortName); + if (array_key_exists($lookup, $this->plugins)) { + unset($this->plugins[$lookup]); + } + return $this; + } + + /** + * Get a list of all registered plugins + * + * @return array|Traversable + */ + public function getRegisteredPlugins() + { + return $this->plugins; + } + + /** + * Whether or not a plugin by a specific name has been registered + * + * @param string $name + * @return bool + */ + public function isLoaded($name) + { + $lookup = strtolower($name); + return isset($this->plugins[$lookup]); + } + + /** + * Return full class name for a named helper + * + * @param string $name + * @return string|false + */ + public function getClassName($name) + { + return $this->load($name); + } + + /** + * Load a helper via the name provided + * + * @param string $name + * @return string|false + */ + public function load($name) + { + if (!$this->isLoaded($name)) { + return false; + } + return $this->plugins[strtolower($name)]; + } + + /** + * Defined by IteratorAggregate + * + * Returns an instance of ArrayIterator, containing a map of + * all plugins + * + * @return ArrayIterator + */ + public function getIterator() + { + return new ArrayIterator($this->plugins); + } +} diff --git a/vendor/zendframework/zend-loader/Zend/Loader/PluginClassLocator.php b/vendor/zendframework/zend-loader/Zend/Loader/PluginClassLocator.php new file mode 100644 index 0000000000..0c79601077 --- /dev/null +++ b/vendor/zendframework/zend-loader/Zend/Loader/PluginClassLocator.php @@ -0,0 +1,43 @@ + + * spl_autoload_register(array($this, 'autoload')); + * + * + * @return void + */ + public function register(); +} diff --git a/vendor/zendframework/zend-loader/Zend/Loader/StandardAutoloader.php b/vendor/zendframework/zend-loader/Zend/Loader/StandardAutoloader.php new file mode 100644 index 0000000000..204db8732e --- /dev/null +++ b/vendor/zendframework/zend-loader/Zend/Loader/StandardAutoloader.php @@ -0,0 +1,327 @@ +setOptions($options); + } + } + + /** + * Configure autoloader + * + * Allows specifying both "namespace" and "prefix" pairs, using the + * following structure: + * + * array( + * 'namespaces' => array( + * 'Zend' => '/path/to/Zend/library', + * 'Doctrine' => '/path/to/Doctrine/library', + * ), + * 'prefixes' => array( + * 'Phly_' => '/path/to/Phly/library', + * ), + * 'fallback_autoloader' => true, + * ) + * + * + * @param array|\Traversable $options + * @throws Exception\InvalidArgumentException + * @return StandardAutoloader + */ + public function setOptions($options) + { + if (!is_array($options) && !($options instanceof \Traversable)) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException('Options must be either an array or Traversable'); + } + + foreach ($options as $type => $pairs) { + switch ($type) { + case self::AUTOREGISTER_ZF: + if ($pairs) { + $this->registerNamespace('Zend', dirname(__DIR__)); + } + break; + case self::LOAD_NS: + if (is_array($pairs) || $pairs instanceof \Traversable) { + $this->registerNamespaces($pairs); + } + break; + case self::LOAD_PREFIX: + if (is_array($pairs) || $pairs instanceof \Traversable) { + $this->registerPrefixes($pairs); + } + break; + case self::ACT_AS_FALLBACK: + $this->setFallbackAutoloader($pairs); + break; + default: + // ignore + } + } + return $this; + } + + /** + * Set flag indicating fallback autoloader status + * + * @param bool $flag + * @return StandardAutoloader + */ + public function setFallbackAutoloader($flag) + { + $this->fallbackAutoloaderFlag = (bool) $flag; + return $this; + } + + /** + * Is this autoloader acting as a fallback autoloader? + * + * @return bool + */ + public function isFallbackAutoloader() + { + return $this->fallbackAutoloaderFlag; + } + + /** + * Register a namespace/directory pair + * + * @param string $namespace + * @param string $directory + * @return StandardAutoloader + */ + public function registerNamespace($namespace, $directory) + { + $namespace = rtrim($namespace, self::NS_SEPARATOR) . self::NS_SEPARATOR; + $this->namespaces[$namespace] = $this->normalizeDirectory($directory); + return $this; + } + + /** + * Register many namespace/directory pairs at once + * + * @param array $namespaces + * @throws Exception\InvalidArgumentException + * @return StandardAutoloader + */ + public function registerNamespaces($namespaces) + { + if (!is_array($namespaces) && !$namespaces instanceof \Traversable) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException('Namespace pairs must be either an array or Traversable'); + } + + foreach ($namespaces as $namespace => $directory) { + $this->registerNamespace($namespace, $directory); + } + return $this; + } + + /** + * Register a prefix/directory pair + * + * @param string $prefix + * @param string $directory + * @return StandardAutoloader + */ + public function registerPrefix($prefix, $directory) + { + $prefix = rtrim($prefix, self::PREFIX_SEPARATOR). self::PREFIX_SEPARATOR; + $this->prefixes[$prefix] = $this->normalizeDirectory($directory); + return $this; + } + + /** + * Register many namespace/directory pairs at once + * + * @param array $prefixes + * @throws Exception\InvalidArgumentException + * @return StandardAutoloader + */ + public function registerPrefixes($prefixes) + { + if (!is_array($prefixes) && !$prefixes instanceof \Traversable) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException('Prefix pairs must be either an array or Traversable'); + } + + foreach ($prefixes as $prefix => $directory) { + $this->registerPrefix($prefix, $directory); + } + return $this; + } + + /** + * Defined by Autoloadable; autoload a class + * + * @param string $class + * @return false|string + */ + public function autoload($class) + { + $isFallback = $this->isFallbackAutoloader(); + if (false !== strpos($class, self::NS_SEPARATOR)) { + if ($this->loadClass($class, self::LOAD_NS)) { + return $class; + } elseif ($isFallback) { + return $this->loadClass($class, self::ACT_AS_FALLBACK); + } + return false; + } + if (false !== strpos($class, self::PREFIX_SEPARATOR)) { + if ($this->loadClass($class, self::LOAD_PREFIX)) { + return $class; + } elseif ($isFallback) { + return $this->loadClass($class, self::ACT_AS_FALLBACK); + } + return false; + } + if ($isFallback) { + return $this->loadClass($class, self::ACT_AS_FALLBACK); + } + return false; + } + + /** + * Register the autoloader with spl_autoload + * + * @return void + */ + public function register() + { + spl_autoload_register(array($this, 'autoload')); + } + + /** + * Transform the class name to a filename + * + * @param string $class + * @param string $directory + * @return string + */ + protected function transformClassNameToFilename($class, $directory) + { + // $class may contain a namespace portion, in which case we need + // to preserve any underscores in that portion. + $matches = array(); + preg_match('/(?P.+\\\)?(?P[^\\\]+$)/', $class, $matches); + + $class = (isset($matches['class'])) ? $matches['class'] : ''; + $namespace = (isset($matches['namespace'])) ? $matches['namespace'] : ''; + + return $directory + . str_replace(self::NS_SEPARATOR, '/', $namespace) + . str_replace(self::PREFIX_SEPARATOR, '/', $class) + . '.php'; + } + + /** + * Load a class, based on its type (namespaced or prefixed) + * + * @param string $class + * @param string $type + * @return bool|string + * @throws Exception\InvalidArgumentException + */ + protected function loadClass($class, $type) + { + if (!in_array($type, array(self::LOAD_NS, self::LOAD_PREFIX, self::ACT_AS_FALLBACK))) { + require_once __DIR__ . '/Exception/InvalidArgumentException.php'; + throw new Exception\InvalidArgumentException(); + } + + // Fallback autoloading + if ($type === self::ACT_AS_FALLBACK) { + // create filename + $filename = $this->transformClassNameToFilename($class, ''); + $resolvedName = stream_resolve_include_path($filename); + if ($resolvedName !== false) { + return include $resolvedName; + } + return false; + } + + // Namespace and/or prefix autoloading + foreach ($this->$type as $leader => $path) { + if (0 === strpos($class, $leader)) { + // Trim off leader (namespace or prefix) + $trimmedClass = substr($class, strlen($leader)); + + // create filename + $filename = $this->transformClassNameToFilename($trimmedClass, $path); + if (file_exists($filename)) { + return include $filename; + } + return false; + } + } + return false; + } + + /** + * Normalize the directory to include a trailing directory separator + * + * @param string $directory + * @return string + */ + protected function normalizeDirectory($directory) + { + $last = $directory[strlen($directory) - 1]; + if (in_array($last, array('/', '\\'))) { + $directory[strlen($directory) - 1] = DIRECTORY_SEPARATOR; + return $directory; + } + $directory .= DIRECTORY_SEPARATOR; + return $directory; + } +} diff --git a/vendor/zendframework/zend-loader/Zend/Loader/composer.json b/vendor/zendframework/zend-loader/Zend/Loader/composer.json new file mode 100644 index 0000000000..fffd5df415 --- /dev/null +++ b/vendor/zendframework/zend-loader/Zend/Loader/composer.json @@ -0,0 +1,24 @@ +{ + "name": "zendframework/zend-loader", + "description": " ", + "license": "BSD-3-Clause", + "keywords": [ + "zf2", + "loader" + ], + "autoload": { + "psr-0": { + "Zend\\Loader\\": "" + } + }, + "target-dir": "Zend/Loader", + "require": { + "php": ">=5.3.3" + }, + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Address.php b/vendor/zendframework/zend-mail/Zend/Mail/Address.php new file mode 100644 index 0000000000..385b9d8638 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Address.php @@ -0,0 +1,74 @@ +email = $email; + $this->name = $name; + } + + /** + * Retrieve email + * + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Retrieve name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * String representation of address + * + * @return string + */ + public function toString() + { + $string = '<' . $this->getEmail() . '>'; + $name = $this->getName(); + if (null === $name) { + return $string; + } + + $string = $name . ' ' . $string; + return $string; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Address/AddressInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Address/AddressInterface.php new file mode 100644 index 0000000000..2b88b81c12 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Address/AddressInterface.php @@ -0,0 +1,17 @@ +createAddress($emailOrAddress, $name); + } elseif (!$emailOrAddress instanceof Address\AddressInterface) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects an email address or %s\Address object as its first argument; received "%s"', + __METHOD__, + __NAMESPACE__, + (is_object($emailOrAddress) ? get_class($emailOrAddress) : gettype($emailOrAddress)) + )); + } + + $email = strtolower($emailOrAddress->getEmail()); + if ($this->has($email)) { + return $this; + } + + $this->addresses[$email] = $emailOrAddress; + return $this; + } + + /** + * Add many addresses at once + * + * If an email key is provided, it will be used as the email, and the value + * as the name. Otherwise, the value is passed as the sole argument to add(), + * and, as such, can be either email strings or Address\AddressInterface objects. + * + * @param array $addresses + * @throws Exception\RuntimeException + * @return AddressList + */ + public function addMany(array $addresses) + { + foreach ($addresses as $key => $value) { + if (is_int($key) || is_numeric($key)) { + $this->add($value); + } elseif (is_string($key)) { + $this->add($key, $value); + } else { + throw new Exception\RuntimeException(sprintf( + 'Invalid key type in provided addresses array ("%s")', + (is_object($key) ? get_class($key) : var_export($key, 1)) + )); + } + } + return $this; + } + + /** + * Merge another address list into this one + * + * @param AddressList $addressList + * @return AddressList + */ + public function merge(AddressList $addressList) + { + foreach ($addressList as $address) { + $this->add($address); + } + return $this; + } + + /** + * Does the email exist in this list? + * + * @param string $email + * @return bool + */ + public function has($email) + { + $email = strtolower($email); + return isset($this->addresses[$email]); + } + + /** + * Get an address by email + * + * @param string $email + * @return bool|Address\AddressInterface + */ + public function get($email) + { + $email = strtolower($email); + if (!isset($this->addresses[$email])) { + return false; + } + + return $this->addresses[$email]; + } + + /** + * Delete an address from the list + * + * @param string $email + * @return bool + */ + public function delete($email) + { + $email = strtolower($email); + if (!isset($this->addresses[$email])) { + return false; + } + + unset($this->addresses[$email]); + return true; + } + + /** + * Return count of addresses + * + * @return int + */ + public function count() + { + return count($this->addresses); + } + + /** + * Rewind iterator + * + * @return mixed the value of the first addresses element, or false if the addresses is + * empty. + * @see addresses + */ + public function rewind() + { + return reset($this->addresses); + } + + /** + * Return current item in iteration + * + * @return Address + */ + public function current() + { + return current($this->addresses); + } + + /** + * Return key of current item of iteration + * + * @return string + */ + public function key() + { + return key($this->addresses); + } + + /** + * Move to next item + * + * @return mixed the addresses value in the next place that's pointed to by the + * internal array pointer, or false if there are no more elements. + * @see addresses + */ + public function next() + { + return next($this->addresses); + } + + /** + * Is the current item of iteration valid? + * + * @return bool + */ + public function valid() + { + $key = key($this->addresses); + return ($key !== null && $key !== false); + } + + /** + * Create an address object + * + * @param string $email + * @param string|null $name + * @return Address + */ + protected function createAddress($email, $name) + { + return new Address($email, $name); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Exception/BadMethodCallException.php b/vendor/zendframework/zend-mail/Zend/Mail/Exception/BadMethodCallException.php new file mode 100644 index 0000000000..2734fa851c --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Exception/BadMethodCallException.php @@ -0,0 +1,18 @@ +setEncoding('UTF-8'); + } + // split value on "," + $fieldValue = str_replace(Headers::FOLDING, ' ', $fieldValue); + $values = explode(',', $fieldValue); + array_walk($values, 'trim'); + + $addressList = $header->getAddressList(); + foreach ($values as $address) { + // split values into name/email + if (!preg_match('/^((?P.*?)<(?P[^>]+)>|(?P.+))$/', $address, $matches)) { + // Should we raise an exception here? + continue; + } + $name = null; + if (isset($matches['name'])) { + $name = trim($matches['name']); + } + if (empty($name)) { + $name = null; + } + + if (isset($matches['namedEmail'])) { + $email = $matches['namedEmail']; + } + if (isset($matches['email'])) { + $email = $matches['email']; + } + $email = trim($email); // we may have leading whitespace + + // populate address list + $addressList->add($email, $name); + } + return $header; + } + + public function getFieldName() + { + return $this->fieldName; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + $emails = array(); + $encoding = $this->getEncoding(); + foreach ($this->getAddressList() as $address) { + $email = $address->getEmail(); + $name = $address->getName(); + if (empty($name)) { + $emails[] = $email; + } else { + if (false !== strstr($name, ',')) { + $name = sprintf('"%s"', $name); + } + + if ($format == HeaderInterface::FORMAT_ENCODED + && 'ASCII' !== $encoding + ) { + $name = HeaderWrap::mimeEncodeValue($name, $encoding); + } + $emails[] = sprintf('%s <%s>', $name, $email); + } + } + + return implode(',' . Headers::FOLDING, $emails); + } + + public function setEncoding($encoding) + { + $this->encoding = $encoding; + return $this; + } + + public function getEncoding() + { + return $this->encoding; + } + + /** + * Set address list for this header + * + * @param AddressList $addressList + */ + public function setAddressList(AddressList $addressList) + { + $this->addressList = $addressList; + } + + /** + * Get address list managed by this header + * + * @return AddressList + */ + public function getAddressList() + { + if (null === $this->addressList) { + $this->setAddressList(new AddressList()); + } + return $this->addressList; + } + + public function toString() + { + $name = $this->getFieldName(); + $value = $this->getFieldValue(HeaderInterface::FORMAT_ENCODED); + return (empty($value)) ? '' : sprintf('%s: %s', $name, $value); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/Bcc.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/Bcc.php new file mode 100644 index 0000000000..53f8a746c6 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/Bcc.php @@ -0,0 +1,16 @@ +setTransferEncoding($value); + + return $header; + } + + public function getFieldName() + { + return 'Content-Transfer-Encoding'; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + return $this->transferEncoding; + } + + public function setEncoding($encoding) + { + // Header must be always in US-ASCII + return $this; + } + + public function getEncoding() + { + return 'ASCII'; + } + + public function toString() + { + return 'Content-Transfer-Encoding: ' . $this->getFieldValue(); + } + + /** + * Set the content transfer encoding + * + * @param string $transferEncoding + * @throws Exception\InvalidArgumentException + * @return self + */ + public function setTransferEncoding($transferEncoding) + { + if (!in_array($transferEncoding, self::$allowedTransferEncodings)) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects one of "'. implode(', ', self::$allowedTransferEncodings) . '"; received "%s"', + __METHOD__, + (string) $transferEncoding + )); + } + $this->transferEncoding = $transferEncoding; + return $this; + } + + /** + * Retrieve the content transfer encoding + * + * @return string + */ + public function getTransferEncoding() + { + return $this->transferEncoding; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/ContentType.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/ContentType.php new file mode 100644 index 0000000000..ab8a373ecf --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/ContentType.php @@ -0,0 +1,174 @@ +setType($type); + + if (count($values)) { + foreach ($values as $keyValuePair) { + list($key, $value) = explode('=', $keyValuePair, 2); + $value = trim($value, "'\" \t\n\r\0\x0B"); + $header->addParameter($key, $value); + } + } + + return $header; + } + + public function getFieldName() + { + return 'Content-Type'; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + $prepared = $this->type; + if (empty($this->parameters)) { + return $prepared; + } + + $values = array($prepared); + foreach ($this->parameters as $attribute => $value) { + $values[] = sprintf('%s="%s"', $attribute, $value); + } + + return implode(';' . Headers::FOLDING, $values); + } + + public function setEncoding($encoding) + { + // This header must be always in US-ASCII + return $this; + } + + public function getEncoding() + { + return 'ASCII'; + } + + public function toString() + { + return 'Content-Type: ' . $this->getFieldValue(); + } + + /** + * Set the content type + * + * @param string $type + * @throws Exception\InvalidArgumentException + * @return ContentType + */ + public function setType($type) + { + if (!preg_match('/^[a-z-]+\/[a-z0-9.+-]+$/i', $type)) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects a value in the format "type/subtype"; received "%s"', + __METHOD__, + (string) $type + )); + } + $this->type = $type; + return $this; + } + + /** + * Retrieve the content type + * + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Add a parameter pair + * + * @param string $name + * @param string $value + * @return ContentType + */ + public function addParameter($name, $value) + { + $name = strtolower($name); + $this->parameters[$name] = (string) $value; + return $this; + } + + /** + * Get all parameters + * + * @return array + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Get a parameter by name + * + * @param string $name + * @return null|string + */ + public function getParameter($name) + { + $name = strtolower($name); + if (isset($this->parameters[$name])) { + return $this->parameters[$name]; + } + return null; + } + + /** + * Remove a named parameter + * + * @param string $name + * @return bool + */ + public function removeParameter($name) + { + $name = strtolower($name); + if (isset($this->parameters[$name])) { + unset($this->parameters[$name]); + return true; + } + return false; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/Date.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/Date.php new file mode 100644 index 0000000000..2f2cae88d8 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/Date.php @@ -0,0 +1,66 @@ +value = $value; + } + + public function getFieldName() + { + return 'Date'; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + return $this->value; + } + + public function setEncoding($encoding) + { + // This header must be always in US-ASCII + return $this; + } + + public function getEncoding() + { + return 'ASCII'; + } + + public function toString() + { + return 'Date: ' . $this->getFieldValue(); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/Exception/BadMethodCallException.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/Exception/BadMethodCallException.php new file mode 100644 index 0000000000..ee9160a0fe --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/Exception/BadMethodCallException.php @@ -0,0 +1,17 @@ +setEncoding('UTF-8'); + } + return $header; + } + + /** + * Splits the header line in `name` and `value` parts. + * + * @param string $headerLine + * @return string[] `name` in the first index and `value` in the second. + * @throws Exception\InvalidArgumentException If header does not match with the format ``name:value`` + */ + public static function splitHeaderLine($headerLine) + { + $parts = explode(':', $headerLine, 2); + if (count($parts) !== 2) { + throw new Exception\InvalidArgumentException('Header must match with the format "name:value"'); + } + + $parts[1] = ltrim($parts[1]); + + return $parts; + } + + /** + * Constructor + * + * @param string $fieldName Optional + * @param string $fieldValue Optional + */ + public function __construct($fieldName = null, $fieldValue = null) + { + if ($fieldName) { + $this->setFieldName($fieldName); + } + + if ($fieldValue) { + $this->setFieldValue($fieldValue); + } + } + + /** + * Set header name + * + * @param string $fieldName + * @throws Exception\InvalidArgumentException + * @return GenericHeader + */ + public function setFieldName($fieldName) + { + if (!is_string($fieldName) || empty($fieldName)) { + throw new Exception\InvalidArgumentException('Header name must be a string'); + } + + // Pre-filter to normalize valid characters, change underscore to dash + $fieldName = str_replace(' ', '-', ucwords(str_replace(array('_', '-'), ' ', $fieldName))); + + // Validate what we have + if (!preg_match('/^[\x21-\x39\x3B-\x7E]*$/', $fieldName)) { + throw new Exception\InvalidArgumentException( + 'Header name must be composed of printable US-ASCII characters, except colon.' + ); + } + + $this->fieldName = $fieldName; + return $this; + } + + public function getFieldName() + { + return $this->fieldName; + } + + /** + * Set header value + * + * @param string $fieldValue + * @return GenericHeader + */ + public function setFieldValue($fieldValue) + { + $fieldValue = (string) $fieldValue; + + if (empty($fieldValue) || preg_match('/^\s+$/', $fieldValue)) { + $fieldValue = ''; + } + + $this->fieldValue = $fieldValue; + return $this; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + if (HeaderInterface::FORMAT_ENCODED === $format) { + return HeaderWrap::wrap($this->fieldValue, $this); + } + + return $this->fieldValue; + } + + public function setEncoding($encoding) + { + $this->encoding = $encoding; + return $this; + } + + public function getEncoding() + { + return $this->encoding; + } + + public function toString() + { + $name = $this->getFieldName(); + $value = $this->getFieldValue(HeaderInterface::FORMAT_ENCODED); + + return $name . ': ' . $value; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/GenericMultiHeader.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/GenericMultiHeader.php new file mode 100644 index 0000000000..a77ba43d53 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/GenericMultiHeader.php @@ -0,0 +1,61 @@ +setEncoding($encoding); + + } + return $headers; + } else { + $header = new static($fieldName, $fieldValue); + if ($decodedLine != $headerLine) { + $header->setEncoding('UTF-8'); + } + return $header; + } + } + + /** + * Cast multiple header objects to a single string header + * + * @param array $headers + * @throws Exception\InvalidArgumentException + * @return string + */ + public function toStringMultipleHeaders(array $headers) + { + $name = $this->getFieldName(); + $values = array($this->getFieldValue(HeaderInterface::FORMAT_ENCODED)); + foreach ($headers as $header) { + if (!$header instanceof static) { + throw new Exception\InvalidArgumentException( + 'This method toStringMultipleHeaders was expecting an array of headers of the same type' + ); + } + $values[] = $header->getFieldValue(HeaderInterface::FORMAT_ENCODED); + } + return $name . ': ' . implode(',', $values); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/HeaderInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/HeaderInterface.php new file mode 100644 index 0000000000..35803cf9bf --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/HeaderInterface.php @@ -0,0 +1,77 @@ + 'Zend\Mail\Header\Bcc', + 'cc' => 'Zend\Mail\Header\Cc', + 'contenttype' => 'Zend\Mail\Header\ContentType', + 'content_type' => 'Zend\Mail\Header\ContentType', + 'content-type' => 'Zend\Mail\Header\ContentType', + 'contenttransferencoding' => 'Zend\Mail\Header\ContentTransferEncoding', + 'content_transfer_encoding' => 'Zend\Mail\Header\ContentTransferEncoding', + 'content-transfer-encoding' => 'Zend\Mail\Header\ContentTransferEncoding', + 'date' => 'Zend\Mail\Header\Date', + 'from' => 'Zend\Mail\Header\From', + 'message-id' => 'Zend\Mail\Header\MessageId', + 'mimeversion' => 'Zend\Mail\Header\MimeVersion', + 'mime_version' => 'Zend\Mail\Header\MimeVersion', + 'mime-version' => 'Zend\Mail\Header\MimeVersion', + 'received' => 'Zend\Mail\Header\Received', + 'replyto' => 'Zend\Mail\Header\ReplyTo', + 'reply_to' => 'Zend\Mail\Header\ReplyTo', + 'reply-to' => 'Zend\Mail\Header\ReplyTo', + 'sender' => 'Zend\Mail\Header\Sender', + 'subject' => 'Zend\Mail\Header\Subject', + 'to' => 'Zend\Mail\Header\To', + ); +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/HeaderWrap.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/HeaderWrap.php new file mode 100644 index 0000000000..4ea98f6a17 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/HeaderWrap.php @@ -0,0 +1,95 @@ +getEncoding(); + if ($encoding == 'ASCII') { + return wordwrap($value, 78, Headers::FOLDING); + } + return static::mimeEncodeValue($value, $encoding, 78); + } + + /** + * Wrap a structured header line + * + * @param string $value + * @param StructuredInterface $header + * @return string + */ + protected static function wrapStructuredHeader($value, StructuredInterface $header) + { + $delimiter = $header->getDelimiter(); + + $length = strlen($value); + $lines = array(); + $temp = ''; + for ($i = 0; $i < $length; $i++) { + $temp .= $value[$i]; + if ($value[$i] == $delimiter) { + $lines[] = $temp; + $temp = ''; + } + } + return implode(Headers::FOLDING, $lines); + } + + /** + * MIME-encode a value + * + * Performs quoted-printable encoding on a value, setting maximum + * line-length to 998. + * + * @param string $value + * @param string $encoding + * @param int $lineLength maximum line-length, by default 998 + * @return string Returns the mime encode value without the last line ending + */ + public static function mimeEncodeValue($value, $encoding, $lineLength = 998) + { + return Mime::encodeQuotedPrintableHeader($value, $encoding, $lineLength, Headers::EOL); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/MessageId.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/MessageId.php new file mode 100644 index 0000000000..27ef715639 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/MessageId.php @@ -0,0 +1,114 @@ +setId($value); + + return $header; + } + + public function getFieldName() + { + return 'Message-ID'; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + return $this->messageId; + } + + public function setEncoding($encoding) + { + // This header must be always in US-ASCII + return $this; + } + + public function getEncoding() + { + return 'ASCII'; + } + + public function toString() + { + return 'Message-ID: ' . $this->getFieldValue(); + } + + /** + * Set the message id + * + * @param string|null $id + * @return MessageId + */ + public function setId($id = null) + { + if ($id === null) { + $id = $this->createMessageId(); + } + + $id = sprintf('<%s>', $id); + $this->messageId = $id; + return $this; + } + + /** + * Retrieve the message id + * + * @return string + */ + public function getId() + { + return $this->messageId; + } + + /** + * Creates the Message-ID + * + * @return string + */ + public function createMessageId() + { + $time = time(); + + if (isset($_SERVER['REMOTE_ADDR'])) { + $user = $_SERVER['REMOTE_ADDR']; + } else { + $user = getmypid(); + } + + $rand = mt_rand(); + + if (isset($_SERVER["SERVER_NAME"])) { + $hostName = $_SERVER["SERVER_NAME"]; + } else { + $hostName = php_uname('n'); + } + + return sha1($time . $user . $rand) . '@' . $hostName; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/MimeVersion.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/MimeVersion.php new file mode 100644 index 0000000000..52474e4a4f --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/MimeVersion.php @@ -0,0 +1,84 @@ +\d+\.\d+)$/', $value, $matches)) { + $header->setVersion($matches['version']); + } + + return $header; + } + + public function getFieldName() + { + return 'MIME-Version'; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + return $this->version; + } + + public function setEncoding($encoding) + { + // This header must be always in US-ASCII + return $this; + } + + public function getEncoding() + { + return 'ASCII'; + } + + public function toString() + { + return 'MIME-Version: ' . $this->getFieldValue(); + } + + /** + * Set the version string used in this header + * + * @param string $version + * @return MimeVersion + */ + public function setVersion($version) + { + $this->version = $version; + return $this; + } + + /** + * Retrieve the version string for this header + * + * @return string + */ + public function getVersion() + { + return $this->version; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/MultipleHeadersInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/MultipleHeadersInterface.php new file mode 100644 index 0000000000..36f0b70f81 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/MultipleHeadersInterface.php @@ -0,0 +1,15 @@ +value = $value; + } + + public function getFieldName() + { + return 'Received'; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + return $this->value; + } + + public function setEncoding($encoding) + { + // This header must be always in US-ASCII + return $this; + } + + public function getEncoding() + { + return 'ASCII'; + } + + public function toString() + { + return 'Received: ' . $this->getFieldValue(); + } + + /** + * Serialize collection of Received headers to string + * + * @param array $headers + * @throws Exception\RuntimeException + * @return string + */ + public function toStringMultipleHeaders(array $headers) + { + $strings = array($this->toString()); + foreach ($headers as $header) { + if (!$header instanceof Received) { + throw new Exception\RuntimeException( + 'The Received multiple header implementation can only accept an array of Received headers' + ); + } + $strings[] = $header->toString(); + } + return implode(Headers::EOL, $strings); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/ReplyTo.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/ReplyTo.php new file mode 100644 index 0000000000..b9fa5e6db8 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/ReplyTo.php @@ -0,0 +1,16 @@ +setEncoding('UTF-8'); + } + + // Check for address, and set if found + if (preg_match('/^(?P.*?)<(?P[^>]+)>$/', $value, $matches)) { + $name = $matches['name']; + if (empty($name)) { + $name = null; + } else { + $name = iconv_mime_decode($name, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8'); + } + $header->setAddress($matches['email'], $name); + } + + return $header; + } + + public function getFieldName() + { + return 'Sender'; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + if (!$this->address instanceof Mail\Address\AddressInterface) { + return ''; + } + + $email = sprintf('<%s>', $this->address->getEmail()); + $name = $this->address->getName(); + if (!empty($name)) { + $encoding = $this->getEncoding(); + if ($format == HeaderInterface::FORMAT_ENCODED + && 'ASCII' !== $encoding + ) { + $name = HeaderWrap::mimeEncodeValue($name, $encoding); + } + $email = sprintf('%s %s', $name, $email); + } + return $email; + } + + public function setEncoding($encoding) + { + $this->encoding = $encoding; + return $this; + } + + public function getEncoding() + { + return $this->encoding; + } + + public function toString() + { + return 'Sender: ' . $this->getFieldValue(HeaderInterface::FORMAT_ENCODED); + } + + /** + * Set the address used in this header + * + * @param string|\Zend\Mail\Address\AddressInterface $emailOrAddress + * @param null|string $name + * @throws Exception\InvalidArgumentException + * @return Sender + */ + public function setAddress($emailOrAddress, $name = null) + { + if (is_string($emailOrAddress)) { + $emailOrAddress = new Mail\Address($emailOrAddress, $name); + } elseif (!$emailOrAddress instanceof Mail\Address\AddressInterface) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects a string or AddressInterface object; received "%s"', + __METHOD__, + (is_object($emailOrAddress) ? get_class($emailOrAddress) : gettype($emailOrAddress)) + )); + } + $this->address = $emailOrAddress; + return $this; + } + + /** + * Retrieve the internal address from this header + * + * @return \Zend\Mail\Address\AddressInterface|null + */ + public function getAddress() + { + return $this->address; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/StructuredInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/StructuredInterface.php new file mode 100644 index 0000000000..734bd3e0ae --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/StructuredInterface.php @@ -0,0 +1,20 @@ +setEncoding('UTF-8'); + } + $header->setSubject($value); + + return $header; + } + + public function getFieldName() + { + return 'Subject'; + } + + public function getFieldValue($format = HeaderInterface::FORMAT_RAW) + { + if (HeaderInterface::FORMAT_ENCODED === $format) { + return HeaderWrap::wrap($this->subject, $this); + } + + return $this->subject; + } + + public function setEncoding($encoding) + { + $this->encoding = $encoding; + return $this; + } + + public function getEncoding() + { + return $this->encoding; + } + + public function setSubject($subject) + { + $this->subject = (string) $subject; + return $this; + } + + public function toString() + { + return 'Subject: ' . $this->getFieldValue(HeaderInterface::FORMAT_ENCODED); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Header/To.php b/vendor/zendframework/zend-mail/Zend/Mail/Header/To.php new file mode 100644 index 0000000000..a26bca2be1 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Header/To.php @@ -0,0 +1,16 @@ +[\x21-\x39\x3B-\x7E]+):.*$/', $line, $matches)) { + if ($currentLine) { + // a header name was present, then store the current complete line + $headers->addHeaderLine($currentLine); + } + $currentLine = trim($line); + } elseif (preg_match('/^\s+.*$/', $line, $matches)) { + // continuation: append to current line + $currentLine .= trim($line); + } elseif (preg_match('/^\s*$/', $line)) { + // empty line indicates end of headers + break; + } else { + // Line does not match header format! + throw new Exception\RuntimeException(sprintf( + 'Line "%s"does not match header format!', + $line + )); + } + } + if ($currentLine) { + $headers->addHeaderLine($currentLine); + } + return $headers; + } + + /** + * Set an alternate implementation for the PluginClassLoader + * + * @param PluginClassLocator $pluginClassLoader + * @return Headers + */ + public function setPluginClassLoader(PluginClassLocator $pluginClassLoader) + { + $this->pluginClassLoader = $pluginClassLoader; + return $this; + } + + /** + * Return an instance of a PluginClassLocator, lazyload and inject map if necessary + * + * @return PluginClassLocator + */ + public function getPluginClassLoader() + { + if ($this->pluginClassLoader === null) { + $this->pluginClassLoader = new Header\HeaderLoader(); + } + return $this->pluginClassLoader; + } + + /** + * Set the header encoding + * + * @param string $encoding + * @return Headers + */ + public function setEncoding($encoding) + { + $this->encoding = $encoding; + foreach ($this as $header) { + $header->setEncoding($encoding); + } + return $this; + } + + /** + * Get the header encoding + * + * @return string + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * Add many headers at once + * + * Expects an array (or Traversable object) of type/value pairs. + * + * @param array|Traversable $headers + * @throws Exception\InvalidArgumentException + * @return Headers + */ + public function addHeaders($headers) + { + if (!is_array($headers) && !$headers instanceof Traversable) { + throw new Exception\InvalidArgumentException(sprintf( + 'Expected array or Traversable; received "%s"', + (is_object($headers) ? get_class($headers) : gettype($headers)) + )); + } + + foreach ($headers as $name => $value) { + if (is_int($name)) { + if (is_string($value)) { + $this->addHeaderLine($value); + } elseif (is_array($value) && count($value) == 1) { + $this->addHeaderLine(key($value), current($value)); + } elseif (is_array($value) && count($value) == 2) { + $this->addHeaderLine($value[0], $value[1]); + } elseif ($value instanceof Header\HeaderInterface) { + $this->addHeader($value); + } + } elseif (is_string($name)) { + $this->addHeaderLine($name, $value); + } + + } + + return $this; + } + + /** + * Add a raw header line, either in name => value, or as a single string 'name: value' + * + * This method allows for lazy-loading in that the parsing and instantiation of HeaderInterface object + * will be delayed until they are retrieved by either get() or current() + * + * @throws Exception\InvalidArgumentException + * @param string $headerFieldNameOrLine + * @param string $fieldValue optional + * @return Headers + */ + public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null) + { + if (!is_string($headerFieldNameOrLine)) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects its first argument to be a string; received "%s"', + (is_object($headerFieldNameOrLine) ? get_class($headerFieldNameOrLine) : gettype($headerFieldNameOrLine)) + )); + } + + if ($fieldValue === null) { + $this->addHeader(Header\GenericHeader::fromString($headerFieldNameOrLine)); + } elseif (is_array($fieldValue)) { + foreach ($fieldValue as $i) { + $this->addHeader(new Header\GenericMultiHeader($headerFieldNameOrLine, $i)); + } + } else { + $this->addHeader(new Header\GenericHeader($headerFieldNameOrLine, $fieldValue)); + } + + return $this; + } + + /** + * Add a Header\Interface to this container, for raw values see {@link addHeaderLine()} and {@link addHeaders()} + * + * @param Header\HeaderInterface $header + * @return Headers + */ + public function addHeader(Header\HeaderInterface $header) + { + $key = $this->normalizeFieldName($header->getFieldName()); + $this->headersKeys[] = $key; + $this->headers[] = $header; + if ($this->getEncoding() !== 'ASCII') { + $header->setEncoding($this->getEncoding()); + } + return $this; + } + + /** + * Remove a Header from the container + * + * @param string $fieldName + * @return bool + */ + public function removeHeader($fieldName) + { + $key = $this->normalizeFieldName($fieldName); + $index = array_search($key, $this->headersKeys, true); + if ($index !== false) { + unset($this->headersKeys[$index]); + unset($this->headers[$index]); + return true; + } + return false; + } + + /** + * Clear all headers + * + * Removes all headers from queue + * + * @return Headers + */ + public function clearHeaders() + { + $this->headers = $this->headersKeys = array(); + return $this; + } + + /** + * Get all headers of a certain name/type + * + * @param string $name + * @return bool|ArrayIterator|Header\HeaderInterface Returns false if there is no headers with $name in this + * contain, an ArrayIterator if the header is a MultipleHeadersInterface instance and finally returns + * HeaderInterface for the rest of cases. + */ + public function get($name) + { + $key = $this->normalizeFieldName($name); + $results = array(); + + foreach (array_keys($this->headersKeys, $key) as $index) { + if ($this->headers[$index] instanceof Header\GenericHeader) { + $results[] = $this->lazyLoadHeader($index); + } else { + $results[] = $this->headers[$index]; + } + } + + switch (count($results)) { + case 0: + return false; + case 1: + if ($results[0] instanceof Header\MultipleHeadersInterface) { + return new ArrayIterator($results); + } else { + return $results[0]; + } + default: + return new ArrayIterator($results); + } + } + + /** + * Test for existence of a type of header + * + * @param string $name + * @return bool + */ + public function has($name) + { + $name = $this->normalizeFieldName($name); + return in_array($name, $this->headersKeys); + } + + /** + * Advance the pointer for this object as an iterator + * + */ + public function next() + { + next($this->headers); + } + + /** + * Return the current key for this object as an iterator + * + * @return mixed + */ + public function key() + { + return key($this->headers); + } + + /** + * Is this iterator still valid? + * + * @return bool + */ + public function valid() + { + return (current($this->headers) !== false); + } + + /** + * Reset the internal pointer for this object as an iterator + * + */ + public function rewind() + { + reset($this->headers); + } + + /** + * Return the current value for this iterator, lazy loading it if need be + * + * @return Header\HeaderInterface + */ + public function current() + { + $current = current($this->headers); + if ($current instanceof Header\GenericHeader) { + $current = $this->lazyLoadHeader(key($this->headers)); + } + return $current; + } + + /** + * Return the number of headers in this contain, if all headers have not been parsed, actual count could + * increase if MultipleHeader objects exist in the Request/Response. If you need an exact count, iterate + * + * @return int count of currently known headers + */ + public function count() + { + return count($this->headers); + } + + /** + * Render all headers at once + * + * This method handles the normal iteration of headers; it is up to the + * concrete classes to prepend with the appropriate status/request line. + * + * @return string + */ + public function toString() + { + $headers = ''; + foreach ($this as $header) { + if ($str = $header->toString()) { + $headers .= $str . self::EOL; + } + } + + return $headers; + } + + /** + * Return the headers container as an array + * + * @todo determine how to produce single line headers, if they are supported + * @return array + */ + public function toArray() + { + $headers = array(); + /* @var $header Header\HeaderInterface */ + foreach ($this->headers as $header) { + if ($header instanceof Header\MultipleHeadersInterface) { + $name = $header->getFieldName(); + if (!isset($headers[$name])) { + $headers[$name] = array(); + } + $headers[$name][] = $header->getFieldValue(); + } else { + $headers[$header->getFieldName()] = $header->getFieldValue(); + } + } + return $headers; + } + + /** + * By calling this, it will force parsing and loading of all headers, after this count() will be accurate + * + * @return bool + */ + public function forceLoading() + { + foreach ($this as $item) { + // $item should now be loaded + } + return true; + } + + /** + * @param $index + * @return mixed + */ + protected function lazyLoadHeader($index) + { + $current = $this->headers[$index]; + + $key = $this->headersKeys[$index]; + /* @var $class Header\HeaderInterface */ + $class = ($this->getPluginClassLoader()->load($key)) ?: 'Zend\Mail\Header\GenericHeader'; + + $encoding = $current->getEncoding(); + $headers = $class::fromString($current->toString()); + if (is_array($headers)) { + $current = array_shift($headers); + $current->setEncoding($encoding); + $this->headers[$index] = $current; + foreach ($headers as $header) { + $header->setEncoding($encoding); + $this->headersKeys[] = $key; + $this->headers[] = $header; + } + return $current; + } + + $current = $headers; + $current->setEncoding($encoding); + $this->headers[$index] = $current; + return $current; + } + + /** + * Normalize a field name + * + * @param string $fieldName + * @return string + */ + protected function normalizeFieldName($fieldName) + { + return str_replace(array('-', '_', ' ', '.'), '', strtolower($fieldName)); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Message.php b/vendor/zendframework/zend-mail/Zend/Mail/Message.php new file mode 100644 index 0000000000..04c39a629a --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Message.php @@ -0,0 +1,554 @@ +getFrom(); + if (!$from instanceof AddressList) { + return false; + } + return (bool) count($from); + } + + /** + * Set the message encoding + * + * @param string $encoding + * @return Message + */ + public function setEncoding($encoding) + { + $this->encoding = $encoding; + $this->getHeaders()->setEncoding($encoding); + return $this; + } + + /** + * Get the message encoding + * + * @return string + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * Compose headers + * + * @param Headers $headers + * @return Message + */ + public function setHeaders(Headers $headers) + { + $this->headers = $headers; + $headers->setEncoding($this->getEncoding()); + return $this; + } + + /** + * Access headers collection + * + * Lazy-loads if not already attached. + * + * @return Headers + */ + public function getHeaders() + { + if (null === $this->headers) { + $this->setHeaders(new Headers()); + $date = Header\Date::fromString('Date: ' . date('r')); + $this->headers->addHeader($date); + } + return $this->headers; + } + + /** + * Set (overwrite) From addresses + * + * @param string|Address\AddressInterface|array|AddressList|Traversable $emailOrAddressList + * @param string|null $name + * @return Message + */ + public function setFrom($emailOrAddressList, $name = null) + { + $this->clearHeaderByName('from'); + return $this->addFrom($emailOrAddressList, $name); + } + + /** + * Add a "From" address + * + * @param string|Address|array|AddressList|Traversable $emailOrAddressOrList + * @param string|null $name + * @return Message + */ + public function addFrom($emailOrAddressOrList, $name = null) + { + $addressList = $this->getFrom(); + $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__); + return $this; + } + + /** + * Retrieve list of From senders + * + * @return AddressList + */ + public function getFrom() + { + return $this->getAddressListFromHeader('from', __NAMESPACE__ . '\Header\From'); + } + + /** + * Overwrite the address list in the To recipients + * + * @param string|Address\AddressInterface|array|AddressList|Traversable $emailOrAddressList + * @param null|string $name + * @return Message + */ + public function setTo($emailOrAddressList, $name = null) + { + $this->clearHeaderByName('to'); + return $this->addTo($emailOrAddressList, $name); + } + + /** + * Add one or more addresses to the To recipients + * + * Appends to the list. + * + * @param string|Address\AddressInterface|array|AddressList|Traversable $emailOrAddressOrList + * @param null|string $name + * @return Message + */ + public function addTo($emailOrAddressOrList, $name = null) + { + $addressList = $this->getTo(); + $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__); + return $this; + } + + /** + * Access the address list of the To header + * + * @return AddressList + */ + public function getTo() + { + return $this->getAddressListFromHeader('to', __NAMESPACE__ . '\Header\To'); + } + + /** + * Set (overwrite) CC addresses + * + * @param string|Address\AddressInterface|array|AddressList|Traversable $emailOrAddressList + * @param string|null $name + * @return Message + */ + public function setCc($emailOrAddressList, $name = null) + { + $this->clearHeaderByName('cc'); + return $this->addCc($emailOrAddressList, $name); + } + + /** + * Add a "Cc" address + * + * @param string|Address|array|AddressList|Traversable $emailOrAddressOrList + * @param string|null $name + * @return Message + */ + public function addCc($emailOrAddressOrList, $name = null) + { + $addressList = $this->getCc(); + $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__); + return $this; + } + + /** + * Retrieve list of CC recipients + * + * @return AddressList + */ + public function getCc() + { + return $this->getAddressListFromHeader('cc', __NAMESPACE__ . '\Header\Cc'); + } + + /** + * Set (overwrite) BCC addresses + * + * @param string|Address\AddressInterface|array|AddressList|Traversable $emailOrAddressList + * @param string|null $name + * @return Message + */ + public function setBcc($emailOrAddressList, $name = null) + { + $this->clearHeaderByName('bcc'); + return $this->addBcc($emailOrAddressList, $name); + } + + /** + * Add a "Bcc" address + * + * @param string|Address|array|AddressList|Traversable $emailOrAddressOrList + * @param string|null $name + * @return Message + */ + public function addBcc($emailOrAddressOrList, $name = null) + { + $addressList = $this->getBcc(); + $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__); + return $this; + } + + /** + * Retrieve list of BCC recipients + * + * @return AddressList + */ + public function getBcc() + { + return $this->getAddressListFromHeader('bcc', __NAMESPACE__ . '\Header\Bcc'); + } + + /** + * Overwrite the address list in the Reply-To recipients + * + * @param string|Address\AddressInterface|array|AddressList|Traversable $emailOrAddressList + * @param null|string $name + * @return Message + */ + public function setReplyTo($emailOrAddressList, $name = null) + { + $this->clearHeaderByName('reply-to'); + return $this->addReplyTo($emailOrAddressList, $name); + } + + /** + * Add one or more addresses to the Reply-To recipients + * + * Appends to the list. + * + * @param string|Address\AddressInterface|array|AddressList|Traversable $emailOrAddressOrList + * @param null|string $name + * @return Message + */ + public function addReplyTo($emailOrAddressOrList, $name = null) + { + $addressList = $this->getReplyTo(); + $this->updateAddressList($addressList, $emailOrAddressOrList, $name, __METHOD__); + return $this; + } + + /** + * Access the address list of the Reply-To header + * + * @return AddressList + */ + public function getReplyTo() + { + return $this->getAddressListFromHeader('reply-to', __NAMESPACE__ . '\Header\ReplyTo'); + } + + /** + * setSender + * + * @param mixed $emailOrAddress + * @param mixed $name + * @return Message + */ + public function setSender($emailOrAddress, $name = null) + { + $header = $this->getHeaderByName('sender', __NAMESPACE__ . '\Header\Sender'); + $header->setAddress($emailOrAddress, $name); + return $this; + } + + /** + * Retrieve the sender address, if any + * + * @return null|Address\AddressInterface + */ + public function getSender() + { + $header = $this->getHeaderByName('sender', __NAMESPACE__ . '\Header\Sender'); + return $header->getAddress(); + } + + /** + * Set the message subject header value + * + * @param string $subject + * @return Message + */ + public function setSubject($subject) + { + $headers = $this->getHeaders(); + if (!$headers->has('subject')) { + $header = new Header\Subject(); + $headers->addHeader($header); + } else { + $header = $headers->get('subject'); + } + $header->setSubject($subject); + return $this; + } + + /** + * Get the message subject header value + * + * @return null|string + */ + public function getSubject() + { + $headers = $this->getHeaders(); + if (!$headers->has('subject')) { + return null; + } + $header = $headers->get('subject'); + return $header->getFieldValue(); + } + + /** + * Set the message body + * + * @param null|string|\Zend\Mime\Message|object $body + * @throws Exception\InvalidArgumentException + * @return Message + */ + public function setBody($body) + { + if (!is_string($body) && $body !== null) { + if (!is_object($body)) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects a string or object argument; received "%s"', + __METHOD__, + gettype($body) + )); + } + if (!$body instanceof Mime\Message) { + if (!method_exists($body, '__toString')) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects object arguments of type Zend\Mime\Message or implementing __toString(); object of type "%s" received', + __METHOD__, + get_class($body) + )); + } + } + } + $this->body = $body; + + if (!$this->body instanceof Mime\Message) { + return $this; + } + + // Get headers, and set Mime-Version header + $headers = $this->getHeaders(); + $this->getHeaderByName('mime-version', __NAMESPACE__ . '\Header\MimeVersion'); + + // Multipart content headers + if ($this->body->isMultiPart()) { + $mime = $this->body->getMime(); + $header = $this->getHeaderByName('content-type', __NAMESPACE__ . '\Header\ContentType'); + $header->setType('multipart/mixed'); + $header->addParameter('boundary', $mime->boundary()); + return $this; + } + + // MIME single part headers + $parts = $this->body->getParts(); + if (!empty($parts)) { + $part = array_shift($parts); + $headers->addHeaders($part->getHeadersArray()); + } + return $this; + } + + /** + * Return the currently set message body + * + * @return object + */ + public function getBody() + { + return $this->body; + } + + /** + * Get the string-serialized message body text + * + * @return string + */ + public function getBodyText() + { + if ($this->body instanceof Mime\Message) { + return $this->body->generateMessage(Headers::EOL); + } + + return (string) $this->body; + } + + /** + * Retrieve a header by name + * + * If not found, instantiates one based on $headerClass. + * + * @param string $headerName + * @param string $headerClass + * @return \Zend\Mail\Header\HeaderInterface + */ + protected function getHeaderByName($headerName, $headerClass) + { + $headers = $this->getHeaders(); + if ($headers->has($headerName)) { + $header = $headers->get($headerName); + } else { + $header = new $headerClass(); + $headers->addHeader($header); + } + return $header; + } + + /** + * Clear a header by name + * + * @param string $headerName + */ + protected function clearHeaderByName($headerName) + { + $this->getHeaders()->removeHeader($headerName); + } + + /** + * Retrieve the AddressList from a named header + * + * Used with To, From, Cc, Bcc, and ReplyTo headers. If the header does not + * exist, instantiates it. + * + * @param string $headerName + * @param string $headerClass + * @throws Exception\DomainException + * @return AddressList + */ + protected function getAddressListFromHeader($headerName, $headerClass) + { + $header = $this->getHeaderByName($headerName, $headerClass); + if (!$header instanceof Header\AbstractAddressList) { + throw new Exception\DomainException(sprintf( + 'Cannot grab address list from header of type "%s"; not an AbstractAddressList implementation', + get_class($header) + )); + } + return $header->getAddressList(); + } + + /** + * Update an address list + * + * Proxied to this from addFrom, addTo, addCc, addBcc, and addReplyTo. + * + * @param AddressList $addressList + * @param string|Address\AddressInterface|array|AddressList|Traversable $emailOrAddressOrList + * @param null|string $name + * @param string $callingMethod + * @throws Exception\InvalidArgumentException + */ + protected function updateAddressList(AddressList $addressList, $emailOrAddressOrList, $name, $callingMethod) + { + if ($emailOrAddressOrList instanceof Traversable) { + foreach ($emailOrAddressOrList as $address) { + $addressList->add($address); + } + return; + } + if (is_array($emailOrAddressOrList)) { + $addressList->addMany($emailOrAddressOrList); + return; + } + if (!is_string($emailOrAddressOrList) && !$emailOrAddressOrList instanceof Address\AddressInterface) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects a string, AddressInterface, array, AddressList, or Traversable as its first argument; received "%s"', + $callingMethod, + (is_object($emailOrAddressOrList) ? get_class($emailOrAddressOrList) : gettype($emailOrAddressOrList)) + )); + } + $addressList->add($emailOrAddressOrList, $name); + } + + /** + * Serialize to string + * + * @return string + */ + public function toString() + { + $headers = $this->getHeaders(); + return $headers->toString() + . Headers::EOL + . $this->getBodyText(); + } + + /** + * Instantiate from raw message string + * + * @todo Restore body to Mime\Message + * @param string $rawMessage + * @return Message + */ + public static function fromString($rawMessage) + { + $message = new static(); + $headers = null; + $content = null; + Mime\Decode::splitMessage($rawMessage, $headers, $content); + if ($headers->has('mime-version')) { + // todo - restore body to mime\message + } + $message->setHeaders($headers); + $message->setBody($content); + return $message; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Protocol/AbstractProtocol.php b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/AbstractProtocol.php new file mode 100644 index 0000000000..25e2b0656d --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/AbstractProtocol.php @@ -0,0 +1,356 @@ +validHost = new Validator\ValidatorChain(); + $this->validHost->attach(new Validator\Hostname(Validator\Hostname::ALLOW_ALL)); + + if (!$this->validHost->isValid($host)) { + throw new Exception\RuntimeException(implode(', ', $this->validHost->getMessages())); + } + + $this->host = $host; + $this->port = $port; + } + + + /** + * Class destructor to cleanup open resources + * + */ + public function __destruct() + { + $this->_disconnect(); + } + + /** + * Set the maximum log size + * + * @param int $maximumLog Maximum log size + */ + public function setMaximumLog($maximumLog) + { + $this->maximumLog = (int) $maximumLog; + } + + + /** + * Get the maximum log size + * + * @return int the maximum log size + */ + public function getMaximumLog() + { + return $this->maximumLog; + } + + + /** + * Create a connection to the remote host + * + * Concrete adapters for this class will implement their own unique connect scripts, using the _connect() method to create the socket resource. + */ + abstract public function connect(); + + + /** + * Retrieve the last client request + * + * @return string + */ + public function getRequest() + { + return $this->request; + } + + + /** + * Retrieve the last server response + * + * @return array + */ + public function getResponse() + { + return $this->response; + } + + + /** + * Retrieve the transaction log + * + * @return string + */ + public function getLog() + { + return implode('', $this->log); + } + + + /** + * Reset the transaction log + * + */ + public function resetLog() + { + $this->log = array(); + } + + /** + * Add the transaction log + * + * @param string $value new transaction + */ + protected function _addLog($value) + { + if ($this->maximumLog >= 0 && count($this->log) >= $this->maximumLog) { + array_shift($this->log); + } + + $this->log[] = $value; + } + + /** + * Connect to the server using the supplied transport and target + * + * An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222' + * + * @param string $remote Remote + * @throws Exception\RuntimeException + * @return bool + */ + protected function _connect($remote) + { + $errorNum = 0; + $errorStr = ''; + + // open connection + $this->socket = @stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION); + + if ($this->socket === false) { + if ($errorNum == 0) { + $errorStr = 'Could not open socket'; + } + throw new Exception\RuntimeException($errorStr); + } + + if (($result = stream_set_timeout($this->socket, self::TIMEOUT_CONNECTION)) === false) { + throw new Exception\RuntimeException('Could not set stream timeout'); + } + + return $result; + } + + + /** + * Disconnect from remote host and free resource + * + */ + protected function _disconnect() + { + if (is_resource($this->socket)) { + fclose($this->socket); + } + } + + + /** + * Send the given request followed by a LINEEND to the server. + * + * @param string $request + * @throws Exception\RuntimeException + * @return int|bool Number of bytes written to remote host + */ + protected function _send($request) + { + if (!is_resource($this->socket)) { + throw new Exception\RuntimeException('No connection has been established to ' . $this->host); + } + + $this->request = $request; + + $result = fwrite($this->socket, $request . self::EOL); + + // Save request to internal log + $this->_addLog($request . self::EOL); + + if ($result === false) { + throw new Exception\RuntimeException('Could not send request to ' . $this->host); + } + + return $result; + } + + + /** + * Get a line from the stream. + * + * @param int $timeout Per-request timeout value if applicable + * @throws Exception\RuntimeException + * @return string + */ + protected function _receive($timeout = null) + { + if (!is_resource($this->socket)) { + throw new Exception\RuntimeException('No connection has been established to ' . $this->host); + } + + // Adapters may wish to supply per-commend timeouts according to appropriate RFC + if ($timeout !== null) { + stream_set_timeout($this->socket, $timeout); + } + + // Retrieve response + $response = fgets($this->socket, 1024); + + // Save request to internal log + $this->_addLog($response); + + // Check meta data to ensure connection is still valid + $info = stream_get_meta_data($this->socket); + + if (!empty($info['timed_out'])) { + throw new Exception\RuntimeException($this->host . ' has timed out'); + } + + if ($response === false) { + throw new Exception\RuntimeException('Could not read from ' . $this->host); + } + + return $response; + } + + + /** + * Parse server response for successful codes + * + * Read the response from the stream and check for expected return code. + * Throws a Zend\Mail\Protocol\Exception\ExceptionInterface if an unexpected code is returned. + * + * @param string|array $code One or more codes that indicate a successful response + * @param int $timeout Per-request timeout value if applicable + * @throws Exception\RuntimeException + * @return string Last line of response string + */ + protected function _expect($code, $timeout = null) + { + $this->response = array(); + $cmd = ''; + $more = ''; + $msg = ''; + $errMsg = ''; + + if (!is_array($code)) { + $code = array($code); + } + + do { + $this->response[] = $result = $this->_receive($timeout); + list($cmd, $more, $msg) = preg_split('/([\s-]+)/', $result, 2, PREG_SPLIT_DELIM_CAPTURE); + + if ($errMsg !== '') { + $errMsg .= ' ' . $msg; + } elseif ($cmd === null || !in_array($cmd, $code)) { + $errMsg = $msg; + } + + } while (strpos($more, '-') === 0); // The '-' message prefix indicates an information string instead of a response string. + + if ($errMsg !== '') { + throw new Exception\RuntimeException($errMsg); + } + + return $msg; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Exception/ExceptionInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..66a5c23f20 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Exception/ExceptionInterface.php @@ -0,0 +1,16 @@ +connect($host, $port, $ssl); + } + } + + /** + * Public destructor + */ + public function __destruct() + { + $this->logout(); + } + + /** + * Open connection to IMAP server + * + * @param string $host hostname or IP address of IMAP server + * @param int|null $port of IMAP server, default is 143 (993 for ssl) + * @param string|bool $ssl use 'SSL', 'TLS' or false + * @throws Exception\RuntimeException + * @return string welcome message + */ + public function connect($host, $port = null, $ssl = false) + { + $isTls = false; + + if ($ssl) { + $ssl = strtolower($ssl); + } + + switch ($ssl) { + case 'ssl': + $host = 'ssl://' . $host; + if (!$port) { + $port = 993; + } + break; + case 'tls': + $isTls = true; + // break intentionally omitted + default: + if (!$port) { + $port = 143; + } + } + + ErrorHandler::start(); + $this->socket = fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION); + $error = ErrorHandler::stop(); + if (!$this->socket) { + throw new Exception\RuntimeException(sprintf( + 'cannot connect to host %s', + ($error ? sprintf('; error = %s (errno = %d )', $error->getMessage(), $error->getCode()) : '') + ), 0, $error); + } + + if (!$this->_assumedNextLine('* OK')) { + throw new Exception\RuntimeException('host doesn\'t allow connection'); + } + + if ($isTls) { + $result = $this->requestAndResponse('STARTTLS'); + $result = $result && stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); + if (!$result) { + throw new Exception\RuntimeException('cannot enable TLS'); + } + } + } + + /** + * get the next line from socket with error checking, but nothing else + * + * @throws Exception\RuntimeException + * @return string next line + */ + protected function _nextLine() + { + $line = fgets($this->socket); + if ($line === false) { + throw new Exception\RuntimeException('cannot read - connection closed?'); + } + + return $line; + } + + /** + * get next line and assume it starts with $start. some requests give a simple + * feedback so we can quickly check if we can go on. + * + * @param string $start the first bytes we assume to be in the next line + * @return bool line starts with $start + */ + protected function _assumedNextLine($start) + { + $line = $this->_nextLine(); + return strpos($line, $start) === 0; + } + + /** + * get next line and split the tag. that's the normal case for a response line + * + * @param string $tag tag of line is returned by reference + * @return string next line + */ + protected function _nextTaggedLine(&$tag) + { + $line = $this->_nextLine(); + + // separate tag from line + list($tag, $line) = explode(' ', $line, 2); + + return $line; + } + + /** + * split a given line in tokens. a token is literal of any form or a list + * + * @param string $line line to decode + * @return array tokens, literals are returned as string, lists as array + */ + protected function _decodeLine($line) + { + $tokens = array(); + $stack = array(); + + /* + We start to decode the response here. The understood tokens are: + literal + "literal" or also "lit\\er\"al" + {bytes}literal + (literals*) + All tokens are returned in an array. Literals in braces (the last understood + token in the list) are returned as an array of tokens. I.e. the following response: + "foo" baz {3}bar ("f\\\"oo" bar) + would be returned as: + array('foo', 'baz', 'bar', array('f\\\"oo', 'bar')); + + // TODO: add handling of '[' and ']' to parser for easier handling of response text + */ + // replace any trailing including spaces with a single space + $line = rtrim($line) . ' '; + while (($pos = strpos($line, ' ')) !== false) { + $token = substr($line, 0, $pos); + while ($token[0] == '(') { + array_push($stack, $tokens); + $tokens = array(); + $token = substr($token, 1); + } + if ($token[0] == '"') { + if (preg_match('%^\(*"((.|\\\\|\\")*?)" *%', $line, $matches)) { + $tokens[] = $matches[1]; + $line = substr($line, strlen($matches[0])); + continue; + } + } + if ($token[0] == '{') { + $endPos = strpos($token, '}'); + $chars = substr($token, 1, $endPos - 1); + if (is_numeric($chars)) { + $token = ''; + while (strlen($token) < $chars) { + $token .= $this->_nextLine(); + } + $line = ''; + if (strlen($token) > $chars) { + $line = substr($token, $chars); + $token = substr($token, 0, $chars); + } else { + $line .= $this->_nextLine(); + } + $tokens[] = $token; + $line = trim($line) . ' '; + continue; + } + } + if ($stack && $token[strlen($token) - 1] == ')') { + // closing braces are not separated by spaces, so we need to count them + $braces = strlen($token); + $token = rtrim($token, ')'); + // only count braces if more than one + $braces -= strlen($token) + 1; + // only add if token had more than just closing braces + if (rtrim($token) != '') { + $tokens[] = rtrim($token); + } + $token = $tokens; + $tokens = array_pop($stack); + // special handline if more than one closing brace + while ($braces-- > 0) { + $tokens[] = $token; + $token = $tokens; + $tokens = array_pop($stack); + } + } + $tokens[] = $token; + $line = substr($line, $pos + 1); + } + + // maybe the server forgot to send some closing braces + while ($stack) { + $child = $tokens; + $tokens = array_pop($stack); + $tokens[] = $child; + } + + return $tokens; + } + + /** + * read a response "line" (could also be more than one real line if response has {..}) + * and do a simple decode + * + * @param array|string $tokens decoded tokens are returned by reference, if $dontParse + * is true the unparsed line is returned here + * @param string $wantedTag check for this tag for response code. Default '*' is + * continuation tag. + * @param bool $dontParse if true only the unparsed line is returned $tokens + * @return bool if returned tag matches wanted tag + */ + public function readLine(&$tokens = array(), $wantedTag = '*', $dontParse = false) + { + $tag = null; // define $tag variable before first use + $line = $this->_nextTaggedLine($tag); // get next tag + if (!$dontParse) { + $tokens = $this->_decodeLine($line); + } else { + $tokens = $line; + } + + // if tag is wanted tag we might be at the end of a multiline response + return $tag == $wantedTag; + } + + /** + * read all lines of response until given tag is found (last line of response) + * + * @param string $tag the tag of your request + * @param bool $dontParse if true every line is returned unparsed instead of + * the decoded tokens + * @return null|bool|array tokens if success, false if error, null if bad request + */ + public function readResponse($tag, $dontParse = false) + { + $lines = array(); + $tokens = null; // define $tokens variable before first use + while (!$this->readLine($tokens, $tag, $dontParse)) { + $lines[] = $tokens; + } + + if ($dontParse) { + // last to chars are still needed for response code + $tokens = array(substr($tokens, 0, 2)); + } + // last line has response code + if ($tokens[0] == 'OK') { + return $lines ? $lines : true; + } elseif ($tokens[0] == 'NO') { + return false; + } + return null; + } + + /** + * send a request + * + * @param string $command your request command + * @param array $tokens additional parameters to command, use escapeString() to prepare + * @param string $tag provide a tag otherwise an autogenerated is returned + * @throws Exception\RuntimeException + */ + public function sendRequest($command, $tokens = array(), &$tag = null) + { + if (!$tag) { + ++$this->tagCount; + $tag = 'TAG' . $this->tagCount; + } + + $line = $tag . ' ' . $command; + + foreach ($tokens as $token) { + if (is_array($token)) { + if (fwrite($this->socket, $line . ' ' . $token[0] . "\r\n") === false) { + throw new Exception\RuntimeException('cannot write - connection closed?'); + } + if (!$this->_assumedNextLine('+ ')) { + throw new Exception\RuntimeException('cannot send literal string'); + } + $line = $token[1]; + } else { + $line .= ' ' . $token; + } + } + + if (fwrite($this->socket, $line . "\r\n") === false) { + throw new Exception\RuntimeException('cannot write - connection closed?'); + } + } + + /** + * send a request and get response at once + * + * @param string $command command as in sendRequest() + * @param array $tokens parameters as in sendRequest() + * @param bool $dontParse if true unparsed lines are returned instead of tokens + * @return mixed response as in readResponse() + */ + public function requestAndResponse($command, $tokens = array(), $dontParse = false) + { + $tag = null; // define $tag variable before first use + $this->sendRequest($command, $tokens, $tag); + $response = $this->readResponse($tag, $dontParse); + + return $response; + } + + /** + * escape one or more literals i.e. for sendRequest + * + * @param string|array $string the literal/-s + * @return string|array escape literals, literals with newline ar returned + * as array('{size}', 'string'); + */ + public function escapeString($string) + { + if (func_num_args() < 2) { + if (strpos($string, "\n") !== false) { + return array('{' . strlen($string) . '}', $string); + } else { + return '"' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string) . '"'; + } + } + $result = array(); + foreach (func_get_args() as $string) { + $result[] = $this->escapeString($string); + } + return $result; + } + + /** + * escape a list with literals or lists + * + * @param array $list list with literals or lists as PHP array + * @return string escaped list for imap + */ + public function escapeList($list) + { + $result = array(); + foreach ($list as $v) { + if (!is_array($v)) { +// $result[] = $this->escapeString($v); + $result[] = $v; + continue; + } + $result[] = $this->escapeList($v); + } + return '(' . implode(' ', $result) . ')'; + } + + /** + * Login to IMAP server. + * + * @param string $user username + * @param string $password password + * @return bool success + */ + public function login($user, $password) + { + return $this->requestAndResponse('LOGIN', $this->escapeString($user, $password), true); + } + + /** + * logout of imap server + * + * @return bool success + */ + public function logout() + { + $result = false; + if ($this->socket) { + try { + $result = $this->requestAndResponse('LOGOUT', array(), true); + } catch (Exception\ExceptionInterface $e) { + // ignoring exception + } + fclose($this->socket); + $this->socket = null; + } + return $result; + } + + + /** + * Get capabilities from IMAP server + * + * @return array list of capabilities + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function capability() + { + $response = $this->requestAndResponse('CAPABILITY'); + + if (!$response) { + return $response; + } + + $capabilities = array(); + foreach ($response as $line) { + $capabilities = array_merge($capabilities, $line); + } + return $capabilities; + } + + /** + * Examine and select have the same response. The common code for both + * is in this method + * + * @param string $command can be 'EXAMINE' or 'SELECT' and this is used as command + * @param string $box which folder to change to or examine + * @return bool|array false if error, array with returned information + * otherwise (flags, exists, recent, uidvalidity) + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function examineOrSelect($command = 'EXAMINE', $box = 'INBOX') + { + $tag = null; // define $tag variable before first use + $this->sendRequest($command, array($this->escapeString($box)), $tag); + + $result = array(); + $tokens = null; // define $tokens variable before first use + while (!$this->readLine($tokens, $tag)) { + if ($tokens[0] == 'FLAGS') { + array_shift($tokens); + $result['flags'] = $tokens; + continue; + } + switch ($tokens[1]) { + case 'EXISTS': + case 'RECENT': + $result[strtolower($tokens[1])] = $tokens[0]; + break; + case '[UIDVALIDITY': + $result['uidvalidity'] = (int) $tokens[2]; + break; + default: + // ignore + } + } + + if ($tokens[0] != 'OK') { + return false; + } + return $result; + } + + /** + * change folder + * + * @param string $box change to this folder + * @return bool|array see examineOrselect() + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function select($box = 'INBOX') + { + return $this->examineOrSelect('SELECT', $box); + } + + /** + * examine folder + * + * @param string $box examine this folder + * @return bool|array see examineOrselect() + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function examine($box = 'INBOX') + { + return $this->examineOrSelect('EXAMINE', $box); + } + + /** + * fetch one or more items of one or more messages + * + * @param string|array $items items to fetch from message(s) as string (if only one item) + * or array of strings + * @param int|array $from message for items or start message if $to !== null + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @throws Exception\RuntimeException + * @return string|array if only one item of one message is fetched it's returned as string + * if items of one message are fetched it's returned as (name => value) + * if one items of messages are fetched it's returned as (msgno => value) + * if items of messages are fetched it's returned as (msgno => (name => value)) + */ + public function fetch($items, $from, $to = null) + { + if (is_array($from)) { + $set = implode(',', $from); + } elseif ($to === null) { + $set = (int) $from; + } elseif ($to === INF) { + $set = (int) $from . ':*'; + } else { + $set = (int) $from . ':' . (int) $to; + } + + $items = (array) $items; + $itemList = $this->escapeList($items); + + $tag = null; // define $tag variable before first use + $this->sendRequest('FETCH', array($set, $itemList), $tag); + + $result = array(); + $tokens = null; // define $tokens variable before first use + while (!$this->readLine($tokens, $tag)) { + // ignore other responses + if ($tokens[1] != 'FETCH') { + continue; + } + // ignore other messages + if ($to === null && !is_array($from) && $tokens[0] != $from) { + continue; + } + // if we only want one item we return that one directly + if (count($items) == 1) { + if ($tokens[2][0] == $items[0]) { + $data = $tokens[2][1]; + } else { + // maybe the server send an other field we didn't wanted + $count = count($tokens[2]); + // we start with 2, because 0 was already checked + for ($i = 2; $i < $count; $i += 2) { + if ($tokens[2][$i] != $items[0]) { + continue; + } + $data = $tokens[2][$i + 1]; + break; + } + } + } else { + $data = array(); + while (key($tokens[2]) !== null) { + $data[current($tokens[2])] = next($tokens[2]); + next($tokens[2]); + } + } + // if we want only one message we can ignore everything else and just return + if ($to === null && !is_array($from) && $tokens[0] == $from) { + // we still need to read all lines + while (!$this->readLine($tokens, $tag)); + return $data; + } + $result[$tokens[0]] = $data; + } + + if ($to === null && !is_array($from)) { + throw new Exception\RuntimeException('the single id was not found in response'); + } + + return $result; + } + + /** + * get mailbox list + * + * this method can't be named after the IMAP command 'LIST', as list is a reserved keyword + * + * @param string $reference mailbox reference for list + * @param string $mailbox mailbox name match with wildcards + * @return array mailboxes that matched $mailbox as array(globalName => array('delim' => .., 'flags' => ..)) + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function listMailbox($reference = '', $mailbox = '*') + { + $result = array(); + $list = $this->requestAndResponse('LIST', $this->escapeString($reference, $mailbox)); + if (!$list || $list === true) { + return $result; + } + + foreach ($list as $item) { + if (count($item) != 4 || $item[0] != 'LIST') { + continue; + } + $result[$item[3]] = array('delim' => $item[2], 'flags' => $item[1]); + } + + return $result; + } + + /** + * set flags + * + * @param array $flags flags to set, add or remove - see $mode + * @param int $from message for items or start message if $to !== null + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param string|null $mode '+' to add flags, '-' to remove flags, everything else sets the flags as given + * @param bool $silent if false the return values are the new flags for the wanted messages + * @return bool|array new flags if $silent is false, else true or false depending on success + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function store(array $flags, $from, $to = null, $mode = null, $silent = true) + { + $item = 'FLAGS'; + if ($mode == '+' || $mode == '-') { + $item = $mode . $item; + } + if ($silent) { + $item .= '.SILENT'; + } + + $flags = $this->escapeList($flags); + $set = (int) $from; + if ($to != null) { + $set .= ':' . ($to == INF ? '*' : (int) $to); + } + + $result = $this->requestAndResponse('STORE', array($set, $item, $flags), $silent); + + if ($silent) { + return $result ? true : false; + } + + $tokens = $result; + $result = array(); + foreach ($tokens as $token) { + if ($token[1] != 'FETCH' || $token[2][0] != 'FLAGS') { + continue; + } + $result[$token[0]] = $token[2][1]; + } + + return $result; + } + + /** + * append a new message to given folder + * + * @param string $folder name of target folder + * @param string $message full message content + * @param array $flags flags for new message + * @param string $date date for new message + * @return bool success + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function append($folder, $message, $flags = null, $date = null) + { + $tokens = array(); + $tokens[] = $this->escapeString($folder); + if ($flags !== null) { + $tokens[] = $this->escapeList($flags); + } + if ($date !== null) { + $tokens[] = $this->escapeString($date); + } + $tokens[] = $this->escapeString($message); + + return $this->requestAndResponse('APPEND', $tokens, true); + } + + /** + * copy message set from current folder to other folder + * + * @param string $folder destination folder + * @param $from + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @return bool success + */ + public function copy($folder, $from, $to = null) + { + $set = (int) $from; + if ($to != null) { + $set .= ':' . ($to == INF ? '*' : (int) $to); + } + + return $this->requestAndResponse('COPY', array($set, $this->escapeString($folder)), true); + } + + /** + * create a new folder (and parent folders if needed) + * + * @param string $folder folder name + * @return bool success + */ + public function create($folder) + { + return $this->requestAndResponse('CREATE', array($this->escapeString($folder)), true); + } + + /** + * rename an existing folder + * + * @param string $old old name + * @param string $new new name + * @return bool success + */ + public function rename($old, $new) + { + return $this->requestAndResponse('RENAME', $this->escapeString($old, $new), true); + } + + /** + * remove a folder + * + * @param string $folder folder name + * @return bool success + */ + public function delete($folder) + { + return $this->requestAndResponse('DELETE', array($this->escapeString($folder)), true); + } + + /** + * permanently remove messages + * + * @return bool success + */ + public function expunge() + { + // TODO: parse response? + return $this->requestAndResponse('EXPUNGE'); + } + + /** + * send noop + * + * @return bool success + */ + public function noop() + { + // TODO: parse response + return $this->requestAndResponse('NOOP'); + } + + /** + * do a search request + * + * This method is currently marked as internal as the API might change and is not + * safe if you don't take precautions. + * + * @param array $params + * @return array message ids + */ + public function search(array $params) + { + $response = $this->requestAndResponse('SEARCH', $params); + if (!$response) { + return $response; + } + + foreach ($response as $ids) { + if ($ids[0] == 'SEARCH') { + array_shift($ids); + return $ids; + } + } + return array(); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Pop3.php b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Pop3.php new file mode 100644 index 0000000000..0b4e8970fc --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Pop3.php @@ -0,0 +1,415 @@ +connect($host, $port, $ssl); + } + } + + + /** + * Public destructor + */ + public function __destruct() + { + $this->logout(); + } + + + /** + * Open connection to POP3 server + * + * @param string $host hostname or IP address of POP3 server + * @param int|null $port of POP3 server, default is 110 (995 for ssl) + * @param string|bool $ssl use 'SSL', 'TLS' or false + * @throws Exception\RuntimeException + * @return string welcome message + */ + public function connect($host, $port = null, $ssl = false) + { + $isTls = false; + + if ($ssl) { + $ssl = strtolower($ssl); + } + + switch ($ssl) { + case 'ssl': + $host = 'ssl://' . $host; + if (!$port) { + $port = 995; + } + break; + case 'tls': + $isTls = true; + // break intentionally omitted + default: + if (!$port) { + $port = 110; + } + } + + ErrorHandler::start(); + $this->socket = fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION); + $error = ErrorHandler::stop(); + if (!$this->socket) { + throw new Exception\RuntimeException(sprintf( + 'cannot connect to host %s', + ($error ? sprintf('; error = %s (errno = %d )', $error->getMessage(), $error->getCode()) : '') + ), 0, $error); + } + + $welcome = $this->readResponse(); + + strtok($welcome, '<'); + $this->timestamp = strtok('>'); + if (!strpos($this->timestamp, '@')) { + $this->timestamp = null; + } else { + $this->timestamp = '<' . $this->timestamp . '>'; + } + + if ($isTls) { + $this->request('STLS'); + $result = stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); + if (!$result) { + throw new Exception\RuntimeException('cannot enable TLS'); + } + } + + return $welcome; + } + + + /** + * Send a request + * + * @param string $request your request without newline + * @throws Exception\RuntimeException + */ + public function sendRequest($request) + { + ErrorHandler::start(); + $result = fputs($this->socket, $request . "\r\n"); + $error = ErrorHandler::stop(); + if (!$result) { + throw new Exception\RuntimeException('send failed - connection closed?', 0, $error); + } + } + + + /** + * read a response + * + * @param bool $multiline response has multiple lines and should be read until "." + * @throws Exception\RuntimeException + * @return string response + */ + public function readResponse($multiline = false) + { + ErrorHandler::start(); + $result = fgets($this->socket); + $error = ErrorHandler::stop(); + if (!is_string($result)) { + throw new Exception\RuntimeException('read failed - connection closed?', 0, $error); + } + + $result = trim($result); + if (strpos($result, ' ')) { + list($status, $message) = explode(' ', $result, 2); + } else { + $status = $result; + $message = ''; + } + + if ($status != '+OK') { + throw new Exception\RuntimeException('last request failed'); + } + + if ($multiline) { + $message = ''; + $line = fgets($this->socket); + while ($line && rtrim($line, "\r\n") != '.') { + if ($line[0] == '.') { + $line = substr($line, 1); + } + $message .= $line; + $line = fgets($this->socket); + }; + } + + return $message; + } + + + /** + * Send request and get response + * + * @see sendRequest() + * @see readResponse() + * @param string $request request + * @param bool $multiline multiline response? + * @return string result from readResponse() + */ + public function request($request, $multiline = false) + { + $this->sendRequest($request); + return $this->readResponse($multiline); + } + + + /** + * End communication with POP3 server (also closes socket) + */ + public function logout() + { + if ($this->socket) { + try { + $this->request('QUIT'); + } catch (Exception\ExceptionInterface $e) { + // ignore error - we're closing the socket anyway + } + + fclose($this->socket); + $this->socket = null; + } + } + + + /** + * Get capabilities from POP3 server + * + * @return array list of capabilities + */ + public function capa() + { + $result = $this->request('CAPA', true); + return explode("\n", $result); + } + + + /** + * Login to POP3 server. Can use APOP + * + * @param string $user username + * @param string $password password + * @param bool $tryApop should APOP be tried? + */ + public function login($user, $password, $tryApop = true) + { + if ($tryApop && $this->timestamp) { + try { + $this->request("APOP $user " . md5($this->timestamp . $password)); + return; + } catch (Exception\ExceptionInterface $e) { + // ignore + } + } + + $result = $this->request("USER $user"); + $result = $this->request("PASS $password"); + } + + + /** + * Make STAT call for message count and size sum + * + * @param int $messages out parameter with count of messages + * @param int $octets out parameter with size in octets of messages + */ + public function status(&$messages, &$octets) + { + $messages = 0; + $octets = 0; + $result = $this->request('STAT'); + + list($messages, $octets) = explode(' ', $result); + } + + + /** + * Make LIST call for size of message(s) + * + * @param int|null $msgno number of message, null for all + * @return int|array size of given message or list with array(num => size) + */ + public function getList($msgno = null) + { + if ($msgno !== null) { + $result = $this->request("LIST $msgno"); + + list(, $result) = explode(' ', $result); + return (int) $result; + } + + $result = $this->request('LIST', true); + $messages = array(); + $line = strtok($result, "\n"); + while ($line) { + list($no, $size) = explode(' ', trim($line)); + $messages[(int) $no] = (int) $size; + $line = strtok("\n"); + } + + return $messages; + } + + + /** + * Make UIDL call for getting a uniqueid + * + * @param int|null $msgno number of message, null for all + * @return string|array uniqueid of message or list with array(num => uniqueid) + */ + public function uniqueid($msgno = null) + { + if ($msgno !== null) { + $result = $this->request("UIDL $msgno"); + + list(, $result) = explode(' ', $result); + return $result; + } + + $result = $this->request('UIDL', true); + + $result = explode("\n", $result); + $messages = array(); + foreach ($result as $line) { + if (!$line) { + continue; + } + list($no, $id) = explode(' ', trim($line), 2); + $messages[(int) $no] = $id; + } + + return $messages; + } + + + /** + * Make TOP call for getting headers and maybe some body lines + * This method also sets hasTop - before it it's not known if top is supported + * + * The fallback makes normal RETR call, which retrieves the whole message. Additional + * lines are not removed. + * + * @param int $msgno number of message + * @param int $lines number of wanted body lines (empty line is inserted after header lines) + * @param bool $fallback fallback with full retrieve if top is not supported + * @throws Exception\RuntimeException + * @throws Exception\ExceptionInterface + * @return string message headers with wanted body lines + */ + public function top($msgno, $lines = 0, $fallback = false) + { + if ($this->hasTop === false) { + if ($fallback) { + return $this->retrieve($msgno); + } else { + throw new Exception\RuntimeException('top not supported and no fallback wanted'); + } + } + $this->hasTop = true; + + $lines = (!$lines || $lines < 1) ? 0 : (int) $lines; + + try { + $result = $this->request("TOP $msgno $lines", true); + } catch (Exception\ExceptionInterface $e) { + $this->hasTop = false; + if ($fallback) { + $result = $this->retrieve($msgno); + } else { + throw $e; + } + } + + return $result; + } + + + /** + * Make a RETR call for retrieving a full message with headers and body + * + * @param int $msgno message number + * @return string message + */ + public function retrieve($msgno) + { + $result = $this->request("RETR $msgno", true); + return $result; + } + + /** + * Make a NOOP call, maybe needed for keeping the server happy + */ + public function noop() + { + $this->request('NOOP'); + } + + + /** + * Make a DELE count to remove a message + * + * @param $msgno + */ + public function delete($msgno) + { + $this->request("DELE $msgno"); + } + + + /** + * Make RSET call, which rollbacks delete requests + */ + public function undelete() + { + $this->request('RSET'); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp.php b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp.php new file mode 100644 index 0000000000..6e31b3767d --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp.php @@ -0,0 +1,411 @@ +secure = 'tls'; + break; + + case 'ssl': + $this->transport = 'ssl'; + $this->secure = 'ssl'; + if ($port == null) { + $port = 465; + } + break; + + default: + throw new Exception\InvalidArgumentException($config['ssl'] . ' is unsupported SSL type'); + break; + } + } + + // If no port has been specified then check the master PHP ini file. Defaults to 25 if the ini setting is null. + if ($port == null) { + if (($port = ini_get('smtp_port')) == '') { + $port = 25; + } + } + + parent::__construct($host, $port); + } + + + /** + * Connect to the server with the parameters given in the constructor. + * + * @return bool + */ + public function connect() + { + return $this->_connect($this->transport . '://' . $this->host . ':' . $this->port); + } + + + /** + * Initiate HELO/EHLO sequence and set flag to indicate valid smtp session + * + * @param string $host The client hostname or IP address (default: 127.0.0.1) + * @throws Exception\RuntimeException + */ + public function helo($host = '127.0.0.1') + { + // Respect RFC 2821 and disallow HELO attempts if session is already initiated. + if ($this->sess === true) { + throw new Exception\RuntimeException('Cannot issue HELO to existing session'); + } + + // Validate client hostname + if (!$this->validHost->isValid($host)) { + throw new Exception\RuntimeException(implode(', ', $this->validHost->getMessages())); + } + + // Initiate helo sequence + $this->_expect(220, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2 + $this->_ehlo($host); + + // If a TLS session is required, commence negotiation + if ($this->secure == 'tls') { + $this->_send('STARTTLS'); + $this->_expect(220, 180); + if (!stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { + throw new Exception\RuntimeException('Unable to connect via TLS'); + } + $this->_ehlo($host); + } + + $this->_startSession(); + $this->auth(); + } + + /** + * Returns the perceived session status + * + * @return bool + */ + public function hasSession() + { + return $this->sess; + } + + /** + * Send EHLO or HELO depending on capabilities of smtp host + * + * @param string $host The client hostname or IP address (default: 127.0.0.1) + * @throws \Exception|Exception\ExceptionInterface + */ + protected function _ehlo($host) + { + // Support for older, less-compliant remote servers. Tries multiple attempts of EHLO or HELO. + try { + $this->_send('EHLO ' . $host); + $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2 + } catch (Exception\ExceptionInterface $e) { + $this->_send('HELO ' . $host); + $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2 + } catch (\Exception $e) { + throw $e; + } + } + + + /** + * Issues MAIL command + * + * @param string $from Sender mailbox + * @throws Exception\RuntimeException + */ + public function mail($from) + { + if ($this->sess !== true) { + throw new Exception\RuntimeException('A valid session has not been started'); + } + + $this->_send('MAIL FROM:<' . $from . '>'); + $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2 + + // Set mail to true, clear recipients and any existing data flags as per 4.1.1.2 of RFC 2821 + $this->mail = true; + $this->rcpt = false; + $this->data = false; + } + + + /** + * Issues RCPT command + * + * @param string $to Receiver(s) mailbox + * @throws Exception\RuntimeException + */ + public function rcpt($to) + { + + if ($this->mail !== true) { + throw new Exception\RuntimeException('No sender reverse path has been supplied'); + } + + // Set rcpt to true, as per 4.1.1.3 of RFC 2821 + $this->_send('RCPT TO:<' . $to . '>'); + $this->_expect(array(250, 251), 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2 + $this->rcpt = true; + } + + + /** + * Issues DATA command + * + * @param string $data + * @throws Exception\RuntimeException + */ + public function data($data) + { + // Ensure recipients have been set + if ($this->rcpt !== true) { // Per RFC 2821 3.3 (page 18) + throw new Exception\RuntimeException('No recipient forward path has been supplied'); + } + + $this->_send('DATA'); + $this->_expect(354, 120); // Timeout set for 2 minutes as per RFC 2821 4.5.3.2 + + foreach (explode(self::EOL, $data) as $line) { + if (strpos($line, '.') === 0) { + // Escape lines prefixed with a '.' + $line = '.' . $line; + } + $this->_send($line); + } + + $this->_send('.'); + $this->_expect(250, 600); // Timeout set for 10 minutes as per RFC 2821 4.5.3.2 + $this->data = true; + } + + + /** + * Issues the RSET command end validates answer + * + * Can be used to restore a clean smtp communication state when a transaction has been cancelled or commencing a new transaction. + * + */ + public function rset() + { + $this->_send('RSET'); + // MS ESMTP doesn't follow RFC, see [ZF-1377] + $this->_expect(array(250, 220)); + + $this->mail = false; + $this->rcpt = false; + $this->data = false; + } + + + /** + * Issues the NOOP command end validates answer + * + * Not used by Zend\Mail, could be used to keep a connection alive or check if it is still open. + * + */ + public function noop() + { + $this->_send('NOOP'); + $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2 + } + + + /** + * Issues the VRFY command end validates answer + * + * Not used by Zend\Mail. + * + * @param string $user User Name or eMail to verify + */ + public function vrfy($user) + { + $this->_send('VRFY ' . $user); + $this->_expect(array(250, 251, 252), 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2 + } + + + /** + * Issues the QUIT command and clears the current session + * + */ + public function quit() + { + if ($this->sess) { + $this->auth = false; + $this->_send('QUIT'); + $this->_expect(221, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2 + $this->_stopSession(); + } + } + + + /** + * Default authentication method + * + * This default method is implemented by AUTH adapters to properly authenticate to a remote host. + * + * @throws Exception\RuntimeException + */ + public function auth() + { + if ($this->auth === true) { + throw new Exception\RuntimeException('Already authenticated for this session'); + } + } + + + /** + * Closes connection + * + */ + public function disconnect() + { + $this->_disconnect(); + } + + /** + * Disconnect from remote host and free resource + */ + protected function _disconnect() + { + // Make sure the session gets closed + $this->quit(); + parent::_disconnect(); + } + + /** + * Start mail session + * + */ + protected function _startSession() + { + $this->sess = true; + } + + + /** + * Stop mail session + * + */ + protected function _stopSession() + { + $this->sess = false; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php new file mode 100644 index 0000000000..5b5ca611c7 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php @@ -0,0 +1,142 @@ +setUsername($config['username']); + } + if (isset($config['password'])) { + $this->setPassword($config['password']); + } + } + + // Call parent with original arguments + parent::__construct($host, $port, $origConfig); + } + + + /** + * Performs CRAM-MD5 authentication with supplied credentials + */ + public function auth() + { + // Ensure AUTH has not already been initiated. + parent::auth(); + + $this->_send('AUTH CRAM-MD5'); + $challenge = $this->_expect(334); + $challenge = base64_decode($challenge); + $digest = $this->_hmacMd5($this->getPassword(), $challenge); + $this->_send(base64_encode($this->getUsername() . ' ' . $digest)); + $this->_expect(235); + $this->auth = true; + } + + /** + * Set value for username + * + * @param string $username + * @return Crammd5 + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Get username + * + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Set value for password + * + * @param string $password + * @return Crammd5 + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Get password + * + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Prepare CRAM-MD5 response to server's ticket + * + * @param string $key Challenge key (usually password) + * @param string $data Challenge data + * @param int $block Length of blocks (deprecated; unused) + * @return string + */ + protected function _hmacMd5($key, $data, $block = 64) + { + return Hmac::compute($key, 'md5', $data); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Login.php b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Login.php new file mode 100644 index 0000000000..bcc2c8c45e --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Login.php @@ -0,0 +1,130 @@ +setUsername($config['username']); + } + if (isset($config['password'])) { + $this->setPassword($config['password']); + } + } + + // Call parent with original arguments + parent::__construct($host, $port, $origConfig); + } + + + /** + * Perform LOGIN authentication with supplied credentials + * + */ + public function auth() + { + // Ensure AUTH has not already been initiated. + parent::auth(); + + $this->_send('AUTH LOGIN'); + $this->_expect(334); + $this->_send(base64_encode($this->getUsername())); + $this->_expect(334); + $this->_send(base64_encode($this->getPassword())); + $this->_expect(235); + $this->auth = true; + } + + /** + * Set value for username + * + * @param string $username + * @return Login + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Get username + * + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Set value for password + * + * @param string $password + * @return Login + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Get password + * + * @return string + */ + public function getPassword() + { + return $this->password; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Plain.php b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Plain.php new file mode 100644 index 0000000000..97d028dc87 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/Smtp/Auth/Plain.php @@ -0,0 +1,128 @@ +setUsername($config['username']); + } + if (isset($config['password'])) { + $this->setPassword($config['password']); + } + } + + // Call parent with original arguments + parent::__construct($host, $port, $origConfig); + } + + + /** + * Perform PLAIN authentication with supplied credentials + * + */ + public function auth() + { + // Ensure AUTH has not already been initiated. + parent::auth(); + + $this->_send('AUTH PLAIN'); + $this->_expect(334); + $this->_send(base64_encode("\0" . $this->getUsername() . "\0" . $this->getPassword())); + $this->_expect(235); + $this->auth = true; + } + + /** + * Set value for username + * + * @param string $username + * @return Plain + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Get username + * + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Set value for password + * + * @param string $password + * @return Plain + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Get password + * + * @return string + */ + public function getPassword() + { + return $this->password; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Protocol/SmtpPluginManager.php b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/SmtpPluginManager.php new file mode 100644 index 0000000000..0aad2a5b95 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Protocol/SmtpPluginManager.php @@ -0,0 +1,56 @@ + 'Zend\Mail\Protocol\Smtp\Auth\Crammd5', + 'login' => 'Zend\Mail\Protocol\Smtp\Auth\Login', + 'plain' => 'Zend\Mail\Protocol\Smtp\Auth\Plain', + 'smtp' => 'Zend\Mail\Protocol\Smtp', + ); + + /** + * Validate the plugin + * + * Checks that the extension loaded is an instance of Smtp. + * + * @param mixed $plugin + * @return void + * @throws Exception\InvalidArgumentException if invalid + */ + public function validatePlugin($plugin) + { + if ($plugin instanceof Smtp) { + // we're okay + return; + } + + throw new Exception\InvalidArgumentException(sprintf( + 'Plugin of type %s is invalid; must extend %s\Smtp', + (is_object($plugin) ? get_class($plugin) : gettype($plugin)), + __NAMESPACE__ + )); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/README.md b/vendor/zendframework/zend-mail/Zend/Mail/README.md new file mode 100644 index 0000000000..21c97e554a --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/README.md @@ -0,0 +1,15 @@ +Mail Component from ZF2 +======================= + +This is the Mail component for ZF2. + +- File issues at https://github.com/zendframework/zf2/issues +- Create pull requests against https://github.com/zendframework/zf2 +- Documentation is at http://framework.zend.com/docs + +LICENSE +------- + +The files in this archive are released under the [Zend Framework +license](http://framework.zend.com/license), which is a 3-clause BSD license. + diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage.php new file mode 100644 index 0000000000..85ea79ee36 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage.php @@ -0,0 +1,23 @@ + true, + 'delete' => false, + 'create' => false, + 'top' => false, + 'fetchPart' => true, + 'flags' => false); + + /** + * current iteration position + * @var int + */ + protected $iterationPos = 0; + + /** + * maximum iteration position (= message count) + * @var null|int + */ + protected $iterationMax = null; + + /** + * used message class, change it in an extended class to extend the returned message class + * @var string + */ + protected $messageClass = 'Zend\Mail\Storage\Message'; + + /** + * Getter for has-properties. The standard has properties + * are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop + * + * The valid values for the has-properties are: + * - true if a feature is supported + * - false if a feature is not supported + * - null is it's not yet known or it can't be know if a feature is supported + * + * @param string $var property name + * @throws Exception\InvalidArgumentException + * @return bool supported or not + */ + public function __get($var) + { + if (strpos($var, 'has') === 0) { + $var = strtolower(substr($var, 3)); + return isset($this->has[$var]) ? $this->has[$var] : null; + } + + throw new Exception\InvalidArgumentException($var . ' not found'); + } + + + /** + * Get a full list of features supported by the specific mail lib and the server + * + * @return array list of features as array(feature_name => true|false[|null]) + */ + public function getCapabilities() + { + return $this->has; + } + + + /** + * Count messages messages in current box/folder + * + * @return int number of messages + * @throws Exception\ExceptionInterface + */ + abstract public function countMessages(); + + + /** + * Get a list of messages with number and size + * + * @param int $id number of message + * @return int|array size of given message of list with all messages as array(num => size) + */ + abstract public function getSize($id = 0); + + + /** + * Get a message with headers and body + * + * @param $id int number of message + * @return Message + */ + abstract public function getMessage($id); + + + /** + * Get raw header of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message header + * @param int $topLines include this many lines with header (after an empty line) + * @return string raw header + */ + abstract public function getRawHeader($id, $part = null, $topLines = 0); + + /** + * Get raw content of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message content + * @return string raw content + */ + abstract public function getRawContent($id, $part = null); + + /** + * Create instance with parameters + * + * @param array $params mail reader specific parameters + * @throws Exception\ExceptionInterface + */ + abstract public function __construct($params); + + + /** + * Destructor calls close() and therefore closes the resource. + */ + public function __destruct() + { + $this->close(); + } + + + /** + * Close resource for mail lib. If you need to control, when the resource + * is closed. Otherwise the destructor would call this. + */ + abstract public function close(); + + + /** + * Keep the resource alive. + */ + abstract public function noop(); + + /** + * delete a message from current box/folder + * + * @param $id + */ + abstract public function removeMessage($id); + + /** + * get unique id for one or all messages + * + * if storage does not support unique ids it's the same as the message number + * + * @param int|null $id message number + * @return array|string message number for given message or all messages as array + * @throws Exception\ExceptionInterface + */ + abstract public function getUniqueId($id = null); + + /** + * get a message number from a unique id + * + * I.e. if you have a webmailer that supports deleting messages you should use unique ids + * as parameter and use this method to translate it to message number right before calling removeMessage() + * + * @param string $id unique id + * @return int message number + * @throws Exception\ExceptionInterface + */ + abstract public function getNumberByUniqueId($id); + + // interface implementations follows + + /** + * Countable::count() + * + * @return int + */ + public function count() + { + return $this->countMessages(); + } + + + /** + * ArrayAccess::offsetExists() + * + * @param int $id + * @return bool + */ + public function offsetExists($id) + { + try { + if ($this->getMessage($id)) { + return true; + } + } catch (Exception\ExceptionInterface $e) {} + + return false; + } + + + /** + * ArrayAccess::offsetGet() + * + * @param int $id + * @return \Zend\Mail\Storage\Message message object + */ + public function offsetGet($id) + { + return $this->getMessage($id); + } + + + /** + * ArrayAccess::offsetSet() + * + * @param mixed $id + * @param mixed $value + * @throws Exception\RuntimeException + */ + public function offsetSet($id, $value) + { + throw new Exception\RuntimeException('cannot write mail messages via array access'); + } + + + /** + * ArrayAccess::offsetUnset() + * + * @param int $id + * @return bool success + */ + public function offsetUnset($id) + { + return $this->removeMessage($id); + } + + + /** + * Iterator::rewind() + * + * Rewind always gets the new count from the storage. Thus if you use + * the interfaces and your scripts take long you should use reset() + * from time to time. + */ + public function rewind() + { + $this->iterationMax = $this->countMessages(); + $this->iterationPos = 1; + } + + + /** + * Iterator::current() + * + * @return Message current message + */ + public function current() + { + return $this->getMessage($this->iterationPos); + } + + + /** + * Iterator::key() + * + * @return int id of current position + */ + public function key() + { + return $this->iterationPos; + } + + + /** + * Iterator::next() + */ + public function next() + { + ++$this->iterationPos; + } + + + /** + * Iterator::valid() + * + * @return bool + */ + public function valid() + { + if ($this->iterationMax === null) { + $this->iterationMax = $this->countMessages(); + } + return $this->iterationPos && $this->iterationPos <= $this->iterationMax; + } + + + /** + * SeekableIterator::seek() + * + * @param int $pos + * @throws Exception\OutOfBoundsException + */ + public function seek($pos) + { + if ($this->iterationMax === null) { + $this->iterationMax = $this->countMessages(); + } + + if ($pos > $this->iterationMax) { + throw new Exception\OutOfBoundsException('this position does not exist'); + } + $this->iterationPos = $pos; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Exception/ExceptionInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..8425b8abd0 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Exception/ExceptionInterface.php @@ -0,0 +1,16 @@ + \Zend\Mail\Storage\Folder folder) + * @var array + */ + protected $folders; + + /** + * local name (name of folder in parent folder) + * @var string + */ + protected $localName; + + /** + * global name (absolute name of folder) + * @var string + */ + protected $globalName; + + /** + * folder is selectable if folder is able to hold messages, else it's just a parent folder + * @var bool + */ + protected $selectable = true; + + /** + * create a new mail folder instance + * + * @param string $localName name of folder in current subdirectory + * @param string $globalName absolute name of folder + * @param bool $selectable if true folder holds messages, if false it's just a parent for subfolders (Default: true) + * @param array $folders init with given instances of \Zend\Mail\Storage\Folder as subfolders + */ + public function __construct($localName, $globalName = '', $selectable = true, array $folders = array()) + { + $this->localName = $localName; + $this->globalName = $globalName ? $globalName : $localName; + $this->selectable = $selectable; + $this->folders = $folders; + } + + /** + * implements RecursiveIterator::hasChildren() + * + * @return bool current element has children + */ + public function hasChildren() + { + $current = $this->current(); + return $current && $current instanceof Folder && !$current->isLeaf(); + } + + /** + * implements RecursiveIterator::getChildren() + * + * @return \Zend\Mail\Storage\Folder same as self::current() + */ + public function getChildren() + { + return $this->current(); + } + + /** + * implements Iterator::valid() + * + * @return bool check if there's a current element + */ + public function valid() + { + return key($this->folders) !== null; + } + + /** + * implements Iterator::next() + */ + public function next() + { + next($this->folders); + } + + /** + * implements Iterator::key() + * + * @return string key/local name of current element + */ + public function key() + { + return key($this->folders); + } + + /** + * implements Iterator::current() + * + * @return \Zend\Mail\Storage\Folder current folder + */ + public function current() + { + return current($this->folders); + } + + /** + * implements Iterator::rewind() + */ + public function rewind() + { + reset($this->folders); + } + + /** + * get subfolder named $name + * + * @param string $name wanted subfolder + * @throws Exception\InvalidArgumentException + * @return \Zend\Mail\Storage\Folder folder named $folder + */ + public function __get($name) + { + if (!isset($this->folders[$name])) { + throw new Exception\InvalidArgumentException("no subfolder named $name"); + } + + return $this->folders[$name]; + } + + /** + * add or replace subfolder named $name + * + * @param string $name local name of subfolder + * @param \Zend\Mail\Storage\Folder $folder instance for new subfolder + */ + public function __set($name, Folder $folder) + { + $this->folders[$name] = $folder; + } + + /** + * remove subfolder named $name + * + * @param string $name local name of subfolder + */ + public function __unset($name) + { + unset($this->folders[$name]); + } + + /** + * magic method for easy output of global name + * + * @return string global name of folder + */ + public function __toString() + { + return (string) $this->getGlobalName(); + } + + /** + * get local name + * + * @return string local name + */ + public function getLocalName() + { + return $this->localName; + } + + /** + * get global name + * + * @return string global name + */ + public function getGlobalName() + { + return $this->globalName; + } + + /** + * is this folder selectable? + * + * @return bool selectable + */ + public function isSelectable() + { + return $this->selectable; + } + + /** + * check if folder has no subfolder + * + * @return bool true if no subfolders + */ + public function isLeaf() + { + return empty($this->folders); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Folder/FolderInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Folder/FolderInterface.php new file mode 100644 index 0000000000..e94b525c32 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Folder/FolderInterface.php @@ -0,0 +1,40 @@ +dirname) || !is_dir($params->dirname)) { + throw new Exception\InvalidArgumentException('no valid dirname given in params'); + } + + $this->rootdir = rtrim($params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; + + $this->delim = isset($params->delim) ? $params->delim : '.'; + + $this->_buildFolderTree(); + $this->selectFolder(!empty($params->folder) ? $params->folder : 'INBOX'); + $this->has['top'] = true; + $this->has['flags'] = true; + } + + /** + * find all subfolders and mbox files for folder structure + * + * Result is save in \Zend\Mail\Storage\Folder instances with the root in $this->rootFolder. + * $parentFolder and $parentGlobalName are only used internally for recursion. + * + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + protected function _buildFolderTree() + { + $this->rootFolder = new Storage\Folder('/', '/', false); + $this->rootFolder->INBOX = new Storage\Folder('INBOX', 'INBOX', true); + + ErrorHandler::start(E_WARNING); + $dh = opendir($this->rootdir); + $error = ErrorHandler::stop(); + if (!$dh) { + throw new Exception\RuntimeException("can't read folders in maildir", 0, $error); + } + $dirs = array(); + + while (($entry = readdir($dh)) !== false) { + + // maildir++ defines folders must start with . + if ($entry[0] != '.' || $entry == '.' || $entry == '..') { + continue; + } + + if ($this->_isMaildir($this->rootdir . $entry)) { + $dirs[] = $entry; + } + } + closedir($dh); + + sort($dirs); + $stack = array(null); + $folderStack = array(null); + $parentFolder = $this->rootFolder; + $parent = '.'; + + foreach ($dirs as $dir) { + do { + if (strpos($dir, $parent) === 0) { + $local = substr($dir, strlen($parent)); + if (strpos($local, $this->delim) !== false) { + throw new Exception\RuntimeException('error while reading maildir'); + } + array_push($stack, $parent); + $parent = $dir . $this->delim; + $folder = new Storage\Folder($local, substr($dir, 1), true); + $parentFolder->$local = $folder; + array_push($folderStack, $parentFolder); + $parentFolder = $folder; + break; + } elseif ($stack) { + $parent = array_pop($stack); + $parentFolder = array_pop($folderStack); + } + } while ($stack); + if (!$stack) { + throw new Exception\RuntimeException('error while reading maildir'); + } + } + } + + /** + * get root folder or given folder + * + * @param string $rootFolder get folder structure for given folder, else root + * @throws \Zend\Mail\Storage\Exception\InvalidArgumentException + * @return \Zend\Mail\Storage\Folder root or wanted folder + */ + public function getFolders($rootFolder = null) + { + if (!$rootFolder || $rootFolder == 'INBOX') { + return $this->rootFolder; + } + + // rootdir is same as INBOX in maildir + if (strpos($rootFolder, 'INBOX' . $this->delim) === 0) { + $rootFolder = substr($rootFolder, 6); + } + $currentFolder = $this->rootFolder; + $subname = trim($rootFolder, $this->delim); + + while ($currentFolder) { + ErrorHandler::start(E_NOTICE); + list($entry, $subname) = explode($this->delim, $subname, 2); + ErrorHandler::stop(); + $currentFolder = $currentFolder->$entry; + if (!$subname) { + break; + } + } + + if ($currentFolder->getGlobalName() != rtrim($rootFolder, $this->delim)) { + throw new Exception\InvalidArgumentException("folder $rootFolder not found"); + } + return $currentFolder; + } + + /** + * select given folder + * + * folder must be selectable! + * + * @param \Zend\Mail\Storage\Folder|string $globalName global name of folder or instance for subfolder + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + public function selectFolder($globalName) + { + $this->currentFolder = (string) $globalName; + + // getting folder from folder tree for validation + $folder = $this->getFolders($this->currentFolder); + + try { + $this->_openMaildir($this->rootdir . '.' . $folder->getGlobalName()); + } catch (Exception\ExceptionInterface $e) { + // check what went wrong + if (!$folder->isSelectable()) { + throw new Exception\RuntimeException("{$this->currentFolder} is not selectable", 0, $e); + } + // seems like file has vanished; rebuilding folder tree - but it's still an exception + $this->_buildFolderTree(); + throw new Exception\RuntimeException('seems like the maildir has vanished, I\'ve rebuild the ' . + 'folder tree, search for an other folder and try again', 0, $e); + } + } + + /** + * get \Zend\Mail\Storage\Folder instance for current folder + * + * @return \Zend\Mail\Storage\Folder instance of current folder + */ + public function getCurrentFolder() + { + return $this->currentFolder; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Folder/Mbox.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Folder/Mbox.php new file mode 100644 index 0000000000..aae3e1839e --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Folder/Mbox.php @@ -0,0 +1,207 @@ +filename)) { + throw new Exception\InvalidArgumentException('use \Zend\Mail\Storage\Mbox for a single file'); + } + + if (!isset($params->dirname) || !is_dir($params->dirname)) { + throw new Exception\InvalidArgumentException('no valid dirname given in params'); + } + + $this->rootdir = rtrim($params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; + + $this->_buildFolderTree($this->rootdir); + $this->selectFolder(!empty($params->folder) ? $params->folder : 'INBOX'); + $this->has['top'] = true; + $this->has['uniqueid'] = false; + } + + /** + * find all subfolders and mbox files for folder structure + * + * Result is save in \Zend\Mail\Storage\Folder instances with the root in $this->rootFolder. + * $parentFolder and $parentGlobalName are only used internally for recursion. + * + * @param string $currentDir call with root dir, also used for recursion. + * @param \Zend\Mail\Storage\Folder|null $parentFolder used for recursion + * @param string $parentGlobalName used for recursion + * @throws \Zend\Mail\Storage\Exception\InvalidArgumentException + */ + protected function _buildFolderTree($currentDir, $parentFolder = null, $parentGlobalName = '') + { + if (!$parentFolder) { + $this->rootFolder = new Storage\Folder('/', '/', false); + $parentFolder = $this->rootFolder; + } + + ErrorHandler::start(E_WARNING); + $dh = opendir($currentDir); + ErrorHandler::stop(); + if (!$dh) { + throw new Exception\InvalidArgumentException("can't read dir $currentDir"); + } + while (($entry = readdir($dh)) !== false) { + // ignore hidden files for mbox + if ($entry[0] == '.') { + continue; + } + $absoluteEntry = $currentDir . $entry; + $globalName = $parentGlobalName . DIRECTORY_SEPARATOR . $entry; + if (is_file($absoluteEntry) && $this->isMboxFile($absoluteEntry)) { + $parentFolder->$entry = new Storage\Folder($entry, $globalName); + continue; + } + if (!is_dir($absoluteEntry) /* || $entry == '.' || $entry == '..' */) { + continue; + } + $folder = new Storage\Folder($entry, $globalName, false); + $parentFolder->$entry = $folder; + $this->_buildFolderTree($absoluteEntry . DIRECTORY_SEPARATOR, $folder, $globalName); + } + + closedir($dh); + } + + /** + * get root folder or given folder + * + * @param string $rootFolder get folder structure for given folder, else root + * @throws \Zend\Mail\Storage\Exception\InvalidArgumentException + * @return \Zend\Mail\Storage\Folder root or wanted folder + */ + public function getFolders($rootFolder = null) + { + if (!$rootFolder) { + return $this->rootFolder; + } + + $currentFolder = $this->rootFolder; + $subname = trim($rootFolder, DIRECTORY_SEPARATOR); + while ($currentFolder) { + ErrorHandler::start(E_NOTICE); + list($entry, $subname) = explode(DIRECTORY_SEPARATOR, $subname, 2); + ErrorHandler::stop(); + $currentFolder = $currentFolder->$entry; + if (!$subname) { + break; + } + } + + if ($currentFolder->getGlobalName() != DIRECTORY_SEPARATOR . trim($rootFolder, DIRECTORY_SEPARATOR)) { + throw new Exception\InvalidArgumentException("folder $rootFolder not found"); + } + return $currentFolder; + } + + /** + * select given folder + * + * folder must be selectable! + * + * @param \Zend\Mail\Storage\Folder|string $globalName global name of folder or instance for subfolder + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + public function selectFolder($globalName) + { + $this->currentFolder = (string) $globalName; + + // getting folder from folder tree for validation + $folder = $this->getFolders($this->currentFolder); + + try { + $this->openMboxFile($this->rootdir . $folder->getGlobalName()); + } catch (Exception\ExceptionInterface $e) { + // check what went wrong + if (!$folder->isSelectable()) { + throw new Exception\RuntimeException("{$this->currentFolder} is not selectable", 0, $e); + } + // seems like file has vanished; rebuilding folder tree - but it's still an exception + $this->_buildFolderTree($this->rootdir); + throw new Exception\RuntimeException('seems like the mbox file has vanished, I\'ve rebuild the ' . + 'folder tree, search for an other folder and try again', 0, $e); + } + } + + /** + * get \Zend\Mail\Storage\Folder instance for current folder + * + * @return \Zend\Mail\Storage\Folder instance of current folder + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getCurrentFolder() + { + return $this->currentFolder; + } + + /** + * magic method for serialize() + * + * with this method you can cache the mbox class + * + * @return array name of variables + */ + public function __sleep() + { + return array_merge(parent::__sleep(), array('currentFolder', 'rootFolder', 'rootdir')); + } + + /** + * magic method for unserialize(), with this method you can cache the mbox class + */ + public function __wakeup() + { + // if cache is stall selectFolder() rebuilds the tree on error + parent::__wakeup(); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Imap.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Imap.php new file mode 100644 index 0000000000..9ef870dc4d --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Imap.php @@ -0,0 +1,508 @@ + Mail\Storage::FLAG_PASSED, + '\Answered' => Mail\Storage::FLAG_ANSWERED, + '\Seen' => Mail\Storage::FLAG_SEEN, + '\Deleted' => Mail\Storage::FLAG_DELETED, + '\Draft' => Mail\Storage::FLAG_DRAFT, + '\Flagged' => Mail\Storage::FLAG_FLAGGED); + + /** + * IMAP flags to search criteria + * @var array + */ + protected static $searchFlags = array('\Recent' => 'RECENT', + '\Answered' => 'ANSWERED', + '\Seen' => 'SEEN', + '\Deleted' => 'DELETED', + '\Draft' => 'DRAFT', + '\Flagged' => 'FLAGGED'); + + /** + * Count messages all messages in current box + * + * @param null $flags + * @throws Exception\RuntimeException + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + * @return int number of messages + */ + public function countMessages($flags = null) + { + if (!$this->currentFolder) { + throw new Exception\RuntimeException('No selected folder to count'); + } + + if ($flags === null) { + return count($this->protocol->search(array('ALL'))); + } + + $params = array(); + foreach ((array) $flags as $flag) { + if (isset(static::$searchFlags[$flag])) { + $params[] = static::$searchFlags[$flag]; + } else { + $params[] = 'KEYWORD'; + $params[] = $this->protocol->escapeString($flag); + } + } + return count($this->protocol->search($params)); + } + + /** + * get a list of messages with number and size + * + * @param int $id number of message + * @return int|array size of given message of list with all messages as array(num => size) + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function getSize($id = 0) + { + if ($id) { + return $this->protocol->fetch('RFC822.SIZE', $id); + } + return $this->protocol->fetch('RFC822.SIZE', 1, INF); + } + + /** + * Fetch a message + * + * @param int $id number of message + * @return \Zend\Mail\Storage\Message + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function getMessage($id) + { + $data = $this->protocol->fetch(array('FLAGS', 'RFC822.HEADER'), $id); + $header = $data['RFC822.HEADER']; + + $flags = array(); + foreach ($data['FLAGS'] as $flag) { + $flags[] = isset(static::$knownFlags[$flag]) ? static::$knownFlags[$flag] : $flag; + } + + return new $this->messageClass(array('handler' => $this, 'id' => $id, 'headers' => $header, 'flags' => $flags)); + } + + /* + * Get raw header of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message header + * @param int $topLines include this many lines with header (after an empty line) + * @param int $topLines include this many lines with header (after an empty line) + * @return string raw header + * @throws Exception\RuntimeException + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function getRawHeader($id, $part = null, $topLines = 0) + { + if ($part !== null) { + // TODO: implement + throw new Exception\RuntimeException('not implemented'); + } + + // TODO: toplines + return $this->protocol->fetch('RFC822.HEADER', $id); + } + + /* + * Get raw content of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message content + * @return string raw content + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + * @throws Exception\RuntimeException + */ + public function getRawContent($id, $part = null) + { + if ($part !== null) { + // TODO: implement + throw new Exception\RuntimeException('not implemented'); + } + + return $this->protocol->fetch('RFC822.TEXT', $id); + } + + /** + * create instance with parameters + * Supported parameters are + * - user username + * - host hostname or ip address of IMAP server [optional, default = 'localhost'] + * - password password for user 'username' [optional, default = ''] + * - port port for IMAP server [optional, default = 110] + * - ssl 'SSL' or 'TLS' for secure sockets + * - folder select this folder [optional, default = 'INBOX'] + * + * @param array $params mail reader specific parameters + * @throws Exception\RuntimeException + * @throws Exception\InvalidArgumentException + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function __construct($params) + { + if (is_array($params)) { + $params = (object) $params; + } + + $this->has['flags'] = true; + + if ($params instanceof Protocol\Imap) { + $this->protocol = $params; + try { + $this->selectFolder('INBOX'); + } catch (Exception\ExceptionInterface $e) { + throw new Exception\RuntimeException('cannot select INBOX, is this a valid transport?', 0, $e); + } + return; + } + + if (!isset($params->user)) { + throw new Exception\InvalidArgumentException('need at least user in params'); + } + + $host = isset($params->host) ? $params->host : 'localhost'; + $password = isset($params->password) ? $params->password : ''; + $port = isset($params->port) ? $params->port : null; + $ssl = isset($params->ssl) ? $params->ssl : false; + + $this->protocol = new Protocol\Imap(); + $this->protocol->connect($host, $port, $ssl); + if (!$this->protocol->login($params->user, $password)) { + throw new Exception\RuntimeException('cannot login, user or password wrong'); + } + $this->selectFolder(isset($params->folder) ? $params->folder : 'INBOX'); + } + + /** + * Close resource for mail lib. If you need to control, when the resource + * is closed. Otherwise the destructor would call this. + */ + public function close() + { + $this->currentFolder = ''; + $this->protocol->logout(); + } + + /** + * Keep the server busy. + * + * @throws Exception\RuntimeException + */ + public function noop() + { + if (!$this->protocol->noop()) { + throw new Exception\RuntimeException('could not do nothing'); + } + } + + /** + * Remove a message from server. If you're doing that from a web environment + * you should be careful and use a uniqueid as parameter if possible to + * identify the message. + * + * @param int $id number of message + * @throws Exception\RuntimeException + */ + public function removeMessage($id) + { + if (!$this->protocol->store(array(Mail\Storage::FLAG_DELETED), $id, null, '+')) { + throw new Exception\RuntimeException('cannot set deleted flag'); + } + // TODO: expunge here or at close? we can handle an error here better and are more fail safe + if (!$this->protocol->expunge()) { + throw new Exception\RuntimeException('message marked as deleted, but could not expunge'); + } + } + + /** + * get unique id for one or all messages + * + * if storage does not support unique ids it's the same as the message number + * + * @param int|null $id message number + * @return array|string message number for given message or all messages as array + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function getUniqueId($id = null) + { + if ($id) { + return $this->protocol->fetch('UID', $id); + } + + return $this->protocol->fetch('UID', 1, INF); + } + + /** + * get a message number from a unique id + * + * I.e. if you have a webmailer that supports deleting messages you should use unique ids + * as parameter and use this method to translate it to message number right before calling removeMessage() + * + * @param string $id unique id + * @throws Exception\InvalidArgumentException + * @return int message number + */ + public function getNumberByUniqueId($id) + { + // TODO: use search to find number directly + $ids = $this->getUniqueId(); + foreach ($ids as $k => $v) { + if ($v == $id) { + return $k; + } + } + + throw new Exception\InvalidArgumentException('unique id not found'); + } + + + /** + * get root folder or given folder + * + * @param string $rootFolder get folder structure for given folder, else root + * @throws Exception\RuntimeException + * @throws Exception\InvalidArgumentException + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + * @return \Zend\Mail\Storage\Folder root or wanted folder + */ + public function getFolders($rootFolder = null) + { + $folders = $this->protocol->listMailbox((string) $rootFolder); + if (!$folders) { + throw new Exception\InvalidArgumentException('folder not found'); + } + + ksort($folders, SORT_STRING); + $root = new Folder('/', '/', false); + $stack = array(null); + $folderStack = array(null); + $parentFolder = $root; + $parent = ''; + + foreach ($folders as $globalName => $data) { + do { + if (!$parent || strpos($globalName, $parent) === 0) { + $pos = strrpos($globalName, $data['delim']); + if ($pos === false) { + $localName = $globalName; + } else { + $localName = substr($globalName, $pos + 1); + } + $selectable = !$data['flags'] || !in_array('\\Noselect', $data['flags']); + + array_push($stack, $parent); + $parent = $globalName . $data['delim']; + $folder = new Folder($localName, $globalName, $selectable); + $parentFolder->$localName = $folder; + array_push($folderStack, $parentFolder); + $parentFolder = $folder; + break; + } elseif ($stack) { + $parent = array_pop($stack); + $parentFolder = array_pop($folderStack); + } + } while ($stack); + if (!$stack) { + throw new Exception\RuntimeException('error while constructing folder tree'); + } + } + + return $root; + } + + /** + * select given folder + * + * folder must be selectable! + * + * @param \Zend\Mail\Storage\Folder|string $globalName global name of folder or instance for subfolder + * @throws Exception\RuntimeException + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function selectFolder($globalName) + { + $this->currentFolder = $globalName; + if (!$this->protocol->select($this->currentFolder)) { + $this->currentFolder = ''; + throw new Exception\RuntimeException('cannot change folder, maybe it does not exist'); + } + } + + + /** + * get \Zend\Mail\Storage\Folder instance for current folder + * + * @return \Zend\Mail\Storage\Folder instance of current folder + */ + public function getCurrentFolder() + { + return $this->currentFolder; + } + + /** + * create a new folder + * + * This method also creates parent folders if necessary. Some mail storages may restrict, which folder + * may be used as parent or which chars may be used in the folder name + * + * @param string $name global name of folder, local name if $parentFolder is set + * @param string|\Zend\Mail\Storage\Folder $parentFolder parent folder for new folder, else root folder is parent + * @throws Exception\RuntimeException + */ + public function createFolder($name, $parentFolder = null) + { + // TODO: we assume / as the hierarchy delim - need to get that from the folder class! + if ($parentFolder instanceof Folder) { + $folder = $parentFolder->getGlobalName() . '/' . $name; + } elseif ($parentFolder != null) { + $folder = $parentFolder . '/' . $name; + } else { + $folder = $name; + } + + if (!$this->protocol->create($folder)) { + throw new Exception\RuntimeException('cannot create folder'); + } + } + + /** + * remove a folder + * + * @param string|\Zend\Mail\Storage\Folder $name name or instance of folder + * @throws Exception\RuntimeException + */ + public function removeFolder($name) + { + if ($name instanceof Folder) { + $name = $name->getGlobalName(); + } + + if (!$this->protocol->delete($name)) { + throw new Exception\RuntimeException('cannot delete folder'); + } + } + + /** + * rename and/or move folder + * + * The new name has the same restrictions as in createFolder() + * + * @param string|\Zend\Mail\Storage\Folder $oldName name or instance of folder + * @param string $newName new global name of folder + * @throws Exception\RuntimeException + */ + public function renameFolder($oldName, $newName) + { + if ($oldName instanceof Folder) { + $oldName = $oldName->getGlobalName(); + } + + if (!$this->protocol->rename($oldName, $newName)) { + throw new Exception\RuntimeException('cannot rename folder'); + } + } + + /** + * append a new message to mail storage + * + * @param string $message message as string or instance of message class + * @param null|string|\Zend\Mail\Storage\Folder $folder folder for new message, else current folder is taken + * @param null|array $flags set flags for new message, else a default set is used + * @throws Exception\RuntimeException + */ + // not yet * @param string|\Zend\Mail\Message|\Zend\Mime\Message $message message as string or instance of message class + public function appendMessage($message, $folder = null, $flags = null) + { + if ($folder === null) { + $folder = $this->currentFolder; + } + + if ($flags === null) { + $flags = array(Mail\Storage::FLAG_SEEN); + } + + // TODO: handle class instances for $message + if (!$this->protocol->append($folder, $message, $flags)) { + throw new Exception\RuntimeException('cannot create message, please check if the folder exists and your flags'); + } + } + + /** + * copy an existing message + * + * @param int $id number of message + * @param string|\Zend\Mail\Storage\Folder $folder name or instance of target folder + * @throws Exception\RuntimeException + */ + public function copyMessage($id, $folder) + { + if (!$this->protocol->copy($folder, $id)) { + throw new Exception\RuntimeException('cannot copy message, does the folder exist?'); + } + } + + /** + * move an existing message + * + * NOTE: IMAP has no native move command, thus it's emulated with copy and delete + * + * @param int $id number of message + * @param string|\Zend\Mail\Storage\Folder $folder name or instance of target folder + * @throws Exception\RuntimeException + */ + public function moveMessage($id, $folder) + { + $this->copyMessage($id, $folder); + $this->removeMessage($id); + } + + /** + * set flags for message + * + * NOTE: this method can't set the recent flag. + * + * @param int $id number of message + * @param array $flags new flags for message + * @throws Exception\RuntimeException + */ + public function setFlags($id, $flags) + { + if (!$this->protocol->store($flags, $id)) { + throw new Exception\RuntimeException('cannot set flags, have you tried to set the recent flag or special chars?'); + } + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Maildir.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Maildir.php new file mode 100644 index 0000000000..3e62533917 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Maildir.php @@ -0,0 +1,408 @@ + Mail\Storage::FLAG_DRAFT, + 'F' => Mail\Storage::FLAG_FLAGGED, + 'P' => Mail\Storage::FLAG_PASSED, + 'R' => Mail\Storage::FLAG_ANSWERED, + 'S' => Mail\Storage::FLAG_SEEN, + 'T' => Mail\Storage::FLAG_DELETED); + + // TODO: getFlags($id) for fast access if headers are not needed (i.e. just setting flags)? + + /** + * Count messages all messages in current box + * + * @param mixed $flags + * @return int number of messages + */ + public function countMessages($flags = null) + { + if ($flags === null) { + return count($this->files); + } + + $count = 0; + if (!is_array($flags)) { + foreach ($this->files as $file) { + if (isset($file['flaglookup'][$flags])) { + ++$count; + } + } + return $count; + } + + $flags = array_flip($flags); + foreach ($this->files as $file) { + foreach ($flags as $flag => $v) { + if (!isset($file['flaglookup'][$flag])) { + continue 2; + } + } + ++$count; + } + return $count; + } + + /** + * Get one or all fields from file structure. Also checks if message is valid + * + * @param int $id message number + * @param string|null $field wanted field + * @throws Exception\InvalidArgumentException + * @return string|array wanted field or all fields as array + */ + protected function _getFileData($id, $field = null) + { + if (!isset($this->files[$id - 1])) { + throw new Exception\InvalidArgumentException('id does not exist'); + } + + if (!$field) { + return $this->files[$id - 1]; + } + + if (!isset($this->files[$id - 1][$field])) { + throw new Exception\InvalidArgumentException('field does not exist'); + } + + return $this->files[$id - 1][$field]; + } + + /** + * Get a list of messages with number and size + * + * @param int|null $id number of message or null for all messages + * @return int|array size of given message of list with all messages as array(num => size) + */ + public function getSize($id = null) + { + if ($id !== null) { + $filedata = $this->_getFileData($id); + return isset($filedata['size']) ? $filedata['size'] : filesize($filedata['filename']); + } + + $result = array(); + foreach ($this->files as $num => $data) { + $result[$num + 1] = isset($data['size']) ? $data['size'] : filesize($data['filename']); + } + + return $result; + } + + + + /** + * Fetch a message + * + * @param int $id number of message + * @return \Zend\Mail\Storage\Message\File + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getMessage($id) + { + // TODO that's ugly, would be better to let the message class decide + if (strtolower($this->messageClass) == '\zend\mail\storage\message\file' + || is_subclass_of($this->messageClass, '\Zend\Mail\Storage\Message\File')) { + return new $this->messageClass(array('file' => $this->_getFileData($id, 'filename'), + 'flags' => $this->_getFileData($id, 'flags'))); + } + + return new $this->messageClass(array('handler' => $this, 'id' => $id, 'headers' => $this->getRawHeader($id), + 'flags' => $this->_getFileData($id, 'flags'))); + } + + /* + * Get raw header of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message header + * @param int $topLines include this many lines with header (after an empty line) + * @throws Exception\RuntimeException + * @return string raw header + */ + public function getRawHeader($id, $part = null, $topLines = 0) + { + if ($part !== null) { + // TODO: implement + throw new Exception\RuntimeException('not implemented'); + } + + $fh = fopen($this->_getFileData($id, 'filename'), 'r'); + + $content = ''; + while (!feof($fh)) { + $line = fgets($fh); + if (!trim($line)) { + break; + } + $content .= $line; + } + + fclose($fh); + return $content; + } + + /* + * Get raw content of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message content + * @throws Exception\RuntimeException + * @return string raw content + */ + public function getRawContent($id, $part = null) + { + if ($part !== null) { + // TODO: implement + throw new Exception\RuntimeException('not implemented'); + } + + $fh = fopen($this->_getFileData($id, 'filename'), 'r'); + + while (!feof($fh)) { + $line = fgets($fh); + if (!trim($line)) { + break; + } + } + + $content = stream_get_contents($fh); + fclose($fh); + return $content; + } + + /** + * Create instance with parameters + * Supported parameters are: + * - dirname dirname of mbox file + * + * @param $params array mail reader specific parameters + * @throws Exception\InvalidArgumentException + */ + public function __construct($params) + { + if (is_array($params)) { + $params = (object) $params; + } + + if (!isset($params->dirname) || !is_dir($params->dirname)) { + throw new Exception\InvalidArgumentException('no valid dirname given in params'); + } + + if (!$this->_isMaildir($params->dirname)) { + throw new Exception\InvalidArgumentException('invalid maildir given'); + } + + $this->has['top'] = true; + $this->has['flags'] = true; + $this->_openMaildir($params->dirname); + } + + /** + * check if a given dir is a valid maildir + * + * @param string $dirname name of dir + * @return bool dir is valid maildir + */ + protected function _isMaildir($dirname) + { + if (file_exists($dirname . '/new') && !is_dir($dirname . '/new')) { + return false; + } + if (file_exists($dirname . '/tmp') && !is_dir($dirname . '/tmp')) { + return false; + } + return is_dir($dirname . '/cur'); + } + + /** + * open given dir as current maildir + * + * @param string $dirname name of maildir + * @throws Exception\RuntimeException + */ + protected function _openMaildir($dirname) + { + if ($this->files) { + $this->close(); + } + + ErrorHandler::start(E_WARNING); + $dh = opendir($dirname . '/cur/'); + $error = ErrorHandler::stop(); + if (!$dh) { + throw new Exception\RuntimeException('cannot open maildir', 0, $error); + } + $this->_getMaildirFiles($dh, $dirname . '/cur/'); + closedir($dh); + + ErrorHandler::start(E_WARNING); + $dh = opendir($dirname . '/new/'); + $error = ErrorHandler::stop(); + if ($dh) { + $this->_getMaildirFiles($dh, $dirname . '/new/', array(Mail\Storage::FLAG_RECENT)); + closedir($dh); + } elseif (file_exists($dirname . '/new/')) { + throw new Exception\RuntimeException('cannot read recent mails in maildir', 0, $error); + } + } + + /** + * find all files in opened dir handle and add to maildir files + * + * @param resource $dh dir handle used for search + * @param string $dirname dirname of dir in $dh + * @param array $defaultFlags default flags for given dir + */ + protected function _getMaildirFiles($dh, $dirname, $defaultFlags = array()) + { + while (($entry = readdir($dh)) !== false) { + if ($entry[0] == '.' || !is_file($dirname . $entry)) { + continue; + } + + ErrorHandler::start(E_NOTICE); + list($uniq, $info) = explode(':', $entry, 2); + list(, $size) = explode(',', $uniq, 2); + ErrorHandler::stop(); + if ($size && $size[0] == 'S' && $size[1] == '=') { + $size = substr($size, 2); + } + if (!ctype_digit($size)) { + $size = null; + } + + ErrorHandler::start(E_NOTICE); + list($version, $flags) = explode(',', $info, 2); + ErrorHandler::stop(); + if ($version != 2) { + $flags = ''; + } + + $namedFlags = $defaultFlags; + $length = strlen($flags); + for ($i = 0; $i < $length; ++$i) { + $flag = $flags[$i]; + $namedFlags[$flag] = isset(static::$knownFlags[$flag]) ? static::$knownFlags[$flag] : $flag; + } + + $data = array('uniq' => $uniq, + 'flags' => $namedFlags, + 'flaglookup' => array_flip($namedFlags), + 'filename' => $dirname . $entry); + if ($size !== null) { + $data['size'] = (int) $size; + } + $this->files[] = $data; + } + } + + + /** + * Close resource for mail lib. If you need to control, when the resource + * is closed. Otherwise the destructor would call this. + * + */ + public function close() + { + $this->files = array(); + } + + + /** + * Waste some CPU cycles doing nothing. + * + * @return bool always return true + */ + public function noop() + { + return true; + } + + + /** + * stub for not supported message deletion + * + * @param $id + * @throws Exception\RuntimeException + */ + public function removeMessage($id) + { + throw new Exception\RuntimeException('maildir is (currently) read-only'); + } + + /** + * get unique id for one or all messages + * + * if storage does not support unique ids it's the same as the message number + * + * @param int|null $id message number + * @return array|string message number for given message or all messages as array + */ + public function getUniqueId($id = null) + { + if ($id) { + return $this->_getFileData($id, 'uniq'); + } + + $ids = array(); + foreach ($this->files as $num => $file) { + $ids[$num + 1] = $file['uniq']; + } + return $ids; + } + + /** + * get a message number from a unique id + * + * I.e. if you have a webmailer that supports deleting messages you should use unique ids + * as parameter and use this method to translate it to message number right before calling removeMessage() + * + * @param string $id unique id + * @throws Exception\InvalidArgumentException + * @return int message number + */ + public function getNumberByUniqueId($id) + { + foreach ($this->files as $num => $file) { + if ($file['uniq'] == $id) { + return $num + 1; + } + } + + throw new Exception\InvalidArgumentException('unique id not found'); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Mbox.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Mbox.php new file mode 100644 index 0000000000..d645209151 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Mbox.php @@ -0,0 +1,394 @@ + start, 'separator' => headersep, 'end' => end) + * @var array + */ + protected $positions; + + /** + * used message class, change it in an extended class to extend the returned message class + * @var string + */ + protected $messageClass = '\Zend\Mail\Storage\Message\File'; + + /** + * Count messages all messages in current box + * + * @return int number of messages + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function countMessages() + { + return count($this->positions); + } + + + /** + * Get a list of messages with number and size + * + * @param int|null $id number of message or null for all messages + * @return int|array size of given message of list with all messages as array(num => size) + */ + public function getSize($id = 0) + { + if ($id) { + $pos = $this->positions[$id - 1]; + return $pos['end'] - $pos['start']; + } + + $result = array(); + foreach ($this->positions as $num => $pos) { + $result[$num + 1] = $pos['end'] - $pos['start']; + } + + return $result; + } + + + /** + * Get positions for mail message or throw exception if id is invalid + * + * @param int $id number of message + * @throws Exception\InvalidArgumentException + * @return array positions as in positions + */ + protected function getPos($id) + { + if (!isset($this->positions[$id - 1])) { + throw new Exception\InvalidArgumentException('id does not exist'); + } + + return $this->positions[$id - 1]; + } + + + /** + * Fetch a message + * + * @param int $id number of message + * @return \Zend\Mail\Storage\Message\File + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getMessage($id) + { + // TODO that's ugly, would be better to let the message class decide + if (strtolower($this->messageClass) == '\zend\mail\storage\message\file' + || is_subclass_of($this->messageClass, '\Zend\Mail\Storage\Message\File')) { + // TODO top/body lines + $messagePos = $this->getPos($id); + return new $this->messageClass(array('file' => $this->fh, 'startPos' => $messagePos['start'], + 'endPos' => $messagePos['end'])); + } + + $bodyLines = 0; // TODO: need a way to change that + + $message = $this->getRawHeader($id); + // file pointer is after headers now + if ($bodyLines) { + $message .= "\n"; + while ($bodyLines-- && ftell($this->fh) < $this->positions[$id - 1]['end']) { + $message .= fgets($this->fh); + } + } + + return new $this->messageClass(array('handler' => $this, 'id' => $id, 'headers' => $message)); + } + + /* + * Get raw header of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message header + * @param int $topLines include this many lines with header (after an empty line) + * @return string raw header + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getRawHeader($id, $part = null, $topLines = 0) + { + if ($part !== null) { + // TODO: implement + throw new Exception\RuntimeException('not implemented'); + } + $messagePos = $this->getPos($id); + // TODO: toplines + return stream_get_contents($this->fh, $messagePos['separator'] - $messagePos['start'], $messagePos['start']); + } + + /* + * Get raw content of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message content + * @return string raw content + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getRawContent($id, $part = null) + { + if ($part !== null) { + // TODO: implement + throw new Exception\RuntimeException('not implemented'); + } + $messagePos = $this->getPos($id); + return stream_get_contents($this->fh, $messagePos['end'] - $messagePos['separator'], $messagePos['separator']); + } + + /** + * Create instance with parameters + * Supported parameters are: + * - filename filename of mbox file + * + * @param $params array mail reader specific parameters + * @throws Exception\InvalidArgumentException + */ + public function __construct($params) + { + if (is_array($params)) { + $params = (object) $params; + } + + if (!isset($params->filename)) { + throw new Exception\InvalidArgumentException('no valid filename given in params'); + } + + $this->openMboxFile($params->filename); + $this->has['top'] = true; + $this->has['uniqueid'] = false; + } + + /** + * check if given file is a mbox file + * + * if $file is a resource its file pointer is moved after the first line + * + * @param resource|string $file stream resource of name of file + * @param bool $fileIsString file is string or resource + * @return bool file is mbox file + */ + protected function isMboxFile($file, $fileIsString = true) + { + if ($fileIsString) { + ErrorHandler::start(E_WARNING); + $file = fopen($file, 'r'); + ErrorHandler::stop(); + if (!$file) { + return false; + } + } else { + fseek($file, 0); + } + + $result = false; + + $line = fgets($file); + if (strpos($line, 'From ') === 0) { + $result = true; + } + + if ($fileIsString) { + ErrorHandler::start(E_WARNING); + fclose($file); + ErrorHandler::stop(); + } + + return $result; + } + + /** + * open given file as current mbox file + * + * @param string $filename filename of mbox file + * @throws Exception\RuntimeException + * @throws Exception\InvalidArgumentException + */ + protected function openMboxFile($filename) + { + if ($this->fh) { + $this->close(); + } + + ErrorHandler::start(); + $this->fh = fopen($filename, 'r'); + $error = ErrorHandler::stop(); + if (!$this->fh) { + throw new Exception\RuntimeException('cannot open mbox file', 0, $error); + } + $this->filename = $filename; + $this->filemtime = filemtime($this->filename); + + if (!$this->isMboxFile($this->fh, false)) { + ErrorHandler::start(E_WARNING); + fclose($this->fh); + $error = ErrorHandler::stop(); + throw new Exception\InvalidArgumentException('file is not a valid mbox format', 0, $error); + } + + $messagePos = array('start' => ftell($this->fh), 'separator' => 0, 'end' => 0); + while (($line = fgets($this->fh)) !== false) { + if (strpos($line, 'From ') === 0) { + $messagePos['end'] = ftell($this->fh) - strlen($line) - 2; // + newline + if (!$messagePos['separator']) { + $messagePos['separator'] = $messagePos['end']; + } + $this->positions[] = $messagePos; + $messagePos = array('start' => ftell($this->fh), 'separator' => 0, 'end' => 0); + } + if (!$messagePos['separator'] && !trim($line)) { + $messagePos['separator'] = ftell($this->fh); + } + } + + $messagePos['end'] = ftell($this->fh); + if (!$messagePos['separator']) { + $messagePos['separator'] = $messagePos['end']; + } + $this->positions[] = $messagePos; + } + + /** + * Close resource for mail lib. If you need to control, when the resource + * is closed. Otherwise the destructor would call this. + * + */ + public function close() + { + ErrorHandler::start(E_WARNING); + fclose($this->fh); + ErrorHandler::stop(); + $this->positions = array(); + } + + + /** + * Waste some CPU cycles doing nothing. + * + * @return bool always return true + */ + public function noop() + { + return true; + } + + + /** + * stub for not supported message deletion + * + * @param $id + * @throws Exception\RuntimeException + */ + public function removeMessage($id) + { + throw new Exception\RuntimeException('mbox is read-only'); + } + + /** + * get unique id for one or all messages + * + * Mbox does not support unique ids (yet) - it's always the same as the message number. + * That shouldn't be a problem, because we can't change mbox files. Therefor the message + * number is save enough. + * + * @param int|null $id message number + * @return array|string message number for given message or all messages as array + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getUniqueId($id = null) + { + if ($id) { + // check if id exists + $this->getPos($id); + return $id; + } + + $range = range(1, $this->countMessages()); + return array_combine($range, $range); + } + + /** + * get a message number from a unique id + * + * I.e. if you have a webmailer that supports deleting messages you should use unique ids + * as parameter and use this method to translate it to message number right before calling removeMessage() + * + * @param string $id unique id + * @return int message number + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getNumberByUniqueId($id) + { + // check if id exists + $this->getPos($id); + return $id; + } + + /** + * magic method for serialize() + * + * with this method you can cache the mbox class + * + * @return array name of variables + */ + public function __sleep() + { + return array('filename', 'positions', 'filemtime'); + } + + /** + * magic method for unserialize() + * + * with this method you can cache the mbox class + * for cache validation the mtime of the mbox file is used + * + * @throws Exception\RuntimeException + */ + public function __wakeup() + { + ErrorHandler::start(); + $filemtime = filemtime($this->filename); + ErrorHandler::stop(); + if ($this->filemtime != $filemtime) { + $this->close(); + $this->openMboxFile($this->filename); + } else { + ErrorHandler::start(); + $this->fh = fopen($this->filename, 'r'); + $error = ErrorHandler::stop(); + if (!$this->fh) { + throw new Exception\RuntimeException('cannot open mbox file', 0, $error); + } + } + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message.php new file mode 100644 index 0000000000..13dc9aaf98 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message.php @@ -0,0 +1,85 @@ +flags = array_combine($params['flags'], $params['flags']); + } + + parent::__construct($params); + } + + /** + * return toplines as found after headers + * + * @return string toplines + */ + public function getTopLines() + { + return $this->topLines; + } + + /** + * check if flag is set + * + * @param mixed $flag a flag name, use constants defined in \Zend\Mail\Storage + * @return bool true if set, otherwise false + */ + public function hasFlag($flag) + { + return isset($this->flags[$flag]); + } + + /** + * get all set flags + * + * @return array array with flags, key and value are the same for easy lookup + */ + public function getFlags() + { + return $this->flags; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message/File.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message/File.php new file mode 100644 index 0000000000..8ae8ed6962 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message/File.php @@ -0,0 +1,71 @@ +flags = array_combine($params['flags'], $params['flags']); + } + + parent::__construct($params); + } + + /** + * return toplines as found after headers + * + * @return string toplines + */ + public function getTopLines() + { + return $this->topLines; + } + + /** + * check if flag is set + * + * @param mixed $flag a flag name, use constants defined in \Zend\Mail\Storage + * @return bool true if set, otherwise false + */ + public function hasFlag($flag) + { + return isset($this->flags[$flag]); + } + + /** + * get all set flags + * + * @return array array with flags, key and value are the same for easy lookup + */ + public function getFlags() + { + return $this->flags; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message/MessageInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message/MessageInterface.php new file mode 100644 index 0000000000..76da37a33d --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Message/MessageInterface.php @@ -0,0 +1,35 @@ + value) or string, if a content part is found it's used as toplines + * - noToplines ignore content found after headers in param 'headers' + * - content content as string + * - strict strictly parse raw content + * + * @param array $params full message with or without headers + * @throws Exception\InvalidArgumentException + */ + public function __construct(array $params) + { + if (isset($params['handler'])) { + if (!$params['handler'] instanceof AbstractStorage) { + throw new Exception\InvalidArgumentException('handler is not a valid mail handler'); + } + if (!isset($params['id'])) { + throw new Exception\InvalidArgumentException('need a message id with a handler'); + } + + $this->mail = $params['handler']; + $this->messageNum = $params['id']; + } + + $params['strict'] = isset($params['strict']) ? $params['strict'] : false; + + if (isset($params['raw'])) { + Mime\Decode::splitMessage($params['raw'], $this->headers, $this->content, Mime\Mime::LINEEND, $params['strict']); + } elseif (isset($params['headers'])) { + if (is_array($params['headers'])) { + $this->headers = new Headers(); + $this->headers->addHeaders($params['headers']); + } else { + if (empty($params['noToplines'])) { + Mime\Decode::splitMessage($params['headers'], $this->headers, $this->topLines); + } else { + $this->headers = Headers::fromString($params['headers']); + } + } + + if (isset($params['content'])) { + $this->content = $params['content']; + } + } + } + + /** + * Check if part is a multipart message + * + * @return bool if part is multipart + */ + public function isMultipart() + { + try { + return stripos($this->contentType, 'multipart/') === 0; + } catch (Exception\ExceptionInterface $e) { + return false; + } + } + + + /** + * Body of part + * + * If part is multipart the raw content of this part with all sub parts is returned + * + * @throws Exception\RuntimeException + * @return string body + */ + public function getContent() + { + if ($this->content !== null) { + return $this->content; + } + + if ($this->mail) { + return $this->mail->getRawContent($this->messageNum); + } + + throw new Exception\RuntimeException('no content'); + } + + /** + * Return size of part + * + * Quite simple implemented currently (not decoding). Handle with care. + * + * @return int size + */ + public function getSize() + { + return strlen($this->getContent()); + } + + + /** + * Cache content and split in parts if multipart + * + * @throws Exception\RuntimeException + * @return null + */ + protected function _cacheContent() + { + // caching content if we can't fetch parts + if ($this->content === null && $this->mail) { + $this->content = $this->mail->getRawContent($this->messageNum); + } + + if (!$this->isMultipart()) { + return; + } + + // split content in parts + $boundary = $this->getHeaderField('content-type', 'boundary'); + if (!$boundary) { + throw new Exception\RuntimeException('no boundary found in content type to split message'); + } + $parts = Mime\Decode::splitMessageStruct($this->content, $boundary); + if ($parts === null) { + return; + } + $counter = 1; + foreach ($parts as $part) { + $this->parts[$counter++] = new static(array('headers' => $part['header'], 'content' => $part['body'])); + } + } + + /** + * Get part of multipart message + * + * @param int $num number of part starting with 1 for first part + * @throws Exception\RuntimeException + * @return Part wanted part + */ + public function getPart($num) + { + if (isset($this->parts[$num])) { + return $this->parts[$num]; + } + + if (!$this->mail && $this->content === null) { + throw new Exception\RuntimeException('part not found'); + } + + if ($this->mail && $this->mail->hasFetchPart) { + // TODO: fetch part + // return + } + + $this->_cacheContent(); + + if (!isset($this->parts[$num])) { + throw new Exception\RuntimeException('part not found'); + } + + return $this->parts[$num]; + } + + /** + * Count parts of a multipart part + * + * @return int number of sub-parts + */ + public function countParts() + { + if ($this->countParts) { + return $this->countParts; + } + + $this->countParts = count($this->parts); + if ($this->countParts) { + return $this->countParts; + } + + if ($this->mail && $this->mail->hasFetchPart) { + // TODO: fetch part + // return + } + + $this->_cacheContent(); + + $this->countParts = count($this->parts); + return $this->countParts; + } + + /** + * Access headers collection + * + * Lazy-loads if not already attached. + * + * @return Headers + */ + public function getHeaders() + { + if (null === $this->headers) { + if ($this->mail) { + $part = $this->mail->getRawHeader($this->messageNum); + $this->headers = Headers::fromString($part); + } else { + $this->headers = new Headers(); + } + } + + return $this->headers; + } + + /** + * Get a header in specified format + * + * Internally headers that occur more than once are saved as array, all other as string. If $format + * is set to string implode is used to concat the values (with Mime::LINEEND as delim). + * + * @param string $name name of header, matches case-insensitive, but camel-case is replaced with dashes + * @param string $format change type of return value to 'string' or 'array' + * @throws Exception\InvalidArgumentException + * @return string|array|HeaderInterface|\ArrayIterator value of header in wanted or internal format + */ + public function getHeader($name, $format = null) + { + $header = $this->getHeaders()->get($name); + if ($header === false) { + $lowerName = strtolower(preg_replace('%([a-z])([A-Z])%', '\1-\2', $name)); + $header = $this->getHeaders()->get($lowerName); + if ($header === false) { + throw new Exception\InvalidArgumentException( + "Header with Name $name or $lowerName not found" + ); + } + } + + switch ($format) { + case 'string': + if ($header instanceof HeaderInterface) { + $return = $header->getFieldValue(HeaderInterface::FORMAT_RAW); + } else { + $return = ''; + foreach ($header as $h) { + $return .= $h->getFieldValue(HeaderInterface::FORMAT_RAW) + . Mime\Mime::LINEEND; + } + $return = trim($return, Mime\Mime::LINEEND); + } + break; + case 'array': + if ($header instanceof HeaderInterface) { + $return = array($header->getFieldValue()); + } else { + $return = array(); + foreach ($header as $h) { + $return[] = $h->getFieldValue(HeaderInterface::FORMAT_RAW); + } + } + break; + default: + $return = $header; + } + + return $return; + } + + /** + * Get a specific field from a header like content type or all fields as array + * + * If the header occurs more than once, only the value from the first header + * is returned. + * + * Throws an Exception if the requested header does not exist. If + * the specific header field does not exist, returns null. + * + * @param string $name name of header, like in getHeader() + * @param string $wantedPart the wanted part, default is first, if null an array with all parts is returned + * @param string $firstName key name for the first part + * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value) + * @throws \Zend\Mime\Exception\RuntimeException + */ + public function getHeaderField($name, $wantedPart = '0', $firstName = '0') + { + return Mime\Decode::splitHeaderField(current($this->getHeader($name, 'array')), $wantedPart, $firstName); + } + + + /** + * Getter for mail headers - name is matched in lowercase + * + * This getter is short for Part::getHeader($name, 'string') + * + * @see Part::getHeader() + * + * @param string $name header name + * @return string value of header + * @throws Exception\ExceptionInterface + */ + public function __get($name) + { + return $this->getHeader($name, 'string'); + } + + /** + * Isset magic method proxy to hasHeader + * + * This method is short syntax for Part::hasHeader($name); + * + * @see Part::hasHeader + * + * @param string + * @return bool + */ + public function __isset($name) + { + return $this->getHeaders()->has($name); + } + + /** + * magic method to get content of part + * + * @return string content + */ + public function __toString() + { + return $this->getContent(); + } + + /** + * implements RecursiveIterator::hasChildren() + * + * @return bool current element has children/is multipart + */ + public function hasChildren() + { + $current = $this->current(); + return $current && $current instanceof Part && $current->isMultipart(); + } + + /** + * implements RecursiveIterator::getChildren() + * + * @return Part same as self::current() + */ + public function getChildren() + { + return $this->current(); + } + + /** + * implements Iterator::valid() + * + * @return bool check if there's a current element + */ + public function valid() + { + if ($this->countParts === null) { + $this->countParts(); + } + return $this->iterationPos && $this->iterationPos <= $this->countParts; + } + + /** + * implements Iterator::next() + */ + public function next() + { + ++$this->iterationPos; + } + + /** + * implements Iterator::key() + * + * @return string key/number of current part + */ + public function key() + { + return $this->iterationPos; + } + + /** + * implements Iterator::current() + * + * @return Part current part + */ + public function current() + { + return $this->getPart($this->iterationPos); + } + + /** + * implements Iterator::rewind() + */ + public function rewind() + { + $this->countParts(); + $this->iterationPos = 1; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Part/Exception/ExceptionInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Part/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..ea6a77eec7 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Part/Exception/ExceptionInterface.php @@ -0,0 +1,16 @@ +fh = fopen($params['file'], 'r'); + } else { + $this->fh = $params['file']; + } + if (!$this->fh) { + throw new Exception\RuntimeException('could not open file'); + } + if (isset($params['startPos'])) { + fseek($this->fh, $params['startPos']); + } + $header = ''; + $endPos = isset($params['endPos']) ? $params['endPos'] : null; + while (($endPos === null || ftell($this->fh) < $endPos) && trim($line = fgets($this->fh))) { + $header .= $line; + } + + $this->headers = Headers::fromString($header); + + $this->contentPos[0] = ftell($this->fh); + if ($endPos !== null) { + $this->contentPos[1] = $endPos; + } else { + fseek($this->fh, 0, SEEK_END); + $this->contentPos[1] = ftell($this->fh); + } + if (!$this->isMultipart()) { + return; + } + + $boundary = $this->getHeaderField('content-type', 'boundary'); + if (!$boundary) { + throw new Exception\RuntimeException('no boundary found in content type to split message'); + } + + $part = array(); + $pos = $this->contentPos[0]; + fseek($this->fh, $pos); + while (!feof($this->fh) && ($endPos === null || $pos < $endPos)) { + $line = fgets($this->fh); + if ($line === false) { + if (feof($this->fh)) { + break; + } + throw new Exception\RuntimeException('error reading file'); + } + + $lastPos = $pos; + $pos = ftell($this->fh); + $line = trim($line); + + if ($line == '--' . $boundary) { + if ($part) { + // not first part + $part[1] = $lastPos; + $this->partPos[] = $part; + } + $part = array($pos); + } elseif ($line == '--' . $boundary . '--') { + $part[1] = $lastPos; + $this->partPos[] = $part; + break; + } + } + $this->countParts = count($this->partPos); + + } + + + /** + * Body of part + * + * If part is multipart the raw content of this part with all sub parts is returned + * + * @param resource $stream Optional + * @return string body + */ + public function getContent($stream = null) + { + fseek($this->fh, $this->contentPos[0]); + if ($stream !== null) { + return stream_copy_to_stream($this->fh, $stream, $this->contentPos[1] - $this->contentPos[0]); + } + $length = $this->contentPos[1] - $this->contentPos[0]; + return $length < 1 ? '' : fread($this->fh, $length); + } + + /** + * Return size of part + * + * Quite simple implemented currently (not decoding). Handle with care. + * + * @return int size + */ + public function getSize() + { + return $this->contentPos[1] - $this->contentPos[0]; + } + + /** + * Get part of multipart message + * + * @param int $num number of part starting with 1 for first part + * @throws Exception\RuntimeException + * @return Part wanted part + */ + public function getPart($num) + { + --$num; + if (!isset($this->partPos[$num])) { + throw new Exception\RuntimeException('part not found'); + } + + return new static(array('file' => $this->fh, 'startPos' => $this->partPos[$num][0], + 'endPos' => $this->partPos[$num][1])); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Part/PartInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Part/PartInterface.php new file mode 100644 index 0000000000..ab90d1fd0b --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Part/PartInterface.php @@ -0,0 +1,118 @@ + firstPart, partname => value) + * @throws Exception\ExceptionInterface + */ + public function getHeaderField($name, $wantedPart = '0', $firstName = '0'); + + + /** + * Getter for mail headers - name is matched in lowercase + * + * This getter is short for PartInterface::getHeader($name, 'string') + * + * @see PartInterface::getHeader() + * + * @param string $name header name + * @return string value of header + * @throws Exception\ExceptionInterface + */ + public function __get($name); + + /** + * magic method to get content of part + * + * @return string content + */ + public function __toString(); +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Pop3.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Pop3.php new file mode 100644 index 0000000000..1043b91574 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Pop3.php @@ -0,0 +1,280 @@ +protocol->status($count, $octets); + return (int) $count; + } + + /** + * get a list of messages with number and size + * + * @param int $id number of message + * @return int|array size of given message of list with all messages as array(num => size) + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function getSize($id = 0) + { + $id = $id ? $id : null; + return $this->protocol->getList($id); + } + + /** + * Fetch a message + * + * @param int $id number of message + * @return \Zend\Mail\Storage\Message + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + */ + public function getMessage($id) + { + $bodyLines = 0; + $message = $this->protocol->top($id, $bodyLines, true); + + return new $this->messageClass(array('handler' => $this, 'id' => $id, 'headers' => $message, + 'noToplines' => $bodyLines < 1)); + } + + /* + * Get raw header of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message header + * @param int $topLines include this many lines with header (after an empty line) + * @return string raw header + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getRawHeader($id, $part = null, $topLines = 0) + { + if ($part !== null) { + // TODO: implement + throw new Exception\RuntimeException('not implemented'); + } + + return $this->protocol->top($id, 0, true); + } + + /* + * Get raw content of message or part + * + * @param int $id number of message + * @param null|array|string $part path to part or null for message content + * @return string raw content + * @throws \Zend\Mail\Protocol\Exception\ExceptionInterface + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getRawContent($id, $part = null) + { + if ($part !== null) { + // TODO: implement + throw new Exception\RuntimeException('not implemented'); + } + + $content = $this->protocol->retrieve($id); + // TODO: find a way to avoid decoding the headers + $headers = null; // "Declare" variable since it's passed by reference + $body = null; // "Declare" variable before first usage. + Mime\Decode::splitMessage($content, $headers, $body); + return $body; + } + + /** + * create instance with parameters + * Supported parameters are + * - host hostname or ip address of POP3 server + * - user username + * - password password for user 'username' [optional, default = ''] + * - port port for POP3 server [optional, default = 110] + * - ssl 'SSL' or 'TLS' for secure sockets + * + * @param $params array mail reader specific parameters + * @throws \Zend\Mail\Storage\Exception\InvalidArgumentException + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function __construct($params) + { + if (is_array($params)) { + $params = (object) $params; + } + + $this->has['fetchPart'] = false; + $this->has['top'] = null; + $this->has['uniqueid'] = null; + + if ($params instanceof Protocol\Pop3) { + $this->protocol = $params; + return; + } + + if (!isset($params->user)) { + throw new Exception\InvalidArgumentException('need at least user in params'); + } + + $host = isset($params->host) ? $params->host : 'localhost'; + $password = isset($params->password) ? $params->password : ''; + $port = isset($params->port) ? $params->port : null; + $ssl = isset($params->ssl) ? $params->ssl : false; + + $this->protocol = new Protocol\Pop3(); + $this->protocol->connect($host, $port, $ssl); + $this->protocol->login($params->user, $password); + } + + /** + * Close resource for mail lib. If you need to control, when the resource + * is closed. Otherwise the destructor would call this. + */ + public function close() + { + $this->protocol->logout(); + } + + /** + * Keep the server busy. + * + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function noop() + { + $this->protocol->noop(); + } + + /** + * Remove a message from server. If you're doing that from a web environment + * you should be careful and use a uniqueid as parameter if possible to + * identify the message. + * + * @param int $id number of message + * @throws \Zend\Mail\Protocol\Exception\RuntimeException + */ + public function removeMessage($id) + { + $this->protocol->delete($id); + } + + /** + * get unique id for one or all messages + * + * if storage does not support unique ids it's the same as the message number + * + * @param int|null $id message number + * @return array|string message number for given message or all messages as array + * @throws \Zend\Mail\Storage\Exception\ExceptionInterface + */ + public function getUniqueId($id = null) + { + if (!$this->hasUniqueid) { + if ($id) { + return $id; + } + $count = $this->countMessages(); + if ($count < 1) { + return array(); + } + $range = range(1, $count); + return array_combine($range, $range); + } + + return $this->protocol->uniqueid($id); + } + + /** + * get a message number from a unique id + * + * I.e. if you have a webmailer that supports deleting messages you should use unique ids + * as parameter and use this method to translate it to message number right before calling removeMessage() + * + * @param string $id unique id + * @throws Exception\InvalidArgumentException + * @return int message number + */ + public function getNumberByUniqueId($id) + { + if (!$this->hasUniqueid) { + return $id; + } + + $ids = $this->getUniqueId(); + foreach ($ids as $k => $v) { + if ($v == $id) { + return $k; + } + } + + throw new Exception\InvalidArgumentException('unique id not found'); + } + + /** + * Special handling for hasTop and hasUniqueid. The headers of the first message is + * retrieved if Top wasn't needed/tried yet. + * + * @see AbstractStorage::__get() + * @param string $var + * @return string + */ + public function __get($var) + { + $result = parent::__get($var); + if ($result !== null) { + return $result; + } + + if (strtolower($var) == 'hastop') { + if ($this->protocol->hasTop === null) { + // need to make a real call, because not all server are honest in their capas + try { + $this->protocol->top(1, 0, false); + } catch (MailException\ExceptionInterface $e) { + // ignoring error + } + } + $this->has['top'] = $this->protocol->hasTop; + return $this->protocol->hasTop; + } + + if (strtolower($var) == 'hasuniqueid') { + $id = null; + try { + $id = $this->protocol->uniqueid(1); + } catch (MailException\ExceptionInterface $e) { + // ignoring error + } + $this->has['uniqueid'] = $id ? true : false; + return $this->has['uniqueid']; + } + + return $result; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Writable/Maildir.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Writable/Maildir.php new file mode 100644 index 0000000000..46d8630ec6 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Writable/Maildir.php @@ -0,0 +1,939 @@ +create) && isset($params->dirname) && !file_exists($params->dirname . DIRECTORY_SEPARATOR . 'cur')) { + self::initMaildir($params->dirname); + } + + parent::__construct($params); + } + + /** + * create a new folder + * + * This method also creates parent folders if necessary. Some mail storages may restrict, which folder + * may be used as parent or which chars may be used in the folder name + * + * @param string $name global name of folder, local name if $parentFolder is set + * @param string|\Zend\Mail\Storage\Folder $parentFolder parent folder for new folder, else root folder is parent + * @throws \Zend\Mail\Storage\Exception\RuntimeException + * @return string only used internally (new created maildir) + */ + public function createFolder($name, $parentFolder = null) + { + if ($parentFolder instanceof Folder) { + $folder = $parentFolder->getGlobalName() . $this->delim . $name; + } elseif ($parentFolder != null) { + $folder = rtrim($parentFolder, $this->delim) . $this->delim . $name; + } else { + $folder = $name; + } + + $folder = trim($folder, $this->delim); + + // first we check if we try to create a folder that does exist + $exists = null; + try { + $exists = $this->getFolders($folder); + } catch (MailException\ExceptionInterface $e) { + // ok + } + if ($exists) { + throw new StorageException\RuntimeException('folder already exists'); + } + + if (strpos($folder, $this->delim . $this->delim) !== false) { + throw new StorageException\RuntimeException('invalid name - folder parts may not be empty'); + } + + if (strpos($folder, 'INBOX' . $this->delim) === 0) { + $folder = substr($folder, 6); + } + + $fulldir = $this->rootdir . '.' . $folder; + + // check if we got tricked and would create a dir outside of the rootdir or not as direct child + if (strpos($folder, DIRECTORY_SEPARATOR) !== false || strpos($folder, '/') !== false + || dirname($fulldir) . DIRECTORY_SEPARATOR != $this->rootdir + ) { + throw new StorageException\RuntimeException('invalid name - no directory separator allowed in folder name'); + } + + // has a parent folder? + $parent = null; + if (strpos($folder, $this->delim)) { + // let's see if the parent folder exists + $parent = substr($folder, 0, strrpos($folder, $this->delim)); + try { + $this->getFolders($parent); + } catch (MailException\ExceptionInterface $e) { + // does not - create parent folder + $this->createFolder($parent); + } + } + + ErrorHandler::start(); + if (!mkdir($fulldir) || !mkdir($fulldir . DIRECTORY_SEPARATOR . 'cur')) { + $error = ErrorHandler::stop(); + throw new StorageException\RuntimeException('error while creating new folder, may be created incompletely', 0, $error); + } + ErrorHandler::stop(); + + mkdir($fulldir . DIRECTORY_SEPARATOR . 'new'); + mkdir($fulldir . DIRECTORY_SEPARATOR . 'tmp'); + + $localName = $parent ? substr($folder, strlen($parent) + 1) : $folder; + $this->getFolders($parent)->$localName = new Folder($localName, $folder, true); + + return $fulldir; + } + + /** + * remove a folder + * + * @param string|Folder $name name or instance of folder + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + public function removeFolder($name) + { + // TODO: This could fail in the middle of the task, which is not optimal. + // But there is no defined standard way to mark a folder as removed and there is no atomar fs-op + // to remove a directory. Also moving the folder to a/the trash folder is not possible, as + // all parent folders must be created. What we could do is add a dash to the front of the + // directory name and it should be ignored as long as other processes obey the standard. + + if ($name instanceof Folder) { + $name = $name->getGlobalName(); + } + + $name = trim($name, $this->delim); + if (strpos($name, 'INBOX' . $this->delim) === 0) { + $name = substr($name, 6); + } + + // check if folder exists and has no children + if (!$this->getFolders($name)->isLeaf()) { + throw new StorageException\RuntimeException('delete children first'); + } + + if ($name == 'INBOX' || $name == DIRECTORY_SEPARATOR || $name == '/') { + throw new StorageException\RuntimeException('wont delete INBOX'); + } + + if ($name == $this->getCurrentFolder()) { + throw new StorageException\RuntimeException('wont delete selected folder'); + } + + foreach (array('tmp', 'new', 'cur', '.') as $subdir) { + $dir = $this->rootdir . '.' . $name . DIRECTORY_SEPARATOR . $subdir; + if (!file_exists($dir)) { + continue; + } + $dh = opendir($dir); + if (!$dh) { + throw new StorageException\RuntimeException("error opening $subdir"); + } + while (($entry = readdir($dh)) !== false) { + if ($entry == '.' || $entry == '..') { + continue; + } + if (!unlink($dir . DIRECTORY_SEPARATOR . $entry)) { + throw new StorageException\RuntimeException("error cleaning $subdir"); + } + } + closedir($dh); + if ($subdir !== '.') { + if (!rmdir($dir)) { + throw new StorageException\RuntimeException("error removing $subdir"); + } + } + } + + if (!rmdir($this->rootdir . '.' . $name)) { + // at least we should try to make it a valid maildir again + mkdir($this->rootdir . '.' . $name . DIRECTORY_SEPARATOR . 'cur'); + throw new StorageException\RuntimeException("error removing maindir"); + } + + $parent = strpos($name, $this->delim) ? substr($name, 0, strrpos($name, $this->delim)) : null; + $localName = $parent ? substr($name, strlen($parent) + 1) : $name; + unset($this->getFolders($parent)->$localName); + } + + /** + * rename and/or move folder + * + * The new name has the same restrictions as in createFolder() + * + * @param string|\Zend\Mail\Storage\Folder $oldName name or instance of folder + * @param string $newName new global name of folder + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + public function renameFolder($oldName, $newName) + { + // TODO: This is also not atomar and has similar problems as removeFolder() + + if ($oldName instanceof Folder) { + $oldName = $oldName->getGlobalName(); + } + + $oldName = trim($oldName, $this->delim); + if (strpos($oldName, 'INBOX' . $this->delim) === 0) { + $oldName = substr($oldName, 6); + } + + $newName = trim($newName, $this->delim); + if (strpos($newName, 'INBOX' . $this->delim) === 0) { + $newName = substr($newName, 6); + } + + if (strpos($newName, $oldName . $this->delim) === 0) { + throw new StorageException\RuntimeException('new folder cannot be a child of old folder'); + } + + // check if folder exists and has no children + $folder = $this->getFolders($oldName); + + if ($oldName == 'INBOX' || $oldName == DIRECTORY_SEPARATOR || $oldName == '/') { + throw new StorageException\RuntimeException('wont rename INBOX'); + } + + if ($oldName == $this->getCurrentFolder()) { + throw new StorageException\RuntimeException('wont rename selected folder'); + } + + $newdir = $this->createFolder($newName); + + if (!$folder->isLeaf()) { + foreach ($folder as $k => $v) { + $this->renameFolder($v->getGlobalName(), $newName . $this->delim . $k); + } + } + + $olddir = $this->rootdir . '.' . $folder; + foreach (array('tmp', 'new', 'cur') as $subdir) { + $subdir = DIRECTORY_SEPARATOR . $subdir; + if (!file_exists($olddir . $subdir)) { + continue; + } + // using copy or moving files would be even better - but also much slower + if (!rename($olddir . $subdir, $newdir . $subdir)) { + throw new StorageException\RuntimeException('error while moving ' . $subdir); + } + } + // create a dummy if removing fails - otherwise we can't read it next time + mkdir($olddir . DIRECTORY_SEPARATOR . 'cur'); + $this->removeFolder($oldName); + } + + /** + * create a uniqueid for maildir filename + * + * This is nearly the format defined in the maildir standard. The microtime() call should already + * create a uniqueid, the pid is for multicore/-cpu machine that manage to call this function at the + * exact same time, and uname() gives us the hostname for multiple machines accessing the same storage. + * + * If someone disables posix we create a random number of the same size, so this method should also + * work on Windows - if you manage to get maildir working on Windows. + * Microtime could also be disabled, although I've never seen it. + * + * @return string new uniqueid + */ + protected function _createUniqueId() + { + $id = ''; + $id .= microtime(true); + $id .= '.' . getmypid(); + $id .= '.' . php_uname('n'); + + return $id; + } + + /** + * open a temporary maildir file + * + * makes sure tmp/ exists and create a file with a unique name + * you should close the returned filehandle! + * + * @param string $folder name of current folder without leading . + * @throws \Zend\Mail\Storage\Exception\RuntimeException + * @return array array('dirname' => dir of maildir folder, 'uniq' => unique id, 'filename' => name of create file + * 'handle' => file opened for writing) + */ + protected function _createTmpFile($folder = 'INBOX') + { + if ($folder == 'INBOX') { + $tmpdir = $this->rootdir . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR; + } else { + $tmpdir = $this->rootdir . '.' . $folder . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR; + } + if (!file_exists($tmpdir)) { + if (!mkdir($tmpdir)) { + throw new StorageException\RuntimeException('problems creating tmp dir'); + } + } + + // we should retry to create a unique id if a file with the same name exists + // to avoid a script timeout we only wait 1 second (instead of 2) and stop + // after a defined retry count + // if you change this variable take into account that it can take up to $maxTries seconds + // normally we should have a valid unique name after the first try, we're just following the "standard" here + $maxTries = 5; + for ($i = 0; $i < $maxTries; ++$i) { + $uniq = $this->_createUniqueId(); + if (!file_exists($tmpdir . $uniq)) { + // here is the race condition! - as defined in the standard + // to avoid having a long time between stat()ing the file and creating it we're opening it here + // to mark the filename as taken + $fh = fopen($tmpdir . $uniq, 'w'); + if (!$fh) { + throw new StorageException\RuntimeException('could not open temp file'); + } + break; + } + sleep(1); + } + + if (!$fh) { + throw new StorageException\RuntimeException("tried $maxTries unique ids for a temp file, but all were taken" + . ' - giving up'); + } + + return array('dirname' => $this->rootdir . '.' . $folder, + 'uniq' => $uniq, + 'filename' => $tmpdir . $uniq, + 'handle' => $fh); + } + + /** + * create an info string for filenames with given flags + * + * @param array $flags wanted flags, with the reference you'll get the set flags with correct key (= char for flag) + * @throws \Zend\Mail\Storage\Exception\InvalidArgumentException + * @return string info string for version 2 filenames including the leading colon + */ + protected function _getInfoString(&$flags) + { + // accessing keys is easier, faster and it removes duplicated flags + $wantedFlags = array_flip($flags); + if (isset($wantedFlags[Storage::FLAG_RECENT])) { + throw new StorageException\InvalidArgumentException('recent flag may not be set'); + } + + $info = ':2,'; + $flags = array(); + foreach (Storage\Maildir::$knownFlags as $char => $flag) { + if (!isset($wantedFlags[$flag])) { + continue; + } + $info .= $char; + $flags[$char] = $flag; + unset($wantedFlags[$flag]); + } + + if (!empty($wantedFlags)) { + $wantedFlags = implode(', ', array_keys($wantedFlags)); + throw new StorageException\InvalidArgumentException('unknown flag(s): ' . $wantedFlags); + } + + return $info; + } + + /** + * append a new message to mail storage + * + * @param string|stream $message message as string or stream resource + * @param null|string|\Zend\Mail\Storage\Folder $folder folder for new message, else current folder is taken + * @param null|array $flags set flags for new message, else a default set is used + * @param bool $recent handle this mail as if recent flag has been set, + * should only be used in delivery + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + // not yet * @param string|\Zend\Mail\Message|\Zend\Mime\Message $message message as string or instance of message class + public function appendMessage($message, $folder = null, $flags = null, $recent = false) + { + if ($this->quota && $this->checkQuota()) { + throw new StorageException\RuntimeException('storage is over quota!'); + } + + if ($folder === null) { + $folder = $this->currentFolder; + } + + if (!($folder instanceof Folder)) { + $folder = $this->getFolders($folder); + } + + if ($flags === null) { + $flags = array(Storage::FLAG_SEEN); + } + $info = $this->_getInfoString($flags); + $tempFile = $this->_createTmpFile($folder->getGlobalName()); + + // TODO: handle class instances for $message + if (is_resource($message) && get_resource_type($message) == 'stream') { + stream_copy_to_stream($message, $tempFile['handle']); + } else { + fwrite($tempFile['handle'], $message); + } + fclose($tempFile['handle']); + + // we're adding the size to the filename for maildir++ + $size = filesize($tempFile['filename']); + if ($size !== false) { + $info = ',S=' . $size . $info; + } + $newFilename = $tempFile['dirname'] . DIRECTORY_SEPARATOR; + $newFilename .= $recent ? 'new' : 'cur'; + $newFilename .= DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info; + + // we're throwing any exception after removing our temp file and saving it to this variable instead + $exception = null; + + if (!link($tempFile['filename'], $newFilename)) { + $exception = new StorageException\RuntimeException('cannot link message file to final dir'); + } + + ErrorHandler::start(E_WARNING); + unlink($tempFile['filename']); + ErrorHandler::stop(); + + if ($exception) { + throw $exception; + } + + $this->files[] = array('uniq' => $tempFile['uniq'], + 'flags' => $flags, + 'filename' => $newFilename); + if ($this->quota) { + $this->_addQuotaEntry((int) $size, 1); + } + } + + /** + * copy an existing message + * + * @param int $id number of message + * @param string|\Zend\Mail\Storage\Folder $folder name or instance of targer folder + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + public function copyMessage($id, $folder) + { + if ($this->quota && $this->checkQuota()) { + throw new StorageException\RuntimeException('storage is over quota!'); + } + + if (!($folder instanceof Folder)) { + $folder = $this->getFolders($folder); + } + + $filedata = $this->_getFileData($id); + $oldFile = $filedata['filename']; + $flags = $filedata['flags']; + + // copied message can't be recent + while (($key = array_search(Storage::FLAG_RECENT, $flags)) !== false) { + unset($flags[$key]); + } + $info = $this->_getInfoString($flags); + + // we're creating the copy as temp file before moving to cur/ + $tempFile = $this->_createTmpFile($folder->getGlobalName()); + // we don't write directly to the file + fclose($tempFile['handle']); + + // we're adding the size to the filename for maildir++ + $size = filesize($oldFile); + if ($size !== false) { + $info = ',S=' . $size . $info; + } + + $newFile = $tempFile['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info; + + // we're throwing any exception after removing our temp file and saving it to this variable instead + $exception = null; + + if (!copy($oldFile, $tempFile['filename'])) { + $exception = new StorageException\RuntimeException('cannot copy message file'); + } elseif (!link($tempFile['filename'], $newFile)) { + $exception = new StorageException\RuntimeException('cannot link message file to final dir'); + } + + ErrorHandler::start(E_WARNING); + unlink($tempFile['filename']); + ErrorHandler::stop(); + + if ($exception) { + throw $exception; + } + + if ($folder->getGlobalName() == $this->currentFolder + || ($this->currentFolder == 'INBOX' && $folder->getGlobalName() == '/') + ) { + $this->files[] = array('uniq' => $tempFile['uniq'], + 'flags' => $flags, + 'filename' => $newFile); + } + + if ($this->quota) { + $this->_addQuotaEntry((int) $size, 1); + } + } + + /** + * move an existing message + * + * @param int $id number of message + * @param string|\Zend\Mail\Storage\Folder $folder name or instance of targer folder + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + public function moveMessage($id, $folder) + { + if (!($folder instanceof Folder)) { + $folder = $this->getFolders($folder); + } + + if ($folder->getGlobalName() == $this->currentFolder + || ($this->currentFolder == 'INBOX' && $folder->getGlobalName() == '/') + ) { + throw new StorageException\RuntimeException('target is current folder'); + } + + $filedata = $this->_getFileData($id); + $oldFile = $filedata['filename']; + $flags = $filedata['flags']; + + // moved message can't be recent + while (($key = array_search(Storage::FLAG_RECENT, $flags)) !== false) { + unset($flags[$key]); + } + $info = $this->_getInfoString($flags); + + // reserving a new name + $tempFile = $this->_createTmpFile($folder->getGlobalName()); + fclose($tempFile['handle']); + + // we're adding the size to the filename for maildir++ + $size = filesize($oldFile); + if ($size !== false) { + $info = ',S=' . $size . $info; + } + + $newFile = $tempFile['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info; + + // we're throwing any exception after removing our temp file and saving it to this variable instead + $exception = null; + + if (!rename($oldFile, $newFile)) { + $exception = new StorageException\RuntimeException('cannot move message file'); + } + + ErrorHandler::start(E_WARNING); + unlink($tempFile['filename']); + ErrorHandler::stop(); + + if ($exception) { + throw $exception; + } + + unset($this->files[$id - 1]); + // remove the gap + $this->files = array_values($this->files); + } + + + /** + * set flags for message + * + * NOTE: this method can't set the recent flag. + * + * @param int $id number of message + * @param array $flags new flags for message + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + public function setFlags($id, $flags) + { + $info = $this->_getInfoString($flags); + $filedata = $this->_getFileData($id); + + // NOTE: double dirname to make sure we always move to cur. if recent flag has been set (message is in new) it will be moved to cur. + $newFilename = dirname(dirname($filedata['filename'])) . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . "$filedata[uniq]$info"; + + ErrorHandler::start(); + $test = rename($filedata['filename'], $newFilename); + $error = ErrorHandler::stop(); + if (!$test) { + throw new StorageException\RuntimeException('cannot rename file', 0, $error); + } + + $filedata['flags'] = $flags; + $filedata['filename'] = $newFilename; + + $this->files[$id - 1] = $filedata; + } + + + /** + * stub for not supported message deletion + * + * @param $id + * @throws \Zend\Mail\Storage\Exception\RuntimeException + */ + public function removeMessage($id) + { + $filename = $this->_getFileData($id, 'filename'); + + if ($this->quota) { + $size = filesize($filename); + } + + ErrorHandler::start(); + $test = unlink($filename); + $error = ErrorHandler::stop(); + if (!$test) { + throw new StorageException\RuntimeException('cannot remove message', 0, $error); + } + unset($this->files[$id - 1]); + // remove the gap + $this->files = array_values($this->files); + if ($this->quota) { + $this->_addQuotaEntry(0 - (int) $size, -1); + } + } + + /** + * enable/disable quota and set a quota value if wanted or needed + * + * You can enable/disable quota with true/false. If you don't have + * a MDA or want to enforce a quota value you can also set this value + * here. Use array('size' => SIZE_QUOTA, 'count' => MAX_MESSAGE) do + * define your quota. Order of these fields does matter! + * + * @param bool|array $value new quota value + */ + public function setQuota($value) + { + $this->quota = $value; + } + + /** + * get currently set quota + * + * @see \Zend\Mail\Storage\Writable\Maildir::setQuota() + * @param bool $fromStorage + * @throws \Zend\Mail\Storage\Exception\RuntimeException + * @return bool|array + */ + public function getQuota($fromStorage = false) + { + if ($fromStorage) { + ErrorHandler::start(E_WARNING); + $fh = fopen($this->rootdir . 'maildirsize', 'r'); + $error = ErrorHandler::stop(); + if (!$fh) { + throw new StorageException\RuntimeException('cannot open maildirsize', 0, $error); + } + $definition = fgets($fh); + fclose($fh); + $definition = explode(',', trim($definition)); + $quota = array(); + foreach ($definition as $member) { + $key = $member[strlen($member) - 1]; + if ($key == 'S' || $key == 'C') { + $key = $key == 'C' ? 'count' : 'size'; + } + $quota[$key] = substr($member, 0, -1); + } + return $quota; + } + + return $this->quota; + } + + /** + * @see http://www.inter7.com/courierimap/README.maildirquota.html "Calculating maildirsize" + * @throws \Zend\Mail\Storage\Exception\RuntimeException + * @return array + */ + protected function _calculateMaildirsize() + { + $timestamps = array(); + $messages = 0; + $totalSize = 0; + + if (is_array($this->quota)) { + $quota = $this->quota; + } else { + try { + $quota = $this->getQuota(true); + } catch (StorageException\ExceptionInterface $e) { + throw new StorageException\RuntimeException('no quota definition found', 0, $e); + } + } + + $folders = new RecursiveIteratorIterator($this->getFolders(), RecursiveIteratorIterator::SELF_FIRST); + foreach ($folders as $folder) { + $subdir = $folder->getGlobalName(); + if ($subdir == 'INBOX') { + $subdir = ''; + } else { + $subdir = '.' . $subdir; + } + if ($subdir == 'Trash') { + continue; + } + + foreach (array('cur', 'new') as $subsubdir) { + $dirname = $this->rootdir . $subdir . DIRECTORY_SEPARATOR . $subsubdir . DIRECTORY_SEPARATOR; + if (!file_exists($dirname)) { + continue; + } + // NOTE: we are using mtime instead of "the latest timestamp". The latest would be atime + // and as we are accessing the directory it would make the whole calculation useless. + $timestamps[$dirname] = filemtime($dirname); + + $dh = opendir($dirname); + // NOTE: Should have been checked in constructor. Not throwing an exception here, quotas will + // therefore not be fully enforced, but next request will fail anyway, if problem persists. + if (!$dh) { + continue; + } + + + while (($entry = readdir()) !== false) { + if ($entry[0] == '.' || !is_file($dirname . $entry)) { + continue; + } + + if (strpos($entry, ',S=')) { + strtok($entry, '='); + $filesize = strtok(':'); + if (is_numeric($filesize)) { + $totalSize += $filesize; + ++$messages; + continue; + } + } + $size = filesize($dirname . $entry); + if ($size === false) { + // ignore, as we assume file got removed + continue; + } + $totalSize += $size; + ++$messages; + } + } + } + + $tmp = $this->_createTmpFile(); + $fh = $tmp['handle']; + $definition = array(); + foreach ($quota as $type => $value) { + if ($type == 'size' || $type == 'count') { + $type = $type == 'count' ? 'C' : 'S'; + } + $definition[] = $value . $type; + } + $definition = implode(',', $definition); + fwrite($fh, "$definition\n"); + fwrite($fh, "$totalSize $messages\n"); + fclose($fh); + rename($tmp['filename'], $this->rootdir . 'maildirsize'); + foreach ($timestamps as $dir => $timestamp) { + if ($timestamp < filemtime($dir)) { + unlink($this->rootdir . 'maildirsize'); + break; + } + } + + return array('size' => $totalSize, + 'count' => $messages, + 'quota' => $quota); + } + + /** + * @see http://www.inter7.com/courierimap/README.maildirquota.html "Calculating the quota for a Maildir++" + * @param bool $forceRecalc + * @return array + */ + protected function _calculateQuota($forceRecalc = false) + { + $fh = null; + $totalSize = 0; + $messages = 0; + $maildirsize = ''; + if (!$forceRecalc && file_exists($this->rootdir . 'maildirsize') && filesize($this->rootdir . 'maildirsize') < 5120) { + $fh = fopen($this->rootdir . 'maildirsize', 'r'); + } + if ($fh) { + $maildirsize = fread($fh, 5120); + if (strlen($maildirsize) >= 5120) { + fclose($fh); + $fh = null; + $maildirsize = ''; + } + } + if (!$fh) { + $result = $this->_calculateMaildirsize(); + $totalSize = $result['size']; + $messages = $result['count']; + $quota = $result['quota']; + } else { + $maildirsize = explode("\n", $maildirsize); + if (is_array($this->quota)) { + $quota = $this->quota; + } else { + $definition = explode(',', $maildirsize[0]); + $quota = array(); + foreach ($definition as $member) { + $key = $member[strlen($member) - 1]; + if ($key == 'S' || $key == 'C') { + $key = $key == 'C' ? 'count' : 'size'; + } + $quota[$key] = substr($member, 0, -1); + } + } + unset($maildirsize[0]); + foreach ($maildirsize as $line) { + list($size, $count) = explode(' ', trim($line)); + $totalSize += $size; + $messages += $count; + } + } + + $overQuota = false; + $overQuota = $overQuota || (isset($quota['size']) && $totalSize > $quota['size']); + $overQuota = $overQuota || (isset($quota['count']) && $messages > $quota['count']); + // NOTE: $maildirsize equals false if it wasn't set (AKA we recalculated) or it's only + // one line, because $maildirsize[0] gets unsetted. + // Also we're using local time to calculate the 15 minute offset. Touching a file just for known the + // local time of the file storage isn't worth the hassle. + if ($overQuota && ($maildirsize || filemtime($this->rootdir . 'maildirsize') > time() - 900)) { + $result = $this->_calculateMaildirsize(); + $totalSize = $result['size']; + $messages = $result['count']; + $quota = $result['quota']; + $overQuota = false; + $overQuota = $overQuota || (isset($quota['size']) && $totalSize > $quota['size']); + $overQuota = $overQuota || (isset($quota['count']) && $messages > $quota['count']); + } + + if ($fh) { + // TODO is there a safe way to keep the handle open for writing? + fclose($fh); + } + + return array('size' => $totalSize, + 'count' => $messages, + 'quota' => $quota, + 'over_quota' => $overQuota); + } + + protected function _addQuotaEntry($size, $count = 1) + { + if (!file_exists($this->rootdir . 'maildirsize')) { + // TODO: should get file handler from _calculateQuota + } + $size = (int) $size; + $count = (int) $count; + file_put_contents($this->rootdir . 'maildirsize', "$size $count\n", FILE_APPEND); + } + + /** + * check if storage is currently over quota + * + * @see _calculateQuota() + * @param bool $detailedResponse return known data of quota and current size and message count + * @param bool $forceRecalc + * @return bool|array over quota state or detailed response + */ + public function checkQuota($detailedResponse = false, $forceRecalc = false) + { + $result = $this->_calculateQuota($forceRecalc); + return $detailedResponse ? $result : $result['over_quota']; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Storage/Writable/WritableInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Writable/WritableInterface.php new file mode 100644 index 0000000000..cad542b1c4 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Storage/Writable/WritableInterface.php @@ -0,0 +1,83 @@ +setOptions($options); + } + + /** + * Sets options + * + * @param FileOptions $options + */ + public function setOptions(FileOptions $options) + { + $this->options = $options; + } + + /** + * Saves e-mail message to a file + * + * @param Message $message + * @throws Exception\RuntimeException on not writable target directory or + * on file_put_contents() failure + */ + public function send(Message $message) + { + $options = $this->options; + $filename = call_user_func($options->getCallback(), $this); + $file = $options->getPath() . DIRECTORY_SEPARATOR . $filename; + $email = $message->toString(); + + if (false === file_put_contents($file, $email)) { + throw new Exception\RuntimeException(sprintf( + 'Unable to write mail to file (directory "%s")', + $options->getPath() + )); + } + + $this->lastFile = $file; + } + + /** + * Get the name of the last file written to + * + * @return string + */ + public function getLastFile() + { + return $this->lastFile; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Transport/FileOptions.php b/vendor/zendframework/zend-mail/Zend/Mail/Transport/FileOptions.php new file mode 100644 index 0000000000..1ad0e75c4f --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Transport/FileOptions.php @@ -0,0 +1,96 @@ +path = $path; + return $this; + } + + /** + * Get path + * + * If none is set, uses value from sys_get_temp_dir() + * + * @return string + */ + public function getPath() + { + if (null === $this->path) { + $this->setPath(sys_get_temp_dir()); + } + return $this->path; + } + + /** + * Set callback used to generate a file name + * + * @param callable $callback + * @throws \Zend\Mail\Exception\InvalidArgumentException + * @return FileOptions + */ + public function setCallback($callback) + { + if (!is_callable($callback)) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects a valid callback; received "%s"', + __METHOD__, + (is_object($callback) ? get_class($callback) : gettype($callback)) + )); + } + $this->callback = $callback; + return $this; + } + + /** + * Get callback used to generate a file name + * + * @return callable + */ + public function getCallback() + { + if (null === $this->callback) { + $this->setCallback(function ($transport) { + return 'ZendMail_' . time() . '_' . mt_rand() . '.tmp'; + }); + } + return $this->callback; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Transport/Sendmail.php b/vendor/zendframework/zend-mail/Zend/Mail/Transport/Sendmail.php new file mode 100644 index 0000000000..fbe8583fd0 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Transport/Sendmail.php @@ -0,0 +1,323 @@ +setParameters($parameters); + } + $this->callable = array($this, 'mailHandler'); + } + + /** + * Set sendmail parameters + * + * Used to populate the additional_parameters argument to mail() + * + * @param null|string|array|Traversable $parameters + * @throws \Zend\Mail\Exception\InvalidArgumentException + * @return Sendmail + */ + public function setParameters($parameters) + { + if ($parameters === null || is_string($parameters)) { + $this->parameters = $parameters; + return $this; + } + + if (!is_array($parameters) && !$parameters instanceof Traversable) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects a string, array, or Traversable object of parameters; received "%s"', + __METHOD__, + (is_object($parameters) ? get_class($parameters) : gettype($parameters)) + )); + } + + $string = ''; + foreach ($parameters as $param) { + $string .= ' ' . $param; + } + trim($string); + + $this->parameters = $string; + return $this; + } + + /** + * Set callback to use for mail + * + * Primarily for testing purposes, but could be used to curry arguments. + * + * @param callable $callable + * @throws \Zend\Mail\Exception\InvalidArgumentException + * @return Sendmail + */ + public function setCallable($callable) + { + if (!is_callable($callable)) { + throw new Exception\InvalidArgumentException(sprintf( + '%s expects a callable argument; received "%s"', + __METHOD__, + (is_object($callable) ? get_class($callable) : gettype($callable)) + )); + } + $this->callable = $callable; + return $this; + } + + /** + * Send a message + * + * @param \Zend\Mail\Message $message + */ + public function send(Mail\Message $message) + { + $to = $this->prepareRecipients($message); + $subject = $this->prepareSubject($message); + $body = $this->prepareBody($message); + $headers = $this->prepareHeaders($message); + $params = $this->prepareParameters($message); + + // On *nix platforms, we need to replace \r\n with \n + // sendmail is not an SMTP server, it is a unix command - it expects LF + if (!$this->isWindowsOs()) { + $to = str_replace("\r\n", "\n", $to); + $subject = str_replace("\r\n", "\n", $subject); + $body = str_replace("\r\n", "\n", $body); + $headers = str_replace("\r\n", "\n", $headers); + } + + call_user_func($this->callable, $to, $subject, $body, $headers, $params); + } + + /** + * Prepare recipients list + * + * @param \Zend\Mail\Message $message + * @throws \Zend\Mail\Exception\RuntimeException + * @return string + */ + protected function prepareRecipients(Mail\Message $message) + { + $headers = $message->getHeaders(); + + if (!$headers->has('to')) { + throw new Exception\RuntimeException('Invalid email; contains no "To" header'); + } + + $to = $headers->get('to'); + $list = $to->getAddressList(); + if (0 == count($list)) { + throw new Exception\RuntimeException('Invalid "To" header; contains no addresses'); + } + + // If not on Windows, return normal string + if (!$this->isWindowsOs()) { + return $to->getFieldValue(HeaderInterface::FORMAT_ENCODED); + } + + // Otherwise, return list of emails + $addresses = array(); + foreach ($list as $address) { + $addresses[] = $address->getEmail(); + } + $addresses = implode(', ', $addresses); + return $addresses; + } + + /** + * Prepare the subject line string + * + * @param \Zend\Mail\Message $message + * @return string + */ + protected function prepareSubject(Mail\Message $message) + { + $headers = $message->getHeaders(); + if (!$headers->has('subject')) { + return null; + } + $header = $headers->get('subject'); + return $header->getFieldValue(HeaderInterface::FORMAT_ENCODED); + } + + /** + * Prepare the body string + * + * @param \Zend\Mail\Message $message + * @return string + */ + protected function prepareBody(Mail\Message $message) + { + if (!$this->isWindowsOs()) { + // *nix platforms can simply return the body text + return $message->getBodyText(); + } + + // On windows, lines beginning with a full stop need to be fixed + $text = $message->getBodyText(); + $text = str_replace("\n.", "\n..", $text); + return $text; + } + + /** + * Prepare the textual representation of headers + * + * @param \Zend\Mail\Message $message + * @return string + */ + protected function prepareHeaders(Mail\Message $message) + { + // On Windows, simply return verbatim + if ($this->isWindowsOs()) { + return $message->getHeaders()->toString(); + } + + // On *nix platforms, strip the "to" header + $headers = clone $message->getHeaders(); + $headers->removeHeader('To'); + $headers->removeHeader('Subject'); + return $headers->toString(); + } + + /** + * Prepare additional_parameters argument + * + * Basically, overrides the MAIL FROM envelope with either the Sender or + * From address. + * + * @param \Zend\Mail\Message $message + * @return string + */ + protected function prepareParameters(Mail\Message $message) + { + if ($this->isWindowsOs()) { + return null; + } + + $parameters = (string) $this->parameters; + + $sender = $message->getSender(); + if ($sender instanceof AddressInterface) { + $parameters .= ' -f ' . $sender->getEmail(); + return $parameters; + } + + $from = $message->getFrom(); + if (count($from)) { + $from->rewind(); + $sender = $from->current(); + $parameters .= ' -f ' . $sender->getEmail(); + return $parameters; + } + + return $parameters; + } + + /** + * Send mail using PHP native mail() + * + * @param string $to + * @param string $subject + * @param string $message + * @param string $headers + * @param $parameters + * @throws \Zend\Mail\Exception\RuntimeException + */ + public function mailHandler($to, $subject, $message, $headers, $parameters) + { + set_error_handler(array($this, 'handleMailErrors')); + if ($parameters === null) { + $result = mail($to, $subject, $message, $headers); + } else { + $result = mail($to, $subject, $message, $headers, $parameters); + } + restore_error_handler(); + + if ($this->errstr !== null || !$result) { + $errstr = $this->errstr; + if (empty($errstr)) { + $errstr = 'Unknown error'; + } + throw new Exception\RuntimeException('Unable to send mail: ' . $errstr); + } + } + + /** + * Temporary error handler for PHP native mail(). + * + * @param int $errno + * @param string $errstr + * @param string $errfile + * @param string $errline + * @param array $errcontext + * @return bool always true + */ + public function handleMailErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null) + { + $this->errstr = $errstr; + return true; + } + + /** + * Is this a windows OS? + * + * @return bool + */ + protected function isWindowsOs() + { + if (!$this->operatingSystem) { + $this->operatingSystem = strtoupper(substr(PHP_OS, 0, 3)); + } + return ($this->operatingSystem == 'WIN'); + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Transport/Smtp.php b/vendor/zendframework/zend-mail/Zend/Mail/Transport/Smtp.php new file mode 100644 index 0000000000..ddfaecfa02 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Transport/Smtp.php @@ -0,0 +1,344 @@ +setOptions($options); + } + + /** + * Set options + * + * @param SmtpOptions $options + * @return Smtp + */ + public function setOptions(SmtpOptions $options) + { + $this->options = $options; + return $this; + } + + /** + * Get options + * + * @return SmtpOptions + */ + public function getOptions() + { + return $this->options; + } + + /** + * Set plugin manager for obtaining SMTP protocol connection + * + * @param Protocol\SmtpPluginManager $plugins + * @throws Exception\InvalidArgumentException + * @return Smtp + */ + public function setPluginManager(Protocol\SmtpPluginManager $plugins) + { + $this->plugins = $plugins; + return $this; + } + + /** + * Get plugin manager for loading SMTP protocol connection + * + * @return Protocol\SmtpPluginManager + */ + public function getPluginManager() + { + if (null === $this->plugins) { + $this->setPluginManager(new Protocol\SmtpPluginManager()); + } + return $this->plugins; + } + + /** + * Set the automatic disconnection when destruct + * + * @param bool $flag + * @return Smtp + */ + public function setAutoDisconnect($flag) + { + $this->autoDisconnect = (bool) $flag; + return $this; + } + + /** + * Get the automatic disconnection value + * + * @return bool + */ + public function getAutoDisconnect() + { + return $this->autoDisconnect; + } + + /** + * Return an SMTP connection + * + * @param string $name + * @param array|null $options + * @return Protocol\Smtp + */ + public function plugin($name, array $options = null) + { + return $this->getPluginManager()->get($name, $options); + } + + /** + * Class destructor to ensure all open connections are closed + */ + public function __destruct() + { + if ($this->connection instanceof Protocol\Smtp) { + try { + $this->connection->quit(); + } catch (ProtocolException\ExceptionInterface $e) { + // ignore + } + if ($this->autoDisconnect) { + $this->connection->disconnect(); + } + } + } + + /** + * Sets the connection protocol instance + * + * @param Protocol\AbstractProtocol $connection + */ + public function setConnection(Protocol\AbstractProtocol $connection) + { + $this->connection = $connection; + } + + + /** + * Gets the connection protocol instance + * + * @return Protocol\Smtp + */ + public function getConnection() + { + return $this->connection; + } + + /** + * Disconnect the connection protocol instance + * + * @return void + */ + public function disconnect() + { + if (!empty($this->connection) && ($this->connection instanceof Protocol\Smtp)) { + $this->connection->disconnect(); + } + } + + /** + * Send an email via the SMTP connection protocol + * + * The connection via the protocol adapter is made just-in-time to allow a + * developer to add a custom adapter if required before mail is sent. + * + * @param Message $message + * @throws Exception\RuntimeException + */ + public function send(Message $message) + { + // If sending multiple messages per session use existing adapter + $connection = $this->getConnection(); + + if (!($connection instanceof Protocol\Smtp) || !$connection->hasSession()) { + $connection = $this->connect(); + } else { + // Reset connection to ensure reliable transaction + $connection->rset(); + } + + // Prepare message + $from = $this->prepareFromAddress($message); + $recipients = $this->prepareRecipients($message); + $headers = $this->prepareHeaders($message); + $body = $this->prepareBody($message); + + if ((count($recipients) == 0) && (!empty($headers) || !empty($body))) { + throw new Exception\RuntimeException( // Per RFC 2821 3.3 (page 18) + sprintf( + '%s transport expects at least one recipient if the message has at least one header or body', + __CLASS__ + )); + } + + // Set sender email address + $connection->mail($from); + + // Set recipient forward paths + foreach ($recipients as $recipient) { + $connection->rcpt($recipient); + } + + // Issue DATA command to client + $connection->data($headers . Headers::EOL . $body); + } + + /** + * Retrieve email address for envelope FROM + * + * @param Message $message + * @throws Exception\RuntimeException + * @return string + */ + protected function prepareFromAddress(Message $message) + { + $sender = $message->getSender(); + if ($sender instanceof Address\AddressInterface) { + return $sender->getEmail(); + } + + $from = $message->getFrom(); + if (!count($from)) { // Per RFC 2822 3.6 + throw new Exception\RuntimeException(sprintf( + '%s transport expects either a Sender or at least one From address in the Message; none provided', + __CLASS__ + )); + } + + $from->rewind(); + $sender = $from->current(); + return $sender->getEmail(); + } + + /** + * Prepare array of email address recipients + * + * @param Message $message + * @return array + */ + protected function prepareRecipients(Message $message) + { + $recipients = array(); + foreach ($message->getTo() as $address) { + $recipients[] = $address->getEmail(); + } + foreach ($message->getCc() as $address) { + $recipients[] = $address->getEmail(); + } + foreach ($message->getBcc() as $address) { + $recipients[] = $address->getEmail(); + } + $recipients = array_unique($recipients); + return $recipients; + } + + /** + * Prepare header string from message + * + * @param Message $message + * @return string + */ + protected function prepareHeaders(Message $message) + { + $headers = clone $message->getHeaders(); + $headers->removeHeader('Bcc'); + return $headers->toString(); + } + + /** + * Prepare body string from message + * + * @param Message $message + * @return string + */ + protected function prepareBody(Message $message) + { + return $message->getBodyText(); + } + + /** + * Lazy load the connection + * + * @return Protocol\Smtp + */ + protected function lazyLoadConnection() + { + // Check if authentication is required and determine required class + $options = $this->getOptions(); + $config = $options->getConnectionConfig(); + $config['host'] = $options->getHost(); + $config['port'] = $options->getPort(); + $connection = $this->plugin($options->getConnectionClass(), $config); + $this->connection = $connection; + + return $this->connect(); + } + + /** + * Connect the connection, and pass it helo + * + * @return Protocol\Smtp + */ + protected function connect() + { + if (!$this->connection instanceof Protocol\Smtp) { + return $this->lazyLoadConnection(); + } + + $this->connection->connect(); + $this->connection->helo($this->getOptions()->getName()); + + return $this->connection; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Transport/SmtpOptions.php b/vendor/zendframework/zend-mail/Zend/Mail/Transport/SmtpOptions.php new file mode 100644 index 0000000000..795c3fb947 --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Transport/SmtpOptions.php @@ -0,0 +1,181 @@ +name; + } + + /** + * Set the local client hostname or IP + * + * @todo hostname/IP validation + * @param string $name + * @throws \Zend\Mail\Exception\InvalidArgumentException + * @return SmtpOptions + */ + public function setName($name) + { + if (!is_string($name) && $name !== null) { + throw new Exception\InvalidArgumentException(sprintf( + 'Name must be a string or null; argument of type "%s" provided', + (is_object($name) ? get_class($name) : gettype($name)) + )); + } + $this->name = $name; + return $this; + } + + /** + * Get connection class + * + * This should be either the class Zend\Mail\Protocol\Smtp or a class + * extending it -- typically a class in the Zend\Mail\Protocol\Smtp\Auth + * namespace. + * + * @return string + */ + public function getConnectionClass() + { + return $this->connectionClass; + } + + /** + * Set connection class + * + * @param string $connectionClass the value to be set + * @throws \Zend\Mail\Exception\InvalidArgumentException + * @return SmtpOptions + */ + public function setConnectionClass($connectionClass) + { + if (!is_string($connectionClass) && $connectionClass !== null) { + throw new Exception\InvalidArgumentException(sprintf( + 'Connection class must be a string or null; argument of type "%s" provided', + (is_object($connectionClass) ? get_class($connectionClass) : gettype($connectionClass)) + )); + } + $this->connectionClass = $connectionClass; + return $this; + } + + /** + * Get connection configuration array + * + * @return array + */ + public function getConnectionConfig() + { + return $this->connectionConfig; + } + + /** + * Set connection configuration array + * + * @param array $connectionConfig + * @return SmtpOptions + */ + public function setConnectionConfig(array $connectionConfig) + { + $this->connectionConfig = $connectionConfig; + return $this; + } + + /** + * Get the host name + * + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Set the SMTP host + * + * @todo hostname/IP validation + * @param string $host + * @return SmtpOptions + */ + public function setHost($host) + { + $this->host = (string) $host; + return $this; + } + + /** + * Get the port the SMTP server runs on + * + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Set the port the SMTP server runs on + * + * @param int $port + * @throws \Zend\Mail\Exception\InvalidArgumentException + * @return SmtpOptions + */ + public function setPort($port) + { + $port = (int) $port; + if ($port < 1) { + throw new Exception\InvalidArgumentException(sprintf( + 'Port must be greater than 1; received "%d"', + $port + )); + } + $this->port = $port; + return $this; + } +} diff --git a/vendor/zendframework/zend-mail/Zend/Mail/Transport/TransportInterface.php b/vendor/zendframework/zend-mail/Zend/Mail/Transport/TransportInterface.php new file mode 100644 index 0000000000..e087ec6daa --- /dev/null +++ b/vendor/zendframework/zend-mail/Zend/Mail/Transport/TransportInterface.php @@ -0,0 +1,26 @@ +=5.3.3", + "zendframework/zend-crypt": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-mime": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "suggest": { + "zendframework/zend-validator": "Zend\\Validator component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component" + }, + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + } +} diff --git a/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/AdapterInterface.php b/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/AdapterInterface.php new file mode 100644 index 0000000000..1906263ed2 --- /dev/null +++ b/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/AdapterInterface.php @@ -0,0 +1,147 @@ + 0 if leftOperand is greater than rightOperand, and 0 if they are equal. + * + * @param string $leftOperand + * @param string $rightOperand + * @return int + */ + public function comp($leftOperand, $rightOperand); + + /** + * Convert big integer into it's binary number representation + * + * @param string $int + * @param bool $twoc + * @return string + */ + public function intToBin($int, $twoc = false); + + /** + * Convert binary number into big integer + * + * @param string $bytes + * @param bool $twoc + * @return string + */ + public function binToInt($bytes, $twoc = false); + + /** + * Convert a number between arbitrary bases + * + * @param string $operand + * @param int $fromBase + * @param int $toBase + * @return string + */ + public function baseConvert($operand, $fromBase, $toBase = 10); +} diff --git a/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/Bcmath.php b/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/Bcmath.php new file mode 100644 index 0000000000..e18a535691 --- /dev/null +++ b/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/Bcmath.php @@ -0,0 +1,334 @@ +baseConvert($operand, $base, 10); + } + + $prod = bcmul($operand, '1'); + if (bccomp($operand, $prod) !== 0) { + return false; + } + + return $sign . $operand; + } + + /** + * Add two big integers + * + * @param string $leftOperand + * @param string $rightOperand + * @return string + */ + public function add($leftOperand, $rightOperand) + { + return bcadd($leftOperand, $rightOperand); + } + + /** + * Subtract two big integers + * + * @param string $leftOperand + * @param string $rightOperand + * @return string + */ + public function sub($leftOperand, $rightOperand) + { + return bcsub($leftOperand, $rightOperand); + } + + /** + * Multiply two big integers + * + * @param string $leftOperand + * @param string $rightOperand + * @return string + */ + public function mul($leftOperand, $rightOperand) + { + return bcmul($leftOperand, $rightOperand); + } + + /** + * Divide two big integers and return integer part result. + * Raises exception if the divisor is zero. + * + * @param string $leftOperand + * @param string $rightOperand + * @return string + * @throws Exception\DivisionByZeroException + */ + public function div($leftOperand, $rightOperand) + { + if ($rightOperand == 0) { + throw new Exception\DivisionByZeroException( + "Division by zero; divisor = {$rightOperand}" + ); + } + + $result = bcdiv($leftOperand, $rightOperand); + + return $result; + } + + /** + * Raise a big integers to another + * + * @param string $operand + * @param string $exp + * @return string + */ + public function pow($operand, $exp) + { + return bcpow($operand, $exp); + } + + /** + * Get the square root of a big integer + * + * @param string $operand + * @return string + */ + public function sqrt($operand) + { + return bcsqrt($operand); + } + + /** + * Get absolute value of a big integer + * + * @param string $operand + * @return string + */ + public function abs($operand) + { + return ltrim($operand, '-'); + } + + /** + * Get modulus of a big integer + * + * @param string $leftOperand + * @param string $rightOperand + * @return string + */ + public function mod($leftOperand, $rightOperand) + { + return bcmod($leftOperand, $rightOperand); + } + + /** + * Raise a big integer to another, reduced by a specified modulus + * + * @param string $leftOperand + * @param string $rightOperand + * @param string $modulus + * @return string + */ + public function powmod($leftOperand, $rightOperand, $modulus) + { + return bcpowmod($leftOperand, $rightOperand, $modulus); + } + + /** + * Compare two big integers and returns result as an integer where + * Returns < 0 if leftOperand is less than rightOperand; + * > 0 if leftOperand is greater than rightOperand, and 0 if they are equal. + * + * @param string $leftOperand + * @param string $rightOperand + * @return int + */ + public function comp($leftOperand, $rightOperand) + { + return bccomp($leftOperand, $rightOperand); + } + + /** + * Convert big integer into it's binary number representation + * + * @param string $operand + * @param bool $twoc return in two's complement form + * @return string + */ + public function intToBin($operand, $twoc = false) + { + $nb = chr(0); + $isNegative = (strpos($operand, '-') === 0) ? true : false; + $operand = ltrim($operand, '+-0'); + + if (empty($operand)) { + return $nb; + } + + if ($isNegative && $twoc) { + $operand = bcsub($operand, '1'); + } + + $bytes = ''; + while (bccomp($operand, '0', 0) > 0) { + $temp = bcmod($operand, '16777216'); + $bytes = chr($temp >> 16) . chr($temp >> 8) . chr($temp) . $bytes; + $operand = bcdiv($operand, '16777216'); + } + $bytes = ltrim($bytes, $nb); + + if ($twoc) { + if (ord($bytes[0]) & 0x80) { + $bytes = $nb . $bytes; + } + return $isNegative ? ~$bytes : $bytes; + } + + return $bytes; + } + + /** + * Convert big integer into it's binary number representation + * + * @param string $bytes + * @param bool $twoc whether binary number is in twos' complement form + * @return string + */ + public function binToInt($bytes, $twoc = false) + { + $isNegative = ((ord($bytes[0]) & 0x80) && $twoc); + + if ($isNegative) { + $bytes = ~$bytes; + } + + $len = (strlen($bytes) + 3) & 0xfffffffc; + $bytes = str_pad($bytes, $len, chr(0), STR_PAD_LEFT); + + $result = '0'; + for ($i = 0; $i < $len; $i += 4) { + $result = bcmul($result, '4294967296'); // 2**32 + $result = bcadd($result, 0x1000000 * ord($bytes[$i]) + + ((ord($bytes[$i + 1]) << 16) | + (ord($bytes[$i + 2]) << 8) | + ord($bytes[$i + 3]))); + } + + if ($isNegative) { + $result = bcsub('-' . $result, '1'); + } + + return $result; + } + + /** + * Base conversion. Bases 2..62 are supported + * + * @param string $operand + * @param int $fromBase + * @param int $toBase + * @return string + * @throws Exception\InvalidArgumentException + */ + public function baseConvert($operand, $fromBase, $toBase = 10) + { + if ($fromBase == $toBase) { + return $operand; + } + + if ($fromBase < 2 || $fromBase > 62) { + throw new Exception\InvalidArgumentException( + "Unsupported base: {$fromBase}, should be 2..62" + ); + } + if ($toBase < 2 || $toBase > 62) { + throw new Exception\InvalidArgumentException( + "Unsupported base: {$toBase}, should be 2..62" + ); + } + + $sign = (strpos($operand, '-') === 0) ? '-' : ''; + $operand = ltrim($operand, '-+'); + + $chars = self::BASE62_ALPHABET; + + // convert to decimal + if ($fromBase == 10) { + $decimal = $operand; + } else { + $decimal = '0'; + for ($i = 0, $len = strlen($operand); $i < $len; $i++) { + $decimal = bcmul($decimal, $fromBase); + $decimal = bcadd($decimal, strpos($chars, $operand[$i])); + } + } + + if ($toBase == 10) { + return $decimal; + } + + // convert decimal to base + $result = ''; + do { + $remainder = bcmod($decimal, $toBase); + $decimal = bcdiv($decimal, $toBase); + $result = $chars[$remainder] . $result; + } while (bccomp($decimal, '0')); + + return $sign . $result; + } +} diff --git a/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/Gmp.php b/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/Gmp.php new file mode 100644 index 0000000000..d866da89fb --- /dev/null +++ b/vendor/zendframework/zend-math/Zend/Math/BigInteger/Adapter/Gmp.php @@ -0,0 +1,319 @@ + 0 if leftOperand is greater than rightOperand, and 0 if they are equal. + * + * @param string $leftOperand + * @param string $rightOperand + * @return int + */ + public function comp($leftOperand, $rightOperand) + { + return gmp_cmp($leftOperand, $rightOperand); + } + + /** + * Convert big integer into it's binary number representation + * + * @param string $int + * @param bool $twoc return in twos' complement form + * @return string + */ + public function intToBin($int, $twoc = false) + { + $nb = chr(0); + $isNegative = (strpos($int, '-') === 0) ? true : false; + $int = ltrim($int, '+-0'); + + if (empty($int)) { + return $nb; + } + + if ($isNegative && $twoc) { + $int = gmp_sub($int, '1'); + } + + $hex = gmp_strval($int, 16); + if (strlen($hex) & 1) { + $hex = '0' . $hex; + } + + $bytes = pack('H*', $hex); + $bytes = ltrim($bytes, $nb); + + if ($twoc) { + if (ord($bytes[0]) & 0x80) { + $bytes = $nb . $bytes; + } + return $isNegative ? ~$bytes : $bytes; + } + + return $bytes; + } + + /** + * Convert binary number into big integer + * + * @param string $bytes + * @param bool $twoc whether binary number is in twos' complement form + * @return string + */ + public function binToInt($bytes, $twoc = false) + { + $isNegative = ((ord($bytes[0]) & 0x80) && $twoc); + + $sign = ''; + if ($isNegative) { + $bytes = ~$bytes; + $sign = '-'; + } + + $result = gmp_init($sign . bin2hex($bytes), 16); + + if ($isNegative) { + $result = gmp_sub($result, '1'); + } + + return gmp_strval($result); + } + + /** + * Base conversion. Bases 2..62 are supported + * + * @param string $operand + * @param int $fromBase + * @param int $toBase + * @return string + * @throws Exception\InvalidArgumentException + */ + public function baseConvert($operand, $fromBase, $toBase = 10) + { + if ($fromBase == $toBase) { + return $operand; + } + + if ($fromBase < 2 || $fromBase > 62) { + throw new Exception\InvalidArgumentException( + "Unsupported base: {$fromBase}, should be 2..62" + ); + } + if ($toBase < 2 || $toBase > 62) { + throw new Exception\InvalidArgumentException( + "Unsupported base: {$toBase}, should be 2..62" + ); + } + + if ($fromBase <= 36 && $toBase <= 36) { + return gmp_strval(gmp_init($operand, $fromBase), $toBase); + } + + $sign = (strpos($operand, '-') === 0) ? '-' : ''; + $operand = ltrim($operand, '-+'); + + $chars = self::BASE62_ALPHABET; + + // convert operand to decimal + if ($fromBase !== 10) { + $decimal = '0'; + for ($i = 0, $len = strlen($operand); $i < $len; $i++) { + $decimal = gmp_mul($decimal, $fromBase); + $decimal = gmp_add($decimal, strpos($chars, $operand[$i])); + } + } else { + $decimal = gmp_init($operand); + } + + if ($toBase == 10) { + return gmp_strval($decimal); + } + + // convert decimal to base + $result = ''; + do { + list($decimal, $remainder) = gmp_div_qr($decimal, $toBase); + $pos = gmp_strval($remainder); + $result = $chars[$pos] . $result; + } while (gmp_cmp($decimal, '0')); + + return $sign . $result; + } +} diff --git a/vendor/zendframework/zend-math/Zend/Math/BigInteger/AdapterPluginManager.php b/vendor/zendframework/zend-math/Zend/Math/BigInteger/AdapterPluginManager.php new file mode 100644 index 0000000000..fae1cb82b0 --- /dev/null +++ b/vendor/zendframework/zend-math/Zend/Math/BigInteger/AdapterPluginManager.php @@ -0,0 +1,55 @@ + 'Zend\Math\BigInteger\Adapter\Bcmath', + 'gmp' => 'Zend\Math\BigInteger\Adapter\Gmp', + ); + + /** + * Validate the plugin + * + * Checks that the adapter loaded is an instance of Adapter\AdapterInterface. + * + * @param mixed $plugin + * @return void + * @throws Exception\RuntimeException if invalid + */ + public function validatePlugin($plugin) + { + if ($plugin instanceof Adapter\AdapterInterface) { + // we're okay + return; + } + + throw new Exception\RuntimeException(sprintf( + 'Plugin of type %s is invalid; must implement %s\Adapter\AdapterInterface', + (is_object($plugin) ? get_class($plugin) : gettype($plugin)), + __NAMESPACE__ + )); + } +} diff --git a/vendor/zendframework/zend-math/Zend/Math/BigInteger/BigInteger.php b/vendor/zendframework/zend-math/Zend/Math/BigInteger/BigInteger.php new file mode 100644 index 0000000000..efaf058e35 --- /dev/null +++ b/vendor/zendframework/zend-math/Zend/Math/BigInteger/BigInteger.php @@ -0,0 +1,121 @@ +get($adapterName); + } + + /** + * Set adapter plugin manager + * + * @param AdapterPluginManager $adapters + */ + public static function setAdapterPluginManager(AdapterPluginManager $adapters) + { + static::$adapters = $adapters; + } + + /** + * Get the adapter plugin manager + * + * @return AdapterPluginManager + */ + public static function getAdapterPluginManager() + { + if (static::$adapters === null) { + static::$adapters = new AdapterPluginManager(); + } + return static::$adapters; + } + + /** + * Set default BigInteger adapter + * + * @param string|Adapter\AdapterInterface $adapter + */ + public static function setDefaultAdapter($adapter) + { + static::$defaultAdapter = static::factory($adapter); + } + + /** + * Get default BigInteger adapter + * + * @return null|Adapter\AdapterInterface + */ + public static function getDefaultAdapter() + { + if (null === static::$defaultAdapter) { + static::$defaultAdapter = static::getAvailableAdapter(); + } + return static::$defaultAdapter; + } + + /** + * Determine and return available adapter + * + * @return Adapter\AdapterInterface + * @throws Exception\RuntimeException + */ + public static function getAvailableAdapter() + { + if (extension_loaded('gmp')) { + $adapterName = 'Gmp'; + } elseif (extension_loaded('bcmath')) { + $adapterName = 'Bcmath'; + } else { + throw new Exception\RuntimeException('Big integer math support is not detected'); + } + return static::factory($adapterName); + } + + /** + * Call adapter methods statically + * + * @param string $method + * @param mixed $args + * @return mixed + */ + public static function __callStatic($method, $args) + { + $adapter = static::getDefaultAdapter(); + return call_user_func_array(array($adapter, $method), $args); + } +} diff --git a/vendor/zendframework/zend-math/Zend/Math/BigInteger/Exception/DivisionByZeroException.php b/vendor/zendframework/zend-math/Zend/Math/BigInteger/Exception/DivisionByZeroException.php new file mode 100644 index 0000000000..e186a34253 --- /dev/null +++ b/vendor/zendframework/zend-math/Zend/Math/BigInteger/Exception/DivisionByZeroException.php @@ -0,0 +1,16 @@ += 0 + || strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') + ) { + $bytes = openssl_random_pseudo_bytes($length, $usable); + if (true === $usable) { + return $bytes; + } + } + if (function_exists('mcrypt_create_iv') + && (version_compare(PHP_VERSION, '5.3.7') >= 0 + || strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') + ) { + $bytes = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); + if ($bytes !== false && strlen($bytes) === $length) { + return $bytes; + } + } + $checkAlternatives = (file_exists('/dev/urandom') && is_readable('/dev/urandom')) + || class_exists('\\COM', false); + if (true === $strong && false === $checkAlternatives) { + throw new Exception\RuntimeException ( + 'This PHP environment doesn\'t support secure random number generation. ' . + 'Please consider installing the OpenSSL and/or Mcrypt extensions' + ); + } + $generator = self::getAlternativeGenerator(); + return $generator->generate($length); + } + + /** + * Retrieve a fallback/alternative RNG generator + * + * @return RandomLib\Generator + */ + public static function getAlternativeGenerator() + { + if (!is_null(static::$generator)) { + return static::$generator; + } + if (!class_exists('RandomLib\\Factory')) { + throw new Exception\RuntimeException( + 'The RandomLib fallback pseudorandom number generator (PRNG) ' + . ' must be installed in the absence of the OpenSSL and ' + . 'Mcrypt extensions' + ); + } + $factory = new RandomLib\Factory; + $factory->registerSource( + 'HashTiming', + 'Zend\Math\Source\HashTiming' + ); + static::$generator = $factory->getMediumStrengthGenerator(); + return static::$generator; + } + + /** + * Generate random boolean + * + * @param bool $strong true if you need a strong random generator (cryptography) + * @return bool + */ + public static function getBoolean($strong = false) + { + $byte = static::getBytes(1, $strong); + return (bool) (ord($byte) % 2); + } + + /** + * Generate a random integer between $min and $max + * + * @param int $min + * @param int $max + * @param bool $strong true if you need a strong random generator (cryptography) + * @return int + * @throws Exception\DomainException + */ + public static function getInteger($min, $max, $strong = false) + { + if ($min > $max) { + throw new Exception\DomainException( + 'The min parameter must be lower than max parameter' + ); + } + $range = $max - $min; + if ($range == 0) { + return $max; + } elseif ($range > PHP_INT_MAX || is_float($range)) { + throw new Exception\DomainException( + 'The supplied range is too great to generate' + ); + } + $log = log($range, 2); + $bytes = (int) ($log / 8) + 1; + $bits = (int) $log + 1; + $filter = (int) (1 << $bits) - 1; + do { + $rnd = hexdec(bin2hex(self::getBytes($bytes, $strong))); + $rnd = $rnd & $filter; + } while ($rnd > $range); + + return ($min + $rnd); + } + + /** + * Generate random float (0..1) + * This function generates floats with platform-dependent precision + * + * PHP uses double precision floating-point format (64-bit) which has + * 52-bits of significand precision. We gather 7 bytes of random data, + * and we fix the exponent to the bias (1023). In this way we generate + * a float of 1.mantissa. + * + * @param bool $strong true if you need a strong random generator (cryptography) + * @return float + */ + public static function getFloat($strong = false) + { + $bytes = static::getBytes(7, $strong); + $bytes[6] = $bytes[6] | chr(0xF0); + $bytes .= chr(63); // exponent bias (1023) + list(, $float) = unpack('d', $bytes); + + return ($float - 1); + } + + /** + * Generate a random string of specified length. + * + * Uses supplied character list for generating the new string. + * If no character list provided - uses Base 64 character set. + * + * @param int $length + * @param string|null $charlist + * @param bool $strong true if you need a strong random generator (cryptography) + * @return string + * @throws Exception\DomainException + */ + public static function getString($length, $charlist = null, $strong = false) + { + if ($length < 1) { + throw new Exception\DomainException('Length should be >= 1'); + } + + // charlist is empty or not provided + if (empty($charlist)) { + $numBytes = ceil($length * 0.75); + $bytes = static::getBytes($numBytes, $strong); + return substr(rtrim(base64_encode($bytes), '='), 0, $length); + } + + $listLen = strlen($charlist); + + if ($listLen == 1) { + return str_repeat($charlist, $length); + } + + $bytes = static::getBytes($length, $strong); + $pos = 0; + $result = ''; + for ($i = 0; $i < $length; $i++) { + $pos = ($pos + ord($bytes[$i])) % $listLen; + $result .= $charlist[$pos]; + } + + return $result; + } +} diff --git a/vendor/zendframework/zend-math/Zend/Math/Source/HashTiming.php b/vendor/zendframework/zend-math/Zend/Math/Source/HashTiming.php new file mode 100644 index 0000000000..2dd0e8250a --- /dev/null +++ b/vendor/zendframework/zend-math/Zend/Math/Source/HashTiming.php @@ -0,0 +1,114 @@ + + * + * Copyright (c) 2012, George Argyros + * 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. + * * Neither the name of the nor the + * names of its contributors may 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 GEORGE ARGYROS 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. + * + * + * + * The function is providing, at least at the systems tested :), + * $len bytes of entropy under any PHP installation or operating system. + * The execution time should be at most 10-20 ms in any system. + * + * Modified by Padraic Brady as part of Zend Framework to use 25% of the + * original version's iterations. + */ +class HashTiming implements RandomLib\Source +{ + + /** + * Return an instance of Strength indicating the strength of the source + * + * @return Strength An instance of one of the strength classes + */ + public static function getStrength() + { + return new Strength(Strength::VERYLOW); + } + + /** + * Generate a random string of the specified size + * + * @param int $size The size of the requested random string + * + * @return string A string of the requested size + */ + public function generate($size) + { + $result = ''; + $entropy = ''; + $msec_per_round = 400; + $bits_per_round = 2; + $total = $size; + $bytes = 0; + $hash_length = 20; + $rounds = 0; + while (strlen($result) < $size) { + $bytes = ($total > $hash_length)? $hash_length : $total; + $total -= $bytes; + for ($i=1; $i < 3; $i++) { + $t1 = microtime(true); + $seed = mt_rand(); + for ($j=1; $j < 50; $j++) { + $seed = sha1($seed); + } + $t2 = microtime(true); + $entropy .= $t1 . $t2; + } + $div = (int) (($t2 - $t1) * 1000000); + if ($div <= 0) { + $div = 400; + } + $rounds = (int) ($msec_per_round * 50 / $div); + $iter = $bytes * (int) (ceil(8 / $bits_per_round)); + for ($i = 0; $i < $iter; $i ++) { + $t1 = microtime(); + $seed = sha1(mt_rand()); + for ($j = 0; $j < $rounds; $j++) { + $seed = sha1($seed); + } + $t2 = microtime(); + $entropy .= $t1 . $t2; + } + $result .= sha1($entropy, true); + } + return substr($result, 0, $size); + } + +} diff --git a/vendor/zendframework/zend-math/Zend/Math/composer.json b/vendor/zendframework/zend-math/Zend/Math/composer.json new file mode 100644 index 0000000000..4af222154d --- /dev/null +++ b/vendor/zendframework/zend-math/Zend/Math/composer.json @@ -0,0 +1,27 @@ +{ + "name": "zendframework/zend-math", + "description": " ", + "license": "BSD-3-Clause", + "keywords": [ + "zf2", + "math" + ], + "autoload": { + "psr-0": { + "Zend\\Math\\": "" + } + }, + "target-dir": "Zend/Math", + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable" + }, + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + } +} diff --git a/vendor/zendframework/zend-mime/Zend/Mime/Decode.php b/vendor/zendframework/zend-mime/Zend/Mime/Decode.php new file mode 100644 index 0000000000..f20d30031f --- /dev/null +++ b/vendor/zendframework/zend-mime/Zend/Mime/Decode.php @@ -0,0 +1,219 @@ + array(name => value), 'body' => content), null if no parts found + * @throws Exception\RuntimeException + */ + public static function splitMessageStruct($message, $boundary, $EOL = Mime::LINEEND) + { + $parts = static::splitMime($message, $boundary); + if (count($parts) <= 0) { + return null; + } + $result = array(); + $headers = null; // "Declare" variable before the first usage "for reading" + $body = null; // "Declare" variable before the first usage "for reading" + foreach ($parts as $part) { + static::splitMessage($part, $headers, $body, $EOL); + $result[] = array('header' => $headers, + 'body' => $body ); + } + return $result; + } + + /** + * split a message in header and body part, if no header or an + * invalid header is found $headers is empty + * + * The charset of the returned headers depend on your iconv settings. + * + * @param string|Headers $message raw message with header and optional content + * @param Headers $headers output param, headers container + * @param string $body output param, content of message + * @param string $EOL EOL string; defaults to {@link Zend\Mime\Mime::LINEEND} + * @param bool $strict enable strict mode for parsing message + * @return null + */ + public static function splitMessage($message, &$headers, &$body, $EOL = Mime::LINEEND, $strict = false) + { + if ($message instanceof Headers) { + $message = $message->toString(); + } + // check for valid header at first line + $firstline = strtok($message, "\n"); + if (!preg_match('%^[^\s]+[^:]*:%', $firstline)) { + $headers = array(); + // TODO: we're ignoring \r for now - is this function fast enough and is it safe to assume noone needs \r? + $body = str_replace(array("\r", "\n"), array('', $EOL), $message); + return; + } + + // see @ZF2-372, pops the first line off a message if it doesn't contain a header + if (!$strict) { + $parts = explode(':', $firstline, 2); + if (count($parts) != 2) { + $message = substr($message, strpos($message, $EOL)+1); + } + } + + // find an empty line between headers and body + // default is set new line + if (strpos($message, $EOL . $EOL)) { + list($headers, $body) = explode($EOL . $EOL, $message, 2); + // next is the standard new line + } elseif ($EOL != "\r\n" && strpos($message, "\r\n\r\n")) { + list($headers, $body) = explode("\r\n\r\n", $message, 2); + // next is the other "standard" new line + } elseif ($EOL != "\n" && strpos($message, "\n\n")) { + list($headers, $body) = explode("\n\n", $message, 2); + // at last resort find anything that looks like a new line + } else { + ErrorHandler::start(E_NOTICE|E_WARNING); + list($headers, $body) = preg_split("%([\r\n]+)\\1%U", $message, 2); + ErrorHandler::stop(); + } + + $headers = Headers::fromString($headers, $EOL); + } + + /** + * split a content type in its different parts + * + * @param string $type content-type + * @param string $wantedPart the wanted part, else an array with all parts is returned + * @return string|array wanted part or all parts as array('type' => content-type, partname => value) + */ + public static function splitContentType($type, $wantedPart = null) + { + return static::splitHeaderField($type, $wantedPart, 'type'); + } + + /** + * split a header field like content type in its different parts + * + * @param string $field header field + * @param string $wantedPart the wanted part, else an array with all parts is returned + * @param string $firstName key name for the first part + * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value) + * @throws Exception\RuntimeException + */ + public static function splitHeaderField($field, $wantedPart = null, $firstName = '0') + { + $wantedPart = strtolower($wantedPart); + $firstName = strtolower($firstName); + + // special case - a bit optimized + if ($firstName === $wantedPart) { + $field = strtok($field, ';'); + return $field[0] == '"' ? substr($field, 1, -1) : $field; + } + + $field = $firstName . '=' . $field; + if (!preg_match_all('%([^=\s]+)\s*=\s*("[^"]+"|[^;]+)(;\s*|$)%', $field, $matches)) { + throw new Exception\RuntimeException('not a valid header field'); + } + + if ($wantedPart) { + foreach ($matches[1] as $key => $name) { + if (strcasecmp($name, $wantedPart)) { + continue; + } + if ($matches[2][$key][0] != '"') { + return $matches[2][$key]; + } + return substr($matches[2][$key], 1, -1); + } + return null; + } + + $split = array(); + foreach ($matches[1] as $key => $name) { + $name = strtolower($name); + if ($matches[2][$key][0] == '"') { + $split[$name] = substr($matches[2][$key], 1, -1); + } else { + $split[$name] = $matches[2][$key]; + } + } + + return $split; + } + + /** + * decode a quoted printable encoded string + * + * The charset of the returned string depends on your iconv settings. + * + * @param string $string encoded string + * @return string decoded string + */ + public static function decodeQuotedPrintable($string) + { + return iconv_mime_decode($string, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8'); + } +} diff --git a/vendor/zendframework/zend-mime/Zend/Mime/Exception/ExceptionInterface.php b/vendor/zendframework/zend-mime/Zend/Mime/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..57e2568711 --- /dev/null +++ b/vendor/zendframework/zend-mime/Zend/Mime/Exception/ExceptionInterface.php @@ -0,0 +1,13 @@ +parts; + } + + /** + * Sets the given array of Zend\Mime\Part as the array for the message + * + * @param array $parts + */ + public function setParts($parts) + { + $this->parts = $parts; + } + + /** + * Append a new Zend\Mime\Part to the current message + * + * @param \Zend\Mime\Part $part + */ + public function addPart(Part $part) + { + /** + * @todo check for duplicate object handle + */ + $this->parts[] = $part; + } + + /** + * Check if message needs to be sent as multipart + * MIME message or if it has only one part. + * + * @return bool + */ + public function isMultiPart() + { + return (count($this->parts) > 1); + } + + /** + * Set Zend\Mime\Mime object for the message + * + * This can be used to set the boundary specifically or to use a subclass of + * Zend\Mime for generating the boundary. + * + * @param \Zend\Mime\Mime $mime + */ + public function setMime(Mime $mime) + { + $this->mime = $mime; + } + + /** + * Returns the Zend\Mime\Mime object in use by the message + * + * If the object was not present, it is created and returned. Can be used to + * determine the boundary used in this message. + * + * @return \Zend\Mime\Mime + */ + public function getMime() + { + if ($this->mime === null) { + $this->mime = new Mime(); + } + + return $this->mime; + } + + /** + * Generate MIME-compliant message from the current configuration + * + * This can be a multipart message if more than one MIME part was added. If + * only one part is present, the content of this part is returned. If no + * part had been added, an empty string is returned. + * + * Parts are separated by the mime boundary as defined in Zend\Mime\Mime. If + * {@link setMime()} has been called before this method, the Zend\Mime\Mime + * object set by this call will be used. Otherwise, a new Zend\Mime\Mime object + * is generated and used. + * + * @param string $EOL EOL string; defaults to {@link Zend\Mime\Mime::LINEEND} + * @return string + */ + public function generateMessage($EOL = Mime::LINEEND) + { + if (!$this->isMultiPart()) { + $part = current($this->parts); + $body = $part->getContent($EOL); + } else { + $mime = $this->getMime(); + + $boundaryLine = $mime->boundaryLine($EOL); + $body = 'This is a message in Mime Format. If you see this, ' + . "your mail reader does not support this format." . $EOL; + + foreach (array_keys($this->parts) as $p) { + $body .= $boundaryLine + . $this->getPartHeaders($p, $EOL) + . $EOL + . $this->getPartContent($p, $EOL); + } + + $body .= $mime->mimeEnd($EOL); + } + + return trim($body); + } + + /** + * Get the headers of a given part as an array + * + * @param int $partnum + * @return array + */ + public function getPartHeadersArray($partnum) + { + return $this->parts[$partnum]->getHeadersArray(); + } + + /** + * Get the headers of a given part as a string + * + * @param int $partnum + * @param string $EOL + * @return string + */ + public function getPartHeaders($partnum, $EOL = Mime::LINEEND) + { + return $this->parts[$partnum]->getHeaders($EOL); + } + + /** + * Get the (encoded) content of a given part as a string + * + * @param int $partnum + * @param string $EOL + * @return string + */ + public function getPartContent($partnum, $EOL = Mime::LINEEND) + { + return $this->parts[$partnum]->getContent($EOL); + } + + /** + * Explode MIME multipart string into separate parts + * + * Parts consist of the header and the body of each MIME part. + * + * @param string $body + * @param string $boundary + * @throws Exception\RuntimeException + * @return array + */ + protected static function _disassembleMime($body, $boundary) + { + $start = 0; + $res = array(); + // find every mime part limiter and cut out the + // string before it. + // the part before the first boundary string is discarded: + $p = strpos($body, '--' . $boundary."\n", $start); + if ($p === false) { + // no parts found! + return array(); + } + + // position after first boundary line + $start = $p + 3 + strlen($boundary); + + while (($p = strpos($body, '--' . $boundary . "\n", $start)) !== false) { + $res[] = substr($body, $start, $p-$start); + $start = $p + 3 + strlen($boundary); + } + + // no more parts, find end boundary + $p = strpos($body, '--' . $boundary . '--', $start); + if ($p===false) { + throw new Exception\RuntimeException('Not a valid Mime Message: End Missing'); + } + + // the remaining part also needs to be parsed: + $res[] = substr($body, $start, $p-$start); + return $res; + } + + /** + * Decodes a MIME encoded string and returns a Zend\Mime\Message object with + * all the MIME parts set according to the given string + * + * @param string $message + * @param string $boundary + * @param string $EOL EOL string; defaults to {@link Zend\Mime\Mime::LINEEND} + * @throws Exception\RuntimeException + * @return \Zend\Mime\Message + */ + public static function createFromMessage($message, $boundary, $EOL = Mime::LINEEND) + { + $parts = Decode::splitMessageStruct($message, $boundary, $EOL); + + $res = new static(); + foreach ($parts as $part) { + // now we build a new MimePart for the current Message Part: + $newPart = new Part($part['body']); + foreach ($part['header'] as $header) { + /** @var \Zend\Mail\Header\HeaderInterface $header */ + /** + * @todo check for characterset and filename + */ + + $fieldName = $header->getFieldName(); + $fieldValue = $header->getFieldValue(); + switch (strtolower($fieldName)) { + case 'content-type': + $newPart->type = $fieldValue; + break; + case 'content-transfer-encoding': + $newPart->encoding = $fieldValue; + break; + case 'content-id': + $newPart->id = trim($fieldValue,'<>'); + break; + case 'content-disposition': + $newPart->disposition = $fieldValue; + break; + case 'content-description': + $newPart->description = $fieldValue; + break; + case 'content-location': + $newPart->location = $fieldValue; + break; + case 'content-language': + $newPart->language = $fieldValue; + break; + default: + throw new Exception\RuntimeException('Unknown header ignored for MimePart:' . $fieldName); + } + } + $res->addPart($newPart); + } + + return $res; + } +} diff --git a/vendor/zendframework/zend-mime/Zend/Mime/Mime.php b/vendor/zendframework/zend-mime/Zend/Mime/Mime.php new file mode 100644 index 0000000000..bf4fe1f3fa --- /dev/null +++ b/vendor/zendframework/zend-mime/Zend/Mime/Mime.php @@ -0,0 +1,349 @@ + $lineLength) { + $ptr = $lineLength; + } + + // Ensure we are not splitting across an encoded character + $pos = strrpos(substr($str, 0, $ptr), '='); + if ($pos !== false && $pos >= $ptr - 2) { + $ptr = $pos; + } + + // Check if there is a space at the end of the line and rewind + if ($ptr > 0 && $str[$ptr - 1] == ' ') { + --$ptr; + } + + // Add string and continue + $out .= substr($str, 0, $ptr) . '=' . $lineEnd; + $str = substr($str, $ptr); + } + + $out = rtrim($out, $lineEnd); + $out = rtrim($out, '='); + return $out; + } + + /** + * Converts a string into quoted printable format. + * + * @param string $str + * @return string + */ + private static function _encodeQuotedPrintable($str) + { + $str = str_replace('=', '=3D', $str); + $str = str_replace(static::$qpKeys, static::$qpReplaceValues, $str); + $str = rtrim($str); + return $str; + } + + /** + * Encode a given string with the QUOTED_PRINTABLE mechanism for Mail Headers. + * + * Mail headers depend on an extended quoted printable algorithm otherwise + * a range of bugs can occur. + * + * @param string $str + * @param string $charset + * @param int $lineLength Defaults to {@link LINELENGTH} + * @param string $lineEnd Defaults to {@link LINEEND} + * @return string + */ + public static function encodeQuotedPrintableHeader($str, $charset, + $lineLength = self::LINELENGTH, + $lineEnd = self::LINEEND) + { + // Reduce line-length by the length of the required delimiter, charsets and encoding + $prefix = sprintf('=?%s?Q?', $charset); + $lineLength = $lineLength-strlen($prefix)-3; + + $str = self::_encodeQuotedPrintable($str); + + // Mail-Header required chars have to be encoded also: + $str = str_replace(array('?', ' ', '_'), array('=3F', '=20', '=5F'), $str); + + // initialize first line, we need it anyways + $lines = array(0 => ""); + + // Split encoded text into separate lines + $tmp = ""; + while (strlen($str) > 0) { + $currentLine = max(count($lines)-1, 0); + $token = static::getNextQuotedPrintableToken($str); + $str = substr($str, strlen($token)); + + $tmp .= $token; + if ($token == '=20') { + // only if we have a single char token or space, we can append the + // tempstring it to the current line or start a new line if necessary. + if (strlen($lines[$currentLine] . $tmp) > $lineLength) { + $lines[$currentLine+1] = $tmp; + } else { + $lines[$currentLine] .= $tmp; + } + $tmp = ""; + } + // don't forget to append the rest to the last line + if (strlen($str) == 0) { + $lines[$currentLine] .= $tmp; + } + } + + // assemble the lines together by pre- and appending delimiters, charset, encoding. + for ($i = 0; $i < count($lines); $i++) { + $lines[$i] = " " . $prefix . $lines[$i] . "?="; + } + $str = trim(implode($lineEnd, $lines)); + return $str; + } + + /** + * Retrieves the first token from a quoted printable string. + * + * @param string $str + * @return string + */ + private static function getNextQuotedPrintableToken($str) + { + if (substr($str, 0, 1) == "=") { + $token = substr($str, 0, 3); + } else { + $token = substr($str, 0, 1); + } + return $token; + } + + /** + * Encode a given string in mail header compatible base64 encoding. + * + * @param string $str + * @param string $charset + * @param int $lineLength Defaults to {@link LINELENGTH} + * @param string $lineEnd Defaults to {@link LINEEND} + * @return string + */ + public static function encodeBase64Header($str, + $charset, + $lineLength = self::LINELENGTH, + $lineEnd = self::LINEEND) + { + $prefix = '=?' . $charset . '?B?'; + $suffix = '?='; + $remainingLength = $lineLength - strlen($prefix) - strlen($suffix); + + $encodedValue = static::encodeBase64($str, $remainingLength, $lineEnd); + $encodedValue = str_replace($lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue); + $encodedValue = $prefix . $encodedValue . $suffix; + return $encodedValue; + } + + /** + * Encode a given string in base64 encoding and break lines + * according to the maximum linelength. + * + * @param string $str + * @param int $lineLength Defaults to {@link LINELENGTH} + * @param string $lineEnd Defaults to {@link LINEEND} + * @return string + */ + public static function encodeBase64($str, + $lineLength = self::LINELENGTH, + $lineEnd = self::LINEEND) + { + return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd)); + } + + /** + * Constructor + * + * @param null|string $boundary + * @access public + */ + public function __construct($boundary = null) + { + // This string needs to be somewhat unique + if ($boundary === null) { + $this->boundary = '=_' . md5(microtime(1) . static::$makeUnique++); + } else { + $this->boundary = $boundary; + } + } + + /** + * Encode the given string with the given encoding. + * + * @param string $str + * @param string $encoding + * @param string $EOL EOL string; defaults to {@link LINEEND} + * @return string + */ + public static function encode($str, $encoding, $EOL = self::LINEEND) + { + switch ($encoding) { + case self::ENCODING_BASE64: + return static::encodeBase64($str, self::LINELENGTH, $EOL); + + case self::ENCODING_QUOTEDPRINTABLE: + return static::encodeQuotedPrintable($str, self::LINELENGTH, $EOL); + + default: + /** + * @todo 7Bit and 8Bit is currently handled the same way. + */ + return $str; + } + } + + /** + * Return a MIME boundary + * + * @access public + * @return string + */ + public function boundary() + { + return $this->boundary; + } + + /** + * Return a MIME boundary line + * + * @param string $EOL Defaults to {@link LINEEND} + * @access public + * @return string + */ + public function boundaryLine($EOL = self::LINEEND) + { + return $EOL . '--' . $this->boundary . $EOL; + } + + /** + * Return MIME ending + * + * @param string $EOL Defaults to {@link LINEEND} + * @access public + * @return string + */ + public function mimeEnd($EOL = self::LINEEND) + { + return $EOL . '--' . $this->boundary . '--' . $EOL; + } +} diff --git a/vendor/zendframework/zend-mime/Zend/Mime/Part.php b/vendor/zendframework/zend-mime/Zend/Mime/Part.php new file mode 100644 index 0000000000..0744534ce3 --- /dev/null +++ b/vendor/zendframework/zend-mime/Zend/Mime/Part.php @@ -0,0 +1,209 @@ +content = $content; + if (is_resource($content)) { + $this->isStream = true; + } + } + + /** + * @todo setters/getters + * @todo error checking for setting $type + * @todo error checking for setting $encoding + */ + + /** + * check if this part can be read as a stream. + * if true, getEncodedStream can be called, otherwise + * only getContent can be used to fetch the encoded + * content of the part + * + * @return bool + */ + public function isStream() + { + return $this->isStream; + } + + /** + * if this was created with a stream, return a filtered stream for + * reading the content. very useful for large file attachments. + * + * @param string $EOL + * @return stream + * @throws Exception\RuntimeException if not a stream or unable to append filter + */ + public function getEncodedStream($EOL = Mime::LINEEND) + { + if (!$this->isStream) { + throw new Exception\RuntimeException('Attempt to get a stream from a string part'); + } + + //stream_filter_remove(); // ??? is that right? + switch ($this->encoding) { + case Mime::ENCODING_QUOTEDPRINTABLE: + $filter = stream_filter_append( + $this->content, + 'convert.quoted-printable-encode', + STREAM_FILTER_READ, + array( + 'line-length' => 76, + 'line-break-chars' => $EOL + ) + ); + if (!is_resource($filter)) { + throw new Exception\RuntimeException('Failed to append quoted-printable filter'); + } + break; + case Mime::ENCODING_BASE64: + $filter = stream_filter_append( + $this->content, + 'convert.base64-encode', + STREAM_FILTER_READ, + array( + 'line-length' => 76, + 'line-break-chars' => $EOL + ) + ); + if (!is_resource($filter)) { + throw new Exception\RuntimeException('Failed to append base64 filter'); + } + break; + default: + } + return $this->content; + } + + /** + * Get the Content of the current Mime Part in the given encoding. + * + * @param string $EOL + * @return string + */ + public function getContent($EOL = Mime::LINEEND) + { + if ($this->isStream) { + return stream_get_contents($this->getEncodedStream($EOL)); + } + return Mime::encode($this->content, $this->encoding, $EOL); + } + + /** + * Get the RAW unencoded content from this part + * @return string + */ + public function getRawContent() + { + if ($this->isStream) { + return stream_get_contents($this->content); + } + return $this->content; + } + + /** + * Create and return the array of headers for this MIME part + * + * @access public + * @param string $EOL + * @return array + */ + public function getHeadersArray($EOL = Mime::LINEEND) + { + $headers = array(); + + $contentType = $this->type; + if ($this->charset) { + $contentType .= '; charset=' . $this->charset; + } + + if ($this->boundary) { + $contentType .= ';' . $EOL + . " boundary=\"" . $this->boundary . '"'; + } + + $headers[] = array('Content-Type', $contentType); + + if ($this->encoding) { + $headers[] = array('Content-Transfer-Encoding', $this->encoding); + } + + if ($this->id) { + $headers[] = array('Content-ID', '<' . $this->id . '>'); + } + + if ($this->disposition) { + $disposition = $this->disposition; + if ($this->filename) { + $disposition .= '; filename="' . $this->filename . '"'; + } + $headers[] = array('Content-Disposition', $disposition); + } + + if ($this->description) { + $headers[] = array('Content-Description', $this->description); + } + + if ($this->location) { + $headers[] = array('Content-Location', $this->location); + } + + if ($this->language) { + $headers[] = array('Content-Language', $this->language); + } + + return $headers; + } + + /** + * Return the headers for this part as a string + * + * @param string $EOL + * @return String + */ + public function getHeaders($EOL = Mime::LINEEND) + { + $res = ''; + foreach ($this->getHeadersArray($EOL) as $header) { + $res .= $header[0] . ': ' . $header[1] . $EOL; + } + + return $res; + } +} diff --git a/vendor/zendframework/zend-mime/Zend/Mime/README.md b/vendor/zendframework/zend-mime/Zend/Mime/README.md new file mode 100644 index 0000000000..9dcacb1662 --- /dev/null +++ b/vendor/zendframework/zend-mime/Zend/Mime/README.md @@ -0,0 +1,15 @@ +MIME Component from ZF2 +======================= + +This is the MIME component for ZF2. + +- File issues at https://github.com/zendframework/zf2/issues +- Create pull requests against https://github.com/zendframework/zf2 +- Documentation is at http://framework.zend.com/docs + +LICENSE +------- + +The files in this archive are released under the [Zend Framework +license](http://framework.zend.com/license), which is a 3-clause BSD license. + diff --git a/vendor/zendframework/zend-mime/Zend/Mime/composer.json b/vendor/zendframework/zend-mime/Zend/Mime/composer.json new file mode 100644 index 0000000000..b7d0c15379 --- /dev/null +++ b/vendor/zendframework/zend-mime/Zend/Mime/composer.json @@ -0,0 +1,25 @@ +{ + "name": "zendframework/zend-mime", + "description": " ", + "license": "BSD-3-Clause", + "keywords": [ + "zf2", + "mime" + ], + "autoload": { + "psr-0": { + "Zend\\Mime\\": "" + } + }, + "target-dir": "Zend/Mime", + "require": { + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" + }, + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/AbstractFactoryInterface.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/AbstractFactoryInterface.php new file mode 100644 index 0000000000..64ab7598e9 --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/AbstractFactoryInterface.php @@ -0,0 +1,33 @@ +addInitializer(function ($instance) use ($self) { + if ($instance instanceof ServiceLocatorAwareInterface) { + $instance->setServiceLocator($self); + } + }); + } + + /** + * Validate the plugin + * + * Checks that the filter loaded is either a valid callback or an instance + * of FilterInterface. + * + * @param mixed $plugin + * @return void + * @throws Exception\RuntimeException if invalid + */ + abstract public function validatePlugin($plugin); + + /** + * Retrieve a service from the manager by name + * + * Allows passing an array of options to use when creating the instance. + * createFromInvokable() will use these and pass them to the instance + * constructor if not null and a non-empty array. + * + * @param string $name + * @param array $options + * @param bool $usePeeringServiceManagers + * @return object + */ + public function get($name, $options = array(), $usePeeringServiceManagers = true) + { + // Allow specifying a class name directly; registers as an invokable class + if (!$this->has($name) && $this->autoAddInvokableClass && class_exists($name)) { + $this->setInvokableClass($name, $name); + } + + $this->creationOptions = $options; + $instance = parent::get($name, $usePeeringServiceManagers); + $this->creationOptions = null; + $this->validatePlugin($instance); + return $instance; + } + + /** + * Register a service with the locator. + * + * Validates that the service object via validatePlugin() prior to + * attempting to register it. + * + * @param string $name + * @param mixed $service + * @param bool $shared + * @return AbstractPluginManager + * @throws Exception\InvalidServiceNameException + */ + public function setService($name, $service, $shared = true) + { + if ($service) { + $this->validatePlugin($service); + } + parent::setService($name, $service, $shared); + return $this; + } + + /** + * Set the main service locator so factories can have access to it to pull deps + * + * @param ServiceLocatorInterface $serviceLocator + * @return AbstractPluginManager + */ + public function setServiceLocator(ServiceLocatorInterface $serviceLocator) + { + $this->serviceLocator = $serviceLocator; + return $this; + } + + /** + * Get the main plugin manager. Useful for fetching dependencies from within factories. + * + * @return mixed + */ + public function getServiceLocator() + { + return $this->serviceLocator; + } + + /** + * Attempt to create an instance via an invokable class + * + * Overrides parent implementation by passing $creationOptions to the + * constructor, if non-null. + * + * @param string $canonicalName + * @param string $requestedName + * @return null|\stdClass + * @throws Exception\ServiceNotCreatedException If resolved class does not exist + */ + protected function createFromInvokable($canonicalName, $requestedName) + { + $invokable = $this->invokableClasses[$canonicalName]; + + if (null === $this->creationOptions + || (is_array($this->creationOptions) && empty($this->creationOptions)) + ) { + $instance = new $invokable(); + } else { + $instance = new $invokable($this->creationOptions); + } + + return $instance; + } + + /** + * Attempt to create an instance via a factory class + * + * Overrides parent implementation by passing $creationOptions to the + * constructor, if non-null. + * + * @param string $canonicalName + * @param string $requestedName + * @return mixed + * @throws Exception\ServiceNotCreatedException If factory is not callable + */ + protected function createFromFactory($canonicalName, $requestedName) + { + $factory = $this->factories[$canonicalName]; + $hasCreationOptions = !(null === $this->creationOptions || (is_array($this->creationOptions) && empty($this->creationOptions))); + + if (is_string($factory) && class_exists($factory, true)) { + if (!$hasCreationOptions) { + $factory = new $factory(); + } else { + $factory = new $factory($this->creationOptions); + } + + $this->factories[$canonicalName] = $factory; + } + + if ($factory instanceof FactoryInterface) { + $instance = $this->createServiceViaCallback(array($factory, 'createService'), $canonicalName, $requestedName); + } elseif (is_callable($factory)) { + $instance = $this->createServiceViaCallback($factory, $canonicalName, $requestedName); + } else { + throw new Exception\ServiceNotCreatedException(sprintf( + 'While attempting to create %s%s an invalid factory was registered for this instance type.', $canonicalName, ($requestedName ? '(alias: ' . $requestedName . ')' : '') + )); + } + + return $instance; + } + + /** + * Create service via callback + * + * @param callable $callable + * @param string $cName + * @param string $rName + * @throws Exception\ServiceNotCreatedException + * @throws Exception\ServiceNotFoundException + * @throws Exception\CircularDependencyFoundException + * @return object + */ + protected function createServiceViaCallback($callable, $cName, $rName) + { + if (is_object($callable)) { + $factory = $callable; + } elseif (is_array($callable)) { + // reset both rewinds and returns the value of the first array element + $factory = reset($callable); + } + + if (isset($factory) + && ($factory instanceof MutableCreationOptionsInterface) + && is_array($this->creationOptions) + && !empty($this->creationOptions) + ) { + $factory->setCreationOptions($this->creationOptions); + } + + return parent::createServiceViaCallback($callable, $cName, $rName); + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Config.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Config.php new file mode 100644 index 0000000000..f0a3e3ee23 --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Config.php @@ -0,0 +1,166 @@ +config = $config; + } + + /** + * Get allow override + * + * @return null|bool + */ + public function getAllowOverride() + { + return (isset($this->config['allow_override'])) ? $this->config['allow_override'] : null; + } + + /** + * Get factories + * + * @return array + */ + public function getFactories() + { + return (isset($this->config['factories'])) ? $this->config['factories'] : array(); + } + + /** + * Get abstract factories + * + * @return array + */ + public function getAbstractFactories() + { + return (isset($this->config['abstract_factories'])) ? $this->config['abstract_factories'] : array(); + } + + /** + * Get invokables + * + * @return array + */ + public function getInvokables() + { + return (isset($this->config['invokables'])) ? $this->config['invokables'] : array(); + } + + /** + * Get services + * + * @return array + */ + public function getServices() + { + return (isset($this->config['services'])) ? $this->config['services'] : array(); + } + + /** + * Get aliases + * + * @return array + */ + public function getAliases() + { + return (isset($this->config['aliases'])) ? $this->config['aliases'] : array(); + } + + /** + * Get initializers + * + * @return array + */ + public function getInitializers() + { + return (isset($this->config['initializers'])) ? $this->config['initializers'] : array(); + } + + /** + * Get shared + * + * @return array + */ + public function getShared() + { + return (isset($this->config['shared'])) ? $this->config['shared'] : array(); + } + + /** + * Get the delegator services map, with keys being the services acting as delegates, + * and values being the delegator factories names + * + * @return array + */ + public function getDelegators() + { + return (isset($this->config['delegators'])) ? $this->config['delegators'] : array(); + } + + /** + * Configure service manager + * + * @param ServiceManager $serviceManager + * @return void + */ + public function configureServiceManager(ServiceManager $serviceManager) + { + if (($allowOverride = $this->getAllowOverride()) !== null) { + $serviceManager->setAllowOverride($allowOverride); + } + + foreach ($this->getFactories() as $name => $factory) { + $serviceManager->setFactory($name, $factory); + } + + foreach ($this->getAbstractFactories() as $factory) { + $serviceManager->addAbstractFactory($factory); + } + + foreach ($this->getInvokables() as $name => $invokable) { + $serviceManager->setInvokableClass($name, $invokable); + } + + foreach ($this->getServices() as $name => $service) { + $serviceManager->setService($name, $service); + } + + foreach ($this->getAliases() as $alias => $nameOrAlias) { + $serviceManager->setAlias($alias, $nameOrAlias); + } + + foreach ($this->getInitializers() as $initializer) { + $serviceManager->addInitializer($initializer); + } + + foreach ($this->getShared() as $name => $isShared) { + $serviceManager->setShared($name, $isShared); + } + + foreach ($this->getDelegators() as $originalServiceName => $delegators) { + foreach ($delegators as $delegator) { + $serviceManager->addDelegator($originalServiceName, $delegator); + } + } + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ConfigInterface.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ConfigInterface.php new file mode 100644 index 0000000000..68e7d2754e --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ConfigInterface.php @@ -0,0 +1,21 @@ +di = $di; + if (in_array($useServiceLocator, array(self::USE_SL_BEFORE_DI, self::USE_SL_AFTER_DI, self::USE_SL_NONE))) { + $this->useServiceLocator = $useServiceLocator; + } + + // since we are using this in a proxy-fashion, localize state + $this->definitions = $this->di->definitions; + $this->instanceManager = $this->di->instanceManager; + } + + /** + * {@inheritDoc} + */ + public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $serviceName, $requestedName) + { + $this->serviceLocator = $serviceLocator; + if ($requestedName) { + return $this->get($requestedName, array()); + } + + return $this->get($serviceName, array()); + } + + /** + * {@inheritDoc} + */ + public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) + { + return $this->instanceManager->hasSharedInstance($requestedName) + || $this->instanceManager->hasAlias($requestedName) + || $this->instanceManager->hasConfig($requestedName) + || $this->instanceManager->hasTypePreferences($requestedName) + || $this->definitions->hasClass($requestedName); + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiInstanceManagerProxy.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiInstanceManagerProxy.php new file mode 100644 index 0000000000..4f1cdb1e3d --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiInstanceManagerProxy.php @@ -0,0 +1,71 @@ +diInstanceManager = $diInstanceManager; + $this->serviceLocator = $serviceLocator; + + // localize state + $this->aliases = &$diInstanceManager->aliases; + $this->sharedInstances = &$diInstanceManager->sharedInstances; + $this->sharedInstancesWithParams = &$diInstanceManager->sharedInstancesWithParams; + $this->configurations = &$diInstanceManager->configurations; + $this->typePreferences = &$diInstanceManager->typePreferences; + } + + /** + * Determine if we have a shared instance by class or alias + * + * @param $classOrAlias + * @return bool + */ + public function hasSharedInstance($classOrAlias) + { + return ($this->serviceLocator->has($classOrAlias) || $this->diInstanceManager->hasSharedInstance($classOrAlias)); + } + + /** + * Get shared instance + * + * @param $classOrAlias + * @return mixed + */ + public function getSharedInstance($classOrAlias) + { + if ($this->serviceLocator->has($classOrAlias)) { + return $this->serviceLocator->get($classOrAlias); + } + + return $this->diInstanceManager->getSharedInstance($classOrAlias); + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiServiceFactory.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiServiceFactory.php new file mode 100644 index 0000000000..0139f1cef8 --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiServiceFactory.php @@ -0,0 +1,122 @@ +di = $di; + $this->name = $name; + $this->parameters = $parameters; + if (in_array($useServiceLocator, array(self::USE_SL_BEFORE_DI, self::USE_SL_AFTER_DI, self::USE_SL_NONE))) { + $this->useServiceLocator = $useServiceLocator; + } + + // since we are using this in a proxy-fashion, localize state + $this->definitions = $this->di->definitions; + $this->instanceManager = $this->di->instanceManager; + } + + /** + * Create service + * + * @param ServiceLocatorInterface $serviceLocator + * @return object + */ + public function createService(ServiceLocatorInterface $serviceLocator) + { + $this->serviceLocator = $serviceLocator; + return $this->get($this->name, $this->parameters); + } + + /** + * Override, as we want it to use the functionality defined in the proxy + * + * @param string $name + * @param array $params + * @return object + * @throws Exception\ServiceNotFoundException + */ + public function get($name, array $params = array()) + { + // allow this di service to get dependencies from the service locator BEFORE trying di + if ($this->useServiceLocator == self::USE_SL_BEFORE_DI && $this->serviceLocator->has($name)) { + return $this->serviceLocator->get($name); + } + + try { + + $service = parent::get($name, $params); + return $service; + + } catch (DiClassNotFoundException $e) { + + // allow this di service to get dependencies from the service locator AFTER trying di + if ($this->useServiceLocator == self::USE_SL_AFTER_DI && $this->serviceLocator->has($name)) { + return $this->serviceLocator->get($name); + } else { + throw new Exception\ServiceNotFoundException( + sprintf('Service %s was not found in this DI instance', $name), + null, + $e + ); + } + } + + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiServiceInitializer.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiServiceInitializer.php new file mode 100644 index 0000000000..f3c0627c36 --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Di/DiServiceInitializer.php @@ -0,0 +1,67 @@ +di = $di; + $this->serviceLocator = $serviceLocator; + $this->diInstanceManagerProxy = ($diImProxy) ?: new DiInstanceManagerProxy($di->instanceManager(), $serviceLocator); + } + + /** + * Initialize + * + * @param $instance + * @param ServiceLocatorInterface $serviceLocator + * @throws \Exception + */ + public function initialize($instance, ServiceLocatorInterface $serviceLocator) + { + $instanceManager = $this->di->instanceManager; + $this->di->instanceManager = $this->diInstanceManagerProxy; + try { + $this->di->injectDependencies($instance); + $this->di->instanceManager = $instanceManager; + } catch (\Exception $e) { + $this->di->instanceManager = $instanceManager; + throw $e; + } + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Exception/CircularDependencyFoundException.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Exception/CircularDependencyFoundException.php new file mode 100644 index 0000000000..fa6d1f10da --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Exception/CircularDependencyFoundException.php @@ -0,0 +1,14 @@ +proxyFactory = $proxyFactory; + $this->servicesMap = $servicesMap; + } + + /** + * {@inheritDoc} + * + * @return object|\ProxyManager\Proxy\LazyLoadingInterface|\ProxyManager\Proxy\ValueHolderInterface + */ + public function createDelegatorWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName, $callback) + { + $initializer = function (& $wrappedInstance, LazyLoadingInterface $proxy) use ($callback) { + $proxy->setProxyInitializer(null); + + $wrappedInstance = call_user_func($callback); + + return true; + }; + + if (isset($this->servicesMap[$requestedName])) { + return $this->proxyFactory->createProxy($this->servicesMap[$requestedName], $initializer); + } elseif (isset($this->servicesMap[$name])) { + return $this->proxyFactory->createProxy($this->servicesMap[$name], $initializer); + } + + throw new Exception\InvalidServiceNameException( + sprintf('The requested service "%s" was not found in the provided services map', $requestedName) + ); + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Proxy/LazyServiceFactoryFactory.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Proxy/LazyServiceFactoryFactory.php new file mode 100644 index 0000000000..6861d6e982 --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Proxy/LazyServiceFactoryFactory.php @@ -0,0 +1,73 @@ +get('Config'); + + if (!isset($config['lazy_services'])) { + throw new Exception\InvalidArgumentException('Missing "lazy_services" config key'); + } + + $lazyServices = $config['lazy_services']; + + if (!isset($lazyServices['class_map'])) { + throw new Exception\InvalidArgumentException('Missing "class_map" config key in "lazy_services"'); + } + + $factoryConfig = new Configuration(); + + if (isset($lazyServices['proxies_target_dir'])) { + $factoryConfig->setProxiesTargetDir($lazyServices['proxies_target_dir']); + } + + if (!isset($lazyServices['write_proxy_files']) || ! $lazyServices['write_proxy_files']) { + $factoryConfig->setGeneratorStrategy(new EvaluatingGeneratorStrategy()); + } + + if (isset($lazyServices['auto_generate_proxies'])) { + $factoryConfig->setAutoGenerateProxies($lazyServices['auto_generate_proxies']); + + // register the proxy autoloader if the proxies already exist + if (!$lazyServices['auto_generate_proxies']) { + spl_autoload_register($factoryConfig->getProxyAutoloader()); + + $factoryConfig->setGeneratorStrategy(new EvaluatingGeneratorStrategy()); + } + } + + //if (!isset($lazyServicesConfig['runtime_evaluate_proxies'])) + + if (isset($lazyServices['proxies_namespace'])) { + $factoryConfig->setProxiesNamespace($lazyServices['proxies_namespace']); + } + + return new LazyServiceFactory(new LazyLoadingValueHolderFactory($factoryConfig), $lazyServices['class_map']); + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/README.md b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/README.md new file mode 100644 index 0000000000..9a4ed65071 --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/README.md @@ -0,0 +1,15 @@ +ServiceManager Component from ZF2 +================================= + +This is the ServiceManager component for ZF2. + +- File issues at https://github.com/zendframework/zf2/issues +- Create pull requests against https://github.com/zendframework/zf2 +- Documentation is at http://framework.zend.com/docs + +LICENSE +------- + +The files in this archive are released under the [Zend Framework +license](http://framework.zend.com/license), which is a 3-clause BSD license. + diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceLocatorAwareInterface.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceLocatorAwareInterface.php new file mode 100644 index 0000000000..cd666803d7 --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceLocatorAwareInterface.php @@ -0,0 +1,27 @@ +serviceLocator = $serviceLocator; + + return $this; + } + + /** + * Get service locator + * + * @return ServiceLocatorInterface + */ + public function getServiceLocator() + { + return $this->serviceLocator; + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceLocatorInterface.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceLocatorInterface.php new file mode 100644 index 0000000000..46064c840f --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceLocatorInterface.php @@ -0,0 +1,33 @@ + '', '_' => '', ' ' => '', '\\' => '', '/' => ''); + + /** + * Constructor + * + * @param ConfigInterface $config + */ + public function __construct(ConfigInterface $config = null) + { + if ($config) { + $config->configureServiceManager($this); + } + } + + /** + * Set allow override + * + * @param $allowOverride + * @return ServiceManager + */ + public function setAllowOverride($allowOverride) + { + $this->allowOverride = (bool) $allowOverride; + return $this; + } + + /** + * Get allow override + * + * @return bool + */ + public function getAllowOverride() + { + return $this->allowOverride; + } + + /** + * Set flag indicating whether services are shared by default + * + * @param bool $shareByDefault + * @return ServiceManager + * @throws Exception\RuntimeException if allowOverride is false + */ + public function setShareByDefault($shareByDefault) + { + if ($this->allowOverride === false) { + throw new Exception\RuntimeException(sprintf( + '%s: cannot alter default shared service setting; container is marked immutable (allow_override is false)', + get_class($this) . '::' . __FUNCTION__ + )); + } + $this->shareByDefault = (bool) $shareByDefault; + return $this; + } + + /** + * Are services shared by default? + * + * @return bool + */ + public function shareByDefault() + { + return $this->shareByDefault; + } + + /** + * Set throw exceptions in create + * + * @param bool $throwExceptionInCreate + * @return ServiceManager + */ + public function setThrowExceptionInCreate($throwExceptionInCreate) + { + $this->throwExceptionInCreate = $throwExceptionInCreate; + return $this; + } + + /** + * Get throw exceptions in create + * + * @return bool + */ + public function getThrowExceptionInCreate() + { + return $this->throwExceptionInCreate; + } + + /** + * Set flag indicating whether to pull from peering manager before attempting creation + * + * @param bool $retrieveFromPeeringManagerFirst + * @return ServiceManager + */ + public function setRetrieveFromPeeringManagerFirst($retrieveFromPeeringManagerFirst = true) + { + $this->retrieveFromPeeringManagerFirst = (bool) $retrieveFromPeeringManagerFirst; + return $this; + } + + /** + * Should we retrieve from the peering manager prior to attempting to create a service? + * + * @return bool + */ + public function retrieveFromPeeringManagerFirst() + { + return $this->retrieveFromPeeringManagerFirst; + } + + /** + * Set invokable class + * + * @param string $name + * @param string $invokableClass + * @param bool $shared + * @return ServiceManager + * @throws Exception\InvalidServiceNameException + */ + public function setInvokableClass($name, $invokableClass, $shared = null) + { + $cName = $this->canonicalizeName($name); + + if ($this->has(array($cName, $name), false)) { + if ($this->allowOverride === false) { + throw new Exception\InvalidServiceNameException(sprintf( + 'A service by the name or alias "%s" already exists and cannot be overridden; please use an alternate name', + $name + )); + } + $this->unregisterService($cName); + } + + if ($shared === null) { + $shared = $this->shareByDefault; + } + + $this->invokableClasses[$cName] = $invokableClass; + $this->shared[$cName] = (bool) $shared; + + return $this; + } + + /** + * Set factory + * + * @param string $name + * @param string|FactoryInterface|callable $factory + * @param bool $shared + * @return ServiceManager + * @throws Exception\InvalidArgumentException + * @throws Exception\InvalidServiceNameException + */ + public function setFactory($name, $factory, $shared = null) + { + $cName = $this->canonicalizeName($name); + + if (!($factory instanceof FactoryInterface || is_string($factory) || is_callable($factory))) { + throw new Exception\InvalidArgumentException( + 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' + ); + } + + if ($this->has(array($cName, $name), false)) { + if ($this->allowOverride === false) { + throw new Exception\InvalidServiceNameException(sprintf( + 'A service by the name or alias "%s" already exists and cannot be overridden, please use an alternate name', + $name + )); + } + $this->unregisterService($cName); + } + + if ($shared === null) { + $shared = $this->shareByDefault; + } + + $this->factories[$cName] = $factory; + $this->shared[$cName] = (bool) $shared; + + return $this; + } + + /** + * Add abstract factory + * + * @param AbstractFactoryInterface|string $factory + * @param bool $topOfStack + * @return ServiceManager + * @throws Exception\InvalidArgumentException if the abstract factory is invalid + */ + public function addAbstractFactory($factory, $topOfStack = true) + { + if (!$factory instanceof AbstractFactoryInterface && is_string($factory)) { + $factory = new $factory(); + } + + if (!$factory instanceof AbstractFactoryInterface) { + throw new Exception\InvalidArgumentException( + 'Provided abstract factory must be the class name of an abstract' + . ' factory or an instance of an AbstractFactoryInterface.' + ); + } + + if ($topOfStack) { + array_unshift($this->abstractFactories, $factory); + } else { + array_push($this->abstractFactories, $factory); + } + return $this; + } + + /** + * Sets the given service name as to be handled by a delegator factory + * + * @param string $serviceName name of the service being the delegate + * @param string $delegatorFactoryName name of the service being the delegator factory + * + * @return ServiceManager + */ + public function addDelegator($serviceName, $delegatorFactoryName) + { + $cName = $this->canonicalizeName($serviceName); + + if (!isset($this->delegators[$cName])) { + $this->delegators[$cName] = array(); + } + + $this->delegators[$cName][] = $delegatorFactoryName; + + return $this; + } + + /** + * Add initializer + * + * @param callable|InitializerInterface $initializer + * @param bool $topOfStack + * @return ServiceManager + * @throws Exception\InvalidArgumentException + */ + public function addInitializer($initializer, $topOfStack = true) + { + if (!($initializer instanceof InitializerInterface || is_callable($initializer))) { + if (is_string($initializer)) { + $initializer = new $initializer; + } + + if (!($initializer instanceof InitializerInterface || is_callable($initializer))) { + throw new Exception\InvalidArgumentException('$initializer should be callable.'); + } + } + + if ($topOfStack) { + array_unshift($this->initializers, $initializer); + } else { + array_push($this->initializers, $initializer); + } + return $this; + } + + /** + * Register a service with the locator + * + * @param string $name + * @param mixed $service + * @return ServiceManager + * @throws Exception\InvalidServiceNameException + */ + public function setService($name, $service) + { + $cName = $this->canonicalizeName($name); + + if ($this->has($cName, false)) { + if ($this->allowOverride === false) { + throw new Exception\InvalidServiceNameException(sprintf( + '%s: A service by the name "%s" or alias already exists and cannot be overridden, please use an alternate name.', + get_class($this) . '::' . __FUNCTION__, + $name + )); + } + $this->unregisterService($cName); + } + + $this->instances[$cName] = $service; + + return $this; + } + + /** + * @param string $name + * @param bool $isShared + * @return ServiceManager + * @throws Exception\ServiceNotFoundException + */ + public function setShared($name, $isShared) + { + $cName = $this->canonicalizeName($name); + + if ( + !isset($this->invokableClasses[$cName]) + && !isset($this->factories[$cName]) + && !$this->canCreateFromAbstractFactory($cName, $name) + ) { + throw new Exception\ServiceNotFoundException(sprintf( + '%s: A service by the name "%s" was not found and could not be marked as shared', + get_class($this) . '::' . __FUNCTION__, + $name + )); + } + + $this->shared[$cName] = (bool) $isShared; + return $this; + } + + /** + * Resolve the alias for the given canonical name + * + * @param string $cName The canonical name to resolve + * @return string The resolved canonical name + */ + protected function resolveAlias($cName) + { + $stack = array(); + + while ($this->hasAlias($cName)) { + if (isset($stack[$cName])) { + throw new Exception\CircularReferenceException(sprintf( + 'Circular alias reference: %s -> %s', + implode(' -> ', $stack), + $cName + )); + } + + $stack[$cName] = $cName; + $cName = $this->aliases[$cName]; + } + + return $cName; + } + + /** + * Retrieve a registered instance + * + * @param string $name + * @param bool $usePeeringServiceManagers + * @throws Exception\ServiceNotFoundException + * @return object|array + */ + public function get($name, $usePeeringServiceManagers = true) + { + // inlined code from ServiceManager::canonicalizeName for performance + if (isset($this->canonicalNames[$name])) { + $cName = $this->canonicalNames[$name]; + } else { + $cName = $this->canonicalizeName($name); + } + + $isAlias = false; + + if ($this->hasAlias($cName)) { + $isAlias = true; + $cName = $this->resolveAlias($cName); + } + + $instance = null; + + if ($usePeeringServiceManagers && $this->retrieveFromPeeringManagerFirst) { + $instance = $this->retrieveFromPeeringManager($name); + + if (null !== $instance) { + return $instance; + } + } + + if (isset($this->instances[$cName])) { + return $this->instances[$cName]; + } + + if (!$instance) { + if ( + isset($this->invokableClasses[$cName]) + || isset($this->factories[$cName]) + || isset($this->aliases[$cName]) + || $this->canCreateFromAbstractFactory($cName, $name) + ) { + $instance = $this->create(array($cName, $name)); + } elseif ($usePeeringServiceManagers && !$this->retrieveFromPeeringManagerFirst) { + $instance = $this->retrieveFromPeeringManager($name); + } + } + + // Still no instance? raise an exception + if ($instance === null) { + if ($isAlias) { + throw new Exception\ServiceNotFoundException(sprintf( + 'An alias "%s" was requested but no service could be found.', + $name + )); + } + + throw new Exception\ServiceNotFoundException(sprintf( + '%s was unable to fetch or create an instance for %s', + get_class($this) . '::' . __FUNCTION__, + $name + )); + } + + if ( + ($this->shareByDefault && !isset($this->shared[$cName])) + || (isset($this->shared[$cName]) && $this->shared[$cName] === true) + ) { + $this->instances[$cName] = $instance; + } + + return $instance; + } + + /** + * Create an instance of the requested service + * + * @param string|array $name + * + * @return bool|object + */ + public function create($name) + { + if (is_array($name)) { + list($cName, $rName) = $name; + } else { + $rName = $name; + + // inlined code from ServiceManager::canonicalizeName for performance + if (isset($this->canonicalNames[$rName])) { + $cName = $this->canonicalNames[$name]; + } else { + $cName = $this->canonicalizeName($name); + } + } + + if (isset($this->delegators[$cName])) { + return $this->createDelegatorFromFactory($cName, $rName); + } + + return $this->doCreate($rName, $cName); + } + + /** + * Creates a callback that uses a delegator to create a service + * + * @param DelegatorFactoryInterface|callable $delegatorFactory the delegator factory + * @param string $rName requested service name + * @param string $cName canonical service name + * @param callable $creationCallback callback for instantiating the real service + * + * @return callable + */ + private function createDelegatorCallback($delegatorFactory, $rName, $cName, $creationCallback) + { + $serviceManager = $this; + + return function () use ($serviceManager, $delegatorFactory, $rName, $cName, $creationCallback) { + return $delegatorFactory instanceof DelegatorFactoryInterface + ? $delegatorFactory->createDelegatorWithName($serviceManager, $cName, $rName, $creationCallback) + : $delegatorFactory($serviceManager, $cName, $rName, $creationCallback); + }; + } + + /** + * Actually creates the service + * + * @param string $rName real service name + * @param string $cName canonicalized service name + * + * @return bool|mixed|null|object + * @throws Exception\ServiceNotFoundException + * + * @internal this method is internal because of PHP 5.3 compatibility - do not explicitly use it + */ + public function doCreate($rName, $cName) + { + $instance = null; + + if (isset($this->factories[$cName])) { + $instance = $this->createFromFactory($cName, $rName); + } + + if ($instance === null && isset($this->invokableClasses[$cName])) { + $instance = $this->createFromInvokable($cName, $rName); + } + + if ($instance === null && $this->canCreateFromAbstractFactory($cName, $rName)) { + $instance = $this->createFromAbstractFactory($cName, $rName); + } + + if ($instance === null && $this->throwExceptionInCreate) { + throw new Exception\ServiceNotFoundException(sprintf( + 'No valid instance was found for %s%s', + $cName, + ($rName ? '(alias: ' . $rName . ')' : '') + )); + } + + // Do not call initializers if we do not have an instance + if ($instance === null) { + return $instance; + } + + foreach ($this->initializers as $initializer) { + if ($initializer instanceof InitializerInterface) { + $initializer->initialize($instance, $this); + } else { + call_user_func($initializer, $instance, $this); + } + } + + return $instance; + } + + /** + * Determine if we can create an instance. + * + * @param string|array $name + * @param bool $checkAbstractFactories + * @return bool + * + * @deprecated this method is being deprecated as of zendframework 2.2, and may be removed in future major versions + */ + public function canCreate($name, $checkAbstractFactories = true) + { + if (is_array($name)) { + list($cName, $rName) = $name; + } else { + $rName = $name; + $cName = $this->canonicalizeName($rName); + } + + return ( + isset($this->invokableClasses[$cName]) + || isset($this->factories[$cName]) + || isset($this->aliases[$cName]) + || isset($this->instances[$cName]) + || ($checkAbstractFactories && $this->canCreateFromAbstractFactory($cName, $rName)) + ); + } + + /** + * @param string|array $name + * @param bool $checkAbstractFactories + * @param bool $usePeeringServiceManagers + * @return bool + */ + public function has($name, $checkAbstractFactories = true, $usePeeringServiceManagers = true) + { + if (is_array($name)) { + list($cName, $rName) = $name; + } else { + $rName = $name; + + // inlined code from ServiceManager::canonicalizeName for performance + if (isset($this->canonicalNames[$rName])) { + $cName = $this->canonicalNames[$name]; + } else { + $cName = $this->canonicalizeName($name); + } + } + + if ( + isset($this->invokableClasses[$cName]) + || isset($this->factories[$cName]) + || isset($this->aliases[$cName]) + || isset($this->instances[$cName]) + || ($checkAbstractFactories && $this->canCreateFromAbstractFactory($cName, $name)) + ) { + return true; + } + + if ($usePeeringServiceManagers) { + foreach ($this->peeringServiceManagers as $peeringServiceManager) { + if ($peeringServiceManager->has($rName)) { + return true; + } + } + } + + return false; + } + + /** + * Determine if we can create an instance from an abstract factory. + * + * @param string $cName + * @param string $rName + * @return bool + */ + public function canCreateFromAbstractFactory($cName, $rName) + { + // check abstract factories + foreach ($this->abstractFactories as $abstractFactory) { + $factoryClass = get_class($abstractFactory); + + if ( + isset($this->pendingAbstractFactoryRequests[$factoryClass]) + && $this->pendingAbstractFactoryRequests[$factoryClass] == $rName + ) { + return false; + } + + $objectHash = spl_object_hash($abstractFactory); + + if ($this->lastAbstractFactoryUsed === $objectHash && $this->lastCanonicalNameUsed === $cName) { + $this->lastAbstractFactoryUsed = $this->lastCanonicalNameUsed = null; + return false; + } + + $this->lastAbstractFactoryUsed = $objectHash; + $this->lastCanonicalNameUsed = $cName; + + if ($abstractFactory->canCreateServiceWithName($this, $cName, $rName)) { + $this->lastAbstractFactoryUsed = $this->lastCanonicalNameUsed = null; + return true; + } + } + return false; + } + + /** + * Ensure the alias definition will not result in a circular reference + * + * @param string $alias + * @param string $nameOrAlias + * @throws Exception\CircularReferenceException + * @return self + */ + protected function checkForCircularAliasReference($alias, $nameOrAlias) + { + $aliases = $this->aliases; + $aliases[$alias] = $nameOrAlias; + $stack = array(); + + while (isset($aliases[$alias])) { + if (isset($stack[$alias])) { + throw new Exception\CircularReferenceException(sprintf( + 'The alias definition "%s" : "%s" results in a circular reference: "%s" -> "%s"', + $alias, + $nameOrAlias, + implode('" -> "', $stack), + $alias + )); + } + + $stack[$alias] = $alias; + $alias = $aliases[$alias]; + } + + return $this; + } + + /** + * @param string $alias + * @param string $nameOrAlias + * @return ServiceManager + * @throws Exception\ServiceNotFoundException + * @throws Exception\InvalidServiceNameException + */ + public function setAlias($alias, $nameOrAlias) + { + if (!is_string($alias) || !is_string($nameOrAlias)) { + throw new Exception\InvalidServiceNameException('Service or alias names must be strings.'); + } + + $cAlias = $this->canonicalizeName($alias); + $nameOrAlias = $this->canonicalizeName($nameOrAlias); + + if ($alias == '' || $nameOrAlias == '') { + throw new Exception\InvalidServiceNameException('Invalid service name alias'); + } + + if ($this->allowOverride === false && $this->has(array($cAlias, $alias), false)) { + throw new Exception\InvalidServiceNameException(sprintf( + 'An alias by the name "%s" or "%s" already exists', + $cAlias, + $alias + )); + } + + if ($this->hasAlias($alias)) { + $this->checkForCircularAliasReference($cAlias, $nameOrAlias); + } + + $this->aliases[$cAlias] = $nameOrAlias; + return $this; + } + + /** + * Determine if we have an alias + * + * @param string $alias + * @return bool + */ + public function hasAlias($alias) + { + return isset($this->aliases[$this->canonicalizeName($alias)]); + } + + /** + * Create scoped service manager + * + * @param string $peering + * @return ServiceManager + */ + public function createScopedServiceManager($peering = self::SCOPE_PARENT) + { + $scopedServiceManager = new ServiceManager(); + if ($peering == self::SCOPE_PARENT) { + $scopedServiceManager->peeringServiceManagers[] = $this; + } + if ($peering == self::SCOPE_CHILD) { + $this->peeringServiceManagers[] = $scopedServiceManager; + } + return $scopedServiceManager; + } + + /** + * Add a peering relationship + * + * @param ServiceManager $manager + * @param string $peering + * @return ServiceManager + */ + public function addPeeringServiceManager(ServiceManager $manager, $peering = self::SCOPE_PARENT) + { + if ($peering == self::SCOPE_PARENT) { + $this->peeringServiceManagers[] = $manager; + } + if ($peering == self::SCOPE_CHILD) { + $manager->peeringServiceManagers[] = $this; + } + return $this; + } + + /** + * Canonicalize name + * + * @param string $name + * @return string + */ + protected function canonicalizeName($name) + { + if (isset($this->canonicalNames[$name])) { + return $this->canonicalNames[$name]; + } + + // this is just for performance instead of using str_replace + return $this->canonicalNames[$name] = strtolower(strtr($name, $this->canonicalNamesReplacements)); + } + + /** + * Create service via callback + * + * @param callable $callable + * @param string $cName + * @param string $rName + * @throws Exception\ServiceNotCreatedException + * @throws Exception\ServiceNotFoundException + * @throws Exception\CircularDependencyFoundException + * @return object + */ + protected function createServiceViaCallback($callable, $cName, $rName) + { + static $circularDependencyResolver = array(); + $depKey = spl_object_hash($this) . '-' . $cName; + + if (isset($circularDependencyResolver[$depKey])) { + $circularDependencyResolver = array(); + throw new Exception\CircularDependencyFoundException('Circular dependency for LazyServiceLoader was found for instance ' . $rName); + } + + try { + $circularDependencyResolver[$depKey] = true; + $instance = call_user_func($callable, $this, $cName, $rName); + unset($circularDependencyResolver[$depKey]); + } catch (Exception\ServiceNotFoundException $e) { + unset($circularDependencyResolver[$depKey]); + throw $e; + } catch (\Exception $e) { + unset($circularDependencyResolver[$depKey]); + throw new Exception\ServiceNotCreatedException( + sprintf('An exception was raised while creating "%s"; no instance returned', $rName), + $e->getCode(), + $e + ); + } + if ($instance === null) { + throw new Exception\ServiceNotCreatedException('The factory was called but did not return an instance.'); + } + + return $instance; + } + + /** + * Retrieve a keyed list of all registered services. Handy for debugging! + * + * @return array + */ + public function getRegisteredServices() + { + return array( + 'invokableClasses' => array_keys($this->invokableClasses), + 'factories' => array_keys($this->factories), + 'aliases' => array_keys($this->aliases), + 'instances' => array_keys($this->instances), + ); + } + + /** + * Retrieve a keyed list of all canonical names. Handy for debugging! + * + * @return array + */ + public function getCanonicalNames() + { + return $this->canonicalNames; + } + + /** + * Allows to override the canonical names lookup map with predefined + * values. + * + * @param array $canonicalNames + * @return ServiceManager + */ + public function setCanonicalNames($canonicalNames) + { + $this->canonicalNames = $canonicalNames; + + return $this; + } + + /** + * Attempt to retrieve an instance via a peering manager + * + * @param string $name + * @return mixed + */ + protected function retrieveFromPeeringManager($name) + { + foreach ($this->peeringServiceManagers as $peeringServiceManager) { + if ($peeringServiceManager->has($name)) { + return $peeringServiceManager->get($name); + } + } + + $name = $this->canonicalizeName($name); + + if ($this->hasAlias($name)) { + do { + $name = $this->aliases[$name]; + } while ($this->hasAlias($name)); + } + + foreach ($this->peeringServiceManagers as $peeringServiceManager) { + if ($peeringServiceManager->has($name)) { + return $peeringServiceManager->get($name); + } + } + + return null; + } + + /** + * Attempt to create an instance via an invokable class + * + * @param string $canonicalName + * @param string $requestedName + * @return null|\stdClass + * @throws Exception\ServiceNotFoundException If resolved class does not exist + */ + protected function createFromInvokable($canonicalName, $requestedName) + { + $invokable = $this->invokableClasses[$canonicalName]; + if (!class_exists($invokable)) { + throw new Exception\ServiceNotFoundException(sprintf( + '%s: failed retrieving "%s%s" via invokable class "%s"; class does not exist', + get_class($this) . '::' . __FUNCTION__, + $canonicalName, + ($requestedName ? '(alias: ' . $requestedName . ')' : ''), + $invokable + )); + } + $instance = new $invokable; + return $instance; + } + + /** + * Attempt to create an instance via a factory + * + * @param string $canonicalName + * @param string $requestedName + * @return mixed + * @throws Exception\ServiceNotCreatedException If factory is not callable + */ + protected function createFromFactory($canonicalName, $requestedName) + { + $factory = $this->factories[$canonicalName]; + if (is_string($factory) && class_exists($factory, true)) { + $factory = new $factory; + $this->factories[$canonicalName] = $factory; + } + if ($factory instanceof FactoryInterface) { + $instance = $this->createServiceViaCallback(array($factory, 'createService'), $canonicalName, $requestedName); + } elseif (is_callable($factory)) { + $instance = $this->createServiceViaCallback($factory, $canonicalName, $requestedName); + } else { + throw new Exception\ServiceNotCreatedException(sprintf( + 'While attempting to create %s%s an invalid factory was registered for this instance type.', + $canonicalName, + ($requestedName ? '(alias: ' . $requestedName . ')' : '') + )); + } + return $instance; + } + + /** + * Attempt to create an instance via an abstract factory + * + * @param string $canonicalName + * @param string $requestedName + * @return object|null + * @throws Exception\ServiceNotCreatedException If abstract factory is not callable + */ + protected function createFromAbstractFactory($canonicalName, $requestedName) + { + foreach ($this->abstractFactories as $index => $abstractFactory) { + // support factories as strings + if (is_string($abstractFactory) && class_exists($abstractFactory, true)) { + $this->abstractFactories[$index] = $abstractFactory = new $abstractFactory; + } elseif (!$abstractFactory instanceof AbstractFactoryInterface) { + throw new Exception\ServiceNotCreatedException(sprintf( + 'While attempting to create %s%s an abstract factory could not produce a valid instance.', + $canonicalName, + ($requestedName ? '(alias: ' . $requestedName . ')' : '') + )); + } + try { + if ($abstractFactory->canCreateServiceWithName($this, $canonicalName, $requestedName)) { + $this->pendingAbstractFactoryRequests[get_class($abstractFactory)] = $requestedName; + $instance = $this->createServiceViaCallback( + array($abstractFactory, 'createServiceWithName'), + $canonicalName, + $requestedName + ); + unset($this->pendingAbstractFactoryRequests[get_class($abstractFactory)]); + } else { + $instance = null; + } + } catch (\Exception $e) { + unset($this->pendingAbstractFactoryRequests[get_class($abstractFactory)]); + throw new Exception\ServiceNotCreatedException( + sprintf( + 'An abstract factory could not create an instance of %s%s.', + $canonicalName, + ($requestedName ? '(alias: ' . $requestedName . ')' : '') + ), + $e->getCode(), + $e + ); + } + if ($instance !== null) { + return $instance; + } + } + } + + /** + * @param $canonicalName + * @param $requestedName + * @return mixed + * @throws Exception\ServiceNotCreatedException + */ + protected function createDelegatorFromFactory($canonicalName, $requestedName) + { + $serviceManager = $this; + $delegatorsCount = count($this->delegators[$canonicalName]); + $creationCallback = function () use ($serviceManager, $requestedName, $canonicalName) { + return $serviceManager->doCreate($requestedName, $canonicalName); + }; + + for ($i = 0; $i < $delegatorsCount; $i += 1) { + + $delegatorFactory = $this->delegators[$canonicalName][$i]; + + if (is_string($delegatorFactory)) { + $delegatorFactory = !$this->has($delegatorFactory) && class_exists($delegatorFactory, true) ? + new $delegatorFactory + : $this->get($delegatorFactory); + $this->delegators[$canonicalName][$i] = $delegatorFactory; + } + + if (!$delegatorFactory instanceof DelegatorFactoryInterface && !is_callable($delegatorFactory)) { + throw new Exception\ServiceNotCreatedException(sprintf( + 'While attempting to create %s%s an invalid factory was registered for this instance type.', + $canonicalName, + ($requestedName ? '(alias: ' . $requestedName . ')' : '') + )); + } + + $creationCallback = $this->createDelegatorCallback( + $delegatorFactory, + $requestedName, + $canonicalName, + $creationCallback + ); + } + + return $creationCallback($serviceManager, $canonicalName, $requestedName, $creationCallback); + } + + /** + * Checks if the object has this class as one of its parents + * + * @see https://bugs.php.net/bug.php?id=53727 + * @see https://github.com/zendframework/zf2/pull/1807 + * + * @param string $className + * @param string $type + * @return bool + * + * @deprecated this method is being deprecated as of zendframework 2.2, and may be removed in future major versions + */ + protected static function isSubclassOf($className, $type) + { + if (is_subclass_of($className, $type)) { + return true; + } + if (version_compare(PHP_VERSION, '5.3.7', '>=')) { + return false; + } + if (!interface_exists($type)) { + return false; + } + $r = new ReflectionClass($className); + return $r->implementsInterface($type); + } + + /** + * Unregister a service + * + * Called when $allowOverride is true and we detect that a service being + * added to the instance already exists. This will remove the duplicate + * entry, and also any shared flags previously registered. + * + * @param string $canonical + * @return void + */ + protected function unregisterService($canonical) + { + $types = array('invokableClasses', 'factories', 'aliases'); + foreach ($types as $type) { + if (isset($this->{$type}[$canonical])) { + unset($this->{$type}[$canonical]); + break; + } + } + + if (isset($this->instances[$canonical])) { + unset($this->instances[$canonical]); + } + + if (isset($this->shared[$canonical])) { + unset($this->shared[$canonical]); + } + } +} diff --git a/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManagerAwareInterface.php b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManagerAwareInterface.php new file mode 100644 index 0000000000..4f6a0cc986 --- /dev/null +++ b/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManagerAwareInterface.php @@ -0,0 +1,20 @@ +=5.3.3" + }, + "suggest": { + "zendframework/zend-di": "Zend\\Di component" + }, + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/AbstractOptions.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/AbstractOptions.php new file mode 100644 index 0000000000..0e68c29e11 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/AbstractOptions.php @@ -0,0 +1,161 @@ +setFromArray($options); + } + } + + /** + * Set one or more configuration properties + * + * @param array|Traversable|AbstractOptions $options + * @throws Exception\InvalidArgumentException + * @return AbstractOptions Provides fluent interface + */ + public function setFromArray($options) + { + if ($options instanceof self) { + $options = $options->toArray(); + } + + if (!is_array($options) && !$options instanceof Traversable) { + throw new Exception\InvalidArgumentException(sprintf( + 'Parameter provided to %s must be an %s, %s or %s', + __METHOD__, 'array', 'Traversable', 'Zend\Stdlib\AbstractOptions' + )); + } + + foreach ($options as $key => $value) { + $this->__set($key, $value); + } + + return $this; + } + + /** + * Cast to array + * + * @return array + */ + public function toArray() + { + $array = array(); + $transform = function ($letters) { + $letter = array_shift($letters); + return '_' . strtolower($letter); + }; + foreach ($this as $key => $value) { + if ($key === '__strictMode__') continue; + $normalizedKey = preg_replace_callback('/([A-Z])/', $transform, $key); + $array[$normalizedKey] = $value; + } + return $array; + } + + /** + * Set a configuration property + * + * @see ParameterObject::__set() + * @param string $key + * @param mixed $value + * @throws Exception\BadMethodCallException + * @return void + */ + public function __set($key, $value) + { + $setter = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))); + if ($this->__strictMode__ && !method_exists($this, $setter)) { + throw new Exception\BadMethodCallException( + 'The option "' . $key . '" does not ' + . 'have a matching ' . $setter . ' setter method ' + . 'which must be defined' + ); + } elseif (!$this->__strictMode__ && !method_exists($this, $setter)) { + return; + } + $this->{$setter}($value); + } + + /** + * Get a configuration property + * + * @see ParameterObject::__get() + * @param string $key + * @throws Exception\BadMethodCallException + * @return mixed + */ + public function __get($key) + { + $getter = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))); + if (!method_exists($this, $getter)) { + throw new Exception\BadMethodCallException( + 'The option "' . $key . '" does not ' + . 'have a matching ' . $getter . ' getter method ' + . 'which must be defined' + ); + } + + return $this->{$getter}(); + } + + /** + * Test if a configuration property is null + * @see ParameterObject::__isset() + * @param string $key + * @return bool + */ + public function __isset($key) + { + return null !== $this->__get($key); + } + + /** + * Set a configuration property to NULL + * + * @see ParameterObject::__unset() + * @param string $key + * @throws Exception\InvalidArgumentException + * @return void + */ + public function __unset($key) + { + try { + $this->__set($key, null); + } catch (Exception\BadMethodCallException $e) { + throw new Exception\InvalidArgumentException( + 'The class property $' . $key . ' cannot be unset as' + . ' NULL is an invalid value for it', + 0, + $e + ); + } + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject.php new file mode 100644 index 0000000000..806c128fc7 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject.php @@ -0,0 +1,34 @@ + 5.3.3, we need to provide a stub for 5.3.3. This stub + * simply extends the PHP ArrayObject implementation, and provides default + * behavior in the constructor. + */ +abstract class PhpLegacyCompatibility extends PhpArrayObject +{ + /** + * Constructor + * + * @param array $input + * @param int $flags + * @param string $iteratorClass + */ + public function __construct($input = array(), $flags = self::STD_PROP_LIST, $iteratorClass = 'ArrayIterator') + { + parent::__construct($input, $flags, $iteratorClass); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpReferenceCompatibility.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpReferenceCompatibility.php new file mode 100644 index 0000000000..e25257c761 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpReferenceCompatibility.php @@ -0,0 +1,433 @@ +setFlags($flags); + $this->storage = $input; + $this->setIteratorClass($iteratorClass); + $this->protectedProperties = array_keys(get_object_vars($this)); + } + + /** + * Returns whether the requested key exists + * + * @param mixed $key + * @return bool + */ + public function __isset($key) + { + if ($this->flag == self::ARRAY_AS_PROPS) { + return $this->offsetExists($key); + } + if (in_array($key, $this->protectedProperties)) { + throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); + } + + return isset($this->$key); + } + + /** + * Sets the value at the specified key to value + * + * @param mixed $key + * @param mixed $value + * @return void + */ + public function __set($key, $value) + { + if ($this->flag == self::ARRAY_AS_PROPS) { + return $this->offsetSet($key, $value); + } + if (in_array($key, $this->protectedProperties)) { + throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); + } + $this->$key = $value; + } + + /** + * Unsets the value at the specified key + * + * @param mixed $key + * @return void + */ + public function __unset($key) + { + if ($this->flag == self::ARRAY_AS_PROPS) { + return $this->offsetUnset($key); + } + if (in_array($key, $this->protectedProperties)) { + throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); + } + unset($this->$key); + } + + /** + * Returns the value at the specified key by reference + * + * @param mixed $key + * @return mixed + */ + public function &__get($key) + { + $ret = null; + if ($this->flag == self::ARRAY_AS_PROPS) { + $ret =& $this->offsetGet($key); + + return $ret; + } + if (in_array($key, $this->protectedProperties)) { + throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); + } + + return $this->$key; + } + + /** + * Appends the value + * + * @param mixed $value + * @return void + */ + public function append($value) + { + $this->storage[] = $value; + } + + /** + * Sort the entries by value + * + * @return void + */ + public function asort() + { + asort($this->storage); + } + + /** + * Get the number of public properties in the ArrayObject + * + * @return int + */ + public function count() + { + return count($this->storage); + } + + /** + * Exchange the array for another one. + * + * @param array|ArrayObject $data + * @return array + */ + public function exchangeArray($data) + { + if (!is_array($data) && !is_object($data)) { + throw new Exception\InvalidArgumentException('Passed variable is not an array or object, using empty array instead'); + } + + if (is_object($data) && ($data instanceof self || $data instanceof \ArrayObject)) { + $data = $data->getArrayCopy(); + } + if (!is_array($data)) { + $data = (array) $data; + } + + $storage = $this->storage; + + $this->storage = $data; + + return $storage; + } + + /** + * Creates a copy of the ArrayObject. + * + * @return array + */ + public function getArrayCopy() + { + return $this->storage; + } + + /** + * Gets the behavior flags. + * + * @return int + */ + public function getFlags() + { + return $this->flag; + } + + /** + * Create a new iterator from an ArrayObject instance + * + * @return \Iterator + */ + public function getIterator() + { + $class = $this->iteratorClass; + + return new $class($this->storage); + } + + /** + * Gets the iterator classname for the ArrayObject. + * + * @return string + */ + public function getIteratorClass() + { + return $this->iteratorClass; + } + + /** + * Sort the entries by key + * + * @return void + */ + public function ksort() + { + ksort($this->storage); + } + + /** + * Sort an array using a case insensitive "natural order" algorithm + * + * @return void + */ + public function natcasesort() + { + natcasesort($this->storage); + } + + /** + * Sort entries using a "natural order" algorithm + * + * @return void + */ + public function natsort() + { + natsort($this->storage); + } + + /** + * Returns whether the requested key exists + * + * @param mixed $key + * @return bool + */ + public function offsetExists($key) + { + return isset($this->storage[$key]); + } + + /** + * Returns the value at the specified key + * + * @param mixed $key + * @return mixed + */ + public function &offsetGet($key) + { + $ret = null; + if (!$this->offsetExists($key)) { + return $ret; + } + $ret =& $this->storage[$key]; + + return $ret; + } + + /** + * Sets the value at the specified key to value + * + * @param mixed $key + * @param mixed $value + * @return void + */ + public function offsetSet($key, $value) + { + $this->storage[$key] = $value; + } + + /** + * Unsets the value at the specified key + * + * @param mixed $key + * @return void + */ + public function offsetUnset($key) + { + if ($this->offsetExists($key)) { + unset($this->storage[$key]); + } + } + + /** + * Serialize an ArrayObject + * + * @return string + */ + public function serialize() + { + return serialize(get_object_vars($this)); + } + + /** + * Sets the behavior flags + * + * @param int $flags + * @return void + */ + public function setFlags($flags) + { + $this->flag = $flags; + } + + /** + * Sets the iterator classname for the ArrayObject + * + * @param string $class + * @return void + */ + public function setIteratorClass($class) + { + if (class_exists($class)) { + $this->iteratorClass = $class; + + return ; + } + + if (strpos($class, '\\') === 0) { + $class = '\\' . $class; + if (class_exists($class)) { + $this->iteratorClass = $class; + + return ; + } + } + + throw new Exception\InvalidArgumentException('The iterator class does not exist'); + } + + /** + * Sort the entries with a user-defined comparison function and maintain key association + * + * @param callable $function + * @return void + */ + public function uasort($function) + { + if (is_callable($function)) { + uasort($this->storage, $function); + } + } + + /** + * Sort the entries by keys using a user-defined comparison function + * + * @param callable $function + * @return void + */ + public function uksort($function) + { + if (is_callable($function)) { + uksort($this->storage, $function); + } + } + + /** + * Unserialize an ArrayObject + * + * @param string $data + * @return void + */ + public function unserialize($data) + { + $ar = unserialize($data); + $this->setFlags($ar['flag']); + $this->exchangeArray($ar['storage']); + $this->setIteratorClass($ar['iteratorClass']); + foreach ($ar as $k => $v) { + switch ($k) { + case 'flag': + $this->setFlags($v); + break; + case 'storage': + $this->exchangeArray($v); + break; + case 'iteratorClass': + $this->setIteratorClass($v); + break; + case 'protectedProperties': + continue; + default: + $this->__set($k, $v); + } + } + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArraySerializableInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArraySerializableInterface.php new file mode 100644 index 0000000000..7bd6f6eddb --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArraySerializableInterface.php @@ -0,0 +1,28 @@ +getArrayCopy(); + return new ArrayIterator(array_reverse($array)); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayUtils.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayUtils.php new file mode 100644 index 0000000000..4261d2e65f --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayUtils.php @@ -0,0 +1,275 @@ + 0; + } + + /** + * Test whether an array contains one or more integer keys + * + * @param mixed $value + * @param bool $allowEmpty Should an empty array() return true + * @return bool + */ + public static function hasIntegerKeys($value, $allowEmpty = false) + { + if (!is_array($value)) { + return false; + } + + if (!$value) { + return $allowEmpty; + } + + return count(array_filter(array_keys($value), 'is_int')) > 0; + } + + /** + * Test whether an array contains one or more numeric keys. + * + * A numeric key can be one of the following: + * - an integer 1, + * - a string with a number '20' + * - a string with negative number: '-1000' + * - a float: 2.2120, -78.150999 + * - a string with float: '4000.99999', '-10.10' + * + * @param mixed $value + * @param bool $allowEmpty Should an empty array() return true + * @return bool + */ + public static function hasNumericKeys($value, $allowEmpty = false) + { + if (!is_array($value)) { + return false; + } + + if (!$value) { + return $allowEmpty; + } + + return count(array_filter(array_keys($value), 'is_numeric')) > 0; + } + + /** + * Test whether an array is a list + * + * A list is a collection of values assigned to continuous integer keys + * starting at 0 and ending at count() - 1. + * + * For example: + * + * $list = array('a', 'b', 'c', 'd'); + * $list = array( + * 0 => 'foo', + * 1 => 'bar', + * 2 => array('foo' => 'baz'), + * ); + * + * + * @param mixed $value + * @param bool $allowEmpty Is an empty list a valid list? + * @return bool + */ + public static function isList($value, $allowEmpty = false) + { + if (!is_array($value)) { + return false; + } + + if (!$value) { + return $allowEmpty; + } + + return (array_values($value) === $value); + } + + /** + * Test whether an array is a hash table. + * + * An array is a hash table if: + * + * 1. Contains one or more non-integer keys, or + * 2. Integer keys are non-continuous or misaligned (not starting with 0) + * + * For example: + * + * $hash = array( + * 'foo' => 15, + * 'bar' => false, + * ); + * $hash = array( + * 1995 => 'Birth of PHP', + * 2009 => 'PHP 5.3.0', + * 2012 => 'PHP 5.4.0', + * ); + * $hash = array( + * 'formElement, + * 'options' => array( 'debug' => true ), + * ); + * + * + * @param mixed $value + * @param bool $allowEmpty Is an empty array() a valid hash table? + * @return bool + */ + public static function isHashTable($value, $allowEmpty = false) + { + if (!is_array($value)) { + return false; + } + + if (!$value) { + return $allowEmpty; + } + + return (array_values($value) !== $value); + } + + /** + * Checks if a value exists in an array. + * + * Due to "foo" == 0 === TRUE with in_array when strict = false, an option + * has been added to prevent this. When $strict = 0/false, the most secure + * non-strict check is implemented. if $strict = -1, the default in_array + * non-strict behaviour is used. + * + * @param mixed $needle + * @param array $haystack + * @param int|bool $strict + * @return bool + */ + public static function inArray($needle, array $haystack, $strict = false) + { + if (!$strict) { + if (is_int($needle) || is_float($needle)) { + $needle = (string) $needle; + } + if (is_string($needle)) { + foreach ($haystack as &$h) { + if (is_int($h) || is_float($h)) { + $h = (string) $h; + } + } + } + } + return in_array($needle, $haystack, $strict); + } + + /** + * Convert an iterator to an array. + * + * Converts an iterator to an array. The $recursive flag, on by default, + * hints whether or not you want to do so recursively. + * + * @param array|Traversable $iterator The array or Traversable object to convert + * @param bool $recursive Recursively check all nested structures + * @throws Exception\InvalidArgumentException if $iterator is not an array or a Traversable object + * @return array + */ + public static function iteratorToArray($iterator, $recursive = true) + { + if (!is_array($iterator) && !$iterator instanceof Traversable) { + throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable object'); + } + + if (!$recursive) { + if (is_array($iterator)) { + return $iterator; + } + + return iterator_to_array($iterator); + } + + if (method_exists($iterator, 'toArray')) { + return $iterator->toArray(); + } + + $array = array(); + foreach ($iterator as $key => $value) { + if (is_scalar($value)) { + $array[$key] = $value; + continue; + } + + if ($value instanceof Traversable) { + $array[$key] = static::iteratorToArray($value, $recursive); + continue; + } + + if (is_array($value)) { + $array[$key] = static::iteratorToArray($value, $recursive); + continue; + } + + $array[$key] = $value; + } + + return $array; + } + + /** + * Merge two arrays together. + * + * If an integer key exists in both arrays, the value from the second array + * will be appended the the first array. If both values are arrays, they + * are merged together, else the value of the second array overwrites the + * one of the first array. + * + * @param array $a + * @param array $b + * @return array + */ + public static function merge(array $a, array $b) + { + foreach ($b as $key => $value) { + if (array_key_exists($key, $a)) { + if (is_int($key)) { + $a[] = $value; + } elseif (is_array($value) && is_array($a[$key])) { + $a[$key] = static::merge($a[$key], $value); + } else { + $a[$key] = $value; + } + } else { + $a[$key] = $value; + } + } + + return $a; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/CallbackHandler.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/CallbackHandler.php new file mode 100644 index 0000000000..f1ac4a65b3 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/CallbackHandler.php @@ -0,0 +1,218 @@ +metadata = $metadata; + $this->registerCallback($callback); + } + + /** + * Registers the callback provided in the constructor + * + * @param callable $callback + * @throws Exception\InvalidCallbackException + * @return void + */ + protected function registerCallback($callback) + { + if (!is_callable($callback)) { + throw new Exception\InvalidCallbackException('Invalid callback provided; not callable'); + } + + $this->callback = $callback; + } + + /** + * Retrieve registered callback + * + * @return callable + */ + public function getCallback() + { + return $this->callback; + } + + /** + * Invoke handler + * + * @param array $args Arguments to pass to callback + * @return mixed + */ + public function call(array $args = array()) + { + $callback = $this->getCallback(); + + // Minor performance tweak, if the callback gets called more than once + if (!isset(static::$isPhp54)) { + static::$isPhp54 = version_compare(PHP_VERSION, '5.4.0rc1', '>='); + } + + $argCount = count($args); + + if (static::$isPhp54 && is_string($callback)) { + $result = $this->validateStringCallbackFor54($callback); + + if ($result !== true && $argCount <= 3) { + $callback = $result; + // Minor performance tweak, if the callback gets called more + // than once + $this->callback = $result; + } + } + + // Minor performance tweak; use call_user_func() until > 3 arguments + // reached + switch ($argCount) { + case 0: + if (static::$isPhp54) { + return $callback(); + } + return call_user_func($callback); + case 1: + if (static::$isPhp54) { + return $callback(array_shift($args)); + } + return call_user_func($callback, array_shift($args)); + case 2: + $arg1 = array_shift($args); + $arg2 = array_shift($args); + if (static::$isPhp54) { + return $callback($arg1, $arg2); + } + return call_user_func($callback, $arg1, $arg2); + case 3: + $arg1 = array_shift($args); + $arg2 = array_shift($args); + $arg3 = array_shift($args); + if (static::$isPhp54) { + return $callback($arg1, $arg2, $arg3); + } + return call_user_func($callback, $arg1, $arg2, $arg3); + default: + return call_user_func_array($callback, $args); + } + } + + /** + * Invoke as functor + * + * @return mixed + */ + public function __invoke() + { + return $this->call(func_get_args()); + } + + /** + * Get all callback metadata + * + * @return array + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Retrieve a single metadatum + * + * @param string $name + * @return mixed + */ + public function getMetadatum($name) + { + if (array_key_exists($name, $this->metadata)) { + return $this->metadata[$name]; + } + return null; + } + + /** + * Validate a static method call + * + * Validates that a static method call in PHP 5.4 will actually work + * + * @param string $callback + * @return true|array + * @throws Exception\InvalidCallbackException if invalid + */ + protected function validateStringCallbackFor54($callback) + { + if (!strstr($callback, '::')) { + return true; + } + + list($class, $method) = explode('::', $callback, 2); + + if (!class_exists($class)) { + throw new Exception\InvalidCallbackException(sprintf( + 'Static method call "%s" refers to a class that does not exist', + $callback + )); + } + + $r = new ReflectionClass($class); + if (!$r->hasMethod($method)) { + throw new Exception\InvalidCallbackException(sprintf( + 'Static method call "%s" refers to a method that does not exist', + $callback + )); + } + $m = $r->getMethod($method); + if (!$m->isStatic()) { + throw new Exception\InvalidCallbackException(sprintf( + 'Static method call "%s" refers to a method that is not static', + $callback + )); + } + + // returning a non boolean value may not be nice for a validate method, + // but that allows the usage of a static string callback without using + // the call_user_func function. + return array($class, $method); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/DateTime.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/DateTime.php new file mode 100644 index 0000000000..5c88ad4732 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/DateTime.php @@ -0,0 +1,47 @@ + GLOB_MARK, + self::GLOB_NOSORT => GLOB_NOSORT, + self::GLOB_NOCHECK => GLOB_NOCHECK, + self::GLOB_NOESCAPE => GLOB_NOESCAPE, + self::GLOB_BRACE => GLOB_BRACE, + self::GLOB_ONLYDIR => GLOB_ONLYDIR, + self::GLOB_ERR => GLOB_ERR, + ); + + $globFlags = 0; + + foreach ($flagMap as $internalFlag => $globFlag) { + if ($flags & $internalFlag) { + $globFlags |= $globFlag; + } + } + } else { + $globFlags = 0; + } + + ErrorHandler::start(); + $res = glob($pattern, $globFlags); + $err = ErrorHandler::stop(); + if ($res === false) { + throw new Exception\RuntimeException("glob('{$pattern}', {$globFlags}) failed", 0, $err); + } + return $res; + } + + /** + * Expand braces manually, then use the system glob. + * + * @param string $pattern + * @param int $flags + * @return array + * @throws Exception\RuntimeException + */ + protected static function fallbackGlob($pattern, $flags) + { + if (!$flags & self::GLOB_BRACE) { + return static::systemGlob($pattern, $flags); + } + + $flags &= ~self::GLOB_BRACE; + $length = strlen($pattern); + $paths = array(); + + if ($flags & self::GLOB_NOESCAPE) { + $begin = strpos($pattern, '{'); + } else { + $begin = 0; + + while (true) { + if ($begin === $length) { + $begin = false; + break; + } elseif ($pattern[$begin] === '\\' && ($begin + 1) < $length) { + $begin++; + } elseif ($pattern[$begin] === '{') { + break; + } + + $begin++; + } + } + + if ($begin === false) { + return static::systemGlob($pattern, $flags); + } + + $next = static::nextBraceSub($pattern, $begin + 1, $flags); + + if ($next === null) { + return static::systemGlob($pattern, $flags); + } + + $rest = $next; + + while ($pattern[$rest] !== '}') { + $rest = static::nextBraceSub($pattern, $rest + 1, $flags); + + if ($rest === null) { + return static::systemGlob($pattern, $flags); + } + } + + $p = $begin + 1; + + while (true) { + $subPattern = substr($pattern, 0, $begin) + . substr($pattern, $p, $next - $p) + . substr($pattern, $rest + 1); + + $result = static::fallbackGlob($subPattern, $flags | self::GLOB_BRACE); + + if ($result) { + $paths = array_merge($paths, $result); + } + + if ($pattern[$next] === '}') { + break; + } + + $p = $next + 1; + $next = static::nextBraceSub($pattern, $p, $flags); + } + + return array_unique($paths); + } + + /** + * Find the end of the sub-pattern in a brace expression. + * + * @param string $pattern + * @param int $begin + * @param int $flags + * @return int|null + */ + protected static function nextBraceSub($pattern, $begin, $flags) + { + $length = strlen($pattern); + $depth = 0; + $current = $begin; + + while ($current < $length) { + if (!$flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\') { + if (++$current === $length) { + break; + } + + $current++; + } else { + if (($pattern[$current] === '}' && $depth-- === 0) || ($pattern[$current] === ',' && $depth === 0)) { + break; + } elseif ($pattern[$current++] === '{') { + $depth++; + } + } + } + + return ($current < $length ? $current : null); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/AbstractHydrator.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/AbstractHydrator.php new file mode 100644 index 0000000000..729260f910 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/AbstractHydrator.php @@ -0,0 +1,198 @@ +strategies = new ArrayObject(); + $this->filterComposite = new FilterComposite(); + } + + /** + * Gets the strategy with the given name. + * + * @param string $name The name of the strategy to get. + * @return StrategyInterface + */ + public function getStrategy($name) + { + if (isset($this->strategies[$name])) { + return $this->strategies[$name]; + } + + if (!isset($this->strategies['*'])) { + throw new Exception\InvalidArgumentException(sprintf( + '%s: no strategy by name of "%s", and no wildcard strategy present', + __METHOD__, + $name + )); + } + + return $this->strategies['*']; + } + + /** + * Checks if the strategy with the given name exists. + * + * @param string $name The name of the strategy to check for. + * @return bool + */ + public function hasStrategy($name) + { + return array_key_exists($name, $this->strategies) + || array_key_exists('*', $this->strategies); + } + + /** + * Adds the given strategy under the given name. + * + * @param string $name The name of the strategy to register. + * @param StrategyInterface $strategy The strategy to register. + * @return HydratorInterface + */ + public function addStrategy($name, StrategyInterface $strategy) + { + $this->strategies[$name] = $strategy; + return $this; + } + + /** + * Removes the strategy with the given name. + * + * @param string $name The name of the strategy to remove. + * @return HydratorInterface + */ + public function removeStrategy($name) + { + unset($this->strategies[$name]); + return $this; + } + + /** + * Converts a value for extraction. If no strategy exists the plain value is returned. + * + * @param string $name The name of the strategy to use. + * @param mixed $value The value that should be converted. + * @param array $object The object is optionally provided as context. + * @return mixed + */ + public function extractValue($name, $value, $object = null) + { + if ($this->hasStrategy($name)) { + $strategy = $this->getStrategy($name); + $value = $strategy->extract($value, $object); + } + return $value; + } + + /** + * Converts a value for hydration. If no strategy exists the plain value is returned. + * + * @param string $name The name of the strategy to use. + * @param mixed $value The value that should be converted. + * @param array $data The whole data is optionally provided as context. + * @return mixed + */ + public function hydrateValue($name, $value, $data = null) + { + if ($this->hasStrategy($name)) { + $strategy = $this->getStrategy($name); + $value = $strategy->hydrate($value, $data); + } + return $value; + } + + /** + * Get the filter instance + * + * @return Filter\FilterComposite + */ + public function getFilter() + { + return $this->filterComposite; + } + + /** + * Add a new filter to take care of what needs to be hydrated. + * To exclude e.g. the method getServiceLocator: + * + * + * $composite->addFilter("servicelocator", + * function ($property) { + * list($class, $method) = explode('::', $property); + * if ($method === 'getServiceLocator') { + * return false; + * } + * return true; + * }, FilterComposite::CONDITION_AND + * ); + * + * + * @param string $name Index in the composite + * @param callable|Filter\FilterInterface $filter + * @param int $condition + * @return Filter\FilterComposite + */ + public function addFilter($name, $filter, $condition = FilterComposite::CONDITION_OR) + { + return $this->filterComposite->addFilter($name, $filter, $condition); + } + + /** + * Check whether a specific filter exists at key $name or not + * + * @param string $name Index in the composite + * @return bool + */ + public function hasFilter($name) + { + return $this->filterComposite->hasFilter($name); + } + + /** + * Remove a filter from the composition. + * To not extract "has" methods, you simply need to unregister it + * + * + * $filterComposite->removeFilter('has'); + * + * + * @param $name + * @return Filter\FilterComposite + */ + public function removeFilter($name) + { + return $this->filterComposite->removeFilter($name); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/AggregateHydrator.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/AggregateHydrator.php new file mode 100644 index 0000000000..bdcf1eb0ad --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/AggregateHydrator.php @@ -0,0 +1,87 @@ +getEventManager()->attachAggregate(new HydratorListener($hydrator), $priority); + } + + /** + * {@inheritDoc} + */ + public function extract($object) + { + $event = new ExtractEvent($this, $object); + + $this->getEventManager()->trigger($event); + + return $event->getExtractedData(); + } + + /** + * {@inheritDoc} + */ + public function hydrate(array $data, $object) + { + $event = new HydrateEvent($this, $object, $data); + + $this->getEventManager()->trigger($event); + + return $event->getHydratedObject(); + } + + /** + * {@inheritDoc} + */ + public function setEventManager(EventManagerInterface $eventManager) + { + $eventManager->setIdentifiers(array(__CLASS__, get_class($this))); + + $this->eventManager = $eventManager; + } + + /** + * {@inheritDoc} + */ + public function getEventManager() + { + if (null === $this->eventManager) { + $this->setEventManager(new EventManager()); + } + + return $this->eventManager; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/ExtractEvent.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/ExtractEvent.php new file mode 100644 index 0000000000..dfdfbcfb6b --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/ExtractEvent.php @@ -0,0 +1,99 @@ +target = $target; + $this->extractionObject = $extractionObject; + } + + /** + * Retrieves the object from which data is extracted + * + * @return object + */ + public function getExtractionObject() + { + return $this->extractionObject; + } + + /** + * @param object $extractionObject + * + * @return void + */ + public function setExtractionObject($extractionObject) + { + $this->extractionObject = $extractionObject; + } + + /** + * Retrieves the data that has been extracted + * + * @return array + */ + public function getExtractedData() + { + return $this->extractedData; + } + + /** + * @param array $extractedData + * + * @return void + */ + public function setExtractedData(array $extractedData) + { + $this->extractedData = $extractedData; + } + + /** + * Merge provided data with the extracted data + * + * @param array $additionalData + * + * @return void + */ + public function mergeExtractedData(array $additionalData) + { + $this->extractedData = array_merge($this->extractedData, $additionalData); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydrateEvent.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydrateEvent.php new file mode 100644 index 0000000000..11bab02379 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydrateEvent.php @@ -0,0 +1,85 @@ +target = $target; + $this->hydratedObject = $hydratedObject; + $this->hydrationData = $hydrationData; + } + + /** + * Retrieves the object that is being hydrated + * + * @return object + */ + public function getHydratedObject() + { + return $this->hydratedObject; + } + + /** + * @param object $hydratedObject + */ + public function setHydratedObject($hydratedObject) + { + $this->hydratedObject = $hydratedObject; + } + + /** + * Retrieves the data that is being used for hydration + * + * @return array + */ + public function getHydrationData() + { + return $this->hydrationData; + } + + /** + * @param array $hydrationData + */ + public function setHydrationData(array $hydrationData) + { + $this->hydrationData = $hydrationData; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydratorListener.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydratorListener.php new file mode 100644 index 0000000000..0ce5ddac03 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydratorListener.php @@ -0,0 +1,81 @@ +hydrator = $hydrator; + } + + /** + * {@inheritDoc} + */ + public function attach(EventManagerInterface $events, $priority = 1) + { + $this->listeners[] = $events->attach(HydrateEvent::EVENT_HYDRATE, array($this, 'onHydrate'), $priority); + $this->listeners[] = $events->attach(ExtractEvent::EVENT_EXTRACT, array($this, 'onExtract'), $priority); + } + + /** + * Callback to be used when {@see \Zend\Stdlib\Hydrator\Aggregate\HydrateEvent::EVENT_HYDRATE} is triggered + * + * @param \Zend\Stdlib\Hydrator\Aggregate\HydrateEvent $event + * + * @return object + * + * @internal + */ + public function onHydrate(HydrateEvent $event) + { + $object = $this->hydrator->hydrate($event->getHydrationData(), $event->getHydratedObject()); + + $event->setHydratedObject($object); + + return $object; + } + + /** + * Callback to be used when {@see \Zend\Stdlib\Hydrator\Aggregate\ExtractEvent::EVENT_EXTRACT} is triggered + * + * @param \Zend\Stdlib\Hydrator\Aggregate\ExtractEvent $event + * + * @return array + * + * @internal + */ + public function onExtract(ExtractEvent $event) + { + $data = $this->hydrator->extract($event->getExtractionObject()); + + $event->mergeExtractedData($data); + + return $data; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ArraySerializable.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ArraySerializable.php new file mode 100644 index 0000000000..d9631122e1 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ArraySerializable.php @@ -0,0 +1,77 @@ +getArrayCopy(); + + foreach ($data as $name => $value) { + if (!$this->getFilter()->filter($name)) { + unset($data[$name]); + continue; + } + + $data[$name] = $this->extractValue($name, $value); + } + + return $data; + } + + /** + * Hydrate an object + * + * Hydrates an object by passing $data to either its exchangeArray() or + * populate() method. + * + * @param array $data + * @param object $object + * @return object + * @throws Exception\BadMethodCallException for an $object not implementing exchangeArray() or populate() + */ + public function hydrate(array $data, $object) + { + $self = $this; + array_walk($data, function (&$value, $name) use ($self) { + $value = $self->hydrateValue($name, $value); + }); + + if (is_callable(array($object, 'exchangeArray'))) { + $object->exchangeArray($data); + } elseif (is_callable(array($object, 'populate'))) { + $object->populate($data); + } else { + throw new Exception\BadMethodCallException(sprintf( + '%s expects the provided object to implement exchangeArray() or populate()', __METHOD__ + )); + } + return $object; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ClassMethods.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ClassMethods.php new file mode 100644 index 0000000000..a3d76ceffb --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ClassMethods.php @@ -0,0 +1,196 @@ +setUnderscoreSeparatedKeys($underscoreSeparatedKeys); + + $this->callableMethodFilter = new OptionalParametersFilter(); + + $this->filterComposite->addFilter("is", new IsFilter()); + $this->filterComposite->addFilter("has", new HasFilter()); + $this->filterComposite->addFilter("get", new GetFilter()); + $this->filterComposite->addFilter("parameter", new OptionalParametersFilter(), FilterComposite::CONDITION_AND); + } + + /** + * @param array|Traversable $options + * @return ClassMethods + * @throws Exception\InvalidArgumentException + */ + public function setOptions($options) + { + if ($options instanceof Traversable) { + $options = ArrayUtils::iteratorToArray($options); + } elseif (!is_array($options)) { + throw new Exception\InvalidArgumentException( + 'The options parameter must be an array or a Traversable' + ); + } + if (isset($options['underscoreSeparatedKeys'])) { + $this->setUnderscoreSeparatedKeys($options['underscoreSeparatedKeys']); + } + + return $this; + } + + /** + * @param bool $underscoreSeparatedKeys + * @return ClassMethods + */ + public function setUnderscoreSeparatedKeys($underscoreSeparatedKeys) + { + $this->underscoreSeparatedKeys = $underscoreSeparatedKeys; + + return $this; + } + + /** + * @return bool + */ + public function getUnderscoreSeparatedKeys() + { + return $this->underscoreSeparatedKeys; + } + + /** + * Extract values from an object with class methods + * + * Extracts the getter/setter of the given $object. + * + * @param object $object + * @return array + * @throws Exception\BadMethodCallException for a non-object $object + */ + public function extract($object) + { + if (!is_object($object)) { + throw new Exception\BadMethodCallException(sprintf( + '%s expects the provided $object to be a PHP object)', __METHOD__ + )); + } + + $filter = null; + if ($object instanceof FilterProviderInterface) { + $filter = new FilterComposite( + array($object->getFilter()), + array(new MethodMatchFilter("getFilter")) + ); + } else { + $filter = $this->filterComposite; + } + + $transform = function ($letters) { + $letter = array_shift($letters); + + return '_' . strtolower($letter); + }; + $attributes = array(); + $methods = get_class_methods($object); + + foreach ($methods as $method) { + if ( + !$filter->filter( + get_class($object) . '::' . $method + ) + ) { + continue; + } + + if (!$this->callableMethodFilter->filter(get_class($object) . '::' . $method)) { + continue; + } + + $attribute = $method; + if (preg_match('/^get/', $method)) { + $attribute = substr($method, 3); + if (!property_exists($object, $attribute)) { + $attribute = lcfirst($attribute); + } + } + + if ($this->underscoreSeparatedKeys) { + $attribute = preg_replace_callback('/([A-Z])/', $transform, $attribute); + } + $attributes[$attribute] = $this->extractValue($attribute, $object->$method(), $object); + } + + return $attributes; + } + + /** + * Hydrate an object by populating getter/setter methods + * + * Hydrates an object by getter/setter methods of the object. + * + * @param array $data + * @param object $object + * @return object + * @throws Exception\BadMethodCallException for a non-object $object + */ + public function hydrate(array $data, $object) + { + if (!is_object($object)) { + throw new Exception\BadMethodCallException(sprintf( + '%s expects the provided $object to be a PHP object)', __METHOD__ + )); + } + + $transform = function ($letters) { + $letter = substr(array_shift($letters), 1, 1); + + return ucfirst($letter); + }; + + foreach ($data as $property => $value) { + $method = 'set' . ucfirst($property); + if ($this->underscoreSeparatedKeys) { + $method = preg_replace_callback('/(_[a-z])/i', $transform, $method); + } + if (is_callable(array($object, $method))) { + $value = $this->hydrateValue($property, $value, $data); + $object->$method($value); + } + } + + return $object; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterComposite.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterComposite.php new file mode 100644 index 0000000000..35bb437c07 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterComposite.php @@ -0,0 +1,198 @@ +orFilter = new ArrayObject($orFilter); + $this->andFilter = new ArrayObject($andFilter); + } + + /** + * Add a filter to the composite. Has to be indexed with $name in + * order to identify a specific filter. + * + * This example will exclude all methods from the hydration, that starts with 'getService' + * + * $composite->addFilter('exclude', + * function ($method) { + * if (preg_match('/^getService/', $method) { + * return false; + * } + * return true; + * }, FilterComposite::CONDITION_AND + * ); + * + * + * @param string $name + * @param callable|FilterInterface $filter + * @param int $condition Can be either FilterComposite::CONDITION_OR or FilterComposite::CONDITION_AND + * @throws InvalidArgumentException + * @return FilterComposite + */ + public function addFilter($name, $filter, $condition = self::CONDITION_OR) + { + if (!is_callable($filter) && !($filter instanceof FilterInterface)) { + throw new InvalidArgumentException( + 'The value of ' . $name . ' should be either a callable or ' . + 'an instance of Zend\Stdlib\Hydrator\Filter\FilterInterface' + ); + } + + if ($condition === self::CONDITION_OR) { + $this->orFilter[$name] = $filter; + } elseif ($condition === self::CONDITION_AND) { + $this->andFilter[$name] = $filter; + } + + return $this; + } + + /** + * Remove a filter from the composition + * + * @param $name string Identifier for the filter + * @return FilterComposite + */ + public function removeFilter($name) + { + if (isset($this->orFilter[$name])) { + unset($this->orFilter[$name]); + } + + if (isset($this->andFilter[$name])) { + unset($this->andFilter[$name]); + } + + return $this; + } + + /** + * Check if $name has a filter registered + * + * @param $name string Identifier for the filter + * @return bool + */ + public function hasFilter($name) + { + return isset($this->orFilter[$name]) || isset($this->andFilter[$name]); + } + + /** + * Filter the composite based on the AND and OR condition + * Will return true if one from the "or conditions" and all from + * the "and condition" returns true. Otherwise false + * + * @param $property string Parameter will be e.g. Parent\Namespace\Class::method + * @return bool + */ + public function filter($property) + { + $andCount = count($this->andFilter); + $orCount = count($this->orFilter); + // return true if no filters are registered + if ($orCount === 0 && $andCount === 0) { + return true; + } elseif ($orCount === 0 && $andCount !== 0) { + $returnValue = true; + } else { + $returnValue = false; + } + + // Check if 1 from the or filters return true + foreach ($this->orFilter as $filter) { + if (is_callable($filter)) { + if ($filter($property) === true) { + $returnValue = true; + break; + } + continue; + } else { + if ($filter->filter($property) === true) { + $returnValue = true; + break; + } + } + } + + // Check if all of the and condition return true + foreach ($this->andFilter as $filter) { + if (is_callable($filter)) { + if ($filter($property) === false) { + return false; + } + continue; + } else { + if ($filter->filter($property) === false) { + return false; + } + } + } + + return $returnValue; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterInterface.php new file mode 100644 index 0000000000..30bd3575a1 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterInterface.php @@ -0,0 +1,21 @@ +method = $method; + $this->exclude = $exclude; + } + + public function filter($property) + { + $pos = strpos($property, '::'); + if ($pos !== false) { + $pos += 2; + } else { + $pos = 0; + } + if (substr($property, $pos) === $this->method) { + return $this->exclude ? false : true; + } + return $this->exclude ? true : false; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php new file mode 100644 index 0000000000..7f4e05289f --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php @@ -0,0 +1,54 @@ +numberOfParameters = 0; + } + + /** + * @param string $property the name of the property + * @return bool + * @throws InvalidArgumentException + */ + public function filter($property) + { + try { + $reflectionMethod = new ReflectionMethod($property); + } catch (ReflectionException $exception) { + throw new InvalidArgumentException( + "Method $property doesn't exist" + ); + } + + if ($reflectionMethod->getNumberOfParameters() !== $this->numberOfParameters) { + return false; + } + + return true; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php new file mode 100644 index 0000000000..9fa1de07e1 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php @@ -0,0 +1,54 @@ +getParameters(), + function (ReflectionParameter $parameter) { + return ! $parameter->isOptional(); + } + ); + + return static::$propertiesCache[$property] = empty($mandatoryParameters); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorAwareInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorAwareInterface.php new file mode 100644 index 0000000000..f2784b3bb2 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorAwareInterface.php @@ -0,0 +1,28 @@ + 'Zend\Stdlib\Hydrator\ArraySerializable', + 'classmethods' => 'Zend\Stdlib\Hydrator\ClassMethods', + 'objectproperty' => 'Zend\Stdlib\Hydrator\ObjectProperty', + 'reflection' => 'Zend\Stdlib\Hydrator\Reflection' + ); + + /** + * {@inheritDoc} + */ + public function validatePlugin($plugin) + { + if ($plugin instanceof HydratorInterface) { + // we're okay + return; + } + + throw new Exception\RuntimeException(sprintf( + 'Plugin of type %s is invalid; must implement Zend\Stdlib\Hydrator\HydratorInterface', + (is_object($plugin) ? get_class($plugin) : gettype($plugin)) + )); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ObjectProperty.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ObjectProperty.php new file mode 100644 index 0000000000..c0bf569a2f --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ObjectProperty.php @@ -0,0 +1,71 @@ +getFilter(); + foreach ($data as $name => $value) { + // Filter keys, removing any we don't want + if (!$filter->filter($name)) { + unset($data[$name]); + continue; + } + // Extract data + $data[$name] = $this->extractValue($name, $value); + } + + return $data; + } + + /** + * Hydrate an object by populating public properties + * + * Hydrates an object by setting public properties of the object. + * + * @param array $data + * @param object $object + * @return object + * @throws Exception\BadMethodCallException for a non-object $object + */ + public function hydrate(array $data, $object) + { + if (!is_object($object)) { + throw new Exception\BadMethodCallException(sprintf( + '%s expects the provided $object to be a PHP object)', __METHOD__ + )); + } + foreach ($data as $property => $value) { + $object->$property = $this->hydrateValue($property, $value, $data); + } + return $object; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Reflection.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Reflection.php new file mode 100644 index 0000000000..fae361aab7 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Reflection.php @@ -0,0 +1,94 @@ +getName(); + if (!$this->filterComposite->filter($propertyName)) { + continue; + } + + $value = $property->getValue($object); + $result[$propertyName] = $this->extractValue($propertyName, $value, $object); + } + + return $result; + } + + /** + * Hydrate $object with the provided $data. + * + * @param array $data + * @param object $object + * @return object + */ + public function hydrate(array $data, $object) + { + $reflProperties = self::getReflProperties($object); + foreach ($data as $key => $value) { + if (isset($reflProperties[$key])) { + $reflProperties[$key]->setValue($object, $this->hydrateValue($key, $value, $data)); + } + } + return $object; + } + + /** + * Get a reflection properties from in-memory cache and lazy-load if + * class has not been loaded. + * + * @param string|object $input + * @throws Exception\InvalidArgumentException + * @return array + */ + protected static function getReflProperties($input) + { + if (is_object($input)) { + $input = get_class($input); + } elseif (!is_string($input)) { + throw new Exception\InvalidArgumentException('Input must be a string or an object.'); + } + + if (isset(static::$reflProperties[$input])) { + return static::$reflProperties[$input]; + } + + static::$reflProperties[$input] = array(); + $reflClass = new ReflectionClass($input); + $reflProperties = $reflClass->getProperties(); + + foreach ($reflProperties as $property) { + $property->setAccessible(true); + static::$reflProperties[$input][$property->getName()] = $property; + } + + return static::$reflProperties[$input]; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php new file mode 100644 index 0000000000..e2b32a640c --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php @@ -0,0 +1,100 @@ +addStrategy('category', new ClosureStrategy( + * function (Category $value) { + * return (int) $value->id; + * }, + * function ($value) { + * return new Category((int) $value); + * } + * )); + * + * @param callable $extractFunc - anonymous function, that extract values + * from object + * @param callable $hydrateFunc - anonymous function, that hydrate values + * into object + */ + public function __construct($extractFunc = null, $hydrateFunc = null) + { + if (isset($extractFunc)) { + if (!is_callable($extractFunc)) { + throw new \Exception('$extractFunc must be callable'); + } + + $this->extractFunc = $extractFunc; + } else { + $this->extractFunc = function ($value) { + return $value; + }; + } + + if (isset($hydrateFunc)) { + if (!is_callable($hydrateFunc)) { + throw new \Exception('$hydrateFunc must be callable'); + } + + $this->hydrateFunc = $hydrateFunc; + } else { + $this->hydrateFunc = function ($value) { + return $value; + }; + } + } + + /** + * Converts the given value so that it can be extracted by the hydrator. + * + * @param mixed $value The original value. + * @return mixed Returns the value that should be extracted. + */ + public function extract($value) + { + $func = $this->extractFunc; + + return $func($value); + } + + /** + * Converts the given value so that it can be hydrated by the hydrator. + * + * @param mixed $value The original value. + * @return mixed Returns the value that should be hydrated. + */ + public function hydrate($value) + { + $func = $this->hydrateFunc; + + return $func($value); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php new file mode 100644 index 0000000000..d98f1f4c72 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php @@ -0,0 +1,35 @@ +setSerializer($serializer); + if ($serializerOptions) { + $this->setSerializerOptions($serializerOptions); + } + } + + /** + * Serialize the given value so that it can be extracted by the hydrator. + * + * @param mixed $value The original value. + * @return mixed Returns the value that should be extracted. + */ + public function extract($value) + { + $serializer = $this->getSerializer(); + return $serializer->serialize($value); + } + + /** + * Unserialize the given value so that it can be hydrated by the hydrator. + * + * @param mixed $value The original value. + * @return mixed Returns the value that should be hydrated. + */ + public function hydrate($value) + { + $serializer = $this->getSerializer(); + return $serializer->unserialize($value); + } + + /** + * Set serializer + * + * @param string|SerializerAdapter $serializer + * @return SerializableStrategy + */ + public function setSerializer($serializer) + { + if (!is_string($serializer) && !$serializer instanceof SerializerAdapter) { + throw new InvalidArgumentException(sprintf( + '%s expects either a string serializer name or Zend\Serializer\Adapter\AdapterInterface instance; ' + . 'received "%s"', + __METHOD__, + (is_object($serializer) ? get_class($serializer) : gettype($serializer)) + )); + } + $this->serializer = $serializer; + return $this; + } + + /** + * Get serializer + * + * @return SerializerAdapter + */ + public function getSerializer() + { + if (is_string($this->serializer)) { + $options = $this->getSerializerOptions(); + $this->setSerializer(SerializerFactory::factory($this->serializer, $options)); + } elseif (null === $this->serializer) { + $this->setSerializer(SerializerFactory::getDefaultAdapter()); + } + + return $this->serializer; + } + + /** + * Set configuration options for instantiating a serializer adapter + * + * @param mixed $serializerOptions + * @return SerializableStrategy + */ + public function setSerializerOptions($serializerOptions) + { + $this->serializerOptions = $serializerOptions; + return $this; + } + + /** + * Get configuration options for instantiating a serializer adapter + * + * @return mixed + */ + public function getSerializerOptions() + { + return $this->serializerOptions; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php new file mode 100644 index 0000000000..8a16355fb3 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php @@ -0,0 +1,34 @@ +metadata[$spec] = $value; + return $this; + } + if (!is_array($spec) && !$spec instanceof Traversable) { + throw new Exception\InvalidArgumentException(sprintf( + 'Expected a string, array, or Traversable argument in first position; received "%s"', + (is_object($spec) ? get_class($spec) : gettype($spec)) + )); + } + foreach ($spec as $key => $value) { + $this->metadata[$key] = $value; + } + return $this; + } + + /** + * Retrieve all metadata or a single metadatum as specified by key + * + * @param null|string|int $key + * @param null|mixed $default + * @throws Exception\InvalidArgumentException + * @return mixed + */ + public function getMetadata($key = null, $default = null) + { + if (null === $key) { + return $this->metadata; + } + + if (!is_scalar($key)) { + throw new Exception\InvalidArgumentException('Non-scalar argument provided for key'); + } + + if (array_key_exists($key, $this->metadata)) { + return $this->metadata[$key]; + } + + return $default; + } + + /** + * Set message content + * + * @param mixed $value + * @return Message + */ + public function setContent($value) + { + $this->content = $value; + return $this; + } + + /** + * Get message content + * + * @return mixed + */ + public function getContent() + { + return $this->content; + } + + /** + * @return string + */ + public function toString() + { + $request = ''; + foreach ($this->getMetadata() as $key => $value) { + $request .= sprintf( + "%s: %s\r\n", + (string) $key, + (string) $value + ); + } + $request .= "\r\n" . $this->getContent(); + return $request; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/MessageInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/MessageInterface.php new file mode 100644 index 0000000000..0abb1ff6b8 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/MessageInterface.php @@ -0,0 +1,45 @@ +exchangeArray($values); + } + + /** + * Populate from query string + * + * @param string $string + * @return void + */ + public function fromString($string) + { + $array = array(); + parse_str($string, $array); + $this->fromArray($array); + } + + /** + * Serialize to native PHP array + * + * @return array + */ + public function toArray() + { + return $this->getArrayCopy(); + } + + /** + * Serialize to query string + * + * @return string + */ + public function toString() + { + return http_build_query($this); + } + + /** + * Retrieve by key + * + * Returns null if the key does not exist. + * + * @param string $name + * @return mixed + */ + public function offsetGet($name) + { + if (isset($this[$name])) { + return parent::offsetGet($name); + } + return null; + } + + /** + * @param string $name + * @param mixed $default optional default value + * @return mixed + */ + public function get($name, $default = null) + { + if (isset($this[$name])) { + return parent::offsetGet($name); + } + return $default; + } + + /** + * @param string $name + * @param mixed $value + * @return Parameters + */ + public function set($name, $value) + { + $this[$name] = $value; + return $this; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParametersInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParametersInterface.php new file mode 100644 index 0000000000..e955b2ac7a --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParametersInterface.php @@ -0,0 +1,86 @@ +items[] = array( + 'data' => $data, + 'priority' => $priority, + ); + $this->getQueue()->insert($data, $priority); + return $this; + } + + /** + * Remove an item from the queue + * + * This is different than {@link extract()}; its purpose is to dequeue an + * item. + * + * This operation is potentially expensive, as it requires + * re-initialization and re-population of the inner queue. + * + * Note: this removes the first item matching the provided item found. If + * the same item has been added multiple times, it will not remove other + * instances. + * + * @param mixed $datum + * @return bool False if the item was not found, true otherwise. + */ + public function remove($datum) + { + $found = false; + foreach ($this->items as $key => $item) { + if ($item['data'] === $datum) { + $found = true; + break; + } + } + if ($found) { + unset($this->items[$key]); + $this->queue = null; + + if (!$this->isEmpty()) { + $queue = $this->getQueue(); + foreach ($this->items as $item) { + $queue->insert($item['data'], $item['priority']); + } + } + return true; + } + return false; + } + + /** + * Is the queue empty? + * + * @return bool + */ + public function isEmpty() + { + return (0 === $this->count()); + } + + /** + * How many items are in the queue? + * + * @return int + */ + public function count() + { + return count($this->items); + } + + /** + * Peek at the top node in the queue, based on priority. + * + * @return mixed + */ + public function top() + { + return $this->getIterator()->top(); + } + + /** + * Extract a node from the inner queue and sift up + * + * @return mixed + */ + public function extract() + { + return $this->getQueue()->extract(); + } + + /** + * Retrieve the inner iterator + * + * SplPriorityQueue acts as a heap, which typically implies that as items + * are iterated, they are also removed. This does not work for situations + * where the queue may be iterated multiple times. As such, this class + * aggregates the values, and also injects an SplPriorityQueue. This method + * retrieves the inner queue object, and clones it for purposes of + * iteration. + * + * @return SplPriorityQueue + */ + public function getIterator() + { + $queue = $this->getQueue(); + return clone $queue; + } + + /** + * Serialize the data structure + * + * @return string + */ + public function serialize() + { + return serialize($this->items); + } + + /** + * Unserialize a string into a PriorityQueue object + * + * Serialization format is compatible with {@link Zend\Stdlib\SplPriorityQueue} + * + * @param string $data + * @return void + */ + public function unserialize($data) + { + foreach (unserialize($data) as $item) { + $this->insert($item['data'], $item['priority']); + } + } + + /** + * Serialize to an array + * + * By default, returns only the item data, and in the order registered (not + * sorted). You may provide one of the EXTR_* flags as an argument, allowing + * the ability to return priorities or both data and priority. + * + * @param int $flag + * @return array + */ + public function toArray($flag = self::EXTR_DATA) + { + switch ($flag) { + case self::EXTR_BOTH: + return $this->items; + break; + case self::EXTR_PRIORITY: + return array_map(function ($item) { + return $item['priority']; + }, $this->items); + case self::EXTR_DATA: + default: + return array_map(function ($item) { + return $item['data']; + }, $this->items); + } + } + + /** + * Specify the internal queue class + * + * Please see {@link getIterator()} for details on the necessity of an + * internal queue class. The class provided should extend SplPriorityQueue. + * + * @param string $class + * @return PriorityQueue + */ + public function setInternalQueueClass($class) + { + $this->queueClass = (string) $class; + return $this; + } + + /** + * Does the queue contain the given datum? + * + * @param mixed $datum + * @return bool + */ + public function contains($datum) + { + foreach ($this->items as $item) { + if ($item['data'] === $datum) { + return true; + } + } + return false; + } + + /** + * Does the queue have an item with the given priority? + * + * @param int $priority + * @return bool + */ + public function hasPriority($priority) + { + foreach ($this->items as $item) { + if ($item['priority'] === $priority) { + return true; + } + } + return false; + } + + /** + * Get the inner priority queue instance + * + * @throws Exception\DomainException + * @return SplPriorityQueue + */ + protected function getQueue() + { + if (null === $this->queue) { + $this->queue = new $this->queueClass(); + if (!$this->queue instanceof \SplPriorityQueue) { + throw new Exception\DomainException(sprintf( + 'PriorityQueue expects an internal queue of type SplPriorityQueue; received "%s"', + get_class($this->queue) + )); + } + } + return $this->queue; + } + + /** + * Add support for deep cloning + * + * @return void + */ + public function __clone() + { + if (null !== $this->queue) { + $this->queue = clone $this->queue; + } + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/README.md b/vendor/zendframework/zend-stdlib/Zend/Stdlib/README.md new file mode 100644 index 0000000000..a2dcb84191 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/README.md @@ -0,0 +1,15 @@ +Stdlib Component from ZF2 +========================= + +This is the Stdlib component for ZF2. + +- File issues at https://github.com/zendframework/zf2/issues +- Create pull requests against https://github.com/zendframework/zf2 +- Documentation is at http://framework.zend.com/docs + +LICENSE +------- + +The files in this archive are released under the [Zend Framework +license](http://framework.zend.com/license), which is a 3-clause BSD license. + diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Request.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Request.php new file mode 100644 index 0000000000..8427bc08f3 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Request.php @@ -0,0 +1,15 @@ +serial--); + } + parent::insert($datum, $priority); + } + + + /** + * Serialize to an array + * + * Array will be priority => data pairs + * + * @return array + */ + public function toArray() + { + $array = array(); + foreach (clone $this as $item) { + $array[] = $item; + } + return $array; + } + + + /** + * Serialize + * + * @return string + */ + public function serialize() + { + $clone = clone $this; + $clone->setExtractFlags(self::EXTR_BOTH); + + $data = array(); + foreach ($clone as $item) { + $data[] = $item; + } + + return serialize($data); + } + + /** + * Deserialize + * + * @param string $data + * @return void + */ + public function unserialize($data) + { + foreach (unserialize($data) as $item) { + $this->insert($item['data'], $item['priority']); + } + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplQueue.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplQueue.php new file mode 100644 index 0000000000..e18ebc6821 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplQueue.php @@ -0,0 +1,55 @@ +toArray()); + } + + /** + * Unserialize + * + * @param string $data + * @return void + */ + public function unserialize($data) + { + foreach (unserialize($data) as $item) { + $this->push($item); + } + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplStack.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplStack.php new file mode 100644 index 0000000000..3bb8f67960 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplStack.php @@ -0,0 +1,55 @@ +toArray()); + } + + /** + * Unserialize + * + * @param string $data + * @return void + */ + public function unserialize($data) + { + foreach (unserialize($data) as $item) { + $this->unshift($item); + } + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringUtils.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringUtils.php new file mode 100644 index 0000000000..2945f9aa62 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringUtils.php @@ -0,0 +1,189 @@ +setEncoding($encoding, $convertEncoding); + return $wrapper; + } + } + + throw new Exception\RuntimeException( + 'No wrapper found supporting "' . $encoding . '"' + . (($convertEncoding !== null) ? ' and "' . $convertEncoding . '"' : '') + ); + } + + /** + * Get a list of all known single-byte character encodings + * + * @return string[] + */ + public static function getSingleByteEncodings() + { + return static::$singleByteEncodings; + } + + /** + * Check if a given encoding is a known single-byte character encoding + * + * @param string $encoding + * @return bool + */ + public static function isSingleByteEncoding($encoding) + { + return in_array(strtoupper($encoding), static::$singleByteEncodings); + } + + /** + * Check if a given string is valid UTF-8 encoded + * + * @param string $str + * @return bool + */ + public static function isValidUtf8($str) + { + return is_string($str) && ($str === '' || preg_match('/^./su', $str) == 1); + } + + /** + * Is PCRE compiled with Unicode support? + * + * @return bool + */ + public static function hasPcreUnicodeSupport() + { + if (static::$hasPcreUnicodeSupport === null) { + ErrorHandler::start(); + static::$hasPcreUnicodeSupport = defined('PREG_BAD_UTF8_OFFSET_ERROR') && preg_match('/\pL/u', 'a') == 1; + ErrorHandler::stop(); + } + return static::$hasPcreUnicodeSupport; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php new file mode 100644 index 0000000000..e22649e7fa --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php @@ -0,0 +1,272 @@ +convertEncoding = $convertEncodingUpper; + } else { + $this->convertEncoding = null; + } + $this->encoding = $encodingUpper; + + return $this; + } + + /** + * Get the defined character encoding to work with + * + * @return string + * @throws Exception\LogicException If no encoding was defined + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * Get the defined character encoding to convert to + * + * @return string|null + */ + public function getConvertEncoding() + { + return $this->convertEncoding; + } + + /** + * Convert a string from defined character encoding to the defined convert encoding + * + * @param string $str + * @param bool $reverse + * @return string|false + */ + public function convert($str, $reverse = false) + { + $encoding = $this->getEncoding(); + $convertEncoding = $this->getConvertEncoding(); + if ($convertEncoding === null) { + throw new Exception\LogicException( + 'No convert encoding defined' + ); + } + + if ($encoding === $convertEncoding) { + return $str; + } + + $from = $reverse ? $convertEncoding : $encoding; + $to = $reverse ? $encoding : $convertEncoding; + throw new Exception\RuntimeException(sprintf( + 'Converting from "%s" to "%s" isn\'t supported by this string wrapper', + $from, + $to + )); + } + + /** + * Wraps a string to a given number of characters + * + * @param string $string + * @param int $width + * @param string $break + * @param bool $cut + * @return string|false + */ + public function wordWrap($string, $width = 75, $break = "\n", $cut = false) + { + $string = (string) $string; + if ($string === '') { + return ''; + } + + $break = (string) $break; + if ($break === '') { + throw new Exception\InvalidArgumentException('Break string cannot be empty'); + } + + $width = (int) $width; + if ($width === 0 && $cut) { + throw new Exception\InvalidArgumentException('Cannot force cut when width is zero'); + } + + if (StringUtils::isSingleByteEncoding($this->getEncoding())) { + return wordwrap($string, $width, $break, $cut); + } + + $stringWidth = $this->strlen($string); + $breakWidth = $this->strlen($break); + + $result = ''; + $lastStart = $lastSpace = 0; + + for ($current = 0; $current < $stringWidth; $current++) { + $char = $this->substr($string, $current, 1); + + $possibleBreak = $char; + if ($breakWidth !== 1) { + $possibleBreak = $this->substr($string, $current, $breakWidth); + } + + if ($possibleBreak === $break) { + $result .= $this->substr($string, $lastStart, $current - $lastStart + $breakWidth); + $current += $breakWidth - 1; + $lastStart = $lastSpace = $current + 1; + continue; + } + + if ($char === ' ') { + if ($current - $lastStart >= $width) { + $result .= $this->substr($string, $lastStart, $current - $lastStart) . $break; + $lastStart = $current + 1; + } + + $lastSpace = $current; + continue; + } + + if ($current - $lastStart >= $width && $cut && $lastStart >= $lastSpace) { + $result .= $this->substr($string, $lastStart, $current - $lastStart) . $break; + $lastStart = $lastSpace = $current; + continue; + } + + if ($current - $lastStart >= $width && $lastStart < $lastSpace) { + $result .= $this->substr($string, $lastStart, $lastSpace - $lastStart) . $break; + $lastStart = $lastSpace = $lastSpace + 1; + continue; + } + } + + if ($lastStart !== $current) { + $result .= $this->substr($string, $lastStart, $current - $lastStart); + } + + return $result; + } + + /** + * Pad a string to a certain length with another string + * + * @param string $input + * @param int $padLength + * @param string $padString + * @param int $padType + * @return string + */ + public function strPad($input, $padLength, $padString = ' ', $padType = STR_PAD_RIGHT) + { + if (StringUtils::isSingleByteEncoding($this->getEncoding())) { + return str_pad($input, $padLength, $padString, $padType); + } + + $lengthOfPadding = $padLength - $this->strlen($input); + if ($lengthOfPadding <= 0) { + return $input; + } + + $padStringLength = $this->strlen($padString); + if ($padStringLength === 0) { + return $input; + } + + $repeatCount = floor($lengthOfPadding / $padStringLength); + + if ($padType === STR_PAD_BOTH) { + $lastStringLeft = ''; + $lastStringRight = ''; + $repeatCountLeft = $repeatCountRight = ($repeatCount - $repeatCount % 2) / 2; + + $lastStringLength = $lengthOfPadding - 2 * $repeatCountLeft * $padStringLength; + $lastStringLeftLength = $lastStringRightLength = floor($lastStringLength / 2); + $lastStringRightLength += $lastStringLength % 2; + + $lastStringLeft = $this->substr($padString, 0, $lastStringLeftLength); + $lastStringRight = $this->substr($padString, 0, $lastStringRightLength); + + return str_repeat($padString, $repeatCountLeft) . $lastStringLeft + . $input + . str_repeat($padString, $repeatCountRight) . $lastStringRight; + } + + $lastString = $this->substr($padString, 0, $lengthOfPadding % $padStringLength); + + if ($padType === STR_PAD_LEFT) { + return str_repeat($padString, $repeatCount) . $lastString . $input; + } + + return $input . str_repeat($padString, $repeatCount) . $lastString; + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Iconv.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Iconv.php new file mode 100644 index 0000000000..35dc39a1c9 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Iconv.php @@ -0,0 +1,289 @@ +getEncoding()); + } + + /** + * Returns the portion of string specified by the start and length parameters + * + * @param string $str + * @param int $offset + * @param int|null $length + * @return string|false + */ + public function substr($str, $offset = 0, $length = null) + { + return iconv_substr($str, $offset, $length, $this->getEncoding()); + } + + /** + * Find the position of the first occurrence of a substring in a string + * + * @param string $haystack + * @param string $needle + * @param int $offset + * @return int|false + */ + public function strpos($haystack, $needle, $offset = 0) + { + return iconv_strpos($haystack, $needle, $offset, $this->getEncoding()); + } + + /** + * Convert a string from defined encoding to the defined convert encoding + * + * @param string $str + * @param bool $reverse + * @return string|false + */ + public function convert($str, $reverse = false) + { + $encoding = $this->getEncoding(); + $convertEncoding = $this->getConvertEncoding(); + if ($convertEncoding === null) { + throw new Exception\LogicException( + 'No convert encoding defined' + ); + } + + if ($encoding === $convertEncoding) { + return $str; + } + + $fromEncoding = $reverse ? $convertEncoding : $encoding; + $toEncoding = $reverse ? $encoding : $convertEncoding; + + // automatically add "//IGNORE" to not stop converting on invalid characters + // invalid characters triggers a notice anyway + return iconv($fromEncoding, $toEncoding . '//IGNORE', $str); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Intl.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Intl.php new file mode 100644 index 0000000000..1c3973bb9d --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Intl.php @@ -0,0 +1,83 @@ +getEncoding()); + } + + /** + * Returns the portion of string specified by the start and length parameters + * + * @param string $str + * @param int $offset + * @param int|null $length + * @return string|false + */ + public function substr($str, $offset = 0, $length = null) + { + return mb_substr($str, $offset, $length, $this->getEncoding()); + } + + /** + * Find the position of the first occurrence of a substring in a string + * + * @param string $haystack + * @param string $needle + * @param int $offset + * @return int|false + */ + public function strpos($haystack, $needle, $offset = 0) + { + return mb_strpos($haystack, $needle, $offset, $this->getEncoding()); + } + + /** + * Convert a string from defined encoding to the defined convert encoding + * + * @param string $str + * @param bool $reverse + * @return string|false + */ + public function convert($str, $reverse = false) + { + $encoding = $this->getEncoding(); + $convertEncoding = $this->getConvertEncoding(); + + if ($convertEncoding === null) { + throw new Exception\LogicException( + 'No convert encoding defined' + ); + } + + if ($encoding === $convertEncoding) { + return $str; + } + + $fromEncoding = $reverse ? $convertEncoding : $encoding; + $toEncoding = $reverse ? $encoding : $convertEncoding; + return mb_convert_encoding($str, $toEncoding, $fromEncoding); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Native.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Native.php new file mode 100644 index 0000000000..978b731118 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Native.php @@ -0,0 +1,134 @@ +convertEncoding = $encodingUpper; + } + + if ($convertEncoding !== null) { + if ($encodingUpper !== strtoupper($convertEncoding)) { + throw new Exception\InvalidArgumentException( + 'Wrapper doesn\'t support to convert between character encodings' + ); + } + + $this->convertEncoding = $encodingUpper; + } else { + $this->convertEncoding = null; + } + $this->encoding = $encodingUpper; + + return $this; + } + + /** + * Returns the length of the given string + * + * @param string $str + * @return int|false + */ + public function strlen($str) + { + return strlen($str); + } + + /** + * Returns the portion of string specified by the start and length parameters + * + * @param string $str + * @param int $offset + * @param int|null $length + * @return string|false + */ + public function substr($str, $offset = 0, $length = null) + { + return substr($str, $offset, $length); + } + + /** + * Find the position of the first occurrence of a substring in a string + * + * @param string $haystack + * @param string $needle + * @param int $offset + * @return int|false + */ + public function strpos($haystack, $needle, $offset = 0) + { + return strpos($haystack, $needle, $offset); + } +} diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/StringWrapperInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/StringWrapperInterface.php new file mode 100644 index 0000000000..974b0be489 --- /dev/null +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/StringWrapperInterface.php @@ -0,0 +1,111 @@ +=5.3.3" + }, + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + } +}