diff --git a/composer.json b/composer.json
new file mode 100644
index 00000000..a2ceeb40
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,13 @@
+{
+ "require": {
+ "silex/silex": "~2.0",
+ "symfony/var-dumper": "^3.2",
+ "doctrine/dbal": "~2.2",
+ "firebase/php-jwt": "^5.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "SON\\": "src"
+ }
+ }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 00000000..d510d532
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,1161 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "8ab00f3c4c91dcef4c596d9b573b6f58",
+ "content-hash": "66424d65aaacda016649b4b3c023a347",
+ "packages": [
+ {
+ "name": "doctrine/annotations",
+ "version": "v1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/annotations.git",
+ "reference": "30e07cf03edc3cd3ef579d0dd4dd8c58250799a5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/30e07cf03edc3cd3ef579d0dd4dd8c58250799a5",
+ "reference": "30e07cf03edc3cd3ef579d0dd4dd8c58250799a5",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/lexer": "1.*",
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "doctrine/cache": "1.*",
+ "phpunit/phpunit": "^5.6.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Docblock Annotations Parser",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "parser"
+ ],
+ "time": "2016-10-24 11:45:47"
+ },
+ {
+ "name": "doctrine/cache",
+ "version": "v1.6.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/cache.git",
+ "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/cache/zipball/b6f544a20f4807e81f7044d31e679ccbb1866dc3",
+ "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3",
+ "shasum": ""
+ },
+ "require": {
+ "php": "~5.5|~7.0"
+ },
+ "conflict": {
+ "doctrine/common": ">2.2,<2.4"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8|~5.0",
+ "predis/predis": "~1.0",
+ "satooshi/php-coveralls": "~0.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.6.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Caching library offering an object-oriented API for many cache backends",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "cache",
+ "caching"
+ ],
+ "time": "2016-10-29 11:16:17"
+ },
+ {
+ "name": "doctrine/collections",
+ "version": "v1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/collections.git",
+ "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
+ "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Collections\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Collections Abstraction library",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "array",
+ "collections",
+ "iterator"
+ ],
+ "time": "2015-04-14 22:21:58"
+ },
+ {
+ "name": "doctrine/common",
+ "version": "v2.6.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/common.git",
+ "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
+ "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/annotations": "1.*",
+ "doctrine/cache": "1.*",
+ "doctrine/collections": "1.*",
+ "doctrine/inflector": "1.*",
+ "doctrine/lexer": "1.*",
+ "php": "~5.5|~7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8|~5.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.7.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\": "lib/Doctrine/Common"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Common Library for Doctrine projects",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "collections",
+ "eventmanager",
+ "persistence",
+ "spl"
+ ],
+ "time": "2016-11-30 16:50:46"
+ },
+ {
+ "name": "doctrine/dbal",
+ "version": "v2.5.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/dbal.git",
+ "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/dbal/zipball/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
+ "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/common": ">=2.4,<2.7-dev",
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*",
+ "symfony/console": "2.*||^3.0"
+ },
+ "suggest": {
+ "symfony/console": "For helpful console commands such as SQL execution and import of files."
+ },
+ "bin": [
+ "bin/doctrine-dbal"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\DBAL\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ }
+ ],
+ "description": "Database Abstraction Layer",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "database",
+ "dbal",
+ "persistence",
+ "queryobject"
+ ],
+ "time": "2016-09-09 19:13:33"
+ },
+ {
+ "name": "doctrine/inflector",
+ "version": "v1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/inflector.git",
+ "reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
+ "reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Inflector\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Common String Manipulations with regard to casing and singular/plural rules.",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "inflection",
+ "pluralize",
+ "singularize",
+ "string"
+ ],
+ "time": "2015-11-06 14:35:42"
+ },
+ {
+ "name": "doctrine/lexer",
+ "version": "v1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/lexer.git",
+ "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Lexer\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "lexer",
+ "parser"
+ ],
+ "time": "2014-09-09 13:34:57"
+ },
+ {
+ "name": "firebase/php-jwt",
+ "version": "v5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/firebase/php-jwt.git",
+ "reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
+ "reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": " 4.8.35"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Firebase\\JWT\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Neuman Vong",
+ "email": "neuman+pear@twilio.com",
+ "role": "Developer"
+ },
+ {
+ "name": "Anant Narayanan",
+ "email": "anant@php.net",
+ "role": "Developer"
+ }
+ ],
+ "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
+ "homepage": "https://github.com/firebase/php-jwt",
+ "time": "2017-06-27 22:17:23"
+ },
+ {
+ "name": "pimple/pimple",
+ "version": "v3.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/silexphp/Pimple.git",
+ "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a",
+ "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Pimple": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Pimple, a simple Dependency Injection Container",
+ "homepage": "http://pimple.sensiolabs.org",
+ "keywords": [
+ "container",
+ "dependency injection"
+ ],
+ "time": "2015-09-11 15:10:35"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2016-10-10 12:19:37"
+ },
+ {
+ "name": "silex/silex",
+ "version": "v2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/silexphp/Silex.git",
+ "reference": "49ca08d853731d1635374e5019c8696cfd53c161"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/silexphp/Silex/zipball/49ca08d853731d1635374e5019c8696cfd53c161",
+ "reference": "49ca08d853731d1635374e5019c8696cfd53c161",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "pimple/pimple": "~3.0",
+ "symfony/event-dispatcher": "~2.8|^3.0",
+ "symfony/http-foundation": "~2.8|^3.0",
+ "symfony/http-kernel": "~2.8|^3.0",
+ "symfony/routing": "~2.8|^3.0"
+ },
+ "replace": {
+ "silex/api": "self.version",
+ "silex/providers": "self.version"
+ },
+ "require-dev": {
+ "doctrine/dbal": "~2.2",
+ "monolog/monolog": "^1.4.1",
+ "swiftmailer/swiftmailer": "~5",
+ "symfony/asset": "~2.8|^3.0",
+ "symfony/browser-kit": "~2.8|^3.0",
+ "symfony/config": "~2.8|^3.0",
+ "symfony/css-selector": "~2.8|^3.0",
+ "symfony/debug": "~2.8|^3.0",
+ "symfony/doctrine-bridge": "~2.8|^3.0",
+ "symfony/dom-crawler": "~2.8|^3.0",
+ "symfony/expression-language": "~2.8|^3.0",
+ "symfony/finder": "~2.8|^3.0",
+ "symfony/form": "~2.8|^3.0",
+ "symfony/intl": "~2.8|^3.0",
+ "symfony/monolog-bridge": "~2.8|^3.0",
+ "symfony/options-resolver": "~2.8|^3.0",
+ "symfony/phpunit-bridge": "~2.8|^3.0",
+ "symfony/process": "~2.8|^3.0",
+ "symfony/security": "~2.8|^3.0",
+ "symfony/serializer": "~2.8|^3.0",
+ "symfony/translation": "~2.8|^3.0",
+ "symfony/twig-bridge": "~2.8|^3.0",
+ "symfony/validator": "~2.8|^3.0",
+ "symfony/var-dumper": "~2.8|^3.0",
+ "twig/twig": "~1.27|~2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Silex\\": "src/Silex"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ }
+ ],
+ "description": "The PHP micro-framework based on the Symfony Components",
+ "homepage": "http://silex.sensiolabs.org",
+ "keywords": [
+ "microframework"
+ ],
+ "time": "2016-11-06 18:09:06"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
+ "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "psr/log": "~1.0"
+ },
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ },
+ "require-dev": {
+ "symfony/class-loader": "~2.8|~3.0",
+ "symfony/http-kernel": "~2.8|~3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-11-16 22:18:16"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e8f47a327c2f0fd5aa04fa60af2b693006ed7283",
+ "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "~2.8|~3.0",
+ "symfony/dependency-injection": "~2.8|~3.0",
+ "symfony/expression-language": "~2.8|~3.0",
+ "symfony/stopwatch": "~2.8|~3.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-10-13 06:29:04"
+ },
+ {
+ "name": "symfony/http-foundation",
+ "version": "v3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-foundation.git",
+ "reference": "9963bc29d7f4398b137dd8efc480efe54fdbe5f1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9963bc29d7f4398b137dd8efc480efe54fdbe5f1",
+ "reference": "9963bc29d7f4398b137dd8efc480efe54fdbe5f1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "symfony/polyfill-mbstring": "~1.1"
+ },
+ "require-dev": {
+ "symfony/expression-language": "~2.8|~3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\HttpFoundation\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpFoundation Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-11-27 04:21:38"
+ },
+ {
+ "name": "symfony/http-kernel",
+ "version": "v3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-kernel.git",
+ "reference": "8fedefadee9c91567414a07130c81e7c406fe68a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8fedefadee9c91567414a07130c81e7c406fe68a",
+ "reference": "8fedefadee9c91567414a07130c81e7c406fe68a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "psr/log": "~1.0",
+ "symfony/debug": "~2.8|~3.0",
+ "symfony/event-dispatcher": "~2.8|~3.0",
+ "symfony/http-foundation": "~2.8.13|~3.1.6|~3.2"
+ },
+ "conflict": {
+ "symfony/config": "<2.8"
+ },
+ "require-dev": {
+ "symfony/browser-kit": "~2.8|~3.0",
+ "symfony/class-loader": "~2.8|~3.0",
+ "symfony/config": "~2.8|~3.0",
+ "symfony/console": "~2.8|~3.0",
+ "symfony/css-selector": "~2.8|~3.0",
+ "symfony/dependency-injection": "~2.8|~3.0",
+ "symfony/dom-crawler": "~2.8|~3.0",
+ "symfony/expression-language": "~2.8|~3.0",
+ "symfony/finder": "~2.8|~3.0",
+ "symfony/process": "~2.8|~3.0",
+ "symfony/routing": "~2.8|~3.0",
+ "symfony/stopwatch": "~2.8|~3.0",
+ "symfony/templating": "~2.8|~3.0",
+ "symfony/translation": "~2.8|~3.0",
+ "symfony/var-dumper": "~3.2"
+ },
+ "suggest": {
+ "symfony/browser-kit": "",
+ "symfony/class-loader": "",
+ "symfony/config": "",
+ "symfony/console": "",
+ "symfony/dependency-injection": "",
+ "symfony/finder": "",
+ "symfony/var-dumper": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\HttpKernel\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpKernel Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-12-13 13:19:46"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2016-11-14 01:06:16"
+ },
+ {
+ "name": "symfony/routing",
+ "version": "v3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/routing.git",
+ "reference": "3f239c0e049d8920928674cd55e21061182b0106"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/3f239c0e049d8920928674cd55e21061182b0106",
+ "reference": "3f239c0e049d8920928674cd55e21061182b0106",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "conflict": {
+ "symfony/config": "<2.8"
+ },
+ "require-dev": {
+ "doctrine/annotations": "~1.0",
+ "doctrine/common": "~2.2",
+ "psr/log": "~1.0",
+ "symfony/config": "~2.8|~3.0",
+ "symfony/expression-language": "~2.8|~3.0",
+ "symfony/http-foundation": "~2.8|~3.0",
+ "symfony/yaml": "~2.8|~3.0"
+ },
+ "suggest": {
+ "doctrine/annotations": "For using the annotation loader",
+ "symfony/config": "For using the all-in-one router or any loader",
+ "symfony/dependency-injection": "For loading routes from a service",
+ "symfony/expression-language": "For using expression matching",
+ "symfony/http-foundation": "For using a Symfony Request object",
+ "symfony/yaml": "For using the YAML loader"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Routing\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Routing Component",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "router",
+ "routing",
+ "uri",
+ "url"
+ ],
+ "time": "2016-11-25 12:32:42"
+ },
+ {
+ "name": "symfony/var-dumper",
+ "version": "v3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/var-dumper.git",
+ "reference": "f722532b0966e9b6fc631e682143c07b2cf583a0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f722532b0966e9b6fc631e682143c07b2cf583a0",
+ "reference": "f722532b0966e9b6fc631e682143c07b2cf583a0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "require-dev": {
+ "twig/twig": "~1.20|~2.0"
+ },
+ "suggest": {
+ "ext-symfony_debug": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "Resources/functions/dump.php"
+ ],
+ "psr-4": {
+ "Symfony\\Component\\VarDumper\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony mechanism for exploring and dumping PHP variables",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "debug",
+ "dump"
+ ],
+ "time": "2016-12-11 14:34:22"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": []
+}
diff --git a/data/schema.sql b/data/schema.sql
new file mode 100644
index 00000000..eeb0430d
--- /dev/null
+++ b/data/schema.sql
@@ -0,0 +1,8 @@
+DROP TABLE IF EXISTS user;
+CREATE TABLE user (id INTEGER PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), username VARCHAR(100), password VARCHAR(255), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP , updated_at TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
+INSERT INTO user (name, username, password) VALUES ('User', 'user', '16MPw8fXNKuLw');
+DROP TABLE IF EXISTS penguin;
+CREATE TABLE penguin (id INTEGER PRIMARY KEY AUTO_INCREMENT, name VARCHAR (255) NOT NULL, age INT, species VARCHAR(150), gender CHAR(1), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP , updated_at TIMESTAMP ON UPDATE CURRENT_TIMESTAMP );
+INSERT INTO penguin (name, age, species, gender) VALUES ('Penguin 1', 25, 'yellow-eyed penguin', 'F');
+INSERT INTO penguin (name, age, species, gender) VALUES ('Penguin 2', 27, 'king penguin', 'M');
+INSERT INTO penguin (name, age, species, gender) VALUES ('Penguin 3', 15, 'emperor penguin', 'F');
diff --git a/public/.htaccess b/public/.htaccess
new file mode 100644
index 00000000..22b3056f
--- /dev/null
+++ b/public/.htaccess
@@ -0,0 +1,19 @@
+
+
+ Options -MultiViews
+
+
+ RewriteEngine On
+ Options FollowSymLinks
+ AllowOverride All
+ Allow from all
+
+ # Redirect Trailing Slashes If Not A Folder...
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^(.*)/$ /$1 [L,R=301]
+
+ # Handle Front Controller...
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^ index.php [L]
+
\ No newline at end of file
diff --git a/public/index.php b/public/index.php
new file mode 100644
index 00000000..0b05def5
--- /dev/null
+++ b/public/index.php
@@ -0,0 +1,11 @@
+ $issuedAt,
+ 'exp' => $expire,
+ 'nbf' => $issuedAt - 1,
+ 'data' => $options['userdata'],
+ ];
+
+ return JWT::encode($tokenParam, self::KEY);
+ }
+
+ /**
+ * Decodifica token jwt
+ */
+ public static function decode($jwt)
+ {
+ return JWT::decode($jwt, self::KEY, ['HS256']);
+ }
+}
\ No newline at end of file
diff --git a/src/app.php b/src/app.php
new file mode 100644
index 00000000..e023322d
--- /dev/null
+++ b/src/app.php
@@ -0,0 +1,104 @@
+register(new Silex\Provider\DoctrineServiceProvider(), array(
+ 'db.options' => array(
+ 'driver' => 'pdo_mysql',
+ 'host' => 'localhost',
+ 'dbname' => 'serasaphp',
+ 'user' => 'root',
+ 'password' => 'root'
+ ),
+));
+
+$app->get('/', function() use ($app) {
+ $subRequest = Request::create('/admin/penguins', 'GET');
+ return $app->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
+});
+
+// Autenticacao
+$app->post('/auth', function (Request $request) use ($app) {
+ $dados = json_decode($request->getContent(), true);
+
+
+ $encoded = crypt($dados['password'], 16);
+
+ $db = $app['db'];
+ $sql = "SELECT * FROM user WHERE username = ? AND password = ?;";
+ $stmt = $db->prepare($sql);
+ $stmt->bindValue(1, $dados['username']);
+ $stmt->bindValue(2, $encoded);
+ $stmt->execute();
+ $user = $stmt->fetch();
+
+ if(!empty($user)) {
+ // autenticacao valida, gerar token
+ $jwt = JWTWrapper::encode([
+ 'expiration_sec' => 3600,
+ 'userdata' => [
+ 'id' => $user['id'],
+ 'name' => $user['name']
+ ]
+ ]);
+
+ return $app->json([
+ 'login' => 'true',
+ 'access_token' => $jwt
+ ]);
+ }
+
+ return $app->json([
+ 'login' => 'false',
+ 'message' => 'Invalid login',
+ ]);
+});
+
+// verificar autenticacao
+$app->before(function(Request $request, $app) {
+ $route = $request->get('_route');
+
+ if($route != 'POST_auth' && $route != 'GET_create_table') {
+ $authorization = $request->headers->get("Authorization");
+ list($jwt) = sscanf($authorization, 'Bearer %s');
+
+ if($jwt) {
+ try {
+ $app['jwt'] = JWTWrapper::decode($jwt);
+ } catch(Exception $ex) {
+ return $app->json(["status" => "error", "message" => "Invalid token !"]);
+ }
+ } else {
+ return $app->json(["status" => "error", "message" => "Token was not informed !"]);
+ }
+ }
+});
+
+$app->get('/create-table', function (Silex\Application $app) {
+ $file = fopen(__DIR__ . '/../data/schema.sql', 'r');
+ while ($line = fread($file, 4096)) {
+ $app['db']->executeQuery($line);
+ }
+ fclose($file);
+ return $app->json(["status" => "success", "message" => "Tabelas criadas"]);
+});
+
+$app->mount('/admin', function($admin) use($app){
+ $penguins = include __DIR__ . '/controllers/penguins.php';
+ $admin->mount('/penguins', $penguins);
+});
+
+$app->error(function(\Exception $e, Request $request, $code) use($app){
+ switch ($code){
+ case 404:
+ return $e->getMessage();
+ }
+});
+
+$app->run();
+
diff --git a/src/controllers/penguins.php b/src/controllers/penguins.php
new file mode 100644
index 00000000..41c2f07c
--- /dev/null
+++ b/src/controllers/penguins.php
@@ -0,0 +1,66 @@
+get('/', function () use ($app) {
+ /** @var \Doctrine\DBAL\Connection $db */
+ $db = $app['db'];
+ $sql = "SELECT * FROM penguin;";
+ $penguins = $db->fetchAll($sql);
+ return new JsonResponse(["status" => "success", "result" => $penguins]);
+});
+
+$penguin->post('/create', function (Request $request) use ($app) {
+ /** @var \Doctrine\DBAL\Connection $db */
+ $db = $app['db'];
+ $data = json_decode($request->getContent(), true);
+ $db->insert('penguin', [
+ 'name' => $data['name'],
+ 'age' => $data['age'],
+ 'species' => $data['species'],
+ 'gender' => $data['gender']
+ ]);
+ return new JsonResponse(["status" => "success", "message" => "the penguin has been created !"]);
+});
+
+
+$penguin->get('/find/{id}', function ($id) use ($app) {
+ /** @var \Doctrine\DBAL\Connection $db */
+ $db = $app['db'];
+ $sql = "SELECT * FROM penguin WHERE id = ?;";
+ $penguin = $db->fetchAssoc($sql, [$id]);
+ if(!$penguin){
+ return new JsonResponse(["error" => "Penguin not found !"]);
+ }
+ return new JsonResponse(["status" => "success", "result" => $penguin]);
+});
+
+$penguin->put('/edit/{id}', function (Request $request, $id) use ($app) {
+ /** @var \Doctrine\DBAL\Connection $db */
+ $db = $app['db'];
+ $sql = "SELECT * FROM penguin WHERE id = ?;";
+ $penguin = $db->fetchAssoc($sql, [$id]);
+ if(!$penguin){
+ return new JsonResponse(["error" => "Penguin not found !"]);
+ }
+ $data = $request->request->all();
+ $db->update('penguin', $data, ['id' => $id]);
+ return new JsonResponse(["status" => "success", "message" => "the penguin has been updated !"]);
+});
+
+$penguin->delete('/delete/{id}', function ($id) use ($app) {
+ /** @var \Doctrine\DBAL\Connection $db */
+ $db = $app['db'];
+ $sql = "SELECT * FROM penguin WHERE id = ?;";
+ $penguin = $db->fetchAssoc($sql, [$id]);
+ if(!$penguin){
+ return new JsonResponse(["error" => "Penguin not found !"]);
+ }
+ $db->delete('penguin', ['id' => $id]);
+ return new JsonResponse(["status" => "success", "message" => "the penguin has been deleted !"]);
+});
+
+return $penguin;
\ No newline at end of file
diff --git a/vendor/autoload.php b/vendor/autoload.php
new file mode 100644
index 00000000..32d6f465
--- /dev/null
+++ b/vendor/autoload.php
@@ -0,0 +1,7 @@
+/dev/null 2>&1; then
+ # Cygwin paths start with /cygdrive/ which will break windows PHP,
+ # so we need to translate the dir path to windows format. However
+ # we could be using cygwin PHP which does not require this, so we
+ # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
+ if [[ $(which php) == /cygdrive/* ]]; then
+ dir=$(cygpath -m "$dir");
+ fi
+fi
+
+dir=$(echo $dir | sed 's/ /\ /g')
+"${dir}/doctrine-dbal" "$@"
diff --git a/vendor/bin/doctrine-dbal.bat b/vendor/bin/doctrine-dbal.bat
new file mode 100644
index 00000000..1551521d
--- /dev/null
+++ b/vendor/bin/doctrine-dbal.bat
@@ -0,0 +1,4 @@
+@ECHO OFF
+setlocal DISABLEDELAYEDEXPANSION
+SET BIN_TARGET=%~dp0/../doctrine/dbal/bin/doctrine-dbal
+php "%BIN_TARGET%" %*
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
new file mode 100644
index 00000000..ac67d302
--- /dev/null
+++ b/vendor/composer/ClassLoader.php
@@ -0,0 +1,415 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ * $loader = new \Composer\Autoload\ClassLoader();
+ *
+ * // register classes with namespaces
+ * $loader->add('Symfony\Component', __DIR__.'/component');
+ * $loader->add('Symfony', __DIR__.'/framework');
+ *
+ * // activate the autoloader
+ * $loader->register();
+ *
+ * // to enable searching the include path (eg. for PEAR packages)
+ * $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier
+ * @author Jordi Boggiano
+ * @see http://www.php-fig.org/psr/psr-0/
+ * @see http://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+ // PSR-4
+ private $prefixLengthsPsr4 = array();
+ private $prefixDirsPsr4 = array();
+ private $fallbackDirsPsr4 = array();
+
+ // PSR-0
+ private $prefixesPsr0 = array();
+ private $fallbackDirsPsr0 = array();
+
+ private $useIncludePath = false;
+ private $classMap = array();
+ private $classMapAuthoritative = false;
+ private $missingClasses = array();
+
+ public function getPrefixes()
+ {
+ if (!empty($this->prefixesPsr0)) {
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
+ }
+
+ return array();
+ }
+
+ public function getPrefixesPsr4()
+ {
+ return $this->prefixDirsPsr4;
+ }
+
+ public function getFallbackDirs()
+ {
+ return $this->fallbackDirsPsr0;
+ }
+
+ public function getFallbackDirsPsr4()
+ {
+ return $this->fallbackDirsPsr4;
+ }
+
+ public function getClassMap()
+ {
+ return $this->classMap;
+ }
+
+ /**
+ * @param array $classMap Class to filename map
+ */
+ public function addClassMap(array $classMap)
+ {
+ if ($this->classMap) {
+ $this->classMap = array_merge($this->classMap, $classMap);
+ } else {
+ $this->classMap = $classMap;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix, either
+ * appending or prepending to the ones previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ */
+ public function add($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ if ($prepend) {
+ $this->fallbackDirsPsr0 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr0
+ );
+ } else {
+ $this->fallbackDirsPsr0 = array_merge(
+ $this->fallbackDirsPsr0,
+ (array) $paths
+ );
+ }
+
+ return;
+ }
+
+ $first = $prefix[0];
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+ return;
+ }
+ if ($prepend) {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixesPsr0[$first][$prefix]
+ );
+ } else {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $this->prefixesPsr0[$first][$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace, either
+ * appending or prepending to the ones previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function addPsr4($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ // Register directories for the root namespace.
+ if ($prepend) {
+ $this->fallbackDirsPsr4 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr4
+ );
+ } else {
+ $this->fallbackDirsPsr4 = array_merge(
+ $this->fallbackDirsPsr4,
+ (array) $paths
+ );
+ }
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ // Register directories for a new namespace.
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ } elseif ($prepend) {
+ // Prepend directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixDirsPsr4[$prefix]
+ );
+ } else {
+ // Append directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $this->prefixDirsPsr4[$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix,
+ * replacing any others previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 base directories
+ */
+ public function set($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr0 = (array) $paths;
+ } else {
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace,
+ * replacing any others previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function setPsr4($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr4 = (array) $paths;
+ } else {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Turns on searching the include path for class files.
+ *
+ * @param bool $useIncludePath
+ */
+ public function setUseIncludePath($useIncludePath)
+ {
+ $this->useIncludePath = $useIncludePath;
+ }
+
+ /**
+ * Can be used to check if the autoloader uses the include path to check
+ * for classes.
+ *
+ * @return bool
+ */
+ public function getUseIncludePath()
+ {
+ return $this->useIncludePath;
+ }
+
+ /**
+ * Turns off searching the prefix and fallback directories for classes
+ * that have not been registered with the class map.
+ *
+ * @param bool $classMapAuthoritative
+ */
+ public function setClassMapAuthoritative($classMapAuthoritative)
+ {
+ $this->classMapAuthoritative = $classMapAuthoritative;
+ }
+
+ /**
+ * Should class lookup fail if not found in the current class map?
+ *
+ * @return bool
+ */
+ public function isClassMapAuthoritative()
+ {
+ return $this->classMapAuthoritative;
+ }
+
+ /**
+ * Registers this instance as an autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+ }
+
+ /**
+ * Unregisters this instance as an autoloader.
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $class The name of the class
+ * @return bool|null True if loaded, null otherwise
+ */
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ includeFile($file);
+
+ return true;
+ }
+ }
+
+ /**
+ * Finds the path to the file where the class is defined.
+ *
+ * @param string $class The name of the class
+ *
+ * @return string|false The path if found, false otherwise
+ */
+ public function findFile($class)
+ {
+ // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
+ if ('\\' == $class[0]) {
+ $class = substr($class, 1);
+ }
+
+ // class map lookup
+ if (isset($this->classMap[$class])) {
+ return $this->classMap[$class];
+ }
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ return false;
+ }
+
+ $file = $this->findFileWithExtension($class, '.php');
+
+ // Search for Hack files if we are running on HHVM
+ if (false === $file && defined('HHVM_VERSION')) {
+ $file = $this->findFileWithExtension($class, '.hh');
+ }
+
+ if (false === $file) {
+ // Remember that this class does not exist.
+ $this->missingClasses[$class] = true;
+ }
+
+ return $file;
+ }
+
+ private function findFileWithExtension($class, $ext)
+ {
+ // PSR-4 lookup
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+ $first = $class[0];
+ if (isset($this->prefixLengthsPsr4[$first])) {
+ foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-4 fallback dirs
+ foreach ($this->fallbackDirsPsr4 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 lookup
+ if (false !== $pos = strrpos($class, '\\')) {
+ // namespaced class name
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ } else {
+ // PEAR-like class name
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ }
+
+ if (isset($this->prefixesPsr0[$first])) {
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-0 fallback dirs
+ foreach ($this->fallbackDirsPsr0 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 include paths.
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+ return $file;
+ }
+
+ return false;
+ }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ */
+function includeFile($file)
+{
+ include $file;
+}
diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE
new file mode 100644
index 00000000..1a281248
--- /dev/null
+++ b/vendor/composer/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) 2016 Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
new file mode 100644
index 00000000..7a91153b
--- /dev/null
+++ b/vendor/composer/autoload_classmap.php
@@ -0,0 +1,9 @@
+ $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
+ '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
+);
diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php
new file mode 100644
index 00000000..7d2f32ef
--- /dev/null
+++ b/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,14 @@
+ array($vendorDir . '/pimple/pimple/src'),
+ 'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/lib'),
+ 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'),
+ 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'),
+ 'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'),
+);
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
new file mode 100644
index 00000000..15a01d72
--- /dev/null
+++ b/vendor/composer/autoload_psr4.php
@@ -0,0 +1,23 @@
+ array($vendorDir . '/symfony/polyfill-mbstring'),
+ 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
+ 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
+ 'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
+ 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
+ 'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
+ 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
+ 'Silex\\' => array($vendorDir . '/silex/silex/src/Silex'),
+ 'SON\\' => array($baseDir . '/src'),
+ 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
+ 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'),
+ 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
+ 'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations'),
+ 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib/Doctrine/Common'),
+);
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
new file mode 100644
index 00000000..fe735205
--- /dev/null
+++ b/vendor/composer/autoload_real.php
@@ -0,0 +1,70 @@
+= 50600 && !defined('HHVM_VERSION');
+ if ($useStaticLoader) {
+ require_once __DIR__ . '/autoload_static.php';
+
+ call_user_func(\Composer\Autoload\ComposerStaticInitbf06b754274a58fc5816c75e2215ed56::getInitializer($loader));
+ } else {
+ $map = require __DIR__ . '/autoload_namespaces.php';
+ foreach ($map as $namespace => $path) {
+ $loader->set($namespace, $path);
+ }
+
+ $map = require __DIR__ . '/autoload_psr4.php';
+ foreach ($map as $namespace => $path) {
+ $loader->setPsr4($namespace, $path);
+ }
+
+ $classMap = require __DIR__ . '/autoload_classmap.php';
+ if ($classMap) {
+ $loader->addClassMap($classMap);
+ }
+ }
+
+ $loader->register(true);
+
+ if ($useStaticLoader) {
+ $includeFiles = Composer\Autoload\ComposerStaticInitbf06b754274a58fc5816c75e2215ed56::$files;
+ } else {
+ $includeFiles = require __DIR__ . '/autoload_files.php';
+ }
+ foreach ($includeFiles as $fileIdentifier => $file) {
+ composerRequirebf06b754274a58fc5816c75e2215ed56($fileIdentifier, $file);
+ }
+
+ return $loader;
+ }
+}
+
+function composerRequirebf06b754274a58fc5816c75e2215ed56($fileIdentifier, $file)
+{
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
+ require $file;
+
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+ }
+}
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
new file mode 100644
index 00000000..3451c0a6
--- /dev/null
+++ b/vendor/composer/autoload_static.php
@@ -0,0 +1,140 @@
+ __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
+ '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
+ );
+
+ public static $prefixLengthsPsr4 = array (
+ 'S' =>
+ array (
+ 'Symfony\\Polyfill\\Mbstring\\' => 26,
+ 'Symfony\\Component\\VarDumper\\' => 28,
+ 'Symfony\\Component\\Routing\\' => 26,
+ 'Symfony\\Component\\HttpKernel\\' => 29,
+ 'Symfony\\Component\\HttpFoundation\\' => 33,
+ 'Symfony\\Component\\EventDispatcher\\' => 34,
+ 'Symfony\\Component\\Debug\\' => 24,
+ 'Silex\\' => 6,
+ 'SON\\' => 4,
+ ),
+ 'P' =>
+ array (
+ 'Psr\\Log\\' => 8,
+ ),
+ 'F' =>
+ array (
+ 'Firebase\\JWT\\' => 13,
+ ),
+ 'D' =>
+ array (
+ 'Doctrine\\Common\\Cache\\' => 22,
+ 'Doctrine\\Common\\Annotations\\' => 28,
+ 'Doctrine\\Common\\' => 16,
+ ),
+ );
+
+ public static $prefixDirsPsr4 = array (
+ 'Symfony\\Polyfill\\Mbstring\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
+ ),
+ 'Symfony\\Component\\VarDumper\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/var-dumper',
+ ),
+ 'Symfony\\Component\\Routing\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/routing',
+ ),
+ 'Symfony\\Component\\HttpKernel\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/http-kernel',
+ ),
+ 'Symfony\\Component\\HttpFoundation\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/http-foundation',
+ ),
+ 'Symfony\\Component\\EventDispatcher\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/event-dispatcher',
+ ),
+ 'Symfony\\Component\\Debug\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/debug',
+ ),
+ 'Silex\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/silex/silex/src/Silex',
+ ),
+ 'SON\\' =>
+ array (
+ 0 => __DIR__ . '/../..' . '/src',
+ ),
+ 'Psr\\Log\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
+ ),
+ 'Firebase\\JWT\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/firebase/php-jwt/src',
+ ),
+ 'Doctrine\\Common\\Cache\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache',
+ ),
+ 'Doctrine\\Common\\Annotations\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/doctrine/annotations/lib/Doctrine/Common/Annotations',
+ ),
+ 'Doctrine\\Common\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/doctrine/common/lib/Doctrine/Common',
+ ),
+ );
+
+ public static $prefixesPsr0 = array (
+ 'P' =>
+ array (
+ 'Pimple' =>
+ array (
+ 0 => __DIR__ . '/..' . '/pimple/pimple/src',
+ ),
+ ),
+ 'D' =>
+ array (
+ 'Doctrine\\DBAL\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/doctrine/dbal/lib',
+ ),
+ 'Doctrine\\Common\\Lexer\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/doctrine/lexer/lib',
+ ),
+ 'Doctrine\\Common\\Inflector\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/doctrine/inflector/lib',
+ ),
+ 'Doctrine\\Common\\Collections\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/doctrine/collections/lib',
+ ),
+ ),
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixLengthsPsr4 = ComposerStaticInitbf06b754274a58fc5816c75e2215ed56::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInitbf06b754274a58fc5816c75e2215ed56::$prefixDirsPsr4;
+ $loader->prefixesPsr0 = ComposerStaticInitbf06b754274a58fc5816c75e2215ed56::$prefixesPsr0;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
new file mode 100644
index 00000000..9a3b2446
--- /dev/null
+++ b/vendor/composer/installed.json
@@ -0,0 +1,1180 @@
+[
+ {
+ "name": "doctrine/lexer",
+ "version": "v1.0.1",
+ "version_normalized": "1.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/lexer.git",
+ "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "time": "2014-09-09 13:34:57",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Lexer\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "lexer",
+ "parser"
+ ]
+ },
+ {
+ "name": "doctrine/annotations",
+ "version": "v1.3.0",
+ "version_normalized": "1.3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/annotations.git",
+ "reference": "30e07cf03edc3cd3ef579d0dd4dd8c58250799a5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/30e07cf03edc3cd3ef579d0dd4dd8c58250799a5",
+ "reference": "30e07cf03edc3cd3ef579d0dd4dd8c58250799a5",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/lexer": "1.*",
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "doctrine/cache": "1.*",
+ "phpunit/phpunit": "^5.6.1"
+ },
+ "time": "2016-10-24 11:45:47",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Docblock Annotations Parser",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "parser"
+ ]
+ },
+ {
+ "name": "doctrine/cache",
+ "version": "v1.6.1",
+ "version_normalized": "1.6.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/cache.git",
+ "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/cache/zipball/b6f544a20f4807e81f7044d31e679ccbb1866dc3",
+ "reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3",
+ "shasum": ""
+ },
+ "require": {
+ "php": "~5.5|~7.0"
+ },
+ "conflict": {
+ "doctrine/common": ">2.2,<2.4"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8|~5.0",
+ "predis/predis": "~1.0",
+ "satooshi/php-coveralls": "~0.6"
+ },
+ "time": "2016-10-29 11:16:17",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.6.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Caching library offering an object-oriented API for many cache backends",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "cache",
+ "caching"
+ ]
+ },
+ {
+ "name": "doctrine/collections",
+ "version": "v1.3.0",
+ "version_normalized": "1.3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/collections.git",
+ "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
+ "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "time": "2015-04-14 22:21:58",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Collections\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Collections Abstraction library",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "array",
+ "collections",
+ "iterator"
+ ]
+ },
+ {
+ "name": "doctrine/inflector",
+ "version": "v1.1.0",
+ "version_normalized": "1.1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/inflector.git",
+ "reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
+ "reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*"
+ },
+ "time": "2015-11-06 14:35:42",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Inflector\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Common String Manipulations with regard to casing and singular/plural rules.",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "inflection",
+ "pluralize",
+ "singularize",
+ "string"
+ ]
+ },
+ {
+ "name": "doctrine/common",
+ "version": "v2.6.2",
+ "version_normalized": "2.6.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/common.git",
+ "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
+ "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/annotations": "1.*",
+ "doctrine/cache": "1.*",
+ "doctrine/collections": "1.*",
+ "doctrine/inflector": "1.*",
+ "doctrine/lexer": "1.*",
+ "php": "~5.5|~7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8|~5.0"
+ },
+ "time": "2016-11-30 16:50:46",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.7.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\": "lib/Doctrine/Common"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Common Library for Doctrine projects",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "collections",
+ "eventmanager",
+ "persistence",
+ "spl"
+ ]
+ },
+ {
+ "name": "doctrine/dbal",
+ "version": "v2.5.5",
+ "version_normalized": "2.5.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/dbal.git",
+ "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/dbal/zipball/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
+ "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/common": ">=2.4,<2.7-dev",
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*",
+ "symfony/console": "2.*||^3.0"
+ },
+ "suggest": {
+ "symfony/console": "For helpful console commands such as SQL execution and import of files."
+ },
+ "time": "2016-09-09 19:13:33",
+ "bin": [
+ "bin/doctrine-dbal"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\DBAL\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ }
+ ],
+ "description": "Database Abstraction Layer",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "database",
+ "dbal",
+ "persistence",
+ "queryobject"
+ ]
+ },
+ {
+ "name": "symfony/routing",
+ "version": "v3.2.1",
+ "version_normalized": "3.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/routing.git",
+ "reference": "3f239c0e049d8920928674cd55e21061182b0106"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/3f239c0e049d8920928674cd55e21061182b0106",
+ "reference": "3f239c0e049d8920928674cd55e21061182b0106",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "conflict": {
+ "symfony/config": "<2.8"
+ },
+ "require-dev": {
+ "doctrine/annotations": "~1.0",
+ "doctrine/common": "~2.2",
+ "psr/log": "~1.0",
+ "symfony/config": "~2.8|~3.0",
+ "symfony/expression-language": "~2.8|~3.0",
+ "symfony/http-foundation": "~2.8|~3.0",
+ "symfony/yaml": "~2.8|~3.0"
+ },
+ "suggest": {
+ "doctrine/annotations": "For using the annotation loader",
+ "symfony/config": "For using the all-in-one router or any loader",
+ "symfony/dependency-injection": "For loading routes from a service",
+ "symfony/expression-language": "For using expression matching",
+ "symfony/http-foundation": "For using a Symfony Request object",
+ "symfony/yaml": "For using the YAML loader"
+ },
+ "time": "2016-11-25 12:32:42",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Routing\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Routing Component",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "router",
+ "routing",
+ "uri",
+ "url"
+ ]
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.3.0",
+ "version_normalized": "1.3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "time": "2016-11-14 01:06:16",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ]
+ },
+ {
+ "name": "symfony/http-foundation",
+ "version": "v3.2.1",
+ "version_normalized": "3.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-foundation.git",
+ "reference": "9963bc29d7f4398b137dd8efc480efe54fdbe5f1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9963bc29d7f4398b137dd8efc480efe54fdbe5f1",
+ "reference": "9963bc29d7f4398b137dd8efc480efe54fdbe5f1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "symfony/polyfill-mbstring": "~1.1"
+ },
+ "require-dev": {
+ "symfony/expression-language": "~2.8|~3.0"
+ },
+ "time": "2016-11-27 04:21:38",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\HttpFoundation\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpFoundation Component",
+ "homepage": "https://symfony.com"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v3.2.1",
+ "version_normalized": "3.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e8f47a327c2f0fd5aa04fa60af2b693006ed7283",
+ "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "~2.8|~3.0",
+ "symfony/dependency-injection": "~2.8|~3.0",
+ "symfony/expression-language": "~2.8|~3.0",
+ "symfony/stopwatch": "~2.8|~3.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "time": "2016-10-13 06:29:04",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "https://symfony.com"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "version_normalized": "1.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2016-10-10 12:19:37",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ]
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v3.2.1",
+ "version_normalized": "3.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
+ "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "psr/log": "~1.0"
+ },
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ },
+ "require-dev": {
+ "symfony/class-loader": "~2.8|~3.0",
+ "symfony/http-kernel": "~2.8|~3.0"
+ },
+ "time": "2016-11-16 22:18:16",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com"
+ },
+ {
+ "name": "symfony/http-kernel",
+ "version": "v3.2.1",
+ "version_normalized": "3.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-kernel.git",
+ "reference": "8fedefadee9c91567414a07130c81e7c406fe68a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8fedefadee9c91567414a07130c81e7c406fe68a",
+ "reference": "8fedefadee9c91567414a07130c81e7c406fe68a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "psr/log": "~1.0",
+ "symfony/debug": "~2.8|~3.0",
+ "symfony/event-dispatcher": "~2.8|~3.0",
+ "symfony/http-foundation": "~2.8.13|~3.1.6|~3.2"
+ },
+ "conflict": {
+ "symfony/config": "<2.8"
+ },
+ "require-dev": {
+ "symfony/browser-kit": "~2.8|~3.0",
+ "symfony/class-loader": "~2.8|~3.0",
+ "symfony/config": "~2.8|~3.0",
+ "symfony/console": "~2.8|~3.0",
+ "symfony/css-selector": "~2.8|~3.0",
+ "symfony/dependency-injection": "~2.8|~3.0",
+ "symfony/dom-crawler": "~2.8|~3.0",
+ "symfony/expression-language": "~2.8|~3.0",
+ "symfony/finder": "~2.8|~3.0",
+ "symfony/process": "~2.8|~3.0",
+ "symfony/routing": "~2.8|~3.0",
+ "symfony/stopwatch": "~2.8|~3.0",
+ "symfony/templating": "~2.8|~3.0",
+ "symfony/translation": "~2.8|~3.0",
+ "symfony/var-dumper": "~3.2"
+ },
+ "suggest": {
+ "symfony/browser-kit": "",
+ "symfony/class-loader": "",
+ "symfony/config": "",
+ "symfony/console": "",
+ "symfony/dependency-injection": "",
+ "symfony/finder": "",
+ "symfony/var-dumper": ""
+ },
+ "time": "2016-12-13 13:19:46",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\HttpKernel\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpKernel Component",
+ "homepage": "https://symfony.com"
+ },
+ {
+ "name": "pimple/pimple",
+ "version": "v3.0.2",
+ "version_normalized": "3.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/silexphp/Pimple.git",
+ "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a",
+ "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2015-09-11 15:10:35",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Pimple": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Pimple, a simple Dependency Injection Container",
+ "homepage": "http://pimple.sensiolabs.org",
+ "keywords": [
+ "container",
+ "dependency injection"
+ ]
+ },
+ {
+ "name": "silex/silex",
+ "version": "v2.0.4",
+ "version_normalized": "2.0.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/silexphp/Silex.git",
+ "reference": "49ca08d853731d1635374e5019c8696cfd53c161"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/silexphp/Silex/zipball/49ca08d853731d1635374e5019c8696cfd53c161",
+ "reference": "49ca08d853731d1635374e5019c8696cfd53c161",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "pimple/pimple": "~3.0",
+ "symfony/event-dispatcher": "~2.8|^3.0",
+ "symfony/http-foundation": "~2.8|^3.0",
+ "symfony/http-kernel": "~2.8|^3.0",
+ "symfony/routing": "~2.8|^3.0"
+ },
+ "replace": {
+ "silex/api": "self.version",
+ "silex/providers": "self.version"
+ },
+ "require-dev": {
+ "doctrine/dbal": "~2.2",
+ "monolog/monolog": "^1.4.1",
+ "swiftmailer/swiftmailer": "~5",
+ "symfony/asset": "~2.8|^3.0",
+ "symfony/browser-kit": "~2.8|^3.0",
+ "symfony/config": "~2.8|^3.0",
+ "symfony/css-selector": "~2.8|^3.0",
+ "symfony/debug": "~2.8|^3.0",
+ "symfony/doctrine-bridge": "~2.8|^3.0",
+ "symfony/dom-crawler": "~2.8|^3.0",
+ "symfony/expression-language": "~2.8|^3.0",
+ "symfony/finder": "~2.8|^3.0",
+ "symfony/form": "~2.8|^3.0",
+ "symfony/intl": "~2.8|^3.0",
+ "symfony/monolog-bridge": "~2.8|^3.0",
+ "symfony/options-resolver": "~2.8|^3.0",
+ "symfony/phpunit-bridge": "~2.8|^3.0",
+ "symfony/process": "~2.8|^3.0",
+ "symfony/security": "~2.8|^3.0",
+ "symfony/serializer": "~2.8|^3.0",
+ "symfony/translation": "~2.8|^3.0",
+ "symfony/twig-bridge": "~2.8|^3.0",
+ "symfony/validator": "~2.8|^3.0",
+ "symfony/var-dumper": "~2.8|^3.0",
+ "twig/twig": "~1.27|~2.0"
+ },
+ "time": "2016-11-06 18:09:06",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Silex\\": "src/Silex"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ }
+ ],
+ "description": "The PHP micro-framework based on the Symfony Components",
+ "homepage": "http://silex.sensiolabs.org",
+ "keywords": [
+ "microframework"
+ ]
+ },
+ {
+ "name": "symfony/var-dumper",
+ "version": "v3.2.1",
+ "version_normalized": "3.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/var-dumper.git",
+ "reference": "f722532b0966e9b6fc631e682143c07b2cf583a0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f722532b0966e9b6fc631e682143c07b2cf583a0",
+ "reference": "f722532b0966e9b6fc631e682143c07b2cf583a0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "require-dev": {
+ "twig/twig": "~1.20|~2.0"
+ },
+ "suggest": {
+ "ext-symfony_debug": ""
+ },
+ "time": "2016-12-11 14:34:22",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "Resources/functions/dump.php"
+ ],
+ "psr-4": {
+ "Symfony\\Component\\VarDumper\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony mechanism for exploring and dumping PHP variables",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "debug",
+ "dump"
+ ]
+ },
+ {
+ "name": "firebase/php-jwt",
+ "version": "v5.0.0",
+ "version_normalized": "5.0.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/firebase/php-jwt.git",
+ "reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
+ "reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": " 4.8.35"
+ },
+ "time": "2017-06-27 22:17:23",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Firebase\\JWT\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Neuman Vong",
+ "email": "neuman+pear@twilio.com",
+ "role": "Developer"
+ },
+ {
+ "name": "Anant Narayanan",
+ "email": "anant@php.net",
+ "role": "Developer"
+ }
+ ],
+ "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
+ "homepage": "https://github.com/firebase/php-jwt"
+ }
+]
diff --git a/vendor/doctrine/annotations/CHANGELOG.md b/vendor/doctrine/annotations/CHANGELOG.md
new file mode 100644
index 00000000..2969c3bc
--- /dev/null
+++ b/vendor/doctrine/annotations/CHANGELOG.md
@@ -0,0 +1,84 @@
+## Changelog
+
+### 1.3.0
+
+This release introduces a PHP version bump. `doctrine/annotations` now requires PHP
+5.6 or later to be installed.
+
+A series of additional improvements have been introduced:
+
+ * support for PHP 7 "grouped use statements"
+ * support for ignoring entire namespace names
+ via `Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredNamespace()` and
+ `Doctrine\Common\Annotations\DocParser::setIgnoredAnnotationNamespaces()`. This will
+ allow you to ignore annotations from namespaces that you cannot autoload
+ * testing all parent classes and interfaces when checking if the annotation cache
+ in the `CachedReader` is fresh
+ * simplifying the cache keys used by the `CachedReader`: keys are no longer artificially
+ namespaced, since `Doctrine\Common\Cache` already supports that
+ * corrected parsing of multibyte strings when `mbstring.func_overload` is enabled
+ * corrected parsing of annotations when `"\t"` is put before the first annotation
+ in a docblock
+ * allow skipping non-imported annotations when a custom `DocParser` is passed to
+ the `AnnotationReader` constructor
+
+Total issues resolved: **15**
+
+- [45: DocParser can now ignore whole namespaces](https://github.com/doctrine/annotations/pull/45)
+- [57: Switch to the docker-based infrastructure on Travis](https://github.com/doctrine/annotations/pull/57)
+- [59: opcache.load_comments has been removed from PHP 7](https://github.com/doctrine/annotations/pull/59)
+- [62: [CachedReader\ Test traits and parent class to see if cache is fresh](https://github.com/doctrine/annotations/pull/62)
+- [65: Remove cache salt making key unnecessarily long](https://github.com/doctrine/annotations/pull/65)
+- [66: Fix of incorrect parsing multibyte strings](https://github.com/doctrine/annotations/pull/66)
+- [68: Annotations that are indented by tab are not processed.](https://github.com/doctrine/annotations/issues/68)
+- [69: Support for Group Use Statements](https://github.com/doctrine/annotations/pull/69)
+- [70: Allow tab character before first annotation in DocBlock](https://github.com/doctrine/annotations/pull/70)
+- [74: Ignore not registered annotations fix](https://github.com/doctrine/annotations/pull/74)
+- [92: Added tests for AnnotationRegistry class.](https://github.com/doctrine/annotations/pull/92)
+- [96: Fix/#62 check trait and parent class ttl in annotations](https://github.com/doctrine/annotations/pull/96)
+- [97: Feature - #45 - allow ignoring entire namespaces](https://github.com/doctrine/annotations/pull/97)
+- [98: Enhancement/#65 remove cache salt from cached reader](https://github.com/doctrine/annotations/pull/98)
+- [99: Fix - #70 - allow tab character before first annotation in docblock](https://github.com/doctrine/annotations/pull/99)
+
+### 1.2.4
+
+Total issues resolved: **1**
+
+- [51: FileCacheReader::saveCacheFile::unlink fix](https://github.com/doctrine/annotations/pull/51)
+
+### 1.2.3
+
+Total issues resolved: [**2**](https://github.com/doctrine/annotations/milestones/v1.2.3)
+
+- [49: #46 - applying correct `chmod()` to generated cache file](https://github.com/doctrine/annotations/pull/49)
+- [50: Hotfix: match escaped quotes (revert #44)](https://github.com/doctrine/annotations/pull/50)
+
+### 1.2.2
+
+Total issues resolved: **4**
+
+- [43: Exclude files from distribution with .gitattributes](https://github.com/doctrine/annotations/pull/43)
+- [44: Update DocLexer.php](https://github.com/doctrine/annotations/pull/44)
+- [46: A plain "file_put_contents" can cause havoc](https://github.com/doctrine/annotations/pull/46)
+- [48: Deprecating the `FileCacheReader` in 1.2.2: will be removed in 2.0.0](https://github.com/doctrine/annotations/pull/48)
+
+### 1.2.1
+
+Total issues resolved: **4**
+
+- [38: fixes doctrine/common#326](https://github.com/doctrine/annotations/pull/38)
+- [39: Remove superfluous NS](https://github.com/doctrine/annotations/pull/39)
+- [41: Warn if load_comments is not enabled.](https://github.com/doctrine/annotations/pull/41)
+- [42: Clean up unused uses](https://github.com/doctrine/annotations/pull/42)
+
+### 1.2.0
+
+ * HHVM support
+ * Allowing dangling comma in annotations
+ * Excluded annotations are no longer autoloaded
+ * Importing namespaces also in traits
+ * Added support for `::class` 5.5-style constant, works also in 5.3 and 5.4
+
+### 1.1.0
+
+ * Add Exception when ZendOptimizer+ or Opcache is configured to drop comments
diff --git a/vendor/doctrine/annotations/LICENSE b/vendor/doctrine/annotations/LICENSE
new file mode 100644
index 00000000..5e781fce
--- /dev/null
+++ b/vendor/doctrine/annotations/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2006-2013 Doctrine Project
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/doctrine/annotations/README.md b/vendor/doctrine/annotations/README.md
new file mode 100644
index 00000000..e9571deb
--- /dev/null
+++ b/vendor/doctrine/annotations/README.md
@@ -0,0 +1,9 @@
+# Doctrine Annotations
+
+[](https://travis-ci.org/doctrine/annotations)
+
+Docblock Annotations Parser library (extracted from [Doctrine Common](https://github.com/doctrine/common)).
+
+## Changelog
+
+See [CHANGELOG.md](CHANGELOG.md)
diff --git a/vendor/doctrine/annotations/composer.json b/vendor/doctrine/annotations/composer.json
new file mode 100644
index 00000000..6ef048dd
--- /dev/null
+++ b/vendor/doctrine/annotations/composer.json
@@ -0,0 +1,31 @@
+{
+ "name": "doctrine/annotations",
+ "type": "library",
+ "description": "Docblock Annotations Parser",
+ "keywords": ["annotations", "docblock", "parser"],
+ "homepage": "http://www.doctrine-project.org",
+ "license": "MIT",
+ "authors": [
+ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
+ {"name": "Roman Borschel", "email": "roman@code-factory.org"},
+ {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
+ {"name": "Jonathan Wage", "email": "jonwage@gmail.com"},
+ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
+ ],
+ "require": {
+ "php": "^5.6 || ^7.0",
+ "doctrine/lexer": "1.*"
+ },
+ "require-dev": {
+ "doctrine/cache": "1.*",
+ "phpunit/phpunit": "^5.6.1"
+ },
+ "autoload": {
+ "psr-4": { "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php
new file mode 100644
index 00000000..a79a0f8f
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php
@@ -0,0 +1,79 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Annotations class.
+ *
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+class Annotation
+{
+ /**
+ * Value property. Common among all derived classes.
+ *
+ * @var string
+ */
+ public $value;
+
+ /**
+ * Constructor.
+ *
+ * @param array $data Key-value for properties to be defined in this class.
+ */
+ public final function __construct(array $data)
+ {
+ foreach ($data as $key => $value) {
+ $this->$key = $value;
+ }
+ }
+
+ /**
+ * Error handler for unknown property accessor in Annotation class.
+ *
+ * @param string $name Unknown property name.
+ *
+ * @throws \BadMethodCallException
+ */
+ public function __get($name)
+ {
+ throw new \BadMethodCallException(
+ sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
+ );
+ }
+
+ /**
+ * Error handler for unknown property mutator in Annotation class.
+ *
+ * @param string $name Unknown property name.
+ * @param mixed $value Property value.
+ *
+ * @throws \BadMethodCallException
+ */
+ public function __set($name, $value)
+ {
+ throw new \BadMethodCallException(
+ sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
+ );
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php
new file mode 100644
index 00000000..dbef6df0
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php
@@ -0,0 +1,47 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check the attribute type during the parsing process.
+ *
+ * @author Fabio B. Silva
+ *
+ * @Annotation
+ */
+final class Attribute
+{
+ /**
+ * @var string
+ */
+ public $name;
+
+ /**
+ * @var string
+ */
+ public $type;
+
+ /**
+ * @var boolean
+ */
+ public $required = false;
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php
new file mode 100644
index 00000000..53134e30
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php
@@ -0,0 +1,37 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check the types of all declared attributes during the parsing process.
+ *
+ * @author Fabio B. Silva
+ *
+ * @Annotation
+ */
+final class Attributes
+{
+ /**
+ * @var array
+ */
+ public $value;
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php
new file mode 100644
index 00000000..e122a753
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php
@@ -0,0 +1,84 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check the available values during the parsing process.
+ *
+ * @since 2.4
+ * @author Fabio B. Silva
+ *
+ * @Annotation
+ * @Attributes({
+ * @Attribute("value", required = true, type = "array"),
+ * @Attribute("literal", required = false, type = "array")
+ * })
+ */
+final class Enum
+{
+ /**
+ * @var array
+ */
+ public $value;
+
+ /**
+ * Literal target declaration.
+ *
+ * @var array
+ */
+ public $literal;
+
+ /**
+ * Annotation constructor.
+ *
+ * @param array $values
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function __construct(array $values)
+ {
+ if ( ! isset($values['literal'])) {
+ $values['literal'] = array();
+ }
+
+ foreach ($values['value'] as $var) {
+ if( ! is_scalar($var)) {
+ throw new \InvalidArgumentException(sprintf(
+ '@Enum supports only scalar values "%s" given.',
+ is_object($var) ? get_class($var) : gettype($var)
+ ));
+ }
+ }
+
+ foreach ($values['literal'] as $key => $var) {
+ if( ! in_array($key, $values['value'])) {
+ throw new \InvalidArgumentException(sprintf(
+ 'Undefined enumerator value "%s" for literal "%s".',
+ $key , $var
+ ));
+ }
+ }
+
+ $this->value = $values['value'];
+ $this->literal = $values['literal'];
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
new file mode 100644
index 00000000..175226a6
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
@@ -0,0 +1,54 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser to ignore specific
+ * annotations during the parsing process.
+ *
+ * @Annotation
+ * @author Johannes M. Schmitt
+ */
+final class IgnoreAnnotation
+{
+ /**
+ * @var array
+ */
+ public $names;
+
+ /**
+ * Constructor.
+ *
+ * @param array $values
+ *
+ * @throws \RuntimeException
+ */
+ public function __construct(array $values)
+ {
+ if (is_string($values['value'])) {
+ $values['value'] = array($values['value']);
+ }
+ if (!is_array($values['value'])) {
+ throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value'])));
+ }
+
+ $this->names = $values['value'];
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php
new file mode 100644
index 00000000..d67f9606
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php
@@ -0,0 +1,33 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check if that attribute is required during the parsing process.
+ *
+ * @author Fabio B. Silva
+ *
+ * @Annotation
+ */
+final class Required
+{
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php
new file mode 100644
index 00000000..f6c54453
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php
@@ -0,0 +1,107 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check the annotation target during the parsing process.
+ *
+ * @author Fabio B. Silva
+ *
+ * @Annotation
+ */
+final class Target
+{
+ const TARGET_CLASS = 1;
+ const TARGET_METHOD = 2;
+ const TARGET_PROPERTY = 4;
+ const TARGET_ANNOTATION = 8;
+ const TARGET_ALL = 15;
+
+ /**
+ * @var array
+ */
+ private static $map = array(
+ 'ALL' => self::TARGET_ALL,
+ 'CLASS' => self::TARGET_CLASS,
+ 'METHOD' => self::TARGET_METHOD,
+ 'PROPERTY' => self::TARGET_PROPERTY,
+ 'ANNOTATION' => self::TARGET_ANNOTATION,
+ );
+
+ /**
+ * @var array
+ */
+ public $value;
+
+ /**
+ * Targets as bitmask.
+ *
+ * @var integer
+ */
+ public $targets;
+
+ /**
+ * Literal target declaration.
+ *
+ * @var integer
+ */
+ public $literal;
+
+ /**
+ * Annotation constructor.
+ *
+ * @param array $values
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function __construct(array $values)
+ {
+ if (!isset($values['value'])){
+ $values['value'] = null;
+ }
+ if (is_string($values['value'])){
+ $values['value'] = array($values['value']);
+ }
+ if (!is_array($values['value'])){
+ throw new \InvalidArgumentException(
+ sprintf('@Target expects either a string value, or an array of strings, "%s" given.',
+ is_object($values['value']) ? get_class($values['value']) : gettype($values['value'])
+ )
+ );
+ }
+
+ $bitmask = 0;
+ foreach ($values['value'] as $literal) {
+ if(!isset(self::$map[$literal])){
+ throw new \InvalidArgumentException(
+ sprintf('Invalid Target "%s". Available targets: [%s]',
+ $literal, implode(', ', array_keys(self::$map)))
+ );
+ }
+ $bitmask |= self::$map[$literal];
+ }
+
+ $this->targets = $bitmask;
+ $this->value = $values['value'];
+ $this->literal = implode(', ', $this->value);
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php
new file mode 100644
index 00000000..d06fe663
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php
@@ -0,0 +1,197 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Description of AnnotationException
+ *
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+class AnnotationException extends \Exception
+{
+ /**
+ * Creates a new AnnotationException describing a Syntax error.
+ *
+ * @param string $message Exception message
+ *
+ * @return AnnotationException
+ */
+ public static function syntaxError($message)
+ {
+ return new self('[Syntax Error] ' . $message);
+ }
+
+ /**
+ * Creates a new AnnotationException describing a Semantical error.
+ *
+ * @param string $message Exception message
+ *
+ * @return AnnotationException
+ */
+ public static function semanticalError($message)
+ {
+ return new self('[Semantical Error] ' . $message);
+ }
+
+ /**
+ * Creates a new AnnotationException describing an error which occurred during
+ * the creation of the annotation.
+ *
+ * @since 2.2
+ *
+ * @param string $message
+ *
+ * @return AnnotationException
+ */
+ public static function creationError($message)
+ {
+ return new self('[Creation Error] ' . $message);
+ }
+
+ /**
+ * Creates a new AnnotationException describing a type error.
+ *
+ * @since 1.1
+ *
+ * @param string $message
+ *
+ * @return AnnotationException
+ */
+ public static function typeError($message)
+ {
+ return new self('[Type Error] ' . $message);
+ }
+
+ /**
+ * Creates a new AnnotationException describing a constant semantical error.
+ *
+ * @since 2.3
+ *
+ * @param string $identifier
+ * @param string $context
+ *
+ * @return AnnotationException
+ */
+ public static function semanticalErrorConstants($identifier, $context = null)
+ {
+ return self::semanticalError(sprintf(
+ "Couldn't find constant %s%s.",
+ $identifier,
+ $context ? ', ' . $context : ''
+ ));
+ }
+
+ /**
+ * Creates a new AnnotationException describing an type error of an attribute.
+ *
+ * @since 2.2
+ *
+ * @param string $attributeName
+ * @param string $annotationName
+ * @param string $context
+ * @param string $expected
+ * @param mixed $actual
+ *
+ * @return AnnotationException
+ */
+ public static function attributeTypeError($attributeName, $annotationName, $context, $expected, $actual)
+ {
+ return self::typeError(sprintf(
+ 'Attribute "%s" of @%s declared on %s expects %s, but got %s.',
+ $attributeName,
+ $annotationName,
+ $context,
+ $expected,
+ is_object($actual) ? 'an instance of ' . get_class($actual) : gettype($actual)
+ ));
+ }
+
+ /**
+ * Creates a new AnnotationException describing an required error of an attribute.
+ *
+ * @since 2.2
+ *
+ * @param string $attributeName
+ * @param string $annotationName
+ * @param string $context
+ * @param string $expected
+ *
+ * @return AnnotationException
+ */
+ public static function requiredError($attributeName, $annotationName, $context, $expected)
+ {
+ return self::typeError(sprintf(
+ 'Attribute "%s" of @%s declared on %s expects %s. This value should not be null.',
+ $attributeName,
+ $annotationName,
+ $context,
+ $expected
+ ));
+ }
+
+ /**
+ * Creates a new AnnotationException describing a invalid enummerator.
+ *
+ * @since 2.4
+ *
+ * @param string $attributeName
+ * @param string $annotationName
+ * @param string $context
+ * @param array $available
+ * @param mixed $given
+ *
+ * @return AnnotationException
+ */
+ public static function enumeratorError($attributeName, $annotationName, $context, $available, $given)
+ {
+ return new self(sprintf(
+ '[Enum Error] Attribute "%s" of @%s declared on %s accept only [%s], but got %s.',
+ $attributeName,
+ $annotationName,
+ $context,
+ implode(', ', $available),
+ is_object($given) ? get_class($given) : $given
+ ));
+ }
+
+ /**
+ * @return AnnotationException
+ */
+ public static function optimizerPlusSaveComments()
+ {
+ return new self(
+ "You have to enable opcache.save_comments=1 or zend_optimizerplus.save_comments=1."
+ );
+ }
+
+ /**
+ * @return AnnotationException
+ */
+ public static function optimizerPlusLoadComments()
+ {
+ return new self(
+ "You have to enable opcache.load_comments=1 or zend_optimizerplus.load_comments=1."
+ );
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php
new file mode 100644
index 00000000..658e82f5
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php
@@ -0,0 +1,419 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation;
+use Doctrine\Common\Annotations\Annotation\Target;
+use ReflectionClass;
+use ReflectionMethod;
+use ReflectionProperty;
+
+/**
+ * A reader for docblock annotations.
+ *
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Johannes M. Schmitt
+ */
+class AnnotationReader implements Reader
+{
+ /**
+ * Global map for imports.
+ *
+ * @var array
+ */
+ private static $globalImports = array(
+ 'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation',
+ );
+
+ /**
+ * A list with annotations that are not causing exceptions when not resolved to an annotation class.
+ *
+ * The names are case sensitive.
+ *
+ * @var array
+ */
+ private static $globalIgnoredNames = array(
+ // Annotation tags
+ 'Annotation' => true, 'Attribute' => true, 'Attributes' => true,
+ /* Can we enable this? 'Enum' => true, */
+ 'Required' => true,
+ 'Target' => true,
+ // Widely used tags (but not existent in phpdoc)
+ 'fix' => true , 'fixme' => true,
+ 'override' => true,
+ // PHPDocumentor 1 tags
+ 'abstract'=> true, 'access'=> true,
+ 'code' => true,
+ 'deprec'=> true,
+ 'endcode' => true, 'exception'=> true,
+ 'final'=> true,
+ 'ingroup' => true, 'inheritdoc'=> true, 'inheritDoc'=> true,
+ 'magic' => true,
+ 'name'=> true,
+ 'toc' => true, 'tutorial'=> true,
+ 'private' => true,
+ 'static'=> true, 'staticvar'=> true, 'staticVar'=> true,
+ 'throw' => true,
+ // PHPDocumentor 2 tags.
+ 'api' => true, 'author'=> true,
+ 'category'=> true, 'copyright'=> true,
+ 'deprecated'=> true,
+ 'example'=> true,
+ 'filesource'=> true,
+ 'global'=> true,
+ 'ignore'=> true, /* Can we enable this? 'index' => true, */ 'internal'=> true,
+ 'license'=> true, 'link'=> true,
+ 'method' => true,
+ 'package'=> true, 'param'=> true, 'property' => true, 'property-read' => true, 'property-write' => true,
+ 'return'=> true,
+ 'see'=> true, 'since'=> true, 'source' => true, 'subpackage'=> true,
+ 'throws'=> true, 'todo'=> true, 'TODO'=> true,
+ 'usedby'=> true, 'uses' => true,
+ 'var'=> true, 'version'=> true,
+ // PHPUnit tags
+ 'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true,
+ // PHPCheckStyle
+ 'SuppressWarnings' => true,
+ // PHPStorm
+ 'noinspection' => true,
+ // PEAR
+ 'package_version' => true,
+ // PlantUML
+ 'startuml' => true, 'enduml' => true,
+ );
+
+ /**
+ * A list with annotations that are not causing exceptions when not resolved to an annotation class.
+ *
+ * The names are case sensitive.
+ *
+ * @var array
+ */
+ private static $globalIgnoredNamespaces = array();
+
+ /**
+ * Add a new annotation to the globally ignored annotation names with regard to exception handling.
+ *
+ * @param string $name
+ */
+ static public function addGlobalIgnoredName($name)
+ {
+ self::$globalIgnoredNames[$name] = true;
+ }
+
+ /**
+ * Add a new annotation to the globally ignored annotation namespaces with regard to exception handling.
+ *
+ * @param string $namespace
+ */
+ static public function addGlobalIgnoredNamespace($namespace)
+ {
+ self::$globalIgnoredNamespaces[$namespace] = true;
+ }
+
+ /**
+ * Annotations parser.
+ *
+ * @var \Doctrine\Common\Annotations\DocParser
+ */
+ private $parser;
+
+ /**
+ * Annotations parser used to collect parsing metadata.
+ *
+ * @var \Doctrine\Common\Annotations\DocParser
+ */
+ private $preParser;
+
+ /**
+ * PHP parser used to collect imports.
+ *
+ * @var \Doctrine\Common\Annotations\PhpParser
+ */
+ private $phpParser;
+
+ /**
+ * In-memory cache mechanism to store imported annotations per class.
+ *
+ * @var array
+ */
+ private $imports = array();
+
+ /**
+ * In-memory cache mechanism to store ignored annotations per class.
+ *
+ * @var array
+ */
+ private $ignoredAnnotationNames = array();
+
+ /**
+ * Constructor.
+ *
+ * Initializes a new AnnotationReader.
+ *
+ * @param DocParser $parser
+ */
+ public function __construct(DocParser $parser = null)
+ {
+ if (extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.save_comments') === "0" || ini_get('opcache.save_comments') === "0")) {
+ throw AnnotationException::optimizerPlusSaveComments();
+ }
+
+ if (extension_loaded('Zend OPcache') && ini_get('opcache.save_comments') == 0) {
+ throw AnnotationException::optimizerPlusSaveComments();
+ }
+
+ if (PHP_VERSION_ID < 70000) {
+ if (extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.load_comments') === "0" || ini_get('opcache.load_comments') === "0")) {
+ throw AnnotationException::optimizerPlusLoadComments();
+ }
+
+ if (extension_loaded('Zend OPcache') && ini_get('opcache.load_comments') == 0) {
+ throw AnnotationException::optimizerPlusLoadComments();
+ }
+ }
+
+ AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php');
+
+ $this->parser = $parser ?: new DocParser();
+
+ $this->preParser = new DocParser;
+
+ $this->preParser->setImports(self::$globalImports);
+ $this->preParser->setIgnoreNotImportedAnnotations(true);
+
+ $this->phpParser = new PhpParser;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotations(ReflectionClass $class)
+ {
+ $this->parser->setTarget(Target::TARGET_CLASS);
+ $this->parser->setImports($this->getClassImports($class));
+ $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
+ $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces);
+
+ return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotation(ReflectionClass $class, $annotationName)
+ {
+ $annotations = $this->getClassAnnotations($class);
+
+ foreach ($annotations as $annotation) {
+ if ($annotation instanceof $annotationName) {
+ return $annotation;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotations(ReflectionProperty $property)
+ {
+ $class = $property->getDeclaringClass();
+ $context = 'property ' . $class->getName() . "::\$" . $property->getName();
+
+ $this->parser->setTarget(Target::TARGET_PROPERTY);
+ $this->parser->setImports($this->getPropertyImports($property));
+ $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
+ $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces);
+
+ return $this->parser->parse($property->getDocComment(), $context);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotation(ReflectionProperty $property, $annotationName)
+ {
+ $annotations = $this->getPropertyAnnotations($property);
+
+ foreach ($annotations as $annotation) {
+ if ($annotation instanceof $annotationName) {
+ return $annotation;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotations(ReflectionMethod $method)
+ {
+ $class = $method->getDeclaringClass();
+ $context = 'method ' . $class->getName() . '::' . $method->getName() . '()';
+
+ $this->parser->setTarget(Target::TARGET_METHOD);
+ $this->parser->setImports($this->getMethodImports($method));
+ $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
+ $this->parser->setIgnoredAnnotationNamespaces(self::$globalIgnoredNamespaces);
+
+ return $this->parser->parse($method->getDocComment(), $context);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotation(ReflectionMethod $method, $annotationName)
+ {
+ $annotations = $this->getMethodAnnotations($method);
+
+ foreach ($annotations as $annotation) {
+ if ($annotation instanceof $annotationName) {
+ return $annotation;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the ignored annotations for the given class.
+ *
+ * @param \ReflectionClass $class
+ *
+ * @return array
+ */
+ private function getIgnoredAnnotationNames(ReflectionClass $class)
+ {
+ if (isset($this->ignoredAnnotationNames[$name = $class->getName()])) {
+ return $this->ignoredAnnotationNames[$name];
+ }
+
+ $this->collectParsingMetadata($class);
+
+ return $this->ignoredAnnotationNames[$name];
+ }
+
+ /**
+ * Retrieves imports.
+ *
+ * @param \ReflectionClass $class
+ *
+ * @return array
+ */
+ private function getClassImports(ReflectionClass $class)
+ {
+ if (isset($this->imports[$name = $class->getName()])) {
+ return $this->imports[$name];
+ }
+
+ $this->collectParsingMetadata($class);
+
+ return $this->imports[$name];
+ }
+
+ /**
+ * Retrieves imports for methods.
+ *
+ * @param \ReflectionMethod $method
+ *
+ * @return array
+ */
+ private function getMethodImports(ReflectionMethod $method)
+ {
+ $class = $method->getDeclaringClass();
+ $classImports = $this->getClassImports($class);
+ if (!method_exists($class, 'getTraits')) {
+ return $classImports;
+ }
+
+ $traitImports = array();
+
+ foreach ($class->getTraits() as $trait) {
+ if ($trait->hasMethod($method->getName())
+ && $trait->getFileName() === $method->getFileName()
+ ) {
+ $traitImports = array_merge($traitImports, $this->phpParser->parseClass($trait));
+ }
+ }
+
+ return array_merge($classImports, $traitImports);
+ }
+
+ /**
+ * Retrieves imports for properties.
+ *
+ * @param \ReflectionProperty $property
+ *
+ * @return array
+ */
+ private function getPropertyImports(ReflectionProperty $property)
+ {
+ $class = $property->getDeclaringClass();
+ $classImports = $this->getClassImports($class);
+ if (!method_exists($class, 'getTraits')) {
+ return $classImports;
+ }
+
+ $traitImports = array();
+
+ foreach ($class->getTraits() as $trait) {
+ if ($trait->hasProperty($property->getName())) {
+ $traitImports = array_merge($traitImports, $this->phpParser->parseClass($trait));
+ }
+ }
+
+ return array_merge($classImports, $traitImports);
+ }
+
+ /**
+ * Collects parsing metadata for a given class.
+ *
+ * @param \ReflectionClass $class
+ */
+ private function collectParsingMetadata(ReflectionClass $class)
+ {
+ $ignoredAnnotationNames = self::$globalIgnoredNames;
+ $annotations = $this->preParser->parse($class->getDocComment(), 'class ' . $class->name);
+
+ foreach ($annotations as $annotation) {
+ if ($annotation instanceof IgnoreAnnotation) {
+ foreach ($annotation->names AS $annot) {
+ $ignoredAnnotationNames[$annot] = true;
+ }
+ }
+ }
+
+ $name = $class->getName();
+
+ $this->imports[$name] = array_merge(
+ self::$globalImports,
+ $this->phpParser->parseClass($class),
+ array('__NAMESPACE__' => $class->getNamespaceName())
+ );
+
+ $this->ignoredAnnotationNames[$name] = $ignoredAnnotationNames;
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php
new file mode 100644
index 00000000..13ceb634
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php
@@ -0,0 +1,151 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * AnnotationRegistry.
+ */
+final class AnnotationRegistry
+{
+ /**
+ * A map of namespaces to use for autoloading purposes based on a PSR-0 convention.
+ *
+ * Contains the namespace as key and an array of directories as value. If the value is NULL
+ * the include path is used for checking for the corresponding file.
+ *
+ * This autoloading mechanism does not utilize the PHP autoloading but implements autoloading on its own.
+ *
+ * @var array
+ */
+ static private $autoloadNamespaces = array();
+
+ /**
+ * A map of autoloader callables.
+ *
+ * @var array
+ */
+ static private $loaders = array();
+
+ /**
+ * @return void
+ */
+ static public function reset()
+ {
+ self::$autoloadNamespaces = array();
+ self::$loaders = array();
+ }
+
+ /**
+ * Registers file.
+ *
+ * @param string $file
+ *
+ * @return void
+ */
+ static public function registerFile($file)
+ {
+ require_once $file;
+ }
+
+ /**
+ * Adds a namespace with one or many directories to look for files or null for the include path.
+ *
+ * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm.
+ *
+ * @param string $namespace
+ * @param string|array|null $dirs
+ *
+ * @return void
+ */
+ static public function registerAutoloadNamespace($namespace, $dirs = null)
+ {
+ self::$autoloadNamespaces[$namespace] = $dirs;
+ }
+
+ /**
+ * Registers multiple namespaces.
+ *
+ * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm.
+ *
+ * @param array $namespaces
+ *
+ * @return void
+ */
+ static public function registerAutoloadNamespaces(array $namespaces)
+ {
+ self::$autoloadNamespaces = array_merge(self::$autoloadNamespaces, $namespaces);
+ }
+
+ /**
+ * Registers an autoloading callable for annotations, much like spl_autoload_register().
+ *
+ * NOTE: These class loaders HAVE to be silent when a class was not found!
+ * IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class.
+ *
+ * @param callable $callable
+ *
+ * @return void
+ *
+ * @throws \InvalidArgumentException
+ */
+ static public function registerLoader($callable)
+ {
+ if (!is_callable($callable)) {
+ throw new \InvalidArgumentException("A callable is expected in AnnotationRegistry::registerLoader().");
+ }
+ self::$loaders[] = $callable;
+ }
+
+ /**
+ * Autoloads an annotation class silently.
+ *
+ * @param string $class
+ *
+ * @return boolean
+ */
+ static public function loadAnnotationClass($class)
+ {
+ foreach (self::$autoloadNamespaces AS $namespace => $dirs) {
+ if (strpos($class, $namespace) === 0) {
+ $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php";
+ if ($dirs === null) {
+ if ($path = stream_resolve_include_path($file)) {
+ require $path;
+ return true;
+ }
+ } else {
+ foreach((array)$dirs AS $dir) {
+ if (is_file($dir . DIRECTORY_SEPARATOR . $file)) {
+ require $dir . DIRECTORY_SEPARATOR . $file;
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ foreach (self::$loaders AS $loader) {
+ if (call_user_func($loader, $class) === true) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php
new file mode 100644
index 00000000..dfd1f894
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php
@@ -0,0 +1,258 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Cache\Cache;
+use ReflectionClass;
+
+/**
+ * A cache aware annotation reader.
+ *
+ * @author Johannes M. Schmitt
+ * @author Benjamin Eberlei
+ */
+final class CachedReader implements Reader
+{
+ /**
+ * @var Reader
+ */
+ private $delegate;
+
+ /**
+ * @var Cache
+ */
+ private $cache;
+
+ /**
+ * @var boolean
+ */
+ private $debug;
+
+ /**
+ * @var array
+ */
+ private $loadedAnnotations = array();
+
+ /**
+ * Constructor.
+ *
+ * @param Reader $reader
+ * @param Cache $cache
+ * @param bool $debug
+ */
+ public function __construct(Reader $reader, Cache $cache, $debug = false)
+ {
+ $this->delegate = $reader;
+ $this->cache = $cache;
+ $this->debug = (boolean) $debug;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotations(ReflectionClass $class)
+ {
+ $cacheKey = $class->getName();
+
+ if (isset($this->loadedAnnotations[$cacheKey])) {
+ return $this->loadedAnnotations[$cacheKey];
+ }
+
+ if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
+ $annots = $this->delegate->getClassAnnotations($class);
+ $this->saveToCache($cacheKey, $annots);
+ }
+
+ return $this->loadedAnnotations[$cacheKey] = $annots;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotation(ReflectionClass $class, $annotationName)
+ {
+ foreach ($this->getClassAnnotations($class) as $annot) {
+ if ($annot instanceof $annotationName) {
+ return $annot;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotations(\ReflectionProperty $property)
+ {
+ $class = $property->getDeclaringClass();
+ $cacheKey = $class->getName().'$'.$property->getName();
+
+ if (isset($this->loadedAnnotations[$cacheKey])) {
+ return $this->loadedAnnotations[$cacheKey];
+ }
+
+ if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
+ $annots = $this->delegate->getPropertyAnnotations($property);
+ $this->saveToCache($cacheKey, $annots);
+ }
+
+ return $this->loadedAnnotations[$cacheKey] = $annots;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
+ {
+ foreach ($this->getPropertyAnnotations($property) as $annot) {
+ if ($annot instanceof $annotationName) {
+ return $annot;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotations(\ReflectionMethod $method)
+ {
+ $class = $method->getDeclaringClass();
+ $cacheKey = $class->getName().'#'.$method->getName();
+
+ if (isset($this->loadedAnnotations[$cacheKey])) {
+ return $this->loadedAnnotations[$cacheKey];
+ }
+
+ if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
+ $annots = $this->delegate->getMethodAnnotations($method);
+ $this->saveToCache($cacheKey, $annots);
+ }
+
+ return $this->loadedAnnotations[$cacheKey] = $annots;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
+ {
+ foreach ($this->getMethodAnnotations($method) as $annot) {
+ if ($annot instanceof $annotationName) {
+ return $annot;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Clears loaded annotations.
+ *
+ * @return void
+ */
+ public function clearLoadedAnnotations()
+ {
+ $this->loadedAnnotations = array();
+ }
+
+ /**
+ * Fetches a value from the cache.
+ *
+ * @param string $cacheKey The cache key.
+ * @param ReflectionClass $class The related class.
+ *
+ * @return mixed The cached value or false when the value is not in cache.
+ */
+ private function fetchFromCache($cacheKey, ReflectionClass $class)
+ {
+ if (($data = $this->cache->fetch($cacheKey)) !== false) {
+ if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) {
+ return $data;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Saves a value to the cache.
+ *
+ * @param string $cacheKey The cache key.
+ * @param mixed $value The value.
+ *
+ * @return void
+ */
+ private function saveToCache($cacheKey, $value)
+ {
+ $this->cache->save($cacheKey, $value);
+ if ($this->debug) {
+ $this->cache->save('[C]'.$cacheKey, time());
+ }
+ }
+
+ /**
+ * Checks if the cache is fresh.
+ *
+ * @param string $cacheKey
+ * @param ReflectionClass $class
+ *
+ * @return boolean
+ */
+ private function isCacheFresh($cacheKey, ReflectionClass $class)
+ {
+ if (null === $lastModification = $this->getLastModification($class)) {
+ return true;
+ }
+
+ return $this->cache->fetch('[C]'.$cacheKey) >= $lastModification;
+ }
+
+ /**
+ * Returns the time the class was last modified, testing traits and parents
+ *
+ * @param ReflectionClass $class
+ * @return int
+ */
+ private function getLastModification(ReflectionClass $class)
+ {
+ $filename = $class->getFileName();
+ $parent = $class->getParentClass();
+
+ return max(array_merge(
+ [$filename ? filemtime($filename) : 0],
+ array_map([$this, 'getTraitLastModificationTimes'], $class->getTraits()),
+ array_map([$this, 'getLastModification'], $class->getInterfaces()),
+ $parent ? [$this->getLastModification($parent)] : []
+ ));
+ }
+
+ private function getTraitLastModificationTimes(ReflectionClass $reflectionTrait)
+ {
+ $fileName = $reflectionTrait->getFileName();
+
+ return array_merge(
+ [$fileName ? filemtime($fileName) : 0],
+ array_map([$this, 'getTraitLastModificationTimes'], $reflectionTrait->getTraits())
+ );
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php
new file mode 100644
index 00000000..d864540e
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php
@@ -0,0 +1,134 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Lexer\AbstractLexer;
+
+/**
+ * Simple lexer for docblock annotations.
+ *
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Johannes M. Schmitt
+ */
+final class DocLexer extends AbstractLexer
+{
+ const T_NONE = 1;
+ const T_INTEGER = 2;
+ const T_STRING = 3;
+ const T_FLOAT = 4;
+
+ // All tokens that are also identifiers should be >= 100
+ const T_IDENTIFIER = 100;
+ const T_AT = 101;
+ const T_CLOSE_CURLY_BRACES = 102;
+ const T_CLOSE_PARENTHESIS = 103;
+ const T_COMMA = 104;
+ const T_EQUALS = 105;
+ const T_FALSE = 106;
+ const T_NAMESPACE_SEPARATOR = 107;
+ const T_OPEN_CURLY_BRACES = 108;
+ const T_OPEN_PARENTHESIS = 109;
+ const T_TRUE = 110;
+ const T_NULL = 111;
+ const T_COLON = 112;
+
+ /**
+ * @var array
+ */
+ protected $noCase = array(
+ '@' => self::T_AT,
+ ',' => self::T_COMMA,
+ '(' => self::T_OPEN_PARENTHESIS,
+ ')' => self::T_CLOSE_PARENTHESIS,
+ '{' => self::T_OPEN_CURLY_BRACES,
+ '}' => self::T_CLOSE_CURLY_BRACES,
+ '=' => self::T_EQUALS,
+ ':' => self::T_COLON,
+ '\\' => self::T_NAMESPACE_SEPARATOR
+ );
+
+ /**
+ * @var array
+ */
+ protected $withCase = array(
+ 'true' => self::T_TRUE,
+ 'false' => self::T_FALSE,
+ 'null' => self::T_NULL
+ );
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getCatchablePatterns()
+ {
+ return array(
+ '[a-z_\\\][a-z0-9_\:\\\]*[a-z_][a-z0-9_]*',
+ '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?',
+ '"(?:""|[^"])*+"',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getNonCatchablePatterns()
+ {
+ return array('\s+', '\*+', '(.)');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getType(&$value)
+ {
+ $type = self::T_NONE;
+
+ if ($value[0] === '"') {
+ $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2));
+
+ return self::T_STRING;
+ }
+
+ if (isset($this->noCase[$value])) {
+ return $this->noCase[$value];
+ }
+
+ if ($value[0] === '_' || $value[0] === '\\' || ctype_alpha($value[0])) {
+ return self::T_IDENTIFIER;
+ }
+
+ $lowerValue = strtolower($value);
+
+ if (isset($this->withCase[$lowerValue])) {
+ return $this->withCase[$lowerValue];
+ }
+
+ // Checking numeric value
+ if (is_numeric($value)) {
+ return (strpos($value, '.') !== false || stripos($value, 'e') !== false)
+ ? self::T_FLOAT : self::T_INTEGER;
+ }
+
+ return $type;
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php
new file mode 100644
index 00000000..b128b93a
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php
@@ -0,0 +1,1184 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Annotations\Annotation\Attribute;
+use ReflectionClass;
+use Doctrine\Common\Annotations\Annotation\Enum;
+use Doctrine\Common\Annotations\Annotation\Target;
+use Doctrine\Common\Annotations\Annotation\Attributes;
+
+/**
+ * A parser for docblock annotations.
+ *
+ * It is strongly discouraged to change the default annotation parsing process.
+ *
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Johannes M. Schmitt
+ * @author Fabio B. Silva
+ */
+final class DocParser
+{
+ /**
+ * An array of all valid tokens for a class name.
+ *
+ * @var array
+ */
+ private static $classIdentifiers = array(
+ DocLexer::T_IDENTIFIER,
+ DocLexer::T_TRUE,
+ DocLexer::T_FALSE,
+ DocLexer::T_NULL
+ );
+
+ /**
+ * The lexer.
+ *
+ * @var \Doctrine\Common\Annotations\DocLexer
+ */
+ private $lexer;
+
+ /**
+ * Current target context.
+ *
+ * @var string
+ */
+ private $target;
+
+ /**
+ * Doc parser used to collect annotation target.
+ *
+ * @var \Doctrine\Common\Annotations\DocParser
+ */
+ private static $metadataParser;
+
+ /**
+ * Flag to control if the current annotation is nested or not.
+ *
+ * @var boolean
+ */
+ private $isNestedAnnotation = false;
+
+ /**
+ * Hashmap containing all use-statements that are to be used when parsing
+ * the given doc block.
+ *
+ * @var array
+ */
+ private $imports = array();
+
+ /**
+ * This hashmap is used internally to cache results of class_exists()
+ * look-ups.
+ *
+ * @var array
+ */
+ private $classExists = array();
+
+ /**
+ * Whether annotations that have not been imported should be ignored.
+ *
+ * @var boolean
+ */
+ private $ignoreNotImportedAnnotations = false;
+
+ /**
+ * An array of default namespaces if operating in simple mode.
+ *
+ * @var array
+ */
+ private $namespaces = array();
+
+ /**
+ * A list with annotations that are not causing exceptions when not resolved to an annotation class.
+ *
+ * The names must be the raw names as used in the class, not the fully qualified
+ * class names.
+ *
+ * @var bool[] indexed by annotation name
+ */
+ private $ignoredAnnotationNames = array();
+
+ /**
+ * A list with annotations in namespaced format
+ * that are not causing exceptions when not resolved to an annotation class.
+ *
+ * @var bool[] indexed by namespace name
+ */
+ private $ignoredAnnotationNamespaces = array();
+
+ /**
+ * @var string
+ */
+ private $context = '';
+
+ /**
+ * Hash-map for caching annotation metadata.
+ *
+ * @var array
+ */
+ private static $annotationMetadata = array(
+ 'Doctrine\Common\Annotations\Annotation\Target' => array(
+ 'is_annotation' => true,
+ 'has_constructor' => true,
+ 'properties' => array(),
+ 'targets_literal' => 'ANNOTATION_CLASS',
+ 'targets' => Target::TARGET_CLASS,
+ 'default_property' => 'value',
+ 'attribute_types' => array(
+ 'value' => array(
+ 'required' => false,
+ 'type' =>'array',
+ 'array_type'=>'string',
+ 'value' =>'array'
+ )
+ ),
+ ),
+ 'Doctrine\Common\Annotations\Annotation\Attribute' => array(
+ 'is_annotation' => true,
+ 'has_constructor' => false,
+ 'targets_literal' => 'ANNOTATION_ANNOTATION',
+ 'targets' => Target::TARGET_ANNOTATION,
+ 'default_property' => 'name',
+ 'properties' => array(
+ 'name' => 'name',
+ 'type' => 'type',
+ 'required' => 'required'
+ ),
+ 'attribute_types' => array(
+ 'value' => array(
+ 'required' => true,
+ 'type' =>'string',
+ 'value' =>'string'
+ ),
+ 'type' => array(
+ 'required' =>true,
+ 'type' =>'string',
+ 'value' =>'string'
+ ),
+ 'required' => array(
+ 'required' =>false,
+ 'type' =>'boolean',
+ 'value' =>'boolean'
+ )
+ ),
+ ),
+ 'Doctrine\Common\Annotations\Annotation\Attributes' => array(
+ 'is_annotation' => true,
+ 'has_constructor' => false,
+ 'targets_literal' => 'ANNOTATION_CLASS',
+ 'targets' => Target::TARGET_CLASS,
+ 'default_property' => 'value',
+ 'properties' => array(
+ 'value' => 'value'
+ ),
+ 'attribute_types' => array(
+ 'value' => array(
+ 'type' =>'array',
+ 'required' =>true,
+ 'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute',
+ 'value' =>'array'
+ )
+ ),
+ ),
+ 'Doctrine\Common\Annotations\Annotation\Enum' => array(
+ 'is_annotation' => true,
+ 'has_constructor' => true,
+ 'targets_literal' => 'ANNOTATION_PROPERTY',
+ 'targets' => Target::TARGET_PROPERTY,
+ 'default_property' => 'value',
+ 'properties' => array(
+ 'value' => 'value'
+ ),
+ 'attribute_types' => array(
+ 'value' => array(
+ 'type' => 'array',
+ 'required' => true,
+ ),
+ 'literal' => array(
+ 'type' => 'array',
+ 'required' => false,
+ ),
+ ),
+ ),
+ );
+
+ /**
+ * Hash-map for handle types declaration.
+ *
+ * @var array
+ */
+ private static $typeMap = array(
+ 'float' => 'double',
+ 'bool' => 'boolean',
+ // allow uppercase Boolean in honor of George Boole
+ 'Boolean' => 'boolean',
+ 'int' => 'integer',
+ );
+
+ /**
+ * Constructs a new DocParser.
+ */
+ public function __construct()
+ {
+ $this->lexer = new DocLexer;
+ }
+
+ /**
+ * Sets the annotation names that are ignored during the parsing process.
+ *
+ * The names are supposed to be the raw names as used in the class, not the
+ * fully qualified class names.
+ *
+ * @param bool[] $names indexed by annotation name
+ *
+ * @return void
+ */
+ public function setIgnoredAnnotationNames(array $names)
+ {
+ $this->ignoredAnnotationNames = $names;
+ }
+
+ /**
+ * Sets the annotation namespaces that are ignored during the parsing process.
+ *
+ * @param bool[] $ignoredAnnotationNamespaces indexed by annotation namespace name
+ *
+ * @return void
+ */
+ public function setIgnoredAnnotationNamespaces($ignoredAnnotationNamespaces)
+ {
+ $this->ignoredAnnotationNamespaces = $ignoredAnnotationNamespaces;
+ }
+
+ /**
+ * Sets ignore on not-imported annotations.
+ *
+ * @param boolean $bool
+ *
+ * @return void
+ */
+ public function setIgnoreNotImportedAnnotations($bool)
+ {
+ $this->ignoreNotImportedAnnotations = (boolean) $bool;
+ }
+
+ /**
+ * Sets the default namespaces.
+ *
+ * @param array $namespace
+ *
+ * @return void
+ *
+ * @throws \RuntimeException
+ */
+ public function addNamespace($namespace)
+ {
+ if ($this->imports) {
+ throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.');
+ }
+
+ $this->namespaces[] = $namespace;
+ }
+
+ /**
+ * Sets the imports.
+ *
+ * @param array $imports
+ *
+ * @return void
+ *
+ * @throws \RuntimeException
+ */
+ public function setImports(array $imports)
+ {
+ if ($this->namespaces) {
+ throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.');
+ }
+
+ $this->imports = $imports;
+ }
+
+ /**
+ * Sets current target context as bitmask.
+ *
+ * @param integer $target
+ *
+ * @return void
+ */
+ public function setTarget($target)
+ {
+ $this->target = $target;
+ }
+
+ /**
+ * Parses the given docblock string for annotations.
+ *
+ * @param string $input The docblock string to parse.
+ * @param string $context The parsing context.
+ *
+ * @return array Array of annotations. If no annotations are found, an empty array is returned.
+ */
+ public function parse($input, $context = '')
+ {
+ $pos = $this->findInitialTokenPosition($input);
+ if ($pos === null) {
+ return array();
+ }
+
+ $this->context = $context;
+
+ $this->lexer->setInput(trim(substr($input, $pos), '* /'));
+ $this->lexer->moveNext();
+
+ return $this->Annotations();
+ }
+
+ /**
+ * Finds the first valid annotation
+ *
+ * @param string $input The docblock string to parse
+ *
+ * @return int|null
+ */
+ private function findInitialTokenPosition($input)
+ {
+ $pos = 0;
+
+ // search for first valid annotation
+ while (($pos = strpos($input, '@', $pos)) !== false) {
+ $preceding = substr($input, $pos - 1, 1);
+
+ // if the @ is preceded by a space, a tab or * it is valid
+ if ($pos === 0 || $preceding === ' ' || $preceding === '*' || $preceding === "\t") {
+ return $pos;
+ }
+
+ $pos++;
+ }
+
+ return null;
+ }
+
+ /**
+ * Attempts to match the given token with the current lookahead token.
+ * If they match, updates the lookahead token; otherwise raises a syntax error.
+ *
+ * @param integer $token Type of token.
+ *
+ * @return boolean True if tokens match; false otherwise.
+ */
+ private function match($token)
+ {
+ if ( ! $this->lexer->isNextToken($token) ) {
+ $this->syntaxError($this->lexer->getLiteral($token));
+ }
+
+ return $this->lexer->moveNext();
+ }
+
+ /**
+ * Attempts to match the current lookahead token with any of the given tokens.
+ *
+ * If any of them matches, this method updates the lookahead token; otherwise
+ * a syntax error is raised.
+ *
+ * @param array $tokens
+ *
+ * @return boolean
+ */
+ private function matchAny(array $tokens)
+ {
+ if ( ! $this->lexer->isNextTokenAny($tokens)) {
+ $this->syntaxError(implode(' or ', array_map(array($this->lexer, 'getLiteral'), $tokens)));
+ }
+
+ return $this->lexer->moveNext();
+ }
+
+ /**
+ * Generates a new syntax error.
+ *
+ * @param string $expected Expected string.
+ * @param array|null $token Optional token.
+ *
+ * @return void
+ *
+ * @throws AnnotationException
+ */
+ private function syntaxError($expected, $token = null)
+ {
+ if ($token === null) {
+ $token = $this->lexer->lookahead;
+ }
+
+ $message = sprintf('Expected %s, got ', $expected);
+ $message .= ($this->lexer->lookahead === null)
+ ? 'end of string'
+ : sprintf("'%s' at position %s", $token['value'], $token['position']);
+
+ if (strlen($this->context)) {
+ $message .= ' in ' . $this->context;
+ }
+
+ $message .= '.';
+
+ throw AnnotationException::syntaxError($message);
+ }
+
+ /**
+ * Attempts to check if a class exists or not. This never goes through the PHP autoloading mechanism
+ * but uses the {@link AnnotationRegistry} to load classes.
+ *
+ * @param string $fqcn
+ *
+ * @return boolean
+ */
+ private function classExists($fqcn)
+ {
+ if (isset($this->classExists[$fqcn])) {
+ return $this->classExists[$fqcn];
+ }
+
+ // first check if the class already exists, maybe loaded through another AnnotationReader
+ if (class_exists($fqcn, false)) {
+ return $this->classExists[$fqcn] = true;
+ }
+
+ // final check, does this class exist?
+ return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn);
+ }
+
+ /**
+ * Collects parsing metadata for a given annotation class
+ *
+ * @param string $name The annotation name
+ *
+ * @return void
+ */
+ private function collectAnnotationMetadata($name)
+ {
+ if (self::$metadataParser === null) {
+ self::$metadataParser = new self();
+
+ self::$metadataParser->setIgnoreNotImportedAnnotations(true);
+ self::$metadataParser->setIgnoredAnnotationNames($this->ignoredAnnotationNames);
+ self::$metadataParser->setImports(array(
+ 'enum' => 'Doctrine\Common\Annotations\Annotation\Enum',
+ 'target' => 'Doctrine\Common\Annotations\Annotation\Target',
+ 'attribute' => 'Doctrine\Common\Annotations\Annotation\Attribute',
+ 'attributes' => 'Doctrine\Common\Annotations\Annotation\Attributes'
+ ));
+
+ AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Enum.php');
+ AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Target.php');
+ AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attribute.php');
+ AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attributes.php');
+ }
+
+ $class = new \ReflectionClass($name);
+ $docComment = $class->getDocComment();
+
+ // Sets default values for annotation metadata
+ $metadata = array(
+ 'default_property' => null,
+ 'has_constructor' => (null !== $constructor = $class->getConstructor()) && $constructor->getNumberOfParameters() > 0,
+ 'properties' => array(),
+ 'property_types' => array(),
+ 'attribute_types' => array(),
+ 'targets_literal' => null,
+ 'targets' => Target::TARGET_ALL,
+ 'is_annotation' => false !== strpos($docComment, '@Annotation'),
+ );
+
+ // verify that the class is really meant to be an annotation
+ if ($metadata['is_annotation']) {
+ self::$metadataParser->setTarget(Target::TARGET_CLASS);
+
+ foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) {
+ if ($annotation instanceof Target) {
+ $metadata['targets'] = $annotation->targets;
+ $metadata['targets_literal'] = $annotation->literal;
+
+ continue;
+ }
+
+ if ($annotation instanceof Attributes) {
+ foreach ($annotation->value as $attribute) {
+ $this->collectAttributeTypeMetadata($metadata, $attribute);
+ }
+ }
+ }
+
+ // if not has a constructor will inject values into public properties
+ if (false === $metadata['has_constructor']) {
+ // collect all public properties
+ foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
+ $metadata['properties'][$property->name] = $property->name;
+
+ if (false === ($propertyComment = $property->getDocComment())) {
+ continue;
+ }
+
+ $attribute = new Attribute();
+
+ $attribute->required = (false !== strpos($propertyComment, '@Required'));
+ $attribute->name = $property->name;
+ $attribute->type = (false !== strpos($propertyComment, '@var') && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches))
+ ? $matches[1]
+ : 'mixed';
+
+ $this->collectAttributeTypeMetadata($metadata, $attribute);
+
+ // checks if the property has @Enum
+ if (false !== strpos($propertyComment, '@Enum')) {
+ $context = 'property ' . $class->name . "::\$" . $property->name;
+
+ self::$metadataParser->setTarget(Target::TARGET_PROPERTY);
+
+ foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) {
+ if ( ! $annotation instanceof Enum) {
+ continue;
+ }
+
+ $metadata['enum'][$property->name]['value'] = $annotation->value;
+ $metadata['enum'][$property->name]['literal'] = ( ! empty($annotation->literal))
+ ? $annotation->literal
+ : $annotation->value;
+ }
+ }
+ }
+
+ // choose the first property as default property
+ $metadata['default_property'] = reset($metadata['properties']);
+ }
+ }
+
+ self::$annotationMetadata[$name] = $metadata;
+ }
+
+ /**
+ * Collects parsing metadata for a given attribute.
+ *
+ * @param array $metadata
+ * @param Attribute $attribute
+ *
+ * @return void
+ */
+ private function collectAttributeTypeMetadata(&$metadata, Attribute $attribute)
+ {
+ // handle internal type declaration
+ $type = isset(self::$typeMap[$attribute->type])
+ ? self::$typeMap[$attribute->type]
+ : $attribute->type;
+
+ // handle the case if the property type is mixed
+ if ('mixed' === $type) {
+ return;
+ }
+
+ // Evaluate type
+ switch (true) {
+ // Checks if the property has array
+ case (false !== $pos = strpos($type, '<')):
+ $arrayType = substr($type, $pos + 1, -1);
+ $type = 'array';
+
+ if (isset(self::$typeMap[$arrayType])) {
+ $arrayType = self::$typeMap[$arrayType];
+ }
+
+ $metadata['attribute_types'][$attribute->name]['array_type'] = $arrayType;
+ break;
+
+ // Checks if the property has type[]
+ case (false !== $pos = strrpos($type, '[')):
+ $arrayType = substr($type, 0, $pos);
+ $type = 'array';
+
+ if (isset(self::$typeMap[$arrayType])) {
+ $arrayType = self::$typeMap[$arrayType];
+ }
+
+ $metadata['attribute_types'][$attribute->name]['array_type'] = $arrayType;
+ break;
+ }
+
+ $metadata['attribute_types'][$attribute->name]['type'] = $type;
+ $metadata['attribute_types'][$attribute->name]['value'] = $attribute->type;
+ $metadata['attribute_types'][$attribute->name]['required'] = $attribute->required;
+ }
+
+ /**
+ * Annotations ::= Annotation {[ "*" ]* [Annotation]}*
+ *
+ * @return array
+ */
+ private function Annotations()
+ {
+ $annotations = array();
+
+ while (null !== $this->lexer->lookahead) {
+ if (DocLexer::T_AT !== $this->lexer->lookahead['type']) {
+ $this->lexer->moveNext();
+ continue;
+ }
+
+ // make sure the @ is preceded by non-catchable pattern
+ if (null !== $this->lexer->token && $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value'])) {
+ $this->lexer->moveNext();
+ continue;
+ }
+
+ // make sure the @ is followed by either a namespace separator, or
+ // an identifier token
+ if ((null === $peek = $this->lexer->glimpse())
+ || (DocLexer::T_NAMESPACE_SEPARATOR !== $peek['type'] && !in_array($peek['type'], self::$classIdentifiers, true))
+ || $peek['position'] !== $this->lexer->lookahead['position'] + 1) {
+ $this->lexer->moveNext();
+ continue;
+ }
+
+ $this->isNestedAnnotation = false;
+ if (false !== $annot = $this->Annotation()) {
+ $annotations[] = $annot;
+ }
+ }
+
+ return $annotations;
+ }
+
+ /**
+ * Annotation ::= "@" AnnotationName MethodCall
+ * AnnotationName ::= QualifiedName | SimpleName
+ * QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName
+ * NameSpacePart ::= identifier | null | false | true
+ * SimpleName ::= identifier | null | false | true
+ *
+ * @return mixed False if it is not a valid annotation.
+ *
+ * @throws AnnotationException
+ */
+ private function Annotation()
+ {
+ $this->match(DocLexer::T_AT);
+
+ // check if we have an annotation
+ $name = $this->Identifier();
+
+ // only process names which are not fully qualified, yet
+ // fully qualified names must start with a \
+ $originalName = $name;
+
+ if ('\\' !== $name[0]) {
+ $alias = (false === $pos = strpos($name, '\\'))? $name : substr($name, 0, $pos);
+ $found = false;
+
+ if ($this->namespaces) {
+ foreach ($this->namespaces as $namespace) {
+ if ($this->classExists($namespace.'\\'.$name)) {
+ $name = $namespace.'\\'.$name;
+ $found = true;
+ break;
+ }
+ }
+ } elseif (isset($this->imports[$loweredAlias = strtolower($alias)])) {
+ $found = true;
+ $name = (false !== $pos)
+ ? $this->imports[$loweredAlias] . substr($name, $pos)
+ : $this->imports[$loweredAlias];
+ } elseif ( ! isset($this->ignoredAnnotationNames[$name])
+ && isset($this->imports['__NAMESPACE__'])
+ && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name)
+ ) {
+ $name = $this->imports['__NAMESPACE__'].'\\'.$name;
+ $found = true;
+ } elseif (! isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) {
+ $found = true;
+ }
+
+ if ( ! $found) {
+ if ($this->isIgnoredAnnotation($name)) {
+ return false;
+ }
+
+ throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation?', $name, $this->context));
+ }
+ }
+
+ if ( ! $this->classExists($name)) {
+ throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context));
+ }
+
+ // at this point, $name contains the fully qualified class name of the
+ // annotation, and it is also guaranteed that this class exists, and
+ // that it is loaded
+
+
+ // collects the metadata annotation only if there is not yet
+ if ( ! isset(self::$annotationMetadata[$name])) {
+ $this->collectAnnotationMetadata($name);
+ }
+
+ // verify that the class is really meant to be an annotation and not just any ordinary class
+ if (self::$annotationMetadata[$name]['is_annotation'] === false) {
+ if (isset($this->ignoredAnnotationNames[$originalName])) {
+ return false;
+ }
+
+ throw AnnotationException::semanticalError(sprintf('The class "%s" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "%s". If it is indeed no annotation, then you need to add @IgnoreAnnotation("%s") to the _class_ doc comment of %s.', $name, $name, $originalName, $this->context));
+ }
+
+ //if target is nested annotation
+ $target = $this->isNestedAnnotation ? Target::TARGET_ANNOTATION : $this->target;
+
+ // Next will be nested
+ $this->isNestedAnnotation = true;
+
+ //if annotation does not support current target
+ if (0 === (self::$annotationMetadata[$name]['targets'] & $target) && $target) {
+ throw AnnotationException::semanticalError(
+ sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.',
+ $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal'])
+ );
+ }
+
+ $values = $this->MethodCall();
+
+ if (isset(self::$annotationMetadata[$name]['enum'])) {
+ // checks all declared attributes
+ foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) {
+ // checks if the attribute is a valid enumerator
+ if (isset($values[$property]) && ! in_array($values[$property], $enum['value'])) {
+ throw AnnotationException::enumeratorError($property, $name, $this->context, $enum['literal'], $values[$property]);
+ }
+ }
+ }
+
+ // checks all declared attributes
+ foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) {
+ if ($property === self::$annotationMetadata[$name]['default_property']
+ && !isset($values[$property]) && isset($values['value'])) {
+ $property = 'value';
+ }
+
+ // handle a not given attribute or null value
+ if (!isset($values[$property])) {
+ if ($type['required']) {
+ throw AnnotationException::requiredError($property, $originalName, $this->context, 'a(n) '.$type['value']);
+ }
+
+ continue;
+ }
+
+ if ($type['type'] === 'array') {
+ // handle the case of a single value
+ if ( ! is_array($values[$property])) {
+ $values[$property] = array($values[$property]);
+ }
+
+ // checks if the attribute has array type declaration, such as "array"
+ if (isset($type['array_type'])) {
+ foreach ($values[$property] as $item) {
+ if (gettype($item) !== $type['array_type'] && !$item instanceof $type['array_type']) {
+ throw AnnotationException::attributeTypeError($property, $originalName, $this->context, 'either a(n) '.$type['array_type'].', or an array of '.$type['array_type'].'s', $item);
+ }
+ }
+ }
+ } elseif (gettype($values[$property]) !== $type['type'] && !$values[$property] instanceof $type['type']) {
+ throw AnnotationException::attributeTypeError($property, $originalName, $this->context, 'a(n) '.$type['value'], $values[$property]);
+ }
+ }
+
+ // check if the annotation expects values via the constructor,
+ // or directly injected into public properties
+ if (self::$annotationMetadata[$name]['has_constructor'] === true) {
+ return new $name($values);
+ }
+
+ $instance = new $name();
+
+ foreach ($values as $property => $value) {
+ if (!isset(self::$annotationMetadata[$name]['properties'][$property])) {
+ if ('value' !== $property) {
+ throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not have a property named "%s". Available properties: %s', $originalName, $this->context, $property, implode(', ', self::$annotationMetadata[$name]['properties'])));
+ }
+
+ // handle the case if the property has no annotations
+ if ( ! $property = self::$annotationMetadata[$name]['default_property']) {
+ throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not accept any values, but got %s.', $originalName, $this->context, json_encode($values)));
+ }
+ }
+
+ $instance->{$property} = $value;
+ }
+
+ return $instance;
+ }
+
+ /**
+ * MethodCall ::= ["(" [Values] ")"]
+ *
+ * @return array
+ */
+ private function MethodCall()
+ {
+ $values = array();
+
+ if ( ! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) {
+ return $values;
+ }
+
+ $this->match(DocLexer::T_OPEN_PARENTHESIS);
+
+ if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) {
+ $values = $this->Values();
+ }
+
+ $this->match(DocLexer::T_CLOSE_PARENTHESIS);
+
+ return $values;
+ }
+
+ /**
+ * Values ::= Array | Value {"," Value}* [","]
+ *
+ * @return array
+ */
+ private function Values()
+ {
+ $values = array($this->Value());
+
+ while ($this->lexer->isNextToken(DocLexer::T_COMMA)) {
+ $this->match(DocLexer::T_COMMA);
+
+ if ($this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) {
+ break;
+ }
+
+ $token = $this->lexer->lookahead;
+ $value = $this->Value();
+
+ if ( ! is_object($value) && ! is_array($value)) {
+ $this->syntaxError('Value', $token);
+ }
+
+ $values[] = $value;
+ }
+
+ foreach ($values as $k => $value) {
+ if (is_object($value) && $value instanceof \stdClass) {
+ $values[$value->name] = $value->value;
+ } else if ( ! isset($values['value'])){
+ $values['value'] = $value;
+ } else {
+ if ( ! is_array($values['value'])) {
+ $values['value'] = array($values['value']);
+ }
+
+ $values['value'][] = $value;
+ }
+
+ unset($values[$k]);
+ }
+
+ return $values;
+ }
+
+ /**
+ * Constant ::= integer | string | float | boolean
+ *
+ * @return mixed
+ *
+ * @throws AnnotationException
+ */
+ private function Constant()
+ {
+ $identifier = $this->Identifier();
+
+ if ( ! defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) {
+ list($className, $const) = explode('::', $identifier);
+
+ $alias = (false === $pos = strpos($className, '\\')) ? $className : substr($className, 0, $pos);
+ $found = false;
+
+ switch (true) {
+ case !empty ($this->namespaces):
+ foreach ($this->namespaces as $ns) {
+ if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) {
+ $className = $ns.'\\'.$className;
+ $found = true;
+ break;
+ }
+ }
+ break;
+
+ case isset($this->imports[$loweredAlias = strtolower($alias)]):
+ $found = true;
+ $className = (false !== $pos)
+ ? $this->imports[$loweredAlias] . substr($className, $pos)
+ : $this->imports[$loweredAlias];
+ break;
+
+ default:
+ if(isset($this->imports['__NAMESPACE__'])) {
+ $ns = $this->imports['__NAMESPACE__'];
+
+ if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) {
+ $className = $ns.'\\'.$className;
+ $found = true;
+ }
+ }
+ break;
+ }
+
+ if ($found) {
+ $identifier = $className . '::' . $const;
+ }
+ }
+
+ // checks if identifier ends with ::class, \strlen('::class') === 7
+ $classPos = stripos($identifier, '::class');
+ if ($classPos === strlen($identifier) - 7) {
+ return substr($identifier, 0, $classPos);
+ }
+
+ if (!defined($identifier)) {
+ throw AnnotationException::semanticalErrorConstants($identifier, $this->context);
+ }
+
+ return constant($identifier);
+ }
+
+ /**
+ * Identifier ::= string
+ *
+ * @return string
+ */
+ private function Identifier()
+ {
+ // check if we have an annotation
+ if ( ! $this->lexer->isNextTokenAny(self::$classIdentifiers)) {
+ $this->syntaxError('namespace separator or identifier');
+ }
+
+ $this->lexer->moveNext();
+
+ $className = $this->lexer->token['value'];
+
+ while ($this->lexer->lookahead['position'] === ($this->lexer->token['position'] + strlen($this->lexer->token['value']))
+ && $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) {
+
+ $this->match(DocLexer::T_NAMESPACE_SEPARATOR);
+ $this->matchAny(self::$classIdentifiers);
+
+ $className .= '\\' . $this->lexer->token['value'];
+ }
+
+ return $className;
+ }
+
+ /**
+ * Value ::= PlainValue | FieldAssignment
+ *
+ * @return mixed
+ */
+ private function Value()
+ {
+ $peek = $this->lexer->glimpse();
+
+ if (DocLexer::T_EQUALS === $peek['type']) {
+ return $this->FieldAssignment();
+ }
+
+ return $this->PlainValue();
+ }
+
+ /**
+ * PlainValue ::= integer | string | float | boolean | Array | Annotation
+ *
+ * @return mixed
+ */
+ private function PlainValue()
+ {
+ if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) {
+ return $this->Arrayx();
+ }
+
+ if ($this->lexer->isNextToken(DocLexer::T_AT)) {
+ return $this->Annotation();
+ }
+
+ if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
+ return $this->Constant();
+ }
+
+ switch ($this->lexer->lookahead['type']) {
+ case DocLexer::T_STRING:
+ $this->match(DocLexer::T_STRING);
+ return $this->lexer->token['value'];
+
+ case DocLexer::T_INTEGER:
+ $this->match(DocLexer::T_INTEGER);
+ return (int)$this->lexer->token['value'];
+
+ case DocLexer::T_FLOAT:
+ $this->match(DocLexer::T_FLOAT);
+ return (float)$this->lexer->token['value'];
+
+ case DocLexer::T_TRUE:
+ $this->match(DocLexer::T_TRUE);
+ return true;
+
+ case DocLexer::T_FALSE:
+ $this->match(DocLexer::T_FALSE);
+ return false;
+
+ case DocLexer::T_NULL:
+ $this->match(DocLexer::T_NULL);
+ return null;
+
+ default:
+ $this->syntaxError('PlainValue');
+ }
+ }
+
+ /**
+ * FieldAssignment ::= FieldName "=" PlainValue
+ * FieldName ::= identifier
+ *
+ * @return array
+ */
+ private function FieldAssignment()
+ {
+ $this->match(DocLexer::T_IDENTIFIER);
+ $fieldName = $this->lexer->token['value'];
+
+ $this->match(DocLexer::T_EQUALS);
+
+ $item = new \stdClass();
+ $item->name = $fieldName;
+ $item->value = $this->PlainValue();
+
+ return $item;
+ }
+
+ /**
+ * Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}"
+ *
+ * @return array
+ */
+ private function Arrayx()
+ {
+ $array = $values = array();
+
+ $this->match(DocLexer::T_OPEN_CURLY_BRACES);
+
+ // If the array is empty, stop parsing and return.
+ if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) {
+ $this->match(DocLexer::T_CLOSE_CURLY_BRACES);
+
+ return $array;
+ }
+
+ $values[] = $this->ArrayEntry();
+
+ while ($this->lexer->isNextToken(DocLexer::T_COMMA)) {
+ $this->match(DocLexer::T_COMMA);
+
+ // optional trailing comma
+ if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) {
+ break;
+ }
+
+ $values[] = $this->ArrayEntry();
+ }
+
+ $this->match(DocLexer::T_CLOSE_CURLY_BRACES);
+
+ foreach ($values as $value) {
+ list ($key, $val) = $value;
+
+ if ($key !== null) {
+ $array[$key] = $val;
+ } else {
+ $array[] = $val;
+ }
+ }
+
+ return $array;
+ }
+
+ /**
+ * ArrayEntry ::= Value | KeyValuePair
+ * KeyValuePair ::= Key ("=" | ":") PlainValue | Constant
+ * Key ::= string | integer | Constant
+ *
+ * @return array
+ */
+ private function ArrayEntry()
+ {
+ $peek = $this->lexer->glimpse();
+
+ if (DocLexer::T_EQUALS === $peek['type']
+ || DocLexer::T_COLON === $peek['type']) {
+
+ if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
+ $key = $this->Constant();
+ } else {
+ $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING));
+ $key = $this->lexer->token['value'];
+ }
+
+ $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON));
+
+ return array($key, $this->PlainValue());
+ }
+
+ return array(null, $this->Value());
+ }
+
+ /**
+ * Checks whether the given $name matches any ignored annotation name or namespace
+ *
+ * @param string $name
+ *
+ * @return bool
+ */
+ private function isIgnoredAnnotation($name)
+ {
+ if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) {
+ return true;
+ }
+
+ foreach (array_keys($this->ignoredAnnotationNamespaces) as $ignoredAnnotationNamespace) {
+ $ignoredAnnotationNamespace = rtrim($ignoredAnnotationNamespace, '\\') . '\\';
+
+ if (0 === stripos(rtrim($name, '\\') . '\\', $ignoredAnnotationNamespace)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php
new file mode 100644
index 00000000..24add1b3
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php
@@ -0,0 +1,288 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * File cache reader for annotations.
+ *
+ * @author Johannes M. Schmitt
+ * @author Benjamin Eberlei
+ *
+ * @deprecated the FileCacheReader is deprecated and will be removed
+ * in version 2.0.0 of doctrine/annotations. Please use the
+ * {@see \Doctrine\Common\Annotations\CachedReader} instead.
+ */
+class FileCacheReader implements Reader
+{
+ /**
+ * @var Reader
+ */
+ private $reader;
+
+ /**
+ * @var string
+ */
+ private $dir;
+
+ /**
+ * @var bool
+ */
+ private $debug;
+
+ /**
+ * @var array
+ */
+ private $loadedAnnotations = array();
+
+ /**
+ * @var array
+ */
+ private $classNameHashes = array();
+
+ /**
+ * @var int
+ */
+ private $umask;
+
+ /**
+ * Constructor.
+ *
+ * @param Reader $reader
+ * @param string $cacheDir
+ * @param boolean $debug
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function __construct(Reader $reader, $cacheDir, $debug = false, $umask = 0002)
+ {
+ if ( ! is_int($umask)) {
+ throw new \InvalidArgumentException(sprintf(
+ 'The parameter umask must be an integer, was: %s',
+ gettype($umask)
+ ));
+ }
+
+ $this->reader = $reader;
+ $this->umask = $umask;
+
+ if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777 & (~$this->umask), true)) {
+ throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $cacheDir));
+ }
+
+ $this->dir = rtrim($cacheDir, '\\/');
+ $this->debug = $debug;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotations(\ReflectionClass $class)
+ {
+ if ( ! isset($this->classNameHashes[$class->name])) {
+ $this->classNameHashes[$class->name] = sha1($class->name);
+ }
+ $key = $this->classNameHashes[$class->name];
+
+ if (isset($this->loadedAnnotations[$key])) {
+ return $this->loadedAnnotations[$key];
+ }
+
+ $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
+ if (!is_file($path)) {
+ $annot = $this->reader->getClassAnnotations($class);
+ $this->saveCacheFile($path, $annot);
+ return $this->loadedAnnotations[$key] = $annot;
+ }
+
+ if ($this->debug
+ && (false !== $filename = $class->getFilename())
+ && filemtime($path) < filemtime($filename)) {
+ @unlink($path);
+
+ $annot = $this->reader->getClassAnnotations($class);
+ $this->saveCacheFile($path, $annot);
+ return $this->loadedAnnotations[$key] = $annot;
+ }
+
+ return $this->loadedAnnotations[$key] = include $path;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotations(\ReflectionProperty $property)
+ {
+ $class = $property->getDeclaringClass();
+ if ( ! isset($this->classNameHashes[$class->name])) {
+ $this->classNameHashes[$class->name] = sha1($class->name);
+ }
+ $key = $this->classNameHashes[$class->name].'$'.$property->getName();
+
+ if (isset($this->loadedAnnotations[$key])) {
+ return $this->loadedAnnotations[$key];
+ }
+
+ $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
+ if (!is_file($path)) {
+ $annot = $this->reader->getPropertyAnnotations($property);
+ $this->saveCacheFile($path, $annot);
+ return $this->loadedAnnotations[$key] = $annot;
+ }
+
+ if ($this->debug
+ && (false !== $filename = $class->getFilename())
+ && filemtime($path) < filemtime($filename)) {
+ @unlink($path);
+
+ $annot = $this->reader->getPropertyAnnotations($property);
+ $this->saveCacheFile($path, $annot);
+ return $this->loadedAnnotations[$key] = $annot;
+ }
+
+ return $this->loadedAnnotations[$key] = include $path;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotations(\ReflectionMethod $method)
+ {
+ $class = $method->getDeclaringClass();
+ if ( ! isset($this->classNameHashes[$class->name])) {
+ $this->classNameHashes[$class->name] = sha1($class->name);
+ }
+ $key = $this->classNameHashes[$class->name].'#'.$method->getName();
+
+ if (isset($this->loadedAnnotations[$key])) {
+ return $this->loadedAnnotations[$key];
+ }
+
+ $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
+ if (!is_file($path)) {
+ $annot = $this->reader->getMethodAnnotations($method);
+ $this->saveCacheFile($path, $annot);
+ return $this->loadedAnnotations[$key] = $annot;
+ }
+
+ if ($this->debug
+ && (false !== $filename = $class->getFilename())
+ && filemtime($path) < filemtime($filename)) {
+ @unlink($path);
+
+ $annot = $this->reader->getMethodAnnotations($method);
+ $this->saveCacheFile($path, $annot);
+ return $this->loadedAnnotations[$key] = $annot;
+ }
+
+ return $this->loadedAnnotations[$key] = include $path;
+ }
+
+ /**
+ * Saves the cache file.
+ *
+ * @param string $path
+ * @param mixed $data
+ *
+ * @return void
+ */
+ private function saveCacheFile($path, $data)
+ {
+ if (!is_writable($this->dir)) {
+ throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support this, check out the acl package.', $this->dir));
+ }
+
+ $tempfile = tempnam($this->dir, uniqid('', true));
+
+ if (false === $tempfile) {
+ throw new \RuntimeException(sprintf('Unable to create tempfile in directory: %s', $this->dir));
+ }
+
+ $written = file_put_contents($tempfile, 'umask));
+
+ if (false === rename($tempfile, $path)) {
+ @unlink($tempfile);
+ throw new \RuntimeException(sprintf('Unable to rename %s to %s', $tempfile, $path));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotation(\ReflectionClass $class, $annotationName)
+ {
+ $annotations = $this->getClassAnnotations($class);
+
+ foreach ($annotations as $annotation) {
+ if ($annotation instanceof $annotationName) {
+ return $annotation;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
+ {
+ $annotations = $this->getMethodAnnotations($method);
+
+ foreach ($annotations as $annotation) {
+ if ($annotation instanceof $annotationName) {
+ return $annotation;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
+ {
+ $annotations = $this->getPropertyAnnotations($property);
+
+ foreach ($annotations as $annotation) {
+ if ($annotation instanceof $annotationName) {
+ return $annotation;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Clears loaded annotations.
+ *
+ * @return void
+ */
+ public function clearLoadedAnnotations()
+ {
+ $this->loadedAnnotations = array();
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php
new file mode 100644
index 00000000..bf7fbdcd
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php
@@ -0,0 +1,119 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Allows the reader to be used in-place of Doctrine's reader.
+ *
+ * @author Johannes M. Schmitt
+ */
+class IndexedReader implements Reader
+{
+ /**
+ * @var Reader
+ */
+ private $delegate;
+
+ /**
+ * Constructor.
+ *
+ * @param Reader $reader
+ */
+ public function __construct(Reader $reader)
+ {
+ $this->delegate = $reader;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotations(\ReflectionClass $class)
+ {
+ $annotations = array();
+ foreach ($this->delegate->getClassAnnotations($class) as $annot) {
+ $annotations[get_class($annot)] = $annot;
+ }
+
+ return $annotations;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotation(\ReflectionClass $class, $annotation)
+ {
+ return $this->delegate->getClassAnnotation($class, $annotation);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotations(\ReflectionMethod $method)
+ {
+ $annotations = array();
+ foreach ($this->delegate->getMethodAnnotations($method) as $annot) {
+ $annotations[get_class($annot)] = $annot;
+ }
+
+ return $annotations;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotation(\ReflectionMethod $method, $annotation)
+ {
+ return $this->delegate->getMethodAnnotation($method, $annotation);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotations(\ReflectionProperty $property)
+ {
+ $annotations = array();
+ foreach ($this->delegate->getPropertyAnnotations($property) as $annot) {
+ $annotations[get_class($annot)] = $annot;
+ }
+
+ return $annotations;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotation(\ReflectionProperty $property, $annotation)
+ {
+ return $this->delegate->getPropertyAnnotation($property, $annotation);
+ }
+
+ /**
+ * Proxies all methods to the delegate.
+ *
+ * @param string $method
+ * @param array $args
+ *
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ return call_user_func_array(array($this->delegate, $method), $args);
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php
new file mode 100644
index 00000000..21ee7cc9
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php
@@ -0,0 +1,91 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use SplFileObject;
+
+/**
+ * Parses a file for namespaces/use/class declarations.
+ *
+ * @author Fabien Potencier
+ * @author Christian Kaps
+ */
+final class PhpParser
+{
+ /**
+ * Parses a class.
+ *
+ * @param \ReflectionClass $class A ReflectionClass object.
+ *
+ * @return array A list with use statements in the form (Alias => FQN).
+ */
+ public function parseClass(\ReflectionClass $class)
+ {
+ if (method_exists($class, 'getUseStatements')) {
+ return $class->getUseStatements();
+ }
+
+ if (false === $filename = $class->getFilename()) {
+ return array();
+ }
+
+ $content = $this->getFileContent($filename, $class->getStartLine());
+
+ if (null === $content) {
+ return array();
+ }
+
+ $namespace = preg_quote($class->getNamespaceName());
+ $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content);
+ $tokenizer = new TokenParser('parseUseStatements($class->getNamespaceName());
+
+ return $statements;
+ }
+
+ /**
+ * Gets the content of the file right up to the given line number.
+ *
+ * @param string $filename The name of the file to load.
+ * @param integer $lineNumber The number of lines to read from file.
+ *
+ * @return string The content of the file.
+ */
+ private function getFileContent($filename, $lineNumber)
+ {
+ if ( ! is_file($filename)) {
+ return null;
+ }
+
+ $content = '';
+ $lineCnt = 0;
+ $file = new SplFileObject($filename);
+ while (!$file->eof()) {
+ if ($lineCnt++ == $lineNumber) {
+ break;
+ }
+
+ $content .= $file->fgets();
+ }
+
+ return $content;
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php
new file mode 100644
index 00000000..4774f873
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php
@@ -0,0 +1,89 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Interface for annotation readers.
+ *
+ * @author Johannes M. Schmitt
+ */
+interface Reader
+{
+ /**
+ * Gets the annotations applied to a class.
+ *
+ * @param \ReflectionClass $class The ReflectionClass of the class from which
+ * the class annotations should be read.
+ *
+ * @return array An array of Annotations.
+ */
+ function getClassAnnotations(\ReflectionClass $class);
+
+ /**
+ * Gets a class annotation.
+ *
+ * @param \ReflectionClass $class The ReflectionClass of the class from which
+ * the class annotations should be read.
+ * @param string $annotationName The name of the annotation.
+ *
+ * @return object|null The Annotation or NULL, if the requested annotation does not exist.
+ */
+ function getClassAnnotation(\ReflectionClass $class, $annotationName);
+
+ /**
+ * Gets the annotations applied to a method.
+ *
+ * @param \ReflectionMethod $method The ReflectionMethod of the method from which
+ * the annotations should be read.
+ *
+ * @return array An array of Annotations.
+ */
+ function getMethodAnnotations(\ReflectionMethod $method);
+
+ /**
+ * Gets a method annotation.
+ *
+ * @param \ReflectionMethod $method The ReflectionMethod to read the annotations from.
+ * @param string $annotationName The name of the annotation.
+ *
+ * @return object|null The Annotation or NULL, if the requested annotation does not exist.
+ */
+ function getMethodAnnotation(\ReflectionMethod $method, $annotationName);
+
+ /**
+ * Gets the annotations applied to a property.
+ *
+ * @param \ReflectionProperty $property The ReflectionProperty of the property
+ * from which the annotations should be read.
+ *
+ * @return array An array of Annotations.
+ */
+ function getPropertyAnnotations(\ReflectionProperty $property);
+
+ /**
+ * Gets a property annotation.
+ *
+ * @param \ReflectionProperty $property The ReflectionProperty to read the annotations from.
+ * @param string $annotationName The name of the annotation.
+ *
+ * @return object|null The Annotation or NULL, if the requested annotation does not exist.
+ */
+ function getPropertyAnnotation(\ReflectionProperty $property, $annotationName);
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php
new file mode 100644
index 00000000..d4757eea
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php
@@ -0,0 +1,127 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Simple Annotation Reader.
+ *
+ * This annotation reader is intended to be used in projects where you have
+ * full-control over all annotations that are available.
+ *
+ * @since 2.2
+ * @author Johannes M. Schmitt
+ * @author Fabio B. Silva
+ */
+class SimpleAnnotationReader implements Reader
+{
+ /**
+ * @var DocParser
+ */
+ private $parser;
+
+ /**
+ * Constructor.
+ *
+ * Initializes a new SimpleAnnotationReader.
+ */
+ public function __construct()
+ {
+ $this->parser = new DocParser();
+ $this->parser->setIgnoreNotImportedAnnotations(true);
+ }
+
+ /**
+ * Adds a namespace in which we will look for annotations.
+ *
+ * @param string $namespace
+ *
+ * @return void
+ */
+ public function addNamespace($namespace)
+ {
+ $this->parser->addNamespace($namespace);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotations(\ReflectionClass $class)
+ {
+ return $this->parser->parse($class->getDocComment(), 'class '.$class->getName());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotations(\ReflectionMethod $method)
+ {
+ return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotations(\ReflectionProperty $property)
+ {
+ return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassAnnotation(\ReflectionClass $class, $annotationName)
+ {
+ foreach ($this->getClassAnnotations($class) as $annot) {
+ if ($annot instanceof $annotationName) {
+ return $annot;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
+ {
+ foreach ($this->getMethodAnnotations($method) as $annot) {
+ if ($annot instanceof $annotationName) {
+ return $annot;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
+ {
+ foreach ($this->getPropertyAnnotations($property) as $annot) {
+ if ($annot instanceof $annotationName) {
+ return $annot;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php
new file mode 100644
index 00000000..bf1b7133
--- /dev/null
+++ b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php
@@ -0,0 +1,194 @@
+.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Parses a file for namespaces/use/class declarations.
+ *
+ * @author Fabien Potencier
+ * @author Christian Kaps
+ */
+class TokenParser
+{
+ /**
+ * The token list.
+ *
+ * @var array
+ */
+ private $tokens;
+
+ /**
+ * The number of tokens.
+ *
+ * @var int
+ */
+ private $numTokens;
+
+ /**
+ * The current array pointer.
+ *
+ * @var int
+ */
+ private $pointer = 0;
+
+ /**
+ * @param string $contents
+ */
+ public function __construct($contents)
+ {
+ $this->tokens = token_get_all($contents);
+
+ // The PHP parser sets internal compiler globals for certain things. Annoyingly, the last docblock comment it
+ // saw gets stored in doc_comment. When it comes to compile the next thing to be include()d this stored
+ // doc_comment becomes owned by the first thing the compiler sees in the file that it considers might have a
+ // docblock. If the first thing in the file is a class without a doc block this would cause calls to
+ // getDocBlock() on said class to return our long lost doc_comment. Argh.
+ // To workaround, cause the parser to parse an empty docblock. Sure getDocBlock() will return this, but at least
+ // it's harmless to us.
+ token_get_all("numTokens = count($this->tokens);
+ }
+
+ /**
+ * Gets the next non whitespace and non comment token.
+ *
+ * @param boolean $docCommentIsComment If TRUE then a doc comment is considered a comment and skipped.
+ * If FALSE then only whitespace and normal comments are skipped.
+ *
+ * @return array|null The token if exists, null otherwise.
+ */
+ public function next($docCommentIsComment = TRUE)
+ {
+ for ($i = $this->pointer; $i < $this->numTokens; $i++) {
+ $this->pointer++;
+ if ($this->tokens[$i][0] === T_WHITESPACE ||
+ $this->tokens[$i][0] === T_COMMENT ||
+ ($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT)) {
+
+ continue;
+ }
+
+ return $this->tokens[$i];
+ }
+
+ return null;
+ }
+
+ /**
+ * Parses a single use statement.
+ *
+ * @return array A list with all found class names for a use statement.
+ */
+ public function parseUseStatement()
+ {
+
+ $groupRoot = '';
+ $class = '';
+ $alias = '';
+ $statements = array();
+ $explicitAlias = false;
+ while (($token = $this->next())) {
+ $isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR;
+ if (!$explicitAlias && $isNameToken) {
+ $class .= $token[1];
+ $alias = $token[1];
+ } else if ($explicitAlias && $isNameToken) {
+ $alias .= $token[1];
+ } else if ($token[0] === T_AS) {
+ $explicitAlias = true;
+ $alias = '';
+ } else if ($token === ',') {
+ $statements[strtolower($alias)] = $groupRoot . $class;
+ $class = '';
+ $alias = '';
+ $explicitAlias = false;
+ } else if ($token === ';') {
+ $statements[strtolower($alias)] = $groupRoot . $class;
+ break;
+ } else if ($token === '{' ) {
+ $groupRoot = $class;
+ $class = '';
+ } else if ($token === '}' ) {
+ continue;
+ } else {
+ break;
+ }
+ }
+
+ return $statements;
+ }
+
+ /**
+ * Gets all use statements.
+ *
+ * @param string $namespaceName The namespace name of the reflected class.
+ *
+ * @return array A list with all found use statements.
+ */
+ public function parseUseStatements($namespaceName)
+ {
+ $statements = array();
+ while (($token = $this->next())) {
+ if ($token[0] === T_USE) {
+ $statements = array_merge($statements, $this->parseUseStatement());
+ continue;
+ }
+ if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $namespaceName) {
+ continue;
+ }
+
+ // Get fresh array for new namespace. This is to prevent the parser to collect the use statements
+ // for a previous namespace with the same name. This is the case if a namespace is defined twice
+ // or if a namespace with the same name is commented out.
+ $statements = array();
+ }
+
+ return $statements;
+ }
+
+ /**
+ * Gets the namespace.
+ *
+ * @return string The found namespace.
+ */
+ public function parseNamespace()
+ {
+ $name = '';
+ while (($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR)) {
+ $name .= $token[1];
+ }
+
+ return $name;
+ }
+
+ /**
+ * Gets the class name.
+ *
+ * @return string The found class name.
+ */
+ public function parseClass()
+ {
+ // Namespaces and class names are tokenized the same: T_STRINGs
+ // separated by T_NS_SEPARATOR so we can use one function to provide
+ // both.
+ return $this->parseNamespace();
+ }
+}
diff --git a/vendor/doctrine/cache/.coveralls.yml b/vendor/doctrine/cache/.coveralls.yml
new file mode 100644
index 00000000..0c082336
--- /dev/null
+++ b/vendor/doctrine/cache/.coveralls.yml
@@ -0,0 +1,4 @@
+# for php-coveralls
+service_name: travis-ci
+src_dir: lib
+coverage_clover: build/logs/clover.xml
diff --git a/vendor/doctrine/cache/.gitignore b/vendor/doctrine/cache/.gitignore
new file mode 100644
index 00000000..ca230231
--- /dev/null
+++ b/vendor/doctrine/cache/.gitignore
@@ -0,0 +1,4 @@
+vendor/
+build/
+phpunit.xml
+composer.lock
\ No newline at end of file
diff --git a/vendor/doctrine/cache/.travis.yml b/vendor/doctrine/cache/.travis.yml
new file mode 100644
index 00000000..a16fd9d9
--- /dev/null
+++ b/vendor/doctrine/cache/.travis.yml
@@ -0,0 +1,42 @@
+language: php
+
+sudo: false
+
+cache:
+ directories:
+ - vendor
+ - $HOME/.composer/cache
+
+php:
+ - 5.5
+ - 5.6
+ - 7.0
+ - hhvm
+
+services:
+ - riak
+ - mongodb
+ - memcached
+ - redis-server
+
+before_install:
+ - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]] ; then pecl channel-update pecl.php.net; fi;
+ - if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then pecl install riak-beta; fi;
+ - if [[ $TRAVIS_PHP_VERSION =~ 5.[56] ]] ; then echo yes | pecl install apcu-4.0.10; fi;
+ - if [[ $TRAVIS_PHP_VERSION = 7.* ]] ; then pecl config-set preferred_state beta; echo yes | pecl install apcu; fi;
+ - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]]; then phpenv config-add ./tests/travis/php.ini; fi;
+
+install:
+ - travis_retry composer install
+
+script:
+ - ./vendor/bin/phpunit -c ./tests/travis/phpunit.travis.xml -v
+
+after_script:
+ - php vendor/bin/coveralls -v
+
+matrix:
+ fast_finish: true
+ allow_failures:
+ - php: hhvm
+ - php: 7.0
diff --git a/vendor/doctrine/cache/LICENSE b/vendor/doctrine/cache/LICENSE
new file mode 100644
index 00000000..8c38cc1b
--- /dev/null
+++ b/vendor/doctrine/cache/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2006-2015 Doctrine Project
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/doctrine/cache/README.md b/vendor/doctrine/cache/README.md
new file mode 100644
index 00000000..94f80a30
--- /dev/null
+++ b/vendor/doctrine/cache/README.md
@@ -0,0 +1,14 @@
+# Doctrine Cache
+
+Master: [](http://travis-ci.org/doctrine/cache) [](https://coveralls.io/r/doctrine/cache?branch=master)
+
+[](https://packagist.org/packages/doctrine/cache) [](https://packagist.org/packages/doctrine/cache)
+
+Cache component extracted from the Doctrine Common project.
+
+## Changelog
+
+### v1.2
+
+* Added support for MongoDB as Cache Provider
+* Fix namespace version reset
diff --git a/vendor/doctrine/cache/UPGRADE.md b/vendor/doctrine/cache/UPGRADE.md
new file mode 100644
index 00000000..e1f8a503
--- /dev/null
+++ b/vendor/doctrine/cache/UPGRADE.md
@@ -0,0 +1,16 @@
+# Upgrade to 1.4
+
+## Minor BC Break: `Doctrine\Common\Cache\FileCache#$extension` is now `private`.
+
+If you need to override the value of `Doctrine\Common\Cache\FileCache#$extension`, then use the
+second parameter of `Doctrine\Common\Cache\FileCache#__construct()` instead of overriding
+the property in your own implementation.
+
+## Minor BC Break: file based caches paths changed
+
+`Doctrine\Common\Cache\FileCache`, `Doctrine\Common\Cache\PhpFileCache` and
+`Doctrine\Common\Cache\FilesystemCache` are using a different cache paths structure.
+
+If you rely on warmed up caches for deployments, consider that caches generated
+with `doctrine/cache` `<1.4` are not compatible with the new directory structure,
+and will be ignored.
diff --git a/vendor/doctrine/cache/build.properties b/vendor/doctrine/cache/build.properties
new file mode 100644
index 00000000..2d98c360
--- /dev/null
+++ b/vendor/doctrine/cache/build.properties
@@ -0,0 +1,3 @@
+# Version class and file
+project.version_class = Doctrine\\Common\\Cache\\Version
+project.version_file = lib/Doctrine/Common/Cache/Version.php
diff --git a/vendor/doctrine/cache/build.xml b/vendor/doctrine/cache/build.xml
new file mode 100644
index 00000000..a7c52e3c
--- /dev/null
+++ b/vendor/doctrine/cache/build.xml
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/doctrine/cache/composer.json b/vendor/doctrine/cache/composer.json
new file mode 100644
index 00000000..7ef1727a
--- /dev/null
+++ b/vendor/doctrine/cache/composer.json
@@ -0,0 +1,37 @@
+{
+ "name": "doctrine/cache",
+ "type": "library",
+ "description": "Caching library offering an object-oriented API for many cache backends",
+ "keywords": ["cache", "caching"],
+ "homepage": "http://www.doctrine-project.org",
+ "license": "MIT",
+ "authors": [
+ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
+ {"name": "Roman Borschel", "email": "roman@code-factory.org"},
+ {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
+ {"name": "Jonathan Wage", "email": "jonwage@gmail.com"},
+ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
+ ],
+ "require": {
+ "php": "~5.5|~7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8|~5.0",
+ "satooshi/php-coveralls": "~0.6",
+ "predis/predis": "~1.0"
+ },
+ "conflict": {
+ "doctrine/common": ">2.2,<2.4"
+ },
+ "autoload": {
+ "psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" }
+ },
+ "autoload-dev": {
+ "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests" }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.6.x-dev"
+ }
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php
new file mode 100644
index 00000000..0dfbd6a1
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php
@@ -0,0 +1,118 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * APC cache provider.
+ *
+ * @link www.doctrine-project.org
+ * @deprecated since version 1.6, use ApcuCache instead
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author David Abdemoulaie
+ */
+class ApcCache extends CacheProvider
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return apc_fetch($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return apc_exists($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ return apc_store($id, $data, $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ // apc_delete returns false if the id does not exist
+ return apc_delete($id) || ! apc_exists($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ return apc_clear_cache() && apc_clear_cache('user');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetchMultiple(array $keys)
+ {
+ return apc_fetch($keys) ?: [];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSaveMultiple(array $keysAndValues, $lifetime = 0)
+ {
+ $result = apc_store($keysAndValues, null, $lifetime);
+
+ return empty($result);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $info = apc_cache_info('', true);
+ $sma = apc_sma_info();
+
+ // @TODO - Temporary fix @see https://github.com/krakjoe/apcu/pull/42
+ if (PHP_VERSION_ID >= 50500) {
+ $info['num_hits'] = isset($info['num_hits']) ? $info['num_hits'] : $info['nhits'];
+ $info['num_misses'] = isset($info['num_misses']) ? $info['num_misses'] : $info['nmisses'];
+ $info['start_time'] = isset($info['start_time']) ? $info['start_time'] : $info['stime'];
+ }
+
+ return array(
+ Cache::STATS_HITS => $info['num_hits'],
+ Cache::STATS_MISSES => $info['num_misses'],
+ Cache::STATS_UPTIME => $info['start_time'],
+ Cache::STATS_MEMORY_USAGE => $info['mem_size'],
+ Cache::STATS_MEMORY_AVAILABLE => $sma['avail_mem'],
+ );
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php
new file mode 100644
index 00000000..2a91752b
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php
@@ -0,0 +1,106 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * APCu cache provider.
+ *
+ * @link www.doctrine-project.org
+ * @since 1.6
+ * @author Kévin Dunglas
+ */
+class ApcuCache extends CacheProvider
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return apcu_fetch($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return apcu_exists($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ return apcu_store($id, $data, $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ // apcu_delete returns false if the id does not exist
+ return apcu_delete($id) || ! apcu_exists($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ return apcu_clear_cache();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetchMultiple(array $keys)
+ {
+ return apcu_fetch($keys) ?: [];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSaveMultiple(array $keysAndValues, $lifetime = 0)
+ {
+ $result = apcu_store($keysAndValues, null, $lifetime);
+
+ return empty($result);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $info = apcu_cache_info(true);
+ $sma = apcu_sma_info();
+
+ return array(
+ Cache::STATS_HITS => $info['num_hits'],
+ Cache::STATS_MISSES => $info['num_misses'],
+ Cache::STATS_UPTIME => $info['start_time'],
+ Cache::STATS_MEMORY_USAGE => $info['mem_size'],
+ Cache::STATS_MEMORY_AVAILABLE => $sma['avail_mem'],
+ );
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php
new file mode 100644
index 00000000..6610cc21
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php
@@ -0,0 +1,142 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Array cache driver.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author David Abdemoulaie
+ */
+class ArrayCache extends CacheProvider
+{
+ /**
+ * @var array[] $data each element being a tuple of [$data, $expiration], where the expiration is int|bool
+ */
+ private $data = [];
+
+ /**
+ * @var int
+ */
+ private $hitsCount = 0;
+
+ /**
+ * @var int
+ */
+ private $missesCount = 0;
+
+ /**
+ * @var int
+ */
+ private $upTime;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function __construct()
+ {
+ $this->upTime = time();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ if (! $this->doContains($id)) {
+ $this->missesCount += 1;
+
+ return false;
+ }
+
+ $this->hitsCount += 1;
+
+ return $this->data[$id][0];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ if (! isset($this->data[$id])) {
+ return false;
+ }
+
+ $expiration = $this->data[$id][1];
+
+ if ($expiration && $expiration < time()) {
+ $this->doDelete($id);
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ $this->data[$id] = [$data, $lifeTime ? time() + $lifeTime : false];
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ unset($this->data[$id]);
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ $this->data = [];
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ return [
+ Cache::STATS_HITS => $this->hitsCount,
+ Cache::STATS_MISSES => $this->missesCount,
+ Cache::STATS_UPTIME => $this->upTime,
+ Cache::STATS_MEMORY_USAGE => null,
+ Cache::STATS_MEMORY_AVAILABLE => null,
+ ];
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php
new file mode 100644
index 00000000..89fe3230
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php
@@ -0,0 +1,116 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Interface for cache drivers.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Fabio B. Silva
+ * @author Kévin Dunglas
+ */
+interface Cache
+{
+ const STATS_HITS = 'hits';
+ const STATS_MISSES = 'misses';
+ const STATS_UPTIME = 'uptime';
+ const STATS_MEMORY_USAGE = 'memory_usage';
+ const STATS_MEMORY_AVAILABLE = 'memory_available';
+ /**
+ * Only for backward compatibility (may be removed in next major release)
+ *
+ * @deprecated
+ */
+ const STATS_MEMORY_AVAILIABLE = 'memory_available';
+
+ /**
+ * Fetches an entry from the cache.
+ *
+ * @param string $id The id of the cache entry to fetch.
+ *
+ * @return mixed The cached data or FALSE, if no cache entry exists for the given id.
+ */
+ public function fetch($id);
+
+ /**
+ * Tests if an entry exists in the cache.
+ *
+ * @param string $id The cache id of the entry to check for.
+ *
+ * @return bool TRUE if a cache entry exists for the given cache id, FALSE otherwise.
+ */
+ public function contains($id);
+
+ /**
+ * Puts data into the cache.
+ *
+ * If a cache entry with the given id already exists, its data will be replaced.
+ *
+ * @param string $id The cache id.
+ * @param mixed $data The cache entry/data.
+ * @param int $lifeTime The lifetime in number of seconds for this cache entry.
+ * If zero (the default), the entry never expires (although it may be deleted from the cache
+ * to make place for other entries).
+ *
+ * @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise.
+ */
+ public function save($id, $data, $lifeTime = 0);
+
+ /**
+ * Deletes a cache entry.
+ *
+ * @param string $id The cache id.
+ *
+ * @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise.
+ * Deleting a non-existing entry is considered successful.
+ */
+ public function delete($id);
+
+ /**
+ * Retrieves cached information from the data store.
+ *
+ * The server's statistics array has the following values:
+ *
+ * - hits
+ * Number of keys that have been requested and found present.
+ *
+ * - misses
+ * Number of items that have been requested and not found.
+ *
+ * - uptime
+ * Time that the server is running.
+ *
+ * - memory_usage
+ * Memory used by this server to store items.
+ *
+ * - memory_available
+ * Memory allowed to use for storage.
+ *
+ * @since 2.2
+ *
+ * @return array|null An associative array with server's statistics if available, NULL otherwise.
+ */
+ public function getStats();
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php
new file mode 100644
index 00000000..9f579237
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php
@@ -0,0 +1,312 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Base class for cache provider implementations.
+ *
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Fabio B. Silva
+ */
+abstract class CacheProvider implements Cache, FlushableCache, ClearableCache, MultiGetCache, MultiPutCache
+{
+ const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]';
+
+ /**
+ * The namespace to prefix all cache ids with.
+ *
+ * @var string
+ */
+ private $namespace = '';
+
+ /**
+ * The namespace version.
+ *
+ * @var integer|null
+ */
+ private $namespaceVersion;
+
+ /**
+ * Sets the namespace to prefix all cache ids with.
+ *
+ * @param string $namespace
+ *
+ * @return void
+ */
+ public function setNamespace($namespace)
+ {
+ $this->namespace = (string) $namespace;
+ $this->namespaceVersion = null;
+ }
+
+ /**
+ * Retrieves the namespace that prefixes all cache ids.
+ *
+ * @return string
+ */
+ public function getNamespace()
+ {
+ return $this->namespace;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function fetch($id)
+ {
+ return $this->doFetch($this->getNamespacedId($id));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function fetchMultiple(array $keys)
+ {
+ if (empty($keys)) {
+ return array();
+ }
+
+ // note: the array_combine() is in place to keep an association between our $keys and the $namespacedKeys
+ $namespacedKeys = array_combine($keys, array_map(array($this, 'getNamespacedId'), $keys));
+ $items = $this->doFetchMultiple($namespacedKeys);
+ $foundItems = array();
+
+ // no internal array function supports this sort of mapping: needs to be iterative
+ // this filters and combines keys in one pass
+ foreach ($namespacedKeys as $requestedKey => $namespacedKey) {
+ if (isset($items[$namespacedKey]) || array_key_exists($namespacedKey, $items)) {
+ $foundItems[$requestedKey] = $items[$namespacedKey];
+ }
+ }
+
+ return $foundItems;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function saveMultiple(array $keysAndValues, $lifetime = 0)
+ {
+ $namespacedKeysAndValues = array();
+ foreach ($keysAndValues as $key => $value) {
+ $namespacedKeysAndValues[$this->getNamespacedId($key)] = $value;
+ }
+
+ return $this->doSaveMultiple($namespacedKeysAndValues, $lifetime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function contains($id)
+ {
+ return $this->doContains($this->getNamespacedId($id));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function save($id, $data, $lifeTime = 0)
+ {
+ return $this->doSave($this->getNamespacedId($id), $data, $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete($id)
+ {
+ return $this->doDelete($this->getNamespacedId($id));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getStats()
+ {
+ return $this->doGetStats();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function flushAll()
+ {
+ return $this->doFlush();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function deleteAll()
+ {
+ $namespaceCacheKey = $this->getNamespaceCacheKey();
+ $namespaceVersion = $this->getNamespaceVersion() + 1;
+
+ if ($this->doSave($namespaceCacheKey, $namespaceVersion)) {
+ $this->namespaceVersion = $namespaceVersion;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Prefixes the passed id with the configured namespace value.
+ *
+ * @param string $id The id to namespace.
+ *
+ * @return string The namespaced id.
+ */
+ private function getNamespacedId($id)
+ {
+ $namespaceVersion = $this->getNamespaceVersion();
+
+ return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion);
+ }
+
+ /**
+ * Returns the namespace cache key.
+ *
+ * @return string
+ */
+ private function getNamespaceCacheKey()
+ {
+ return sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace);
+ }
+
+ /**
+ * Returns the namespace version.
+ *
+ * @return integer
+ */
+ private function getNamespaceVersion()
+ {
+ if (null !== $this->namespaceVersion) {
+ return $this->namespaceVersion;
+ }
+
+ $namespaceCacheKey = $this->getNamespaceCacheKey();
+ $this->namespaceVersion = $this->doFetch($namespaceCacheKey) ?: 1;
+
+ return $this->namespaceVersion;
+ }
+
+ /**
+ * Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it.
+ *
+ * @param array $keys Array of keys to retrieve from cache
+ * @return array Array of values retrieved for the given keys.
+ */
+ protected function doFetchMultiple(array $keys)
+ {
+ $returnValues = array();
+
+ foreach ($keys as $key) {
+ if (false !== ($item = $this->doFetch($key)) || $this->doContains($key)) {
+ $returnValues[$key] = $item;
+ }
+ }
+
+ return $returnValues;
+ }
+
+ /**
+ * Fetches an entry from the cache.
+ *
+ * @param string $id The id of the cache entry to fetch.
+ *
+ * @return mixed|false The cached data or FALSE, if no cache entry exists for the given id.
+ */
+ abstract protected function doFetch($id);
+
+ /**
+ * Tests if an entry exists in the cache.
+ *
+ * @param string $id The cache id of the entry to check for.
+ *
+ * @return bool TRUE if a cache entry exists for the given cache id, FALSE otherwise.
+ */
+ abstract protected function doContains($id);
+
+ /**
+ * Default implementation of doSaveMultiple. Each driver that supports multi-put should override it.
+ *
+ * @param array $keysAndValues Array of keys and values to save in cache
+ * @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these
+ * cache entries (0 => infinite lifeTime).
+ *
+ * @return bool TRUE if the operation was successful, FALSE if it wasn't.
+ */
+ protected function doSaveMultiple(array $keysAndValues, $lifetime = 0)
+ {
+ $success = true;
+
+ foreach ($keysAndValues as $key => $value) {
+ if (!$this->doSave($key, $value, $lifetime)) {
+ $success = false;
+ }
+ }
+
+ return $success;
+ }
+
+ /**
+ * Puts data into the cache.
+ *
+ * @param string $id The cache id.
+ * @param string $data The cache entry/data.
+ * @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this
+ * cache entry (0 => infinite lifeTime).
+ *
+ * @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise.
+ */
+ abstract protected function doSave($id, $data, $lifeTime = 0);
+
+ /**
+ * Deletes a cache entry.
+ *
+ * @param string $id The cache id.
+ *
+ * @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise.
+ */
+ abstract protected function doDelete($id);
+
+ /**
+ * Flushes all cache entries.
+ *
+ * @return bool TRUE if the cache entries were successfully flushed, FALSE otherwise.
+ */
+ abstract protected function doFlush();
+
+ /**
+ * Retrieves cached information from the data store.
+ *
+ * @since 2.2
+ *
+ * @return array|null An associative array with server's statistics if available, NULL otherwise.
+ */
+ abstract protected function doGetStats();
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php
new file mode 100644
index 00000000..96c9b547
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php
@@ -0,0 +1,147 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Cache provider that allows to easily chain multiple cache providers
+ *
+ * @author Michaël Gallego
+ */
+class ChainCache extends CacheProvider
+{
+ /**
+ * @var CacheProvider[]
+ */
+ private $cacheProviders = array();
+
+ /**
+ * Constructor
+ *
+ * @param CacheProvider[] $cacheProviders
+ */
+ public function __construct($cacheProviders = array())
+ {
+ $this->cacheProviders = $cacheProviders;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function setNamespace($namespace)
+ {
+ parent::setNamespace($namespace);
+
+ foreach ($this->cacheProviders as $cacheProvider) {
+ $cacheProvider->setNamespace($namespace);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doFetch($id)
+ {
+ foreach ($this->cacheProviders as $key => $cacheProvider) {
+ if ($cacheProvider->doContains($id)) {
+ $value = $cacheProvider->doFetch($id);
+
+ // We populate all the previous cache layers (that are assumed to be faster)
+ for ($subKey = $key - 1 ; $subKey >= 0 ; $subKey--) {
+ $this->cacheProviders[$subKey]->doSave($id, $value);
+ }
+
+ return $value;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doContains($id)
+ {
+ foreach ($this->cacheProviders as $cacheProvider) {
+ if ($cacheProvider->doContains($id)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ $stored = true;
+
+ foreach ($this->cacheProviders as $cacheProvider) {
+ $stored = $cacheProvider->doSave($id, $data, $lifeTime) && $stored;
+ }
+
+ return $stored;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doDelete($id)
+ {
+ $deleted = true;
+
+ foreach ($this->cacheProviders as $cacheProvider) {
+ $deleted = $cacheProvider->doDelete($id) && $deleted;
+ }
+
+ return $deleted;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doFlush()
+ {
+ $flushed = true;
+
+ foreach ($this->cacheProviders as $cacheProvider) {
+ $flushed = $cacheProvider->doFlush() && $flushed;
+ }
+
+ return $flushed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doGetStats()
+ {
+ // We return all the stats from all adapters
+ $stats = array();
+
+ foreach ($this->cacheProviders as $cacheProvider) {
+ $stats[] = $cacheProvider->doGetStats();
+ }
+
+ return $stats;
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php
new file mode 100644
index 00000000..3a91eaf3
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php
@@ -0,0 +1,40 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Interface for cache that can be flushed.
+ *
+ * Intended to be used for partial clearing of a cache namespace. For a more
+ * global "flushing", see {@see FlushableCache}.
+ *
+ * @link www.doctrine-project.org
+ * @since 1.4
+ * @author Adirelle
+ */
+interface ClearableCache
+{
+ /**
+ * Deletes all cache entries in the current cache namespace.
+ *
+ * @return bool TRUE if the cache entries were successfully deleted, FALSE otherwise.
+ */
+ public function deleteAll();
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php
new file mode 100644
index 00000000..c21691df
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php
@@ -0,0 +1,121 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+use \Couchbase;
+
+/**
+ * Couchbase cache provider.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.4
+ * @author Michael Nitschinger
+ */
+class CouchbaseCache extends CacheProvider
+{
+ /**
+ * @var Couchbase|null
+ */
+ private $couchbase;
+
+ /**
+ * Sets the Couchbase instance to use.
+ *
+ * @param Couchbase $couchbase
+ *
+ * @return void
+ */
+ public function setCouchbase(Couchbase $couchbase)
+ {
+ $this->couchbase = $couchbase;
+ }
+
+ /**
+ * Gets the Couchbase instance used by the cache.
+ *
+ * @return Couchbase|null
+ */
+ public function getCouchbase()
+ {
+ return $this->couchbase;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return $this->couchbase->get($id) ?: false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return (null !== $this->couchbase->get($id));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ if ($lifeTime > 30 * 24 * 3600) {
+ $lifeTime = time() + $lifeTime;
+ }
+ return $this->couchbase->set($id, $data, (int) $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ return $this->couchbase->delete($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ return $this->couchbase->flush();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $stats = $this->couchbase->getStats();
+ $servers = $this->couchbase->getServers();
+ $server = explode(":", $servers[0]);
+ $key = $server[0] . ":" . "11210";
+ $stats = $stats[$key];
+ return array(
+ Cache::STATS_HITS => $stats['get_hits'],
+ Cache::STATS_MISSES => $stats['get_misses'],
+ Cache::STATS_UPTIME => $stats['uptime'],
+ Cache::STATS_MEMORY_USAGE => $stats['bytes'],
+ Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'],
+ );
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php
new file mode 100644
index 00000000..b2e0427e
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php
@@ -0,0 +1,286 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Base file cache driver.
+ *
+ * @since 2.3
+ * @author Fabio B. Silva
+ * @author Tobias Schultze
+ */
+abstract class FileCache extends CacheProvider
+{
+ /**
+ * The cache directory.
+ *
+ * @var string
+ */
+ protected $directory;
+
+ /**
+ * The cache file extension.
+ *
+ * @var string
+ */
+ private $extension;
+
+ /**
+ * @var int
+ */
+ private $umask;
+
+ /**
+ * @var int
+ */
+ private $directoryStringLength;
+
+ /**
+ * @var int
+ */
+ private $extensionStringLength;
+
+ /**
+ * @var bool
+ */
+ private $isRunningOnWindows;
+
+ /**
+ * Constructor.
+ *
+ * @param string $directory The cache directory.
+ * @param string $extension The cache file extension.
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function __construct($directory, $extension = '', $umask = 0002)
+ {
+ // YES, this needs to be *before* createPathIfNeeded()
+ if ( ! is_int($umask)) {
+ throw new \InvalidArgumentException(sprintf(
+ 'The umask parameter is required to be integer, was: %s',
+ gettype($umask)
+ ));
+ }
+ $this->umask = $umask;
+
+ if ( ! $this->createPathIfNeeded($directory)) {
+ throw new \InvalidArgumentException(sprintf(
+ 'The directory "%s" does not exist and could not be created.',
+ $directory
+ ));
+ }
+
+ if ( ! is_writable($directory)) {
+ throw new \InvalidArgumentException(sprintf(
+ 'The directory "%s" is not writable.',
+ $directory
+ ));
+ }
+
+ // YES, this needs to be *after* createPathIfNeeded()
+ $this->directory = realpath($directory);
+ $this->extension = (string) $extension;
+
+ $this->directoryStringLength = strlen($this->directory);
+ $this->extensionStringLength = strlen($this->extension);
+ $this->isRunningOnWindows = defined('PHP_WINDOWS_VERSION_BUILD');
+ }
+
+ /**
+ * Gets the cache directory.
+ *
+ * @return string
+ */
+ public function getDirectory()
+ {
+ return $this->directory;
+ }
+
+ /**
+ * Gets the cache file extension.
+ *
+ * @return string
+ */
+ public function getExtension()
+ {
+ return $this->extension;
+ }
+
+ /**
+ * @param string $id
+ *
+ * @return string
+ */
+ protected function getFilename($id)
+ {
+ $hash = hash('sha256', $id);
+
+ // This ensures that the filename is unique and that there are no invalid chars in it.
+ if (
+ '' === $id
+ || ((strlen($id) * 2 + $this->extensionStringLength) > 255)
+ || ($this->isRunningOnWindows && ($this->directoryStringLength + 4 + strlen($id) * 2 + $this->extensionStringLength) > 258)
+ ) {
+ // Most filesystems have a limit of 255 chars for each path component. On Windows the the whole path is limited
+ // to 260 chars (including terminating null char). Using long UNC ("\\?\" prefix) does not work with the PHP API.
+ // And there is a bug in PHP (https://bugs.php.net/bug.php?id=70943) with path lengths of 259.
+ // So if the id in hex representation would surpass the limit, we use the hash instead. The prefix prevents
+ // collisions between the hash and bin2hex.
+ $filename = '_' . $hash;
+ } else {
+ $filename = bin2hex($id);
+ }
+
+ return $this->directory
+ . DIRECTORY_SEPARATOR
+ . substr($hash, 0, 2)
+ . DIRECTORY_SEPARATOR
+ . $filename
+ . $this->extension;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ $filename = $this->getFilename($id);
+
+ return @unlink($filename) || ! file_exists($filename);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ foreach ($this->getIterator() as $name => $file) {
+ if ($file->isDir()) {
+ // Remove the intermediate directories which have been created to balance the tree. It only takes effect
+ // if the directory is empty. If several caches share the same directory but with different file extensions,
+ // the other ones are not removed.
+ @rmdir($name);
+ } elseif ($this->isFilenameEndingWithExtension($name)) {
+ // If an extension is set, only remove files which end with the given extension.
+ // If no extension is set, we have no other choice than removing everything.
+ @unlink($name);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $usage = 0;
+ foreach ($this->getIterator() as $name => $file) {
+ if (! $file->isDir() && $this->isFilenameEndingWithExtension($name)) {
+ $usage += $file->getSize();
+ }
+ }
+
+ $free = disk_free_space($this->directory);
+
+ return array(
+ Cache::STATS_HITS => null,
+ Cache::STATS_MISSES => null,
+ Cache::STATS_UPTIME => null,
+ Cache::STATS_MEMORY_USAGE => $usage,
+ Cache::STATS_MEMORY_AVAILABLE => $free,
+ );
+ }
+
+ /**
+ * Create path if needed.
+ *
+ * @param string $path
+ * @return bool TRUE on success or if path already exists, FALSE if path cannot be created.
+ */
+ private function createPathIfNeeded($path)
+ {
+ if ( ! is_dir($path)) {
+ if (false === @mkdir($path, 0777 & (~$this->umask), true) && !is_dir($path)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Writes a string content to file in an atomic way.
+ *
+ * @param string $filename Path to the file where to write the data.
+ * @param string $content The content to write
+ *
+ * @return bool TRUE on success, FALSE if path cannot be created, if path is not writable or an any other error.
+ */
+ protected function writeFile($filename, $content)
+ {
+ $filepath = pathinfo($filename, PATHINFO_DIRNAME);
+
+ if ( ! $this->createPathIfNeeded($filepath)) {
+ return false;
+ }
+
+ if ( ! is_writable($filepath)) {
+ return false;
+ }
+
+ $tmpFile = tempnam($filepath, 'swap');
+ @chmod($tmpFile, 0666 & (~$this->umask));
+
+ if (file_put_contents($tmpFile, $content) !== false) {
+ if (@rename($tmpFile, $filename)) {
+ return true;
+ }
+
+ @unlink($tmpFile);
+ }
+
+ return false;
+ }
+
+ /**
+ * @return \Iterator
+ */
+ private function getIterator()
+ {
+ return new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($this->directory, \FilesystemIterator::SKIP_DOTS),
+ \RecursiveIteratorIterator::CHILD_FIRST
+ );
+ }
+
+ /**
+ * @param string $name The filename
+ *
+ * @return bool
+ */
+ private function isFilenameEndingWithExtension($name)
+ {
+ return '' === $this->extension
+ || strrpos($name, $this->extension) === (strlen($name) - $this->extensionStringLength);
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php
new file mode 100644
index 00000000..d988294f
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php
@@ -0,0 +1,111 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Filesystem cache driver.
+ *
+ * @since 2.3
+ * @author Fabio B. Silva
+ */
+class FilesystemCache extends FileCache
+{
+ const EXTENSION = '.doctrinecache.data';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function __construct($directory, $extension = self::EXTENSION, $umask = 0002)
+ {
+ parent::__construct($directory, $extension, $umask);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ $data = '';
+ $lifetime = -1;
+ $filename = $this->getFilename($id);
+
+ if ( ! is_file($filename)) {
+ return false;
+ }
+
+ $resource = fopen($filename, "r");
+
+ if (false !== ($line = fgets($resource))) {
+ $lifetime = (int) $line;
+ }
+
+ if ($lifetime !== 0 && $lifetime < time()) {
+ fclose($resource);
+
+ return false;
+ }
+
+ while (false !== ($line = fgets($resource))) {
+ $data .= $line;
+ }
+
+ fclose($resource);
+
+ return unserialize($data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ $lifetime = -1;
+ $filename = $this->getFilename($id);
+
+ if ( ! is_file($filename)) {
+ return false;
+ }
+
+ $resource = fopen($filename, "r");
+
+ if (false !== ($line = fgets($resource))) {
+ $lifetime = (int) $line;
+ }
+
+ fclose($resource);
+
+ return $lifetime === 0 || $lifetime > time();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ if ($lifeTime > 0) {
+ $lifeTime = time() + $lifeTime;
+ }
+
+ $data = serialize($data);
+ $filename = $this->getFilename($id);
+
+ return $this->writeFile($filename, $lifeTime . PHP_EOL . $data);
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php
new file mode 100644
index 00000000..4311d4f5
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php
@@ -0,0 +1,37 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Interface for cache that can be flushed.
+ *
+ * @link www.doctrine-project.org
+ * @since 1.4
+ * @author Adirelle
+ */
+interface FlushableCache
+{
+ /**
+ * Flushes all cache entries, globally.
+ *
+ * @return bool TRUE if the cache entries were successfully flushed, FALSE otherwise.
+ */
+ public function flushAll();
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php
new file mode 100644
index 00000000..8afaeeac
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php
@@ -0,0 +1,126 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+use \Memcache;
+
+/**
+ * Memcache cache provider.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author David Abdemoulaie
+ */
+class MemcacheCache extends CacheProvider
+{
+ /**
+ * @var Memcache|null
+ */
+ private $memcache;
+
+ /**
+ * Sets the memcache instance to use.
+ *
+ * @param Memcache $memcache
+ *
+ * @return void
+ */
+ public function setMemcache(Memcache $memcache)
+ {
+ $this->memcache = $memcache;
+ }
+
+ /**
+ * Gets the memcache instance used by the cache.
+ *
+ * @return Memcache|null
+ */
+ public function getMemcache()
+ {
+ return $this->memcache;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return $this->memcache->get($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ $flags = null;
+ $this->memcache->get($id, $flags);
+
+ //if memcache has changed the value of "flags", it means the value exists
+ return ($flags !== null);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ if ($lifeTime > 30 * 24 * 3600) {
+ $lifeTime = time() + $lifeTime;
+ }
+ return $this->memcache->set($id, $data, 0, (int) $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ // Memcache::delete() returns false if entry does not exist
+ return $this->memcache->delete($id) || ! $this->doContains($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ return $this->memcache->flush();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $stats = $this->memcache->getStats();
+ return array(
+ Cache::STATS_HITS => $stats['get_hits'],
+ Cache::STATS_MISSES => $stats['get_misses'],
+ Cache::STATS_UPTIME => $stats['uptime'],
+ Cache::STATS_MEMORY_USAGE => $stats['bytes'],
+ Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'],
+ );
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php
new file mode 100644
index 00000000..dc4016b5
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php
@@ -0,0 +1,146 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+use \Memcached;
+
+/**
+ * Memcached cache provider.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author David Abdemoulaie
+ */
+class MemcachedCache extends CacheProvider
+{
+ /**
+ * @var Memcached|null
+ */
+ private $memcached;
+
+ /**
+ * Sets the memcache instance to use.
+ *
+ * @param Memcached $memcached
+ *
+ * @return void
+ */
+ public function setMemcached(Memcached $memcached)
+ {
+ $this->memcached = $memcached;
+ }
+
+ /**
+ * Gets the memcached instance used by the cache.
+ *
+ * @return Memcached|null
+ */
+ public function getMemcached()
+ {
+ return $this->memcached;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return $this->memcached->get($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetchMultiple(array $keys)
+ {
+ return $this->memcached->getMulti($keys) ?: [];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSaveMultiple(array $keysAndValues, $lifetime = 0)
+ {
+ if ($lifetime > 30 * 24 * 3600) {
+ $lifetime = time() + $lifetime;
+ }
+
+ return $this->memcached->setMulti($keysAndValues, $lifetime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return false !== $this->memcached->get($id)
+ || $this->memcached->getResultCode() !== Memcached::RES_NOTFOUND;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ if ($lifeTime > 30 * 24 * 3600) {
+ $lifeTime = time() + $lifeTime;
+ }
+ return $this->memcached->set($id, $data, (int) $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ return $this->memcached->delete($id)
+ || $this->memcached->getResultCode() === Memcached::RES_NOTFOUND;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ return $this->memcached->flush();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $stats = $this->memcached->getStats();
+ $servers = $this->memcached->getServerList();
+ $key = $servers[0]['host'] . ':' . $servers[0]['port'];
+ $stats = $stats[$key];
+ return array(
+ Cache::STATS_HITS => $stats['get_hits'],
+ Cache::STATS_MISSES => $stats['get_misses'],
+ Cache::STATS_UPTIME => $stats['uptime'],
+ Cache::STATS_MEMORY_USAGE => $stats['bytes'],
+ Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes'],
+ );
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php
new file mode 100644
index 00000000..75fe0ca1
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php
@@ -0,0 +1,197 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+use MongoBinData;
+use MongoCollection;
+use MongoCursorException;
+use MongoDate;
+
+/**
+ * MongoDB cache provider.
+ *
+ * @since 1.1
+ * @author Jeremy Mikola
+ */
+class MongoDBCache extends CacheProvider
+{
+ /**
+ * The data field will store the serialized PHP value.
+ */
+ const DATA_FIELD = 'd';
+
+ /**
+ * The expiration field will store a MongoDate value indicating when the
+ * cache entry should expire.
+ *
+ * With MongoDB 2.2+, entries can be automatically deleted by MongoDB by
+ * indexing this field with the "expireAfterSeconds" option equal to zero.
+ * This will direct MongoDB to regularly query for and delete any entries
+ * whose date is older than the current time. Entries without a date value
+ * in this field will be ignored.
+ *
+ * The cache provider will also check dates on its own, in case expired
+ * entries are fetched before MongoDB's TTLMonitor pass can expire them.
+ *
+ * @see http://docs.mongodb.org/manual/tutorial/expire-data/
+ */
+ const EXPIRATION_FIELD = 'e';
+
+ /**
+ * @var MongoCollection
+ */
+ private $collection;
+
+ /**
+ * Constructor.
+ *
+ * This provider will default to the write concern and read preference
+ * options set on the MongoCollection instance (or inherited from MongoDB or
+ * MongoClient). Using an unacknowledged write concern (< 1) may make the
+ * return values of delete() and save() unreliable. Reading from secondaries
+ * may make contain() and fetch() unreliable.
+ *
+ * @see http://www.php.net/manual/en/mongo.readpreferences.php
+ * @see http://www.php.net/manual/en/mongo.writeconcerns.php
+ * @param MongoCollection $collection
+ */
+ public function __construct(MongoCollection $collection)
+ {
+ $this->collection = $collection;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ $document = $this->collection->findOne(array('_id' => $id), array(self::DATA_FIELD, self::EXPIRATION_FIELD));
+
+ if ($document === null) {
+ return false;
+ }
+
+ if ($this->isExpired($document)) {
+ $this->doDelete($id);
+ return false;
+ }
+
+ return unserialize($document[self::DATA_FIELD]->bin);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ $document = $this->collection->findOne(array('_id' => $id), array(self::EXPIRATION_FIELD));
+
+ if ($document === null) {
+ return false;
+ }
+
+ if ($this->isExpired($document)) {
+ $this->doDelete($id);
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ try {
+ $result = $this->collection->update(
+ array('_id' => $id),
+ array('$set' => array(
+ self::EXPIRATION_FIELD => ($lifeTime > 0 ? new MongoDate(time() + $lifeTime) : null),
+ self::DATA_FIELD => new MongoBinData(serialize($data), MongoBinData::BYTE_ARRAY),
+ )),
+ array('upsert' => true, 'multiple' => false)
+ );
+ } catch (MongoCursorException $e) {
+ return false;
+ }
+
+ return isset($result['ok']) ? $result['ok'] == 1 : true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ $result = $this->collection->remove(array('_id' => $id));
+
+ return isset($result['ok']) ? $result['ok'] == 1 : true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ // Use remove() in lieu of drop() to maintain any collection indexes
+ $result = $this->collection->remove();
+
+ return isset($result['ok']) ? $result['ok'] == 1 : true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $serverStatus = $this->collection->db->command(array(
+ 'serverStatus' => 1,
+ 'locks' => 0,
+ 'metrics' => 0,
+ 'recordStats' => 0,
+ 'repl' => 0,
+ ));
+
+ $collStats = $this->collection->db->command(array('collStats' => 1));
+
+ return array(
+ Cache::STATS_HITS => null,
+ Cache::STATS_MISSES => null,
+ Cache::STATS_UPTIME => (isset($serverStatus['uptime']) ? (int) $serverStatus['uptime'] : null),
+ Cache::STATS_MEMORY_USAGE => (isset($collStats['size']) ? (int) $collStats['size'] : null),
+ Cache::STATS_MEMORY_AVAILABLE => null,
+ );
+ }
+
+ /**
+ * Check if the document is expired.
+ *
+ * @param array $document
+ *
+ * @return bool
+ */
+ private function isExpired(array $document)
+ {
+ return isset($document[self::EXPIRATION_FIELD]) &&
+ $document[self::EXPIRATION_FIELD] instanceof MongoDate &&
+ $document[self::EXPIRATION_FIELD]->sec < time();
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php
new file mode 100644
index 00000000..df7146d7
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php
@@ -0,0 +1,39 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Interface for cache drivers that allows to get many items at once.
+ *
+ * @link www.doctrine-project.org
+ * @since 1.4
+ * @author Asmir Mustafic
+ */
+interface MultiGetCache
+{
+ /**
+ * Returns an associative array of values for keys is found in cache.
+ *
+ * @param string[] $keys Array of keys to retrieve from cache
+ * @return mixed[] Array of retrieved values, indexed by the specified keys.
+ * Values that couldn't be retrieved are not contained in this array.
+ */
+ function fetchMultiple(array $keys);
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php
new file mode 100644
index 00000000..bf87ea9f
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php
@@ -0,0 +1,41 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Interface for cache drivers that allows to put many items at once.
+ *
+ * @link www.doctrine-project.org
+ * @since 1.6
+ * @author Daniel Gorgan
+ */
+interface MultiPutCache
+{
+ /**
+ * Returns a boolean value indicating if the operation succeeded.
+ *
+ * @param array $keysAndValues Array of keys and values to save in cache
+ * @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these
+ * cache entries (0 => infinite lifeTime).
+ *
+ * @return bool TRUE if the operation was successful, FALSE if it wasn't.
+ */
+ function saveMultiple(array $keysAndValues, $lifetime = 0);
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php
new file mode 100644
index 00000000..5e751967
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php
@@ -0,0 +1,120 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Php file cache driver.
+ *
+ * @since 2.3
+ * @author Fabio B. Silva
+ */
+class PhpFileCache extends FileCache
+{
+ const EXTENSION = '.doctrinecache.php';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function __construct($directory, $extension = self::EXTENSION, $umask = 0002)
+ {
+ parent::__construct($directory, $extension, $umask);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ $value = $this->includeFileForId($id);
+
+ if (! $value) {
+ return false;
+ }
+
+ if ($value['lifetime'] !== 0 && $value['lifetime'] < time()) {
+ return false;
+ }
+
+ return $value['data'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ $value = $this->includeFileForId($id);
+
+ if (! $value) {
+ return false;
+ }
+
+ return $value['lifetime'] === 0 || $value['lifetime'] > time();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ if ($lifeTime > 0) {
+ $lifeTime = time() + $lifeTime;
+ }
+
+ if (is_object($data) && ! method_exists($data, '__set_state')) {
+ throw new \InvalidArgumentException(
+ "Invalid argument given, PhpFileCache only allows objects that implement __set_state() " .
+ "and fully support var_export(). You can use the FilesystemCache to save arbitrary object " .
+ "graphs using serialize()/deserialize()."
+ );
+ }
+
+ $filename = $this->getFilename($id);
+
+ $value = array(
+ 'lifetime' => $lifeTime,
+ 'data' => $data
+ );
+
+ $value = var_export($value, true);
+ $code = sprintf('writeFile($filename, $code);
+ }
+
+ /**
+ * @param string $id
+ *
+ * @return array|false
+ */
+ private function includeFileForId($id)
+ {
+ $fileName = $this->getFilename($id);
+
+ // note: error suppression is still faster than `file_exists`, `is_file` and `is_readable`
+ $value = @include $fileName;
+
+ if (! isset($value['lifetime'])) {
+ return false;
+ }
+
+ return $value;
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php
new file mode 100644
index 00000000..bcd27497
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php
@@ -0,0 +1,136 @@
+
+ */
+class PredisCache extends CacheProvider
+{
+ /**
+ * @var ClientInterface
+ */
+ private $client;
+
+ /**
+ * @param ClientInterface $client
+ *
+ * @return void
+ */
+ public function __construct(ClientInterface $client)
+ {
+ $this->client = $client;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ $result = $this->client->get($id);
+ if (null === $result) {
+ return false;
+ }
+
+ return unserialize($result);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetchMultiple(array $keys)
+ {
+ $fetchedItems = call_user_func_array(array($this->client, 'mget'), $keys);
+
+ return array_map('unserialize', array_filter(array_combine($keys, $fetchedItems)));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSaveMultiple(array $keysAndValues, $lifetime = 0)
+ {
+ if ($lifetime) {
+ $success = true;
+
+ // Keys have lifetime, use SETEX for each of them
+ foreach ($keysAndValues as $key => $value) {
+ $response = $this->client->setex($key, $lifetime, serialize($value));
+
+ if ((string) $response != 'OK') {
+ $success = false;
+ }
+ }
+
+ return $success;
+ }
+
+ // No lifetime, use MSET
+ $response = $this->client->mset(array_map(function ($value) {
+ return serialize($value);
+ }, $keysAndValues));
+
+ return (string) $response == 'OK';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return (bool) $this->client->exists($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ $data = serialize($data);
+ if ($lifeTime > 0) {
+ $response = $this->client->setex($id, $lifeTime, $data);
+ } else {
+ $response = $this->client->set($id, $data);
+ }
+
+ return $response === true || $response == 'OK';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ return $this->client->del($id) >= 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ $response = $this->client->flushdb();
+
+ return $response === true || $response == 'OK';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $info = $this->client->info();
+
+ return array(
+ Cache::STATS_HITS => $info['Stats']['keyspace_hits'],
+ Cache::STATS_MISSES => $info['Stats']['keyspace_misses'],
+ Cache::STATS_UPTIME => $info['Server']['uptime_in_seconds'],
+ Cache::STATS_MEMORY_USAGE => $info['Memory']['used_memory'],
+ Cache::STATS_MEMORY_AVAILABLE => false
+ );
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php
new file mode 100644
index 00000000..22add667
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php
@@ -0,0 +1,180 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+use Redis;
+
+/**
+ * Redis cache provider.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Osman Ungur
+ */
+class RedisCache extends CacheProvider
+{
+ /**
+ * @var Redis|null
+ */
+ private $redis;
+
+ /**
+ * Sets the redis instance to use.
+ *
+ * @param Redis $redis
+ *
+ * @return void
+ */
+ public function setRedis(Redis $redis)
+ {
+ $redis->setOption(Redis::OPT_SERIALIZER, $this->getSerializerValue());
+ $this->redis = $redis;
+ }
+
+ /**
+ * Gets the redis instance used by the cache.
+ *
+ * @return Redis|null
+ */
+ public function getRedis()
+ {
+ return $this->redis;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return $this->redis->get($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetchMultiple(array $keys)
+ {
+ $fetchedItems = array_combine($keys, $this->redis->mget($keys));
+
+ // Redis mget returns false for keys that do not exist. So we need to filter those out unless it's the real data.
+ $foundItems = array();
+
+ foreach ($fetchedItems as $key => $value) {
+ if (false !== $value || $this->redis->exists($key)) {
+ $foundItems[$key] = $value;
+ }
+ }
+
+ return $foundItems;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSaveMultiple(array $keysAndValues, $lifetime = 0)
+ {
+ if ($lifetime) {
+ $success = true;
+
+ // Keys have lifetime, use SETEX for each of them
+ foreach ($keysAndValues as $key => $value) {
+ if (!$this->redis->setex($key, $lifetime, $value)) {
+ $success = false;
+ }
+ }
+
+ return $success;
+ }
+
+ // No lifetime, use MSET
+ return (bool) $this->redis->mset($keysAndValues);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return $this->redis->exists($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ if ($lifeTime > 0) {
+ return $this->redis->setex($id, $lifeTime, $data);
+ }
+
+ return $this->redis->set($id, $data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ return $this->redis->delete($id) >= 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ return $this->redis->flushDB();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $info = $this->redis->info();
+ return array(
+ Cache::STATS_HITS => $info['keyspace_hits'],
+ Cache::STATS_MISSES => $info['keyspace_misses'],
+ Cache::STATS_UPTIME => $info['uptime_in_seconds'],
+ Cache::STATS_MEMORY_USAGE => $info['used_memory'],
+ Cache::STATS_MEMORY_AVAILABLE => false
+ );
+ }
+
+ /**
+ * Returns the serializer constant to use. If Redis is compiled with
+ * igbinary support, that is used. Otherwise the default PHP serializer is
+ * used.
+ *
+ * @return integer One of the Redis::SERIALIZER_* constants
+ */
+ protected function getSerializerValue()
+ {
+ if (defined('HHVM_VERSION')) {
+ return Redis::SERIALIZER_PHP;
+ }
+
+ if (defined('Redis::SERIALIZER_IGBINARY') && extension_loaded('igbinary')) {
+ return Redis::SERIALIZER_IGBINARY;
+ }
+
+ return Redis::SERIALIZER_PHP;
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php
new file mode 100644
index 00000000..0baa3f25
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php
@@ -0,0 +1,250 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+use Riak\Bucket;
+use Riak\Connection;
+use Riak\Input;
+use Riak\Exception;
+use Riak\Object;
+
+/**
+ * Riak cache provider.
+ *
+ * @link www.doctrine-project.org
+ * @since 1.1
+ * @author Guilherme Blanco
+ */
+class RiakCache extends CacheProvider
+{
+ const EXPIRES_HEADER = 'X-Riak-Meta-Expires';
+
+ /**
+ * @var \Riak\Bucket
+ */
+ private $bucket;
+
+ /**
+ * Sets the riak bucket instance to use.
+ *
+ * @param \Riak\Bucket $bucket
+ */
+ public function __construct(Bucket $bucket)
+ {
+ $this->bucket = $bucket;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ try {
+ $response = $this->bucket->get($id);
+
+ // No objects found
+ if ( ! $response->hasObject()) {
+ return false;
+ }
+
+ // Check for attempted siblings
+ $object = ($response->hasSiblings())
+ ? $this->resolveConflict($id, $response->getVClock(), $response->getObjectList())
+ : $response->getFirstObject();
+
+ // Check for expired object
+ if ($this->isExpired($object)) {
+ $this->bucket->delete($object);
+
+ return false;
+ }
+
+ return unserialize($object->getContent());
+ } catch (Exception\RiakException $e) {
+ // Covers:
+ // - Riak\ConnectionException
+ // - Riak\CommunicationException
+ // - Riak\UnexpectedResponseException
+ // - Riak\NotFoundException
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ try {
+ // We only need the HEAD, not the entire object
+ $input = new Input\GetInput();
+
+ $input->setReturnHead(true);
+
+ $response = $this->bucket->get($id, $input);
+
+ // No objects found
+ if ( ! $response->hasObject()) {
+ return false;
+ }
+
+ $object = $response->getFirstObject();
+
+ // Check for expired object
+ if ($this->isExpired($object)) {
+ $this->bucket->delete($object);
+
+ return false;
+ }
+
+ return true;
+ } catch (Exception\RiakException $e) {
+ // Do nothing
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ try {
+ $object = new Object($id);
+
+ $object->setContent(serialize($data));
+
+ if ($lifeTime > 0) {
+ $object->addMetadata(self::EXPIRES_HEADER, (string) (time() + $lifeTime));
+ }
+
+ $this->bucket->put($object);
+
+ return true;
+ } catch (Exception\RiakException $e) {
+ // Do nothing
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ try {
+ $this->bucket->delete($id);
+
+ return true;
+ } catch (Exception\BadArgumentsException $e) {
+ // Key did not exist on cluster already
+ } catch (Exception\RiakException $e) {
+ // Covers:
+ // - Riak\Exception\ConnectionException
+ // - Riak\Exception\CommunicationException
+ // - Riak\Exception\UnexpectedResponseException
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ try {
+ $keyList = $this->bucket->getKeyList();
+
+ foreach ($keyList as $key) {
+ $this->bucket->delete($key);
+ }
+
+ return true;
+ } catch (Exception\RiakException $e) {
+ // Do nothing
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ // Only exposed through HTTP stats API, not Protocol Buffers API
+ return null;
+ }
+
+ /**
+ * Check if a given Riak Object have expired.
+ *
+ * @param \Riak\Object $object
+ *
+ * @return bool
+ */
+ private function isExpired(Object $object)
+ {
+ $metadataMap = $object->getMetadataMap();
+
+ return isset($metadataMap[self::EXPIRES_HEADER])
+ && $metadataMap[self::EXPIRES_HEADER] < time();
+ }
+
+ /**
+ * On-read conflict resolution. Applied approach here is last write wins.
+ * Specific needs may override this method to apply alternate conflict resolutions.
+ *
+ * {@internal Riak does not attempt to resolve a write conflict, and store
+ * it as sibling of conflicted one. By following this approach, it is up to
+ * the next read to resolve the conflict. When this happens, your fetched
+ * object will have a list of siblings (read as a list of objects).
+ * In our specific case, we do not care about the intermediate ones since
+ * they are all the same read from storage, and we do apply a last sibling
+ * (last write) wins logic.
+ * If by any means our resolution generates another conflict, it'll up to
+ * next read to properly solve it.}
+ *
+ * @param string $id
+ * @param string $vClock
+ * @param array $objectList
+ *
+ * @return \Riak\Object
+ */
+ protected function resolveConflict($id, $vClock, array $objectList)
+ {
+ // Our approach here is last-write wins
+ $winner = $objectList[count($objectList)];
+
+ $putInput = new Input\PutInput();
+ $putInput->setVClock($vClock);
+
+ $mergedObject = new Object($id);
+ $mergedObject->setContent($winner->getContent());
+
+ $this->bucket->put($mergedObject, $putInput);
+
+ return $mergedObject;
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php
new file mode 100644
index 00000000..0bf6e4d4
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php
@@ -0,0 +1,220 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+use SQLite3;
+use SQLite3Result;
+
+/**
+ * SQLite3 cache provider.
+ *
+ * @since 1.4
+ * @author Jake Bell
+ */
+class SQLite3Cache extends CacheProvider
+{
+ /**
+ * The ID field will store the cache key.
+ */
+ const ID_FIELD = 'k';
+
+ /**
+ * The data field will store the serialized PHP value.
+ */
+ const DATA_FIELD = 'd';
+
+ /**
+ * The expiration field will store a date value indicating when the
+ * cache entry should expire.
+ */
+ const EXPIRATION_FIELD = 'e';
+
+ /**
+ * @var SQLite3
+ */
+ private $sqlite;
+
+ /**
+ * @var string
+ */
+ private $table;
+
+ /**
+ * Constructor.
+ *
+ * Calling the constructor will ensure that the database file and table
+ * exist and will create both if they don't.
+ *
+ * @param SQLite3 $sqlite
+ * @param string $table
+ */
+ public function __construct(SQLite3 $sqlite, $table)
+ {
+ $this->sqlite = $sqlite;
+ $this->table = (string) $table;
+
+ list($id, $data, $exp) = $this->getFields();
+
+ return $this->sqlite->exec(sprintf(
+ 'CREATE TABLE IF NOT EXISTS %s(%s TEXT PRIMARY KEY NOT NULL, %s BLOB, %s INTEGER)',
+ $table,
+ $id,
+ $data,
+ $exp
+ ));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ if ($item = $this->findById($id)) {
+ return unserialize($item[self::DATA_FIELD]);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return null !== $this->findById($id, false);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ $statement = $this->sqlite->prepare(sprintf(
+ 'INSERT OR REPLACE INTO %s (%s) VALUES (:id, :data, :expire)',
+ $this->table,
+ implode(',', $this->getFields())
+ ));
+
+ $statement->bindValue(':id', $id);
+ $statement->bindValue(':data', serialize($data), SQLITE3_BLOB);
+ $statement->bindValue(':expire', $lifeTime > 0 ? time() + $lifeTime : null);
+
+ return $statement->execute() instanceof SQLite3Result;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ list($idField) = $this->getFields();
+
+ $statement = $this->sqlite->prepare(sprintf(
+ 'DELETE FROM %s WHERE %s = :id',
+ $this->table,
+ $idField
+ ));
+
+ $statement->bindValue(':id', $id);
+
+ return $statement->execute() instanceof SQLite3Result;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ return $this->sqlite->exec(sprintf('DELETE FROM %s', $this->table));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ // no-op.
+ }
+
+ /**
+ * Find a single row by ID.
+ *
+ * @param mixed $id
+ * @param bool $includeData
+ *
+ * @return array|null
+ */
+ private function findById($id, $includeData = true)
+ {
+ list($idField) = $fields = $this->getFields();
+
+ if (!$includeData) {
+ $key = array_search(static::DATA_FIELD, $fields);
+ unset($fields[$key]);
+ }
+
+ $statement = $this->sqlite->prepare(sprintf(
+ 'SELECT %s FROM %s WHERE %s = :id LIMIT 1',
+ implode(',', $fields),
+ $this->table,
+ $idField
+ ));
+
+ $statement->bindValue(':id', $id, SQLITE3_TEXT);
+
+ $item = $statement->execute()->fetchArray(SQLITE3_ASSOC);
+
+ if ($item === false) {
+ return null;
+ }
+
+ if ($this->isExpired($item)) {
+ $this->doDelete($id);
+
+ return null;
+ }
+
+ return $item;
+ }
+
+ /**
+ * Gets an array of the fields in our table.
+ *
+ * @return array
+ */
+ private function getFields()
+ {
+ return array(static::ID_FIELD, static::DATA_FIELD, static::EXPIRATION_FIELD);
+ }
+
+ /**
+ * Check if the item is expired.
+ *
+ * @param array $item
+ *
+ * @return bool
+ */
+ private function isExpired(array $item)
+ {
+ return isset($item[static::EXPIRATION_FIELD]) &&
+ $item[self::EXPIRATION_FIELD] !== null &&
+ $item[self::EXPIRATION_FIELD] < time();
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php
new file mode 100644
index 00000000..a6399ecc
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php
@@ -0,0 +1,25 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+class Version
+{
+ const VERSION = '1.6.1-DEV';
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php
new file mode 100644
index 00000000..65e8456f
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php
@@ -0,0 +1,78 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Void cache driver. The cache could be of use in tests where you don`t need to cache anything.
+ *
+ * @link www.doctrine-project.org
+ * @since 1.5
+ * @author Kotlyar Maksim
+ */
+class VoidCache extends CacheProvider
+{
+ /**
+ * {@inheritDoc}
+ */
+ protected function doFetch($id)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doContains($id)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doDelete($id)
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doFlush()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function doGetStats()
+ {
+ return;
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php
new file mode 100644
index 00000000..8a250b29
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php
@@ -0,0 +1,109 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * WinCache cache provider.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author David Abdemoulaie
+ */
+class WinCacheCache extends CacheProvider
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return wincache_ucache_get($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return wincache_ucache_exists($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ return wincache_ucache_set($id, $data, $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ return wincache_ucache_delete($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ return wincache_ucache_clear();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetchMultiple(array $keys)
+ {
+ return wincache_ucache_get($keys);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSaveMultiple(array $keysAndValues, $lifetime = 0)
+ {
+ $result = wincache_ucache_set($keysAndValues, null, $lifetime);
+
+ return empty($result);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $info = wincache_ucache_info();
+ $meminfo = wincache_ucache_meminfo();
+
+ return array(
+ Cache::STATS_HITS => $info['total_hit_count'],
+ Cache::STATS_MISSES => $info['total_miss_count'],
+ Cache::STATS_UPTIME => $info['total_cache_uptime'],
+ Cache::STATS_MEMORY_USAGE => $meminfo['memory_total'],
+ Cache::STATS_MEMORY_AVAILABLE => $meminfo['memory_free'],
+ );
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php
new file mode 100644
index 00000000..a2c4ca56
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php
@@ -0,0 +1,112 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Xcache cache driver.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author David Abdemoulaie
+ */
+class XcacheCache extends CacheProvider
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return $this->doContains($id) ? unserialize(xcache_get($id)) : false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return xcache_isset($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ return xcache_set($id, serialize($data), (int) $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ return xcache_unset($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ $this->checkAuthorization();
+
+ xcache_clear_cache(XC_TYPE_VAR);
+
+ return true;
+ }
+
+ /**
+ * Checks that xcache.admin.enable_auth is Off.
+ *
+ * @return void
+ *
+ * @throws \BadMethodCallException When xcache.admin.enable_auth is On.
+ */
+ protected function checkAuthorization()
+ {
+ if (ini_get('xcache.admin.enable_auth')) {
+ throw new \BadMethodCallException(
+ 'To use all features of \Doctrine\Common\Cache\XcacheCache, '
+ . 'you must set "xcache.admin.enable_auth" to "Off" in your php.ini.'
+ );
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ $this->checkAuthorization();
+
+ $info = xcache_info(XC_TYPE_VAR, 0);
+ return array(
+ Cache::STATS_HITS => $info['hits'],
+ Cache::STATS_MISSES => $info['misses'],
+ Cache::STATS_UPTIME => null,
+ Cache::STATS_MEMORY_USAGE => $info['size'],
+ Cache::STATS_MEMORY_AVAILABLE => $info['avail'],
+ );
+ }
+}
diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php
new file mode 100644
index 00000000..6e35ac82
--- /dev/null
+++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php
@@ -0,0 +1,83 @@
+.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Zend Data Cache cache driver.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Ralph Schindler
+ * @author Guilherme Blanco
+ */
+class ZendDataCache extends CacheProvider
+{
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFetch($id)
+ {
+ return zend_shm_cache_fetch($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doContains($id)
+ {
+ return (false !== zend_shm_cache_fetch($id));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doSave($id, $data, $lifeTime = 0)
+ {
+ return zend_shm_cache_store($id, $data, $lifeTime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doDelete($id)
+ {
+ return zend_shm_cache_delete($id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doFlush()
+ {
+ $namespace = $this->getNamespace();
+ if (empty($namespace)) {
+ return zend_shm_cache_clear();
+ }
+ return zend_shm_cache_clear($namespace);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doGetStats()
+ {
+ return null;
+ }
+}
diff --git a/vendor/doctrine/cache/phpunit.xml.dist b/vendor/doctrine/cache/phpunit.xml.dist
new file mode 100644
index 00000000..40cc24de
--- /dev/null
+++ b/vendor/doctrine/cache/phpunit.xml.dist
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+ ./tests/Doctrine/
+
+
+
+
+
+ ./lib/Doctrine/
+
+
+
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php
new file mode 100644
index 00000000..5becdf99
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php
@@ -0,0 +1,28 @@
+markTestSkipped('APC must be enabled for the CLI with the ini setting apc.enable_cli=1');
+ }
+ }
+
+ protected function _getCacheDriver()
+ {
+ return new ApcCache();
+ }
+
+ public function testLifetime()
+ {
+ $this->markTestSkipped('The APC cache TTL is not working in a single process/request. See https://bugs.php.net/bug.php?id=58084');
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcuCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcuCacheTest.php
new file mode 100644
index 00000000..27764cd7
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcuCacheTest.php
@@ -0,0 +1,28 @@
+markTestSkipped('APC must be enabled for the CLI with the ini setting apc.enable_cli=1');
+ }
+ }
+
+ protected function _getCacheDriver()
+ {
+ return new ApcuCache();
+ }
+
+ public function testLifetime()
+ {
+ $this->markTestSkipped('The APC cache TTL is not working in a single process/request. See https://bugs.php.net/bug.php?id=58084');
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php
new file mode 100644
index 00000000..3be94c61
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php
@@ -0,0 +1,52 @@
+_getCacheDriver();
+ $cache->fetch('test1');
+ $cache->fetch('test2');
+ $cache->fetch('test3');
+
+ $cache->save('test1', 123);
+ $cache->save('test2', 123);
+
+ $cache->fetch('test1');
+ $cache->fetch('test2');
+ $cache->fetch('test3');
+
+ $stats = $cache->getStats();
+ $this->assertEquals(2, $stats[Cache::STATS_HITS]);
+ $this->assertEquals(5, $stats[Cache::STATS_MISSES]); // +1 for internal call to DoctrineNamespaceCacheKey
+ $this->assertNotNull($stats[Cache::STATS_UPTIME]);
+ $this->assertNull($stats[Cache::STATS_MEMORY_USAGE]);
+ $this->assertNull($stats[Cache::STATS_MEMORY_AVAILABLE]);
+
+ $cache->delete('test1');
+ $cache->delete('test2');
+
+ $cache->fetch('test1');
+ $cache->fetch('test2');
+ $cache->fetch('test3');
+
+ $stats = $cache->getStats();
+ $this->assertEquals(2, $stats[Cache::STATS_HITS]);
+ $this->assertEquals(8, $stats[Cache::STATS_MISSES]); // +1 for internal call to DoctrineNamespaceCacheKey
+ }
+
+ protected function isSharedStorage()
+ {
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php
new file mode 100644
index 00000000..c1256ee3
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/BaseFileCacheTest.php
@@ -0,0 +1,155 @@
+directory = sys_get_temp_dir() . '/doctrine_cache_'. uniqid();
+ } while (file_exists($this->directory));
+ }
+
+ protected function tearDown()
+ {
+ if ( ! is_dir($this->directory)) {
+ return;
+ }
+
+ $iterator = new RecursiveDirectoryIterator($this->directory);
+
+ foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {
+ if ($file->isFile()) {
+ @unlink($file->getRealPath());
+ } elseif ($file->isDir()) {
+ @rmdir($file->getRealPath());
+ }
+ }
+
+ @rmdir($this->directory);
+ }
+
+ public function testFlushAllRemovesBalancingDirectories()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $this->assertTrue($cache->save('key1', 1));
+ $this->assertTrue($cache->save('key2', 2));
+ $this->assertTrue($cache->flushAll());
+
+ $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->directory, \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST);
+
+ $this->assertCount(0, $iterator);
+ }
+
+ protected function isSharedStorage()
+ {
+ return false;
+ }
+
+ public function getPathLengthsToTest()
+ {
+ // Windows officially supports 260 bytes including null terminator
+ // 258 bytes available to use due to php bug #70943
+ // Windows officially supports 260 bytes including null terminator
+ // 259 characters is too large due to PHP bug (https://bugs.php.net/bug.php?id=70943)
+ // 260 characters is too large - null terminator is included in allowable length
+ return array(
+ array(257, false),
+ array(258, false),
+ array(259, true),
+ array(260, true)
+ );
+ }
+
+ private static function getBasePathForWindowsPathLengthTests($pathLength)
+ {
+ return FileCacheTest::getBasePathForWindowsPathLengthTests($pathLength);
+ }
+
+ /**
+ * @param int $length
+ * @param string $basePath
+ *
+ * @return array
+ */
+ private static function getKeyAndPathFittingLength($length, $basePath)
+ {
+ $baseDirLength = strlen($basePath);
+ $extensionLength = strlen('.doctrine.cache');
+ $directoryLength = strlen(DIRECTORY_SEPARATOR . 'aa' . DIRECTORY_SEPARATOR);
+ $namespaceAndBracketLength = strlen(bin2hex("[][1]"));
+ $keyLength = $length
+ - ($baseDirLength
+ + $extensionLength
+ + $directoryLength
+ + $namespaceAndBracketLength);
+
+ $key = str_repeat('a', floor($keyLength / 2));
+ $namespacedKey = '[' . $key . '][1]';
+
+ $keyHash = hash('sha256', $namespacedKey);
+
+ $keyPath = $basePath
+ . DIRECTORY_SEPARATOR
+ . substr($keyHash, 0, 2)
+ . DIRECTORY_SEPARATOR
+ . bin2hex($namespacedKey)
+ . '.doctrine.cache';
+
+ $hashedKeyPath = $basePath
+ . DIRECTORY_SEPARATOR
+ . substr($keyHash, 0, 2)
+ . DIRECTORY_SEPARATOR
+ . '_' . $keyHash
+ . '.doctrine.cache';
+
+ return array($key, $keyPath, $hashedKeyPath);
+ }
+
+ /**
+ * @dataProvider getPathLengthsToTest
+ *
+ * @param int $length
+ * @param bool $pathShouldBeHashed
+ */
+ public function testWindowsPathLengthLimitIsCorrectlyHandled($length, $pathShouldBeHashed)
+ {
+ $this->directory = self::getBasePathForWindowsPathLengthTests($length);
+
+ list($key, $keyPath, $hashedKeyPath) = self::getKeyAndPathFittingLength($length, $this->directory);
+
+ $this->assertEquals($length, strlen($keyPath), 'Unhashed path should be of correct length.');
+
+ $cacheClass = get_class($this->_getCacheDriver());
+ /* @var $cache \Doctrine\Common\Cache\FileCache */
+ $cache = new $cacheClass($this->directory, '.doctrine.cache');
+
+ // Trick it into thinking this is windows.
+ $reflClass = new \ReflectionClass(FileCache::class);
+ $reflProp = $reflClass->getProperty('isRunningOnWindows');
+ $reflProp->setAccessible(true);
+ $reflProp->setValue($cache, true);
+ $reflProp->setAccessible(false);
+
+ $value = uniqid('value', true);
+
+ $cache->save($key, $value);
+ $this->assertEquals($value, $cache->fetch($key));
+
+ if ($pathShouldBeHashed) {
+ $this->assertFileExists($hashedKeyPath, 'Path generated for key should be hashed.');
+ unlink($hashedKeyPath);
+ } else {
+ $this->assertFileExists($keyPath, 'Path generated for key should not be hashed.');
+ unlink($keyPath);
+ }
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheProviderTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheProviderTest.php
new file mode 100644
index 00000000..5e11652c
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheProviderTest.php
@@ -0,0 +1,103 @@
+getMockForAbstractClass(
+ 'Doctrine\Common\Cache\CacheProvider',
+ array(),
+ '',
+ true,
+ true,
+ true,
+ array('doFetchMultiple')
+ );
+
+ $cache
+ ->expects($this->once())
+ ->method('doFetchMultiple')
+ ->will($this->returnValue(array(
+ '[foo][1]' => 'bar',
+ '[bar][1]' => 'baz',
+ '[baz][1]' => 'tab',
+ )));
+
+ $this->assertEquals(
+ array('foo' => 'bar', 'bar' => 'baz'),
+ $cache->fetchMultiple(array('foo', 'bar'))
+ );
+ }
+
+ public function testFailedDeleteAllDoesNotChangeNamespaceVersion()
+ {
+ /* @var $cache \Doctrine\Common\Cache\CacheProvider|\PHPUnit_Framework_MockObject_MockObject */
+ $cache = $this->getMockForAbstractClass(
+ 'Doctrine\Common\Cache\CacheProvider',
+ array(),
+ '',
+ true,
+ true,
+ true,
+ array('doFetch', 'doSave', 'doContains')
+ );
+
+ $cache
+ ->expects($this->once())
+ ->method('doFetch')
+ ->with('DoctrineNamespaceCacheKey[]')
+ ->will($this->returnValue(false));
+
+ // doSave is only called once from deleteAll as we do not need to persist the default version in getNamespaceVersion()
+ $cache
+ ->expects($this->once())
+ ->method('doSave')
+ ->with('DoctrineNamespaceCacheKey[]')
+ ->will($this->returnValue(false));
+
+ // After a failed deleteAll() the local namespace version is not increased (still 1). Otherwise all data written afterwards
+ // would be lost outside the current instance.
+ $cache
+ ->expects($this->once())
+ ->method('doContains')
+ ->with('[key][1]')
+ ->will($this->returnValue(true));
+
+ $this->assertFalse($cache->deleteAll(), 'deleteAll() returns false when saving the namespace version fails');
+ $cache->contains('key');
+ }
+
+ public function testSaveMultipleNoFail()
+ {
+ /* @var $cache \Doctrine\Common\Cache\CacheProvider|\PHPUnit_Framework_MockObject_MockObject */
+ $cache = $this->getMockForAbstractClass(
+ 'Doctrine\Common\Cache\CacheProvider',
+ array(),
+ '',
+ true,
+ true,
+ true,
+ array('doSave')
+ );
+
+ $cache
+ ->expects($this->at(1))
+ ->method('doSave')
+ ->with('[kerr][1]', 'verr', 0)
+ ->will($this->returnValue(false));
+
+ $cache
+ ->expects($this->at(2))
+ ->method('doSave')
+ ->with('[kok][1]', 'vok', 0)
+ ->will($this->returnValue(true));
+
+ $cache->saveMultiple(array(
+ 'kerr' => 'verr',
+ 'kok' => 'vok',
+ ));
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php
new file mode 100644
index 00000000..5dd64d7f
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php
@@ -0,0 +1,463 @@
+_getCacheDriver();
+
+ // Test saving a value, checking if it exists, and fetching it back
+ $this->assertTrue($cache->save('key', $value));
+ $this->assertTrue($cache->contains('key'));
+ if (is_object($value)) {
+ $this->assertEquals($value, $cache->fetch('key'), 'Objects retrieved from the cache must be equal but not necessarily the same reference');
+ } else {
+ $this->assertSame($value, $cache->fetch('key'), 'Scalar and array data retrieved from the cache must be the same as the original, e.g. same type');
+ }
+
+ // Test deleting a value
+ $this->assertTrue($cache->delete('key'));
+ $this->assertFalse($cache->contains('key'));
+ $this->assertFalse($cache->fetch('key'));
+ }
+
+ /**
+ * @dataProvider provideDataToCache
+ */
+ public function testUpdateExistingEntry($value)
+ {
+ $cache = $this->_getCacheDriver();
+
+ $this->assertTrue($cache->save('key', 'old-value'));
+ $this->assertTrue($cache->contains('key'));
+
+ $this->assertTrue($cache->save('key', $value));
+ $this->assertTrue($cache->contains('key'));
+ if (is_object($value)) {
+ $this->assertEquals($value, $cache->fetch('key'), 'Objects retrieved from the cache must be equal but not necessarily the same reference');
+ } else {
+ $this->assertSame($value, $cache->fetch('key'), 'Scalar and array data retrieved from the cache must be the same as the original, e.g. same type');
+ }
+ }
+
+ public function testCacheKeyIsCaseSensitive()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $this->assertTrue($cache->save('key', 'value'));
+ $this->assertTrue($cache->contains('key'));
+ $this->assertSame('value', $cache->fetch('key'));
+
+ $this->assertFalse($cache->contains('KEY'));
+ $this->assertFalse($cache->fetch('KEY'));
+
+ $cache->delete('KEY');
+ $this->assertTrue($cache->contains('key', 'Deleting cache item with different case must not affect other cache item'));
+ }
+
+ public function testFetchMultiple()
+ {
+ $cache = $this->_getCacheDriver();
+ $values = $this->provideDataToCache();
+ $saved = array();
+
+ foreach ($values as $key => $value) {
+ $cache->save($key, $value[0]);
+
+ $saved[$key] = $value[0];
+ }
+
+ $keys = array_keys($saved);
+
+ $this->assertEquals(
+ $saved,
+ $cache->fetchMultiple($keys),
+ 'Testing fetchMultiple with different data types'
+ );
+ $this->assertEquals(
+ array_slice($saved, 0, 1),
+ $cache->fetchMultiple(array_slice($keys, 0, 1)),
+ 'Testing fetchMultiple with a single key'
+ );
+
+ $keysWithNonExisting = array();
+ $keysWithNonExisting[] = 'non_existing1';
+ $keysWithNonExisting[] = $keys[0];
+ $keysWithNonExisting[] = 'non_existing2';
+ $keysWithNonExisting[] = $keys[1];
+ $keysWithNonExisting[] = 'non_existing3';
+
+ $this->assertEquals(
+ array_slice($saved, 0, 2),
+ $cache->fetchMultiple($keysWithNonExisting),
+ 'Testing fetchMultiple with a subset of keys and mixed with non-existing ones'
+ );
+ }
+
+ public function testFetchMultipleWithNoKeys()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $this->assertSame(array(), $cache->fetchMultiple(array()));
+ }
+
+ public function testSaveMultiple()
+ {
+ $cache = $this->_getCacheDriver();
+ $cache->deleteAll();
+
+ $data = array_map(function ($value) {
+ return $value[0];
+ }, $this->provideDataToCache());
+
+ $this->assertTrue($cache->saveMultiple($data));
+
+ $keys = array_keys($data);
+
+ $this->assertEquals($data, $cache->fetchMultiple($keys));
+ }
+
+ public function provideDataToCache()
+ {
+ $obj = new \stdClass();
+ $obj->foo = 'bar';
+ $obj2 = new \stdClass();
+ $obj2->bar = 'foo';
+ $obj2->obj = $obj;
+ $obj->obj2 = $obj2;
+
+ return array(
+ 'array' => array(array('one', 2, 3.01)),
+ 'string' => array('value'),
+ 'string_invalid_utf8' => array("\xc3\x28"),
+ 'string_null_byte' => array('with'."\0".'null char'),
+ 'integer' => array(1),
+ 'float' => array(1.5),
+ 'object' => array(new ArrayObject(array('one', 2, 3.01))),
+ 'object_recursive' => array($obj),
+ 'true' => array(true),
+ // the following are considered FALSE in boolean context, but caches should still recognize their existence
+ 'null' => array(null),
+ 'false' => array(false),
+ 'array_empty' => array(array()),
+ 'string_zero' => array('0'),
+ 'integer_zero' => array(0),
+ 'float_zero' => array(0.0),
+ 'string_empty' => array(''),
+ );
+ }
+
+ public function testDeleteIsSuccessfulWhenKeyDoesNotExist()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $cache->delete('key');
+ $this->assertFalse($cache->contains('key'));
+ $this->assertTrue($cache->delete('key'));
+ }
+
+ public function testDeleteAll()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $this->assertTrue($cache->save('key1', 1));
+ $this->assertTrue($cache->save('key2', 2));
+ $this->assertTrue($cache->deleteAll());
+ $this->assertFalse($cache->contains('key1'));
+ $this->assertFalse($cache->contains('key2'));
+ }
+
+ /**
+ * @dataProvider provideCacheIds
+ */
+ public function testCanHandleSpecialCacheIds($id)
+ {
+ $cache = $this->_getCacheDriver();
+
+ $this->assertTrue($cache->save($id, 'value'));
+ $this->assertTrue($cache->contains($id));
+ $this->assertEquals('value', $cache->fetch($id));
+
+ $this->assertTrue($cache->delete($id));
+ $this->assertFalse($cache->contains($id));
+ $this->assertFalse($cache->fetch($id));
+ }
+
+ public function testNoCacheIdCollisions()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $ids = $this->provideCacheIds();
+
+ // fill cache with each id having a different value
+ foreach ($ids as $index => $id) {
+ $cache->save($id[0], $index);
+ }
+
+ // then check value of each cache id
+ foreach ($ids as $index => $id) {
+ $value = $cache->fetch($id[0]);
+ $this->assertNotFalse($value, sprintf('Failed to retrieve data for cache id "%s".', $id[0]));
+ if ($index !== $value) {
+ $this->fail(sprintf('Cache id "%s" collides with id "%s".', $id[0], $ids[$value][0]));
+ }
+ }
+ }
+
+ /**
+ * Returns cache ids with special characters that should still work.
+ *
+ * For example, the characters :\/<>"*?| are not valid in Windows filenames. So they must be encoded properly.
+ * Each cache id should be considered different from the others.
+ *
+ * @return array
+ */
+ public function provideCacheIds()
+ {
+ return array(
+ array(':'),
+ array('\\'),
+ array('/'),
+ array('<'),
+ array('>'),
+ array('"'),
+ array('*'),
+ array('?'),
+ array('|'),
+ array('['),
+ array(']'),
+ array('ä'),
+ array('a'),
+ array('é'),
+ array('e'),
+ array('.'), // directory traversal
+ array('..'), // directory traversal
+ array('-'),
+ array('_'),
+ array('$'),
+ array('%'),
+ array(' '),
+ array("\0"),
+ array(''),
+ array(str_repeat('a', 300)), // long key
+ array(str_repeat('a', 113)),
+ );
+ }
+
+ public function testLifetime()
+ {
+ $cache = $this->_getCacheDriver();
+ $cache->save('expire', 'value', 1);
+ $this->assertTrue($cache->contains('expire'), 'Data should not be expired yet');
+ // @TODO should more TTL-based tests pop up, so then we should mock the `time` API instead
+ sleep(2);
+ $this->assertFalse($cache->contains('expire'), 'Data should be expired');
+ }
+
+ public function testNoExpire()
+ {
+ $cache = $this->_getCacheDriver();
+ $cache->save('noexpire', 'value', 0);
+ // @TODO should more TTL-based tests pop up, so then we should mock the `time` API instead
+ sleep(1);
+ $this->assertTrue($cache->contains('noexpire'), 'Data with lifetime of zero should not expire');
+ }
+
+ public function testLongLifetime()
+ {
+ $cache = $this->_getCacheDriver();
+ $cache->save('longlifetime', 'value', 30 * 24 * 3600 + 1);
+ $this->assertTrue($cache->contains('longlifetime'), 'Data with lifetime > 30 days should be accepted');
+ }
+
+ public function testDeleteAllAndNamespaceVersioningBetweenCaches()
+ {
+ if ( ! $this->isSharedStorage()) {
+ $this->markTestSkipped('The cache storage needs to be shared.');
+ }
+
+ $cache1 = $this->_getCacheDriver();
+ $cache2 = $this->_getCacheDriver();
+
+ $this->assertTrue($cache1->save('key1', 1));
+ $this->assertTrue($cache2->save('key2', 2));
+
+ /* Both providers are initialized with the same namespace version, so
+ * they can see entries set by each other.
+ */
+ $this->assertTrue($cache1->contains('key1'));
+ $this->assertTrue($cache1->contains('key2'));
+ $this->assertTrue($cache2->contains('key1'));
+ $this->assertTrue($cache2->contains('key2'));
+
+ /* Deleting all entries through one provider will only increment the
+ * namespace version on that object (and in the cache itself, which new
+ * instances will use to initialize). The second provider will retain
+ * its original version and still see stale data.
+ */
+ $this->assertTrue($cache1->deleteAll());
+ $this->assertFalse($cache1->contains('key1'));
+ $this->assertFalse($cache1->contains('key2'));
+ $this->assertTrue($cache2->contains('key1'));
+ $this->assertTrue($cache2->contains('key2'));
+
+ /* A new cache provider should not see the deleted entries, since its
+ * namespace version will be initialized.
+ */
+ $cache3 = $this->_getCacheDriver();
+ $this->assertFalse($cache3->contains('key1'));
+ $this->assertFalse($cache3->contains('key2'));
+ }
+
+ public function testFlushAll()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $this->assertTrue($cache->save('key1', 1));
+ $this->assertTrue($cache->save('key2', 2));
+ $this->assertTrue($cache->flushAll());
+ $this->assertFalse($cache->contains('key1'));
+ $this->assertFalse($cache->contains('key2'));
+ }
+
+ public function testFlushAllAndNamespaceVersioningBetweenCaches()
+ {
+ if ( ! $this->isSharedStorage()) {
+ $this->markTestSkipped('The cache storage needs to be shared.');
+ }
+
+ $cache1 = $this->_getCacheDriver();
+ $cache2 = $this->_getCacheDriver();
+
+ /* Deleting all elements from the first provider should increment its
+ * namespace version before saving the first entry.
+ */
+ $cache1->deleteAll();
+ $this->assertTrue($cache1->save('key1', 1));
+
+ /* The second provider will be initialized with the same namespace
+ * version upon its first save operation.
+ */
+ $this->assertTrue($cache2->save('key2', 2));
+
+ /* Both providers have the same namespace version and can see entries
+ * set by each other.
+ */
+ $this->assertTrue($cache1->contains('key1'));
+ $this->assertTrue($cache1->contains('key2'));
+ $this->assertTrue($cache2->contains('key1'));
+ $this->assertTrue($cache2->contains('key2'));
+
+ /* Flushing all entries through one cache will remove all entries from
+ * the cache but leave their namespace version as-is.
+ */
+ $this->assertTrue($cache1->flushAll());
+ $this->assertFalse($cache1->contains('key1'));
+ $this->assertFalse($cache1->contains('key2'));
+ $this->assertFalse($cache2->contains('key1'));
+ $this->assertFalse($cache2->contains('key2'));
+
+ /* Inserting a new entry will use the same, incremented namespace
+ * version, and it will be visible to both providers.
+ */
+ $this->assertTrue($cache1->save('key1', 1));
+ $this->assertTrue($cache1->contains('key1'));
+ $this->assertTrue($cache2->contains('key1'));
+
+ /* A new cache provider will be initialized with the original namespace
+ * version and not share any visibility with the first two providers.
+ */
+ $cache3 = $this->_getCacheDriver();
+ $this->assertFalse($cache3->contains('key1'));
+ $this->assertFalse($cache3->contains('key2'));
+ $this->assertTrue($cache3->save('key3', 3));
+ $this->assertTrue($cache3->contains('key3'));
+ }
+
+ public function testNamespace()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $cache->setNamespace('ns1_');
+
+ $this->assertTrue($cache->save('key1', 1));
+ $this->assertTrue($cache->contains('key1'));
+
+ $cache->setNamespace('ns2_');
+
+ $this->assertFalse($cache->contains('key1'));
+ }
+
+ public function testDeleteAllNamespace()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $cache->setNamespace('ns1');
+ $this->assertFalse($cache->contains('key1'));
+ $cache->save('key1', 'test');
+ $this->assertTrue($cache->contains('key1'));
+
+ $cache->setNamespace('ns2');
+ $this->assertFalse($cache->contains('key1'));
+ $cache->save('key1', 'test');
+ $this->assertTrue($cache->contains('key1'));
+
+ $cache->setNamespace('ns1');
+ $this->assertTrue($cache->contains('key1'));
+ $cache->deleteAll();
+ $this->assertFalse($cache->contains('key1'));
+
+ $cache->setNamespace('ns2');
+ $this->assertTrue($cache->contains('key1'));
+ $cache->deleteAll();
+ $this->assertFalse($cache->contains('key1'));
+ }
+
+ /**
+ * @group DCOM-43
+ */
+ public function testGetStats()
+ {
+ $cache = $this->_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertArrayHasKey(Cache::STATS_HITS, $stats);
+ $this->assertArrayHasKey(Cache::STATS_MISSES, $stats);
+ $this->assertArrayHasKey(Cache::STATS_UPTIME, $stats);
+ $this->assertArrayHasKey(Cache::STATS_MEMORY_USAGE, $stats);
+ $this->assertArrayHasKey(Cache::STATS_MEMORY_AVAILABLE, $stats);
+ }
+
+ public function testSaveReturnsTrueWithAndWithoutTTlSet()
+ {
+ $cache = $this->_getCacheDriver();
+ $cache->deleteAll();
+ $this->assertTrue($cache->save('without_ttl', 'without_ttl'));
+ $this->assertTrue($cache->save('with_ttl', 'with_ttl', 3600));
+ }
+
+ /**
+ * Return whether multiple cache providers share the same storage.
+ *
+ * This is used for skipping certain tests for shared storage behavior.
+ *
+ * @return bool
+ */
+ protected function isSharedStorage()
+ {
+ return true;
+ }
+
+ /**
+ * @return \Doctrine\Common\Cache\CacheProvider
+ */
+ abstract protected function _getCacheDriver();
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ChainCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ChainCacheTest.php
new file mode 100644
index 00000000..a3c013b8
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ChainCacheTest.php
@@ -0,0 +1,99 @@
+markTestSkipped('The ChainCache test uses ArrayCache which does not implement TTL currently.');
+ }
+
+ public function testGetStats()
+ {
+ $cache = $this->_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertInternalType('array', $stats);
+ }
+
+ public function testOnlyFetchFirstOne()
+ {
+ $cache1 = new ArrayCache();
+ $cache2 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider');
+
+ $cache2->expects($this->never())->method('doFetch');
+
+ $chainCache = new ChainCache(array($cache1, $cache2));
+ $chainCache->save('id', 'bar');
+
+ $this->assertEquals('bar', $chainCache->fetch('id'));
+ }
+
+ public function testFetchPropagateToFastestCache()
+ {
+ $cache1 = new ArrayCache();
+ $cache2 = new ArrayCache();
+
+ $cache2->save('bar', 'value');
+
+ $chainCache = new ChainCache(array($cache1, $cache2));
+
+ $this->assertFalse($cache1->contains('bar'));
+
+ $result = $chainCache->fetch('bar');
+
+ $this->assertEquals('value', $result);
+ $this->assertTrue($cache2->contains('bar'));
+ }
+
+ public function testNamespaceIsPropagatedToAllProviders()
+ {
+ $cache1 = new ArrayCache();
+ $cache2 = new ArrayCache();
+
+ $chainCache = new ChainCache(array($cache1, $cache2));
+ $chainCache->setNamespace('bar');
+
+ $this->assertEquals('bar', $cache1->getNamespace());
+ $this->assertEquals('bar', $cache2->getNamespace());
+ }
+
+ public function testDeleteToAllProviders()
+ {
+ $cache1 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider');
+ $cache2 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider');
+
+ $cache1->expects($this->once())->method('doDelete');
+ $cache2->expects($this->once())->method('doDelete');
+
+ $chainCache = new ChainCache(array($cache1, $cache2));
+ $chainCache->delete('bar');
+ }
+
+ public function testFlushToAllProviders()
+ {
+ $cache1 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider');
+ $cache2 = $this->getMockForAbstractClass('Doctrine\Common\Cache\CacheProvider');
+
+ $cache1->expects($this->once())->method('doFlush');
+ $cache2->expects($this->once())->method('doFlush');
+
+ $chainCache = new ChainCache(array($cache1, $cache2));
+ $chainCache->flushAll();
+ }
+
+ protected function isSharedStorage()
+ {
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php
new file mode 100644
index 00000000..f42b3a7f
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php
@@ -0,0 +1,30 @@
+couchbase = new Couchbase('127.0.0.1', 'Administrator', 'password', 'default');
+ } catch(Exception $ex) {
+ $this->markTestSkipped('Could not instantiate the Couchbase cache because of: ' . $ex);
+ }
+ }
+
+ protected function _getCacheDriver()
+ {
+ $driver = new CouchbaseCache();
+ $driver->setCouchbase($this->couchbase);
+ return $driver;
+ }
+}
\ No newline at end of file
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php
new file mode 100644
index 00000000..f27d5428
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php
@@ -0,0 +1,268 @@
+driver = $this->getMock(
+ 'Doctrine\Common\Cache\FileCache',
+ array('doFetch', 'doContains', 'doSave'),
+ array(), '', false
+ );
+ }
+
+ public function testFilenameShouldCreateThePathWithOneSubDirectory()
+ {
+ $cache = $this->driver;
+ $method = new \ReflectionMethod($cache, 'getFilename');
+ $key = 'item-key';
+ $expectedDir = array(
+ '84',
+ );
+ $expectedDir = implode(DIRECTORY_SEPARATOR, $expectedDir);
+
+ $method->setAccessible(true);
+
+ $path = $method->invoke($cache, $key);
+ $dirname = pathinfo($path, PATHINFO_DIRNAME);
+
+ $this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir, $dirname);
+ }
+
+ public function testFileExtensionCorrectlyEscaped()
+ {
+ $driver1 = $this->getMock(
+ 'Doctrine\Common\Cache\FileCache',
+ array('doFetch', 'doContains', 'doSave'),
+ array(__DIR__, '.*')
+ );
+ $driver2 = $this->getMock(
+ 'Doctrine\Common\Cache\FileCache',
+ array('doFetch', 'doContains', 'doSave'),
+ array(__DIR__, '.php')
+ );
+
+ $doGetStats = new \ReflectionMethod($driver1, 'doGetStats');
+
+ $doGetStats->setAccessible(true);
+
+ $stats1 = $doGetStats->invoke($driver1);
+ $stats2 = $doGetStats->invoke($driver2);
+
+ $this->assertSame(0, $stats1[Cache::STATS_MEMORY_USAGE]);
+ $this->assertGreaterThan(0, $stats2[Cache::STATS_MEMORY_USAGE]);
+ }
+
+ /**
+ * @group DCOM-266
+ */
+ public function testFileExtensionSlashCorrectlyEscaped()
+ {
+ $driver = $this->getMock(
+ 'Doctrine\Common\Cache\FileCache',
+ array('doFetch', 'doContains', 'doSave'),
+ array(__DIR__ . '/../', DIRECTORY_SEPARATOR . basename(__FILE__))
+ );
+
+ $doGetStats = new \ReflectionMethod($driver, 'doGetStats');
+
+ $doGetStats->setAccessible(true);
+
+ $stats = $doGetStats->invoke($driver);
+
+ $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_USAGE]);
+ }
+
+ public function testNonIntUmaskThrowsInvalidArgumentException()
+ {
+ $this->setExpectedException('InvalidArgumentException');
+
+ $this->getMock(
+ 'Doctrine\Common\Cache\FileCache',
+ array('doFetch', 'doContains', 'doSave'),
+ array('', '', 'invalid')
+ );
+ }
+
+ public function testGetDirectoryReturnsRealpathDirectoryString()
+ {
+ $directory = __DIR__ . '/../';
+ $driver = $this->getMock(
+ 'Doctrine\Common\Cache\FileCache',
+ array('doFetch', 'doContains', 'doSave'),
+ array($directory)
+ );
+
+ $doGetDirectory = new \ReflectionMethod($driver, 'getDirectory');
+
+ $actualDirectory = $doGetDirectory->invoke($driver);
+ $expectedDirectory = realpath($directory);
+
+ $this->assertEquals($expectedDirectory, $actualDirectory);
+ }
+
+ public function testGetExtensionReturnsExtensionString()
+ {
+ $directory = __DIR__ . '/../';
+ $extension = DIRECTORY_SEPARATOR . basename(__FILE__);
+ $driver = $this->getMock(
+ 'Doctrine\Common\Cache\FileCache',
+ array('doFetch', 'doContains', 'doSave'),
+ array($directory, $extension)
+ );
+
+ $doGetExtension = new \ReflectionMethod($driver, 'getExtension');
+
+ $actualExtension = $doGetExtension->invoke($driver);
+
+ $this->assertEquals($extension, $actualExtension);
+ }
+
+ const WIN_MAX_PATH_LEN = 258;
+
+ public static function getBasePathForWindowsPathLengthTests($pathLength)
+ {
+ // Not using __DIR__ because it can get screwed up when xdebug debugger is attached.
+ $basePath = realpath(sys_get_temp_dir()) . '/' . uniqid('doctrine-cache', true);
+
+ /** @noinspection MkdirRaceConditionInspection */
+ @mkdir($basePath);
+
+ $basePath = realpath($basePath);
+
+ // Test whether the desired path length is odd or even.
+ $desiredPathLengthIsOdd = ($pathLength % 2) == 1;
+
+ // If the cache key is not too long, the filecache codepath will add
+ // a slash and bin2hex($key). The length of the added portion will be an odd number.
+ // len(desired) = len(base path) + len(slash . bin2hex($key))
+ // odd = even + odd
+ // even = odd + odd
+ $basePathLengthShouldBeOdd = !$desiredPathLengthIsOdd;
+
+ $basePathLengthIsOdd = (strlen($basePath) % 2) == 1;
+
+ // If the base path needs to be odd or even where it is not, we add an odd number of
+ // characters as a pad. In this case, we're adding '\aa' (or '/aa' depending on platform)
+ // This is all to make it so that the key we're testing would result in
+ // a path that is exactly the length we want to test IF the path length limit
+ // were not in place in FileCache.
+ if ($basePathLengthIsOdd != $basePathLengthShouldBeOdd) {
+ $basePath .= DIRECTORY_SEPARATOR . "aa";
+ }
+
+ return $basePath;
+ }
+
+ /**
+ * @param int $length
+ * @param string $basePath
+ *
+ * @return array
+ */
+ public static function getKeyAndPathFittingLength($length, $basePath)
+ {
+ $baseDirLength = strlen($basePath);
+ $extensionLength = strlen('.doctrine.cache');
+ $directoryLength = strlen(DIRECTORY_SEPARATOR . 'aa' . DIRECTORY_SEPARATOR);
+ $keyLength = $length - ($baseDirLength + $extensionLength + $directoryLength); // - 1 because of slash
+
+ $key = str_repeat('a', floor($keyLength / 2));
+
+ $keyHash = hash('sha256', $key);
+
+ $keyPath = $basePath
+ . DIRECTORY_SEPARATOR
+ . substr($keyHash, 0, 2)
+ . DIRECTORY_SEPARATOR
+ . bin2hex($key)
+ . '.doctrine.cache';
+
+ $hashedKeyPath = $basePath
+ . DIRECTORY_SEPARATOR
+ . substr($keyHash, 0, 2)
+ . DIRECTORY_SEPARATOR
+ . '_' . $keyHash
+ . '.doctrine.cache';
+
+ return array($key, $keyPath, $hashedKeyPath);
+ }
+
+ public function getPathLengthsToTest()
+ {
+ // Windows officially supports 260 bytes including null terminator
+ // 259 characters is too large due to PHP bug (https://bugs.php.net/bug.php?id=70943)
+ // 260 characters is too large - null terminator is included in allowable length
+ return array(
+ array(257, false),
+ array(258, false),
+ array(259, true),
+ array(260, true)
+ );
+ }
+
+ /**
+ * @runInSeparateProcess
+ * @dataProvider getPathLengthsToTest
+ *
+ * @covers \Doctrine\Common\Cache\FileCache::getFilename
+ *
+ * @param int $length
+ * @param bool $pathShouldBeHashed
+ */
+ public function testWindowsPathLengthLimitationsAreCorrectlyRespected($length, $pathShouldBeHashed)
+ {
+ if (! defined('PHP_WINDOWS_VERSION_BUILD')) {
+ define('PHP_WINDOWS_VERSION_BUILD', 'Yes, this is the "usual suspect", with the usual limitations');
+ }
+
+ $basePath = self::getBasePathForWindowsPathLengthTests($length);
+
+ $fileCache = $this->getMockForAbstractClass(
+ 'Doctrine\Common\Cache\FileCache',
+ array($basePath, '.doctrine.cache')
+ );
+
+ list($key, $keyPath, $hashedKeyPath) = self::getKeyAndPathFittingLength($length, $basePath);
+
+ $getFileName = new \ReflectionMethod($fileCache, 'getFilename');
+
+ $getFileName->setAccessible(true);
+
+ $this->assertEquals(
+ $length,
+ strlen($keyPath),
+ sprintf('Path expected to be %d characters long is %d characters long', $length, strlen($keyPath))
+ );
+
+ if ($pathShouldBeHashed) {
+ $keyPath = $hashedKeyPath;
+ }
+
+ if ($pathShouldBeHashed) {
+ $this->assertSame(
+ $hashedKeyPath,
+ $getFileName->invoke($fileCache, $key),
+ 'Keys should be hashed correctly if they are over the limit.'
+ );
+ } else {
+ $this->assertSame(
+ $keyPath,
+ $getFileName->invoke($fileCache, $key),
+ 'Keys below limit of the allowed length are used directly, unhashed'
+ );
+ }
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php
new file mode 100644
index 00000000..9e7c9e81
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php
@@ -0,0 +1,61 @@
+_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertNull($stats[Cache::STATS_HITS]);
+ $this->assertNull($stats[Cache::STATS_MISSES]);
+ $this->assertNull($stats[Cache::STATS_UPTIME]);
+ $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]);
+ $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_AVAILABLE]);
+ }
+
+ public function testCacheInSharedDirectoryIsPerExtension()
+ {
+ $cache1 = new FilesystemCache($this->directory, '.foo');
+ $cache2 = new FilesystemCache($this->directory, '.bar');
+
+ $this->assertTrue($cache1->save('key1', 11));
+ $this->assertTrue($cache1->save('key2', 12));
+
+ $this->assertTrue($cache2->save('key1', 21));
+ $this->assertTrue($cache2->save('key2', 22));
+
+ $this->assertSame(11, $cache1->fetch('key1'), 'Cache value must not be influenced by a different cache in the same directory but different extension');
+ $this->assertSame(12, $cache1->fetch('key2'));
+ $this->assertTrue($cache1->flushAll());
+ $this->assertFalse($cache1->fetch('key1'), 'flushAll() must delete all items with the current extension');
+ $this->assertFalse($cache1->fetch('key2'));
+
+ $this->assertSame(21, $cache2->fetch('key1'), 'flushAll() must not remove items with a different extension in a shared directory');
+ $this->assertSame(22, $cache2->fetch('key2'));
+ }
+
+ public function testFlushAllWithNoExtension()
+ {
+ $cache = new FilesystemCache($this->directory, '');
+
+ $this->assertTrue($cache->save('key1', 1));
+ $this->assertTrue($cache->save('key2', 2));
+ $this->assertTrue($cache->flushAll());
+ $this->assertFalse($cache->contains('key1'));
+ $this->assertFalse($cache->contains('key2'));
+ }
+
+ protected function _getCacheDriver()
+ {
+ return new FilesystemCache($this->directory);
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php
new file mode 100644
index 00000000..74853b84
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php
@@ -0,0 +1,59 @@
+memcache = new Memcache();
+
+ if (@$this->memcache->connect('localhost', 11211) === false) {
+ unset($this->memcache);
+ $this->markTestSkipped('Cannot connect to Memcache.');
+ }
+ }
+
+ protected function tearDown()
+ {
+ if ($this->memcache instanceof Memcache) {
+ $this->memcache->flush();
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * Memcache does not support " " and null byte as key so we remove them from the tests.
+ */
+ public function provideCacheIds()
+ {
+ $ids = parent::provideCacheIds();
+ unset($ids[21], $ids[22]);
+
+ return $ids;
+ }
+
+ public function testGetMemcacheReturnsInstanceOfMemcache()
+ {
+ $this->assertInstanceOf('Memcache', $this->_getCacheDriver()->getMemcache());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function _getCacheDriver()
+ {
+ $driver = new MemcacheCache();
+ $driver->setMemcache($this->memcache);
+ return $driver;
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php
new file mode 100644
index 00000000..fbcf5c38
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php
@@ -0,0 +1,61 @@
+memcached = new Memcached();
+ $this->memcached->setOption(Memcached::OPT_COMPRESSION, false);
+ $this->memcached->addServer('127.0.0.1', 11211);
+
+ if (@fsockopen('127.0.0.1', 11211) === false) {
+ unset($this->memcached);
+ $this->markTestSkipped('Cannot connect to Memcached.');
+ }
+ }
+
+ protected function tearDown()
+ {
+ if ($this->memcached instanceof Memcached) {
+ $this->memcached->flush();
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * Memcached does not support " ", null byte and very long keys so we remove them from the tests.
+ */
+ public function provideCacheIds()
+ {
+ $ids = parent::provideCacheIds();
+ unset($ids[21], $ids[22], $ids[24]);
+
+ return $ids;
+ }
+
+ public function testGetMemcachedReturnsInstanceOfMemcached()
+ {
+ $this->assertInstanceOf('Memcached', $this->_getCacheDriver()->getMemcached());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function _getCacheDriver()
+ {
+ $driver = new MemcachedCache();
+ $driver->setMemcached($this->memcached);
+ return $driver;
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php
new file mode 100644
index 00000000..fa7cfacd
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MongoDBCacheTest.php
@@ -0,0 +1,68 @@
+=')) {
+ $this->markTestSkipped('Mongo >= 1.3.0 is required.');
+ }
+
+ $mongo = new MongoClient();
+ $this->collection = $mongo->selectCollection('doctrine_common_cache', 'test');
+ }
+
+ protected function tearDown()
+ {
+ if ($this->collection instanceof MongoCollection) {
+ $this->collection->drop();
+ }
+ }
+
+ public function testGetStats()
+ {
+ $cache = $this->_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertNull($stats[Cache::STATS_HITS]);
+ $this->assertNull($stats[Cache::STATS_MISSES]);
+ $this->assertGreaterThan(0, $stats[Cache::STATS_UPTIME]);
+ $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]);
+ $this->assertNull($stats[Cache::STATS_MEMORY_AVAILABLE]);
+ }
+
+ /**
+ * @group 108
+ */
+ public function testMongoCursorExceptionsDoNotBubbleUp()
+ {
+ /* @var $collection \MongoCollection|\PHPUnit_Framework_MockObject_MockObject */
+ $collection = $this->getMock('MongoCollection', array(), array(), '', false);
+
+ $collection->expects(self::once())->method('update')->willThrowException(new \MongoCursorException());
+
+ $cache = new MongoDBCache($collection);
+
+ self::assertFalse($cache->save('foo', 'bar'));
+ }
+
+ protected function _getCacheDriver()
+ {
+ return new MongoDBCache($this->collection);
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php
new file mode 100644
index 00000000..d1851cb3
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php
@@ -0,0 +1,98 @@
+_getCacheDriver();
+
+ // Test save
+ $cache->save('test_set_state', new SetStateClass(array(1,2,3)));
+
+ //Test __set_state call
+ $this->assertCount(0, SetStateClass::$values);
+
+ // Test fetch
+ $value = $cache->fetch('test_set_state');
+ $this->assertInstanceOf('Doctrine\Tests\Common\Cache\SetStateClass', $value);
+ $this->assertEquals(array(1,2,3), $value->getValue());
+
+ //Test __set_state call
+ $this->assertCount(1, SetStateClass::$values);
+
+ // Test contains
+ $this->assertTrue($cache->contains('test_set_state'));
+ }
+
+ public function testNotImplementsSetState()
+ {
+ $cache = $this->_getCacheDriver();
+
+ $this->setExpectedException('InvalidArgumentException');
+ $cache->save('test_not_set_state', new NotSetStateClass(array(1,2,3)));
+ }
+
+ public function testGetStats()
+ {
+ $cache = $this->_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertNull($stats[Cache::STATS_HITS]);
+ $this->assertNull($stats[Cache::STATS_MISSES]);
+ $this->assertNull($stats[Cache::STATS_UPTIME]);
+ $this->assertEquals(0, $stats[Cache::STATS_MEMORY_USAGE]);
+ $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_AVAILABLE]);
+ }
+
+ protected function _getCacheDriver()
+ {
+ return new PhpFileCache($this->directory);
+ }
+}
+
+class NotSetStateClass
+{
+ private $value;
+
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ public function getValue()
+ {
+ return $this->value;
+ }
+}
+
+class SetStateClass extends NotSetStateClass
+{
+ public static $values = array();
+
+ public static function __set_state($data)
+ {
+ self::$values = $data;
+ return new self($data['value']);
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PredisCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PredisCacheTest.php
new file mode 100644
index 00000000..e20839dc
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PredisCacheTest.php
@@ -0,0 +1,87 @@
+markTestSkipped('Predis\Client is missing. Make sure to "composer install" to have all dev dependencies.');
+ }
+
+ $this->client = new Client();
+
+ try {
+ $this->client->connect();
+ } catch (ConnectionException $e) {
+ $this->markTestSkipped('Cannot connect to Redis because of: ' . $e);
+ }
+ }
+
+ public function testHitMissesStatsAreProvided()
+ {
+ $cache = $this->_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertNotNull($stats[Cache::STATS_HITS]);
+ $this->assertNotNull($stats[Cache::STATS_MISSES]);
+ }
+
+ /**
+ * @return PredisCache
+ */
+ protected function _getCacheDriver()
+ {
+ return new PredisCache($this->client);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @dataProvider provideDataToCache
+ */
+ public function testSetContainsFetchDelete($value)
+ {
+ if (array() === $value) {
+ $this->markTestIncomplete(
+ 'Predis currently doesn\'t support saving empty array values. '
+ . 'See https://github.com/nrk/predis/issues/241'
+ );
+ }
+
+ parent::testSetContainsFetchDelete($value);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @dataProvider provideDataToCache
+ */
+ public function testUpdateExistingEntry($value)
+ {
+ if (array() === $value) {
+ $this->markTestIncomplete(
+ 'Predis currently doesn\'t support saving empty array values. '
+ . 'See https://github.com/nrk/predis/issues/241'
+ );
+ }
+
+ parent::testUpdateExistingEntry($value);
+ }
+
+ public function testAllowsGenericPredisClient()
+ {
+ /* @var $predisClient \Predis\ClientInterface */
+ $predisClient = $this->getMock('Predis\\ClientInterface');
+
+ $this->assertInstanceOf('Doctrine\\Common\\Cache\\PredisCache', new PredisCache($predisClient));
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php
new file mode 100644
index 00000000..5fb6a11d
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php
@@ -0,0 +1,59 @@
+_redis = new \Redis();
+ $ok = @$this->_redis->connect('127.0.0.1');
+ if (!$ok) {
+ $this->markTestSkipped('Cannot connect to Redis.');
+ }
+ }
+
+ public function testHitMissesStatsAreProvided()
+ {
+ $cache = $this->_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertNotNull($stats[Cache::STATS_HITS]);
+ $this->assertNotNull($stats[Cache::STATS_MISSES]);
+ }
+
+ public function testGetRedisReturnsInstanceOfRedis()
+ {
+ $this->assertInstanceOf('Redis', $this->_getCacheDriver()->getRedis());
+ }
+
+ public function testSerializerOptionWithOutIgbinaryExtension()
+ {
+ if (defined('Redis::SERIALIZER_IGBINARY') && extension_loaded('igbinary')) {
+ $this->markTestSkipped('Extension igbinary is loaded.');
+ }
+
+ $this->assertEquals(
+ \Redis::SERIALIZER_PHP,
+ $this->_getCacheDriver()->getRedis()->getOption(\Redis::OPT_SERIALIZER)
+ );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function _getCacheDriver()
+ {
+ $driver = new RedisCache();
+ $driver->setRedis($this->_redis);
+ return $driver;
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php
new file mode 100644
index 00000000..e7d5f3dd
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php
@@ -0,0 +1,58 @@
+connection = new Connection('127.0.0.1', 8087);
+ $this->bucket = new Bucket($this->connection, 'test');
+ } catch (Exception\RiakException $e) {
+ $this->markTestSkipped('Cannot connect to Riak.');
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function testGetStats()
+ {
+ $cache = $this->_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertNull($stats);
+ }
+
+ /**
+ * Retrieve RiakCache instance.
+ *
+ * @return \Doctrine\Common\Cache\RiakCache
+ */
+ protected function _getCacheDriver()
+ {
+ return new RiakCache($this->bucket);
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/SQLite3CacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/SQLite3CacheTest.php
new file mode 100644
index 00000000..f0c5b0b5
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/SQLite3CacheTest.php
@@ -0,0 +1,42 @@
+file = tempnam(null, 'doctrine-cache-test-');
+ unlink($this->file);
+ $this->sqlite = new SQLite3($this->file);
+ }
+
+ protected function tearDown()
+ {
+ $this->sqlite = null; // DB must be closed before
+ unlink($this->file);
+ }
+
+ public function testGetStats()
+ {
+ $this->assertNull($this->_getCacheDriver()->getStats());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function _getCacheDriver()
+ {
+ return new SQLite3Cache($this->sqlite, 'test_table');
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/VoidCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/VoidCacheTest.php
new file mode 100644
index 00000000..8ab7e5b4
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/VoidCacheTest.php
@@ -0,0 +1,58 @@
+assertFalse($cache->contains('foo'));
+ $this->assertFalse($cache->contains('bar'));
+ }
+
+ public function testShouldAlwaysReturnFalseOnFetch()
+ {
+ $cache = new VoidCache();
+
+ $this->assertFalse($cache->fetch('foo'));
+ $this->assertFalse($cache->fetch('bar'));
+ }
+
+ public function testShouldAlwaysReturnTrueOnSaveButNotStoreAnything()
+ {
+ $cache = new VoidCache();
+
+ $this->assertTrue($cache->save('foo', 'fooVal'));
+
+ $this->assertFalse($cache->contains('foo'));
+ $this->assertFalse($cache->fetch('foo'));
+ }
+
+ public function testShouldAlwaysReturnTrueOnDelete()
+ {
+ $cache = new VoidCache();
+
+ $this->assertTrue($cache->delete('foo'));
+ }
+
+ public function testShouldAlwaysReturnNullOnGetStatus()
+ {
+ $cache = new VoidCache();
+
+ $this->assertNull($cache->getStats());
+ }
+
+ public function testShouldAlwaysReturnTrueOnFlush()
+ {
+ $cache = new VoidCache();
+
+ $this->assertTrue($cache->flushAll());
+ }
+}
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php
new file mode 100644
index 00000000..1dded424
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php
@@ -0,0 +1,16 @@
+markTestSkipped('Zend Data Cache only works in apache2handler SAPI.');
+ }
+ }
+
+ public function testGetStats()
+ {
+ $cache = $this->_getCacheDriver();
+ $stats = $cache->getStats();
+
+ $this->assertNull($stats);
+ }
+
+ protected function _getCacheDriver()
+ {
+ return new ZendDataCache();
+ }
+}
\ No newline at end of file
diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php b/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php
new file mode 100644
index 00000000..e8323d29
--- /dev/null
+++ b/vendor/doctrine/cache/tests/Doctrine/Tests/DoctrineTestCase.php
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ../Doctrine/
+
+
+
+
+
+ ../../lib/Doctrine/
+
+
+
+
+
+ performance
+
+
+
diff --git a/vendor/doctrine/collections/.gitignore b/vendor/doctrine/collections/.gitignore
new file mode 100644
index 00000000..48b8bf90
--- /dev/null
+++ b/vendor/doctrine/collections/.gitignore
@@ -0,0 +1 @@
+vendor/
diff --git a/vendor/doctrine/collections/.travis.yml b/vendor/doctrine/collections/.travis.yml
new file mode 100644
index 00000000..60f47927
--- /dev/null
+++ b/vendor/doctrine/collections/.travis.yml
@@ -0,0 +1,21 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+ - 5.6
+ - 7.0
+ - hhvm
+ - hhvm-nightly
+
+matrix:
+ fast_finish: true
+ allow_failures:
+ - php: 7.0
+
+before_script:
+ - composer --prefer-source install
+
+script:
+ - phpunit
diff --git a/vendor/doctrine/collections/LICENSE b/vendor/doctrine/collections/LICENSE
new file mode 100644
index 00000000..5e781fce
--- /dev/null
+++ b/vendor/doctrine/collections/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2006-2013 Doctrine Project
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/doctrine/collections/README.md b/vendor/doctrine/collections/README.md
new file mode 100644
index 00000000..161cab63
--- /dev/null
+++ b/vendor/doctrine/collections/README.md
@@ -0,0 +1,25 @@
+# Doctrine Collections
+
+[](https://travis-ci.org/doctrine/collections)
+
+Collections Abstraction library
+
+## Changelog
+
+### v1.3.0
+
+* [Explicit casting of first and max results in criteria API](https://github.com/doctrine/collections/pull/26)
+* [Keep keys when using `ArrayCollection#matching()` with sorting](https://github.com/doctrine/collections/pull/49)
+* [Made `AbstractLazyCollection#$initialized` protected for extensibility](https://github.com/doctrine/collections/pull/52)
+
+### v1.2.0
+
+* Add a new ``AbstractLazyCollection``
+
+### v1.1.0
+
+* Deprecated ``Comparison::IS``, because it's only there for SQL semantics.
+ These are fixed in the ORM instead.
+* Add ``Comparison::CONTAINS`` to perform partial string matches:
+
+ $criteria->andWhere($criteria->expr()->contains('property', 'Foo'));
diff --git a/vendor/doctrine/collections/composer.json b/vendor/doctrine/collections/composer.json
new file mode 100644
index 00000000..155cac48
--- /dev/null
+++ b/vendor/doctrine/collections/composer.json
@@ -0,0 +1,29 @@
+{
+ "name": "doctrine/collections",
+ "type": "library",
+ "description": "Collections Abstraction library",
+ "keywords": ["collections", "array", "iterator"],
+ "homepage": "http://www.doctrine-project.org",
+ "license": "MIT",
+ "authors": [
+ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
+ {"name": "Roman Borschel", "email": "roman@code-factory.org"},
+ {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
+ {"name": "Jonathan Wage", "email": "jonwage@gmail.com"},
+ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
+ ],
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "autoload": {
+ "psr-0": { "Doctrine\\Common\\Collections\\": "lib/" }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php
new file mode 100644
index 00000000..b907f8b0
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php
@@ -0,0 +1,343 @@
+.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use Closure;
+
+/**
+ * Lazy collection that is backed by a concrete collection
+ *
+ * @author Michaël Gallego
+ * @since 1.2
+ */
+abstract class AbstractLazyCollection implements Collection
+{
+ /**
+ * The backed collection to use
+ *
+ * @var Collection
+ */
+ protected $collection;
+
+ /**
+ * @var boolean
+ */
+ protected $initialized = false;
+
+ /**
+ * {@inheritDoc}
+ */
+ public function count()
+ {
+ $this->initialize();
+ return $this->collection->count();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function add($element)
+ {
+ $this->initialize();
+ return $this->collection->add($element);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function clear()
+ {
+ $this->initialize();
+ $this->collection->clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function contains($element)
+ {
+ $this->initialize();
+ return $this->collection->contains($element);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isEmpty()
+ {
+ $this->initialize();
+ return $this->collection->isEmpty();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function remove($key)
+ {
+ $this->initialize();
+ return $this->collection->remove($key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function removeElement($element)
+ {
+ $this->initialize();
+ return $this->collection->removeElement($element);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function containsKey($key)
+ {
+ $this->initialize();
+ return $this->collection->containsKey($key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get($key)
+ {
+ $this->initialize();
+ return $this->collection->get($key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getKeys()
+ {
+ $this->initialize();
+ return $this->collection->getKeys();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getValues()
+ {
+ $this->initialize();
+ return $this->collection->getValues();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function set($key, $value)
+ {
+ $this->initialize();
+ $this->collection->set($key, $value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function toArray()
+ {
+ $this->initialize();
+ return $this->collection->toArray();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function first()
+ {
+ $this->initialize();
+ return $this->collection->first();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function last()
+ {
+ $this->initialize();
+ return $this->collection->last();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function key()
+ {
+ $this->initialize();
+ return $this->collection->key();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function current()
+ {
+ $this->initialize();
+ return $this->collection->current();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function next()
+ {
+ $this->initialize();
+ return $this->collection->next();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function exists(Closure $p)
+ {
+ $this->initialize();
+ return $this->collection->exists($p);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function filter(Closure $p)
+ {
+ $this->initialize();
+ return $this->collection->filter($p);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function forAll(Closure $p)
+ {
+ $this->initialize();
+ return $this->collection->forAll($p);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function map(Closure $func)
+ {
+ $this->initialize();
+ return $this->collection->map($func);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function partition(Closure $p)
+ {
+ $this->initialize();
+ return $this->collection->partition($p);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function indexOf($element)
+ {
+ $this->initialize();
+ return $this->collection->indexOf($element);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function slice($offset, $length = null)
+ {
+ $this->initialize();
+ return $this->collection->slice($offset, $length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getIterator()
+ {
+ $this->initialize();
+ return $this->collection->getIterator();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function offsetExists($offset)
+ {
+ $this->initialize();
+ return $this->collection->offsetExists($offset);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function offsetGet($offset)
+ {
+ $this->initialize();
+ return $this->collection->offsetGet($offset);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function offsetSet($offset, $value)
+ {
+ $this->initialize();
+ $this->collection->offsetSet($offset, $value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function offsetUnset($offset)
+ {
+ $this->initialize();
+ $this->collection->offsetUnset($offset);
+ }
+
+ /**
+ * Is the lazy collection already initialized?
+ *
+ * @return bool
+ */
+ public function isInitialized()
+ {
+ return $this->initialized;
+ }
+
+ /**
+ * Initialize the collection
+ *
+ * @return void
+ */
+ protected function initialize()
+ {
+ if ( ! $this->initialized) {
+ $this->doInitialize();
+ $this->initialized = true;
+ }
+ }
+
+ /**
+ * Do the initialization logic
+ *
+ * @return void
+ */
+ abstract protected function doInitialize();
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php
new file mode 100644
index 00000000..bce57512
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php
@@ -0,0 +1,387 @@
+.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use ArrayIterator;
+use Closure;
+use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor;
+
+/**
+ * An ArrayCollection is a Collection implementation that wraps a regular PHP array.
+ *
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+class ArrayCollection implements Collection, Selectable
+{
+ /**
+ * An array containing the entries of this collection.
+ *
+ * @var array
+ */
+ private $elements;
+
+ /**
+ * Initializes a new ArrayCollection.
+ *
+ * @param array $elements
+ */
+ public function __construct(array $elements = array())
+ {
+ $this->elements = $elements;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function toArray()
+ {
+ return $this->elements;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function first()
+ {
+ return reset($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function last()
+ {
+ return end($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function key()
+ {
+ return key($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function next()
+ {
+ return next($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function current()
+ {
+ return current($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function remove($key)
+ {
+ if ( ! isset($this->elements[$key]) && ! array_key_exists($key, $this->elements)) {
+ return null;
+ }
+
+ $removed = $this->elements[$key];
+ unset($this->elements[$key]);
+
+ return $removed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function removeElement($element)
+ {
+ $key = array_search($element, $this->elements, true);
+
+ if ($key === false) {
+ return false;
+ }
+
+ unset($this->elements[$key]);
+
+ return true;
+ }
+
+ /**
+ * Required by interface ArrayAccess.
+ *
+ * {@inheritDoc}
+ */
+ public function offsetExists($offset)
+ {
+ return $this->containsKey($offset);
+ }
+
+ /**
+ * Required by interface ArrayAccess.
+ *
+ * {@inheritDoc}
+ */
+ public function offsetGet($offset)
+ {
+ return $this->get($offset);
+ }
+
+ /**
+ * Required by interface ArrayAccess.
+ *
+ * {@inheritDoc}
+ */
+ public function offsetSet($offset, $value)
+ {
+ if ( ! isset($offset)) {
+ return $this->add($value);
+ }
+
+ $this->set($offset, $value);
+ }
+
+ /**
+ * Required by interface ArrayAccess.
+ *
+ * {@inheritDoc}
+ */
+ public function offsetUnset($offset)
+ {
+ return $this->remove($offset);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function containsKey($key)
+ {
+ return isset($this->elements[$key]) || array_key_exists($key, $this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function contains($element)
+ {
+ return in_array($element, $this->elements, true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function exists(Closure $p)
+ {
+ foreach ($this->elements as $key => $element) {
+ if ($p($key, $element)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function indexOf($element)
+ {
+ return array_search($element, $this->elements, true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function get($key)
+ {
+ return isset($this->elements[$key]) ? $this->elements[$key] : null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getKeys()
+ {
+ return array_keys($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getValues()
+ {
+ return array_values($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function count()
+ {
+ return count($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function set($key, $value)
+ {
+ $this->elements[$key] = $value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function add($value)
+ {
+ $this->elements[] = $value;
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isEmpty()
+ {
+ return empty($this->elements);
+ }
+
+ /**
+ * Required by interface IteratorAggregate.
+ *
+ * {@inheritDoc}
+ */
+ public function getIterator()
+ {
+ return new ArrayIterator($this->elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function map(Closure $func)
+ {
+ return new static(array_map($func, $this->elements));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function filter(Closure $p)
+ {
+ return new static(array_filter($this->elements, $p));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function forAll(Closure $p)
+ {
+ foreach ($this->elements as $key => $element) {
+ if ( ! $p($key, $element)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function partition(Closure $p)
+ {
+ $matches = $noMatches = array();
+
+ foreach ($this->elements as $key => $element) {
+ if ($p($key, $element)) {
+ $matches[$key] = $element;
+ } else {
+ $noMatches[$key] = $element;
+ }
+ }
+
+ return array(new static($matches), new static($noMatches));
+ }
+
+ /**
+ * Returns a string representation of this object.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return __CLASS__ . '@' . spl_object_hash($this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function clear()
+ {
+ $this->elements = array();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function slice($offset, $length = null)
+ {
+ return array_slice($this->elements, $offset, $length, true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function matching(Criteria $criteria)
+ {
+ $expr = $criteria->getWhereExpression();
+ $filtered = $this->elements;
+
+ if ($expr) {
+ $visitor = new ClosureExpressionVisitor();
+ $filter = $visitor->dispatch($expr);
+ $filtered = array_filter($filtered, $filter);
+ }
+
+ if ($orderings = $criteria->getOrderings()) {
+ foreach (array_reverse($orderings) as $field => $ordering) {
+ $next = ClosureExpressionVisitor::sortByField($field, $ordering == Criteria::DESC ? -1 : 1);
+ }
+
+ uasort($filtered, $next);
+ }
+
+ $offset = $criteria->getFirstResult();
+ $length = $criteria->getMaxResults();
+
+ if ($offset || $length) {
+ $filtered = array_slice($filtered, (int)$offset, $length);
+ }
+
+ return new static($filtered);
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php
new file mode 100644
index 00000000..8792f7a5
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php
@@ -0,0 +1,263 @@
+.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use ArrayAccess;
+use Closure;
+use Countable;
+use IteratorAggregate;
+
+/**
+ * The missing (SPL) Collection/Array/OrderedMap interface.
+ *
+ * A Collection resembles the nature of a regular PHP array. That is,
+ * it is essentially an ordered map that can also be used
+ * like a list.
+ *
+ * A Collection has an internal iterator just like a PHP array. In addition,
+ * a Collection can be iterated with external iterators, which is preferable.
+ * To use an external iterator simply use the foreach language construct to
+ * iterate over the collection (which calls {@link getIterator()} internally) or
+ * explicitly retrieve an iterator though {@link getIterator()} which can then be
+ * used to iterate over the collection.
+ * You can not rely on the internal iterator of the collection being at a certain
+ * position unless you explicitly positioned it before. Prefer iteration with
+ * external iterators.
+ *
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+interface Collection extends Countable, IteratorAggregate, ArrayAccess
+{
+ /**
+ * Adds an element at the end of the collection.
+ *
+ * @param mixed $element The element to add.
+ *
+ * @return boolean Always TRUE.
+ */
+ public function add($element);
+
+ /**
+ * Clears the collection, removing all elements.
+ *
+ * @return void
+ */
+ public function clear();
+
+ /**
+ * Checks whether an element is contained in the collection.
+ * This is an O(n) operation, where n is the size of the collection.
+ *
+ * @param mixed $element The element to search for.
+ *
+ * @return boolean TRUE if the collection contains the element, FALSE otherwise.
+ */
+ public function contains($element);
+
+ /**
+ * Checks whether the collection is empty (contains no elements).
+ *
+ * @return boolean TRUE if the collection is empty, FALSE otherwise.
+ */
+ public function isEmpty();
+
+ /**
+ * Removes the element at the specified index from the collection.
+ *
+ * @param string|integer $key The kex/index of the element to remove.
+ *
+ * @return mixed The removed element or NULL, if the collection did not contain the element.
+ */
+ public function remove($key);
+
+ /**
+ * Removes the specified element from the collection, if it is found.
+ *
+ * @param mixed $element The element to remove.
+ *
+ * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
+ */
+ public function removeElement($element);
+
+ /**
+ * Checks whether the collection contains an element with the specified key/index.
+ *
+ * @param string|integer $key The key/index to check for.
+ *
+ * @return boolean TRUE if the collection contains an element with the specified key/index,
+ * FALSE otherwise.
+ */
+ public function containsKey($key);
+
+ /**
+ * Gets the element at the specified key/index.
+ *
+ * @param string|integer $key The key/index of the element to retrieve.
+ *
+ * @return mixed
+ */
+ public function get($key);
+
+ /**
+ * Gets all keys/indices of the collection.
+ *
+ * @return array The keys/indices of the collection, in the order of the corresponding
+ * elements in the collection.
+ */
+ public function getKeys();
+
+ /**
+ * Gets all values of the collection.
+ *
+ * @return array The values of all elements in the collection, in the order they
+ * appear in the collection.
+ */
+ public function getValues();
+
+ /**
+ * Sets an element in the collection at the specified key/index.
+ *
+ * @param string|integer $key The key/index of the element to set.
+ * @param mixed $value The element to set.
+ *
+ * @return void
+ */
+ public function set($key, $value);
+
+ /**
+ * Gets a native PHP array representation of the collection.
+ *
+ * @return array
+ */
+ public function toArray();
+
+ /**
+ * Sets the internal iterator to the first element in the collection and returns this element.
+ *
+ * @return mixed
+ */
+ public function first();
+
+ /**
+ * Sets the internal iterator to the last element in the collection and returns this element.
+ *
+ * @return mixed
+ */
+ public function last();
+
+ /**
+ * Gets the key/index of the element at the current iterator position.
+ *
+ * @return int|string
+ */
+ public function key();
+
+ /**
+ * Gets the element of the collection at the current iterator position.
+ *
+ * @return mixed
+ */
+ public function current();
+
+ /**
+ * Moves the internal iterator position to the next element and returns this element.
+ *
+ * @return mixed
+ */
+ public function next();
+
+ /**
+ * Tests for the existence of an element that satisfies the given predicate.
+ *
+ * @param Closure $p The predicate.
+ *
+ * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
+ */
+ public function exists(Closure $p);
+
+ /**
+ * Returns all the elements of this collection that satisfy the predicate p.
+ * The order of the elements is preserved.
+ *
+ * @param Closure $p The predicate used for filtering.
+ *
+ * @return Collection A collection with the results of the filter operation.
+ */
+ public function filter(Closure $p);
+
+ /**
+ * Tests whether the given predicate p holds for all elements of this collection.
+ *
+ * @param Closure $p The predicate.
+ *
+ * @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
+ */
+ public function forAll(Closure $p);
+
+ /**
+ * Applies the given function to each element in the collection and returns
+ * a new collection with the elements returned by the function.
+ *
+ * @param Closure $func
+ *
+ * @return Collection
+ */
+ public function map(Closure $func);
+
+ /**
+ * Partitions this collection in two collections according to a predicate.
+ * Keys are preserved in the resulting collections.
+ *
+ * @param Closure $p The predicate on which to partition.
+ *
+ * @return array An array with two elements. The first element contains the collection
+ * of elements where the predicate returned TRUE, the second element
+ * contains the collection of elements where the predicate returned FALSE.
+ */
+ public function partition(Closure $p);
+
+ /**
+ * Gets the index/key of a given element. The comparison of two elements is strict,
+ * that means not only the value but also the type must match.
+ * For objects this means reference equality.
+ *
+ * @param mixed $element The element to search for.
+ *
+ * @return int|string|bool The key/index of the element or FALSE if the element was not found.
+ */
+ public function indexOf($element);
+
+ /**
+ * Extracts a slice of $length elements starting at position $offset from the Collection.
+ *
+ * If $length is null it returns all elements from $offset to the end of the Collection.
+ * Keys have to be preserved by this method. Calling this method will only return the
+ * selected slice and NOT change the elements contained in the collection slice is called on.
+ *
+ * @param int $offset The offset to start from.
+ * @param int|null $length The maximum number of elements to return, or null for no limit.
+ *
+ * @return array
+ */
+ public function slice($offset, $length = null);
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php
new file mode 100644
index 00000000..3f9d43a8
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php
@@ -0,0 +1,259 @@
+.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use Doctrine\Common\Collections\Expr\Expression;
+use Doctrine\Common\Collections\Expr\CompositeExpression;
+
+/**
+ * Criteria for filtering Selectable collections.
+ *
+ * @author Benjamin Eberlei
+ * @since 2.3
+ */
+class Criteria
+{
+ /**
+ * @var string
+ */
+ const ASC = 'ASC';
+
+ /**
+ * @var string
+ */
+ const DESC = 'DESC';
+
+ /**
+ * @var \Doctrine\Common\Collections\ExpressionBuilder|null
+ */
+ private static $expressionBuilder;
+
+ /**
+ * @var \Doctrine\Common\Collections\Expr\Expression|null
+ */
+ private $expression;
+
+ /**
+ * @var string[]
+ */
+ private $orderings = array();
+
+ /**
+ * @var int|null
+ */
+ private $firstResult;
+
+ /**
+ * @var int|null
+ */
+ private $maxResults;
+
+ /**
+ * Creates an instance of the class.
+ *
+ * @return Criteria
+ */
+ public static function create()
+ {
+ return new static();
+ }
+
+ /**
+ * Returns the expression builder.
+ *
+ * @return \Doctrine\Common\Collections\ExpressionBuilder
+ */
+ public static function expr()
+ {
+ if (self::$expressionBuilder === null) {
+ self::$expressionBuilder = new ExpressionBuilder();
+ }
+
+ return self::$expressionBuilder;
+ }
+
+ /**
+ * Construct a new Criteria.
+ *
+ * @param Expression $expression
+ * @param string[]|null $orderings
+ * @param int|null $firstResult
+ * @param int|null $maxResults
+ */
+ public function __construct(Expression $expression = null, array $orderings = null, $firstResult = null, $maxResults = null)
+ {
+ $this->expression = $expression;
+
+ $this->setFirstResult($firstResult);
+ $this->setMaxResults($maxResults);
+
+ if (null !== $orderings) {
+ $this->orderBy($orderings);
+ }
+ }
+
+ /**
+ * Sets the where expression to evaluate when this Criteria is searched for.
+ *
+ * @param Expression $expression
+ *
+ * @return Criteria
+ */
+ public function where(Expression $expression)
+ {
+ $this->expression = $expression;
+
+ return $this;
+ }
+
+ /**
+ * Appends the where expression to evaluate when this Criteria is searched for
+ * using an AND with previous expression.
+ *
+ * @param Expression $expression
+ *
+ * @return Criteria
+ */
+ public function andWhere(Expression $expression)
+ {
+ if ($this->expression === null) {
+ return $this->where($expression);
+ }
+
+ $this->expression = new CompositeExpression(CompositeExpression::TYPE_AND, array(
+ $this->expression, $expression
+ ));
+
+ return $this;
+ }
+
+ /**
+ * Appends the where expression to evaluate when this Criteria is searched for
+ * using an OR with previous expression.
+ *
+ * @param Expression $expression
+ *
+ * @return Criteria
+ */
+ public function orWhere(Expression $expression)
+ {
+ if ($this->expression === null) {
+ return $this->where($expression);
+ }
+
+ $this->expression = new CompositeExpression(CompositeExpression::TYPE_OR, array(
+ $this->expression, $expression
+ ));
+
+ return $this;
+ }
+
+ /**
+ * Gets the expression attached to this Criteria.
+ *
+ * @return Expression|null
+ */
+ public function getWhereExpression()
+ {
+ return $this->expression;
+ }
+
+ /**
+ * Gets the current orderings of this Criteria.
+ *
+ * @return string[]
+ */
+ public function getOrderings()
+ {
+ return $this->orderings;
+ }
+
+ /**
+ * Sets the ordering of the result of this Criteria.
+ *
+ * Keys are field and values are the order, being either ASC or DESC.
+ *
+ * @see Criteria::ASC
+ * @see Criteria::DESC
+ *
+ * @param string[] $orderings
+ *
+ * @return Criteria
+ */
+ public function orderBy(array $orderings)
+ {
+ $this->orderings = array_map(
+ function ($ordering) {
+ return strtoupper($ordering) === Criteria::ASC ? Criteria::ASC : Criteria::DESC;
+ },
+ $orderings
+ );
+
+ return $this;
+ }
+
+ /**
+ * Gets the current first result option of this Criteria.
+ *
+ * @return int|null
+ */
+ public function getFirstResult()
+ {
+ return $this->firstResult;
+ }
+
+ /**
+ * Set the number of first result that this Criteria should return.
+ *
+ * @param int|null $firstResult The value to set.
+ *
+ * @return Criteria
+ */
+ public function setFirstResult($firstResult)
+ {
+ $this->firstResult = null === $firstResult ? null : (int) $firstResult;
+
+ return $this;
+ }
+
+ /**
+ * Gets maxResults.
+ *
+ * @return int|null
+ */
+ public function getMaxResults()
+ {
+ return $this->maxResults;
+ }
+
+ /**
+ * Sets maxResults.
+ *
+ * @param int|null $maxResults The value to set.
+ *
+ * @return Criteria
+ */
+ public function setMaxResults($maxResults)
+ {
+ $this->maxResults = null === $maxResults ? null : (int) $maxResults;
+
+ return $this;
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php
new file mode 100644
index 00000000..994085f9
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php
@@ -0,0 +1,227 @@
+.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * Walks an expression graph and turns it into a PHP closure.
+ *
+ * This closure can be used with {@Collection#filter()} and is used internally
+ * by {@ArrayCollection#select()}.
+ *
+ * @author Benjamin Eberlei
+ * @since 2.3
+ */
+class ClosureExpressionVisitor extends ExpressionVisitor
+{
+ /**
+ * Accesses the field of a given object. This field has to be public
+ * directly or indirectly (through an accessor get*, is*, or a magic
+ * method, __get, __call).
+ *
+ * @param object $object
+ * @param string $field
+ *
+ * @return mixed
+ */
+ public static function getObjectFieldValue($object, $field)
+ {
+ if (is_array($object)) {
+ return $object[$field];
+ }
+
+ $accessors = array('get', 'is');
+
+ foreach ($accessors as $accessor) {
+ $accessor .= $field;
+
+ if ( ! method_exists($object, $accessor)) {
+ continue;
+ }
+
+ return $object->$accessor();
+ }
+
+ // __call should be triggered for get.
+ $accessor = $accessors[0] . $field;
+
+ if (method_exists($object, '__call')) {
+ return $object->$accessor();
+ }
+
+ if ($object instanceof \ArrayAccess) {
+ return $object[$field];
+ }
+
+ return $object->$field;
+ }
+
+ /**
+ * Helper for sorting arrays of objects based on multiple fields + orientations.
+ *
+ * @param string $name
+ * @param int $orientation
+ * @param \Closure $next
+ *
+ * @return \Closure
+ */
+ public static function sortByField($name, $orientation = 1, \Closure $next = null)
+ {
+ if ( ! $next) {
+ $next = function() {
+ return 0;
+ };
+ }
+
+ return function ($a, $b) use ($name, $next, $orientation) {
+ $aValue = ClosureExpressionVisitor::getObjectFieldValue($a, $name);
+ $bValue = ClosureExpressionVisitor::getObjectFieldValue($b, $name);
+
+ if ($aValue === $bValue) {
+ return $next($a, $b);
+ }
+
+ return (($aValue > $bValue) ? 1 : -1) * $orientation;
+ };
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function walkComparison(Comparison $comparison)
+ {
+ $field = $comparison->getField();
+ $value = $comparison->getValue()->getValue(); // shortcut for walkValue()
+
+ switch ($comparison->getOperator()) {
+ case Comparison::EQ:
+ return function ($object) use ($field, $value) {
+ return ClosureExpressionVisitor::getObjectFieldValue($object, $field) === $value;
+ };
+
+ case Comparison::NEQ:
+ return function ($object) use ($field, $value) {
+ return ClosureExpressionVisitor::getObjectFieldValue($object, $field) !== $value;
+ };
+
+ case Comparison::LT:
+ return function ($object) use ($field, $value) {
+ return ClosureExpressionVisitor::getObjectFieldValue($object, $field) < $value;
+ };
+
+ case Comparison::LTE:
+ return function ($object) use ($field, $value) {
+ return ClosureExpressionVisitor::getObjectFieldValue($object, $field) <= $value;
+ };
+
+ case Comparison::GT:
+ return function ($object) use ($field, $value) {
+ return ClosureExpressionVisitor::getObjectFieldValue($object, $field) > $value;
+ };
+
+ case Comparison::GTE:
+ return function ($object) use ($field, $value) {
+ return ClosureExpressionVisitor::getObjectFieldValue($object, $field) >= $value;
+ };
+
+ case Comparison::IN:
+ return function ($object) use ($field, $value) {
+ return in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
+ };
+
+ case Comparison::NIN:
+ return function ($object) use ($field, $value) {
+ return ! in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
+ };
+
+ case Comparison::CONTAINS:
+ return function ($object) use ($field, $value) {
+ return false !== strpos(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
+ };
+
+ default:
+ throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function walkValue(Value $value)
+ {
+ return $value->getValue();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function walkCompositeExpression(CompositeExpression $expr)
+ {
+ $expressionList = array();
+
+ foreach ($expr->getExpressionList() as $child) {
+ $expressionList[] = $this->dispatch($child);
+ }
+
+ switch($expr->getType()) {
+ case CompositeExpression::TYPE_AND:
+ return $this->andExpressions($expressionList);
+
+ case CompositeExpression::TYPE_OR:
+ return $this->orExpressions($expressionList);
+
+ default:
+ throw new \RuntimeException("Unknown composite " . $expr->getType());
+ }
+ }
+
+ /**
+ * @param array $expressions
+ *
+ * @return callable
+ */
+ private function andExpressions($expressions)
+ {
+ return function ($object) use ($expressions) {
+ foreach ($expressions as $expression) {
+ if ( ! $expression($object)) {
+ return false;
+ }
+ }
+ return true;
+ };
+ }
+
+ /**
+ * @param array $expressions
+ *
+ * @return callable
+ */
+ private function orExpressions($expressions)
+ {
+ return function ($object) use ($expressions) {
+ foreach ($expressions as $expression) {
+ if ($expression($object)) {
+ return true;
+ }
+ }
+ return false;
+ };
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php
new file mode 100644
index 00000000..d54ecf25
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php
@@ -0,0 +1,103 @@
+.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * Comparison of a field with a value by the given operator.
+ *
+ * @author Benjamin Eberlei
+ * @since 2.3
+ */
+class Comparison implements Expression
+{
+ const EQ = '=';
+ const NEQ = '<>';
+ const LT = '<';
+ const LTE = '<=';
+ const GT = '>';
+ const GTE = '>=';
+ const IS = '='; // no difference with EQ
+ const IN = 'IN';
+ const NIN = 'NIN';
+ const CONTAINS = 'CONTAINS';
+
+ /**
+ * @var string
+ */
+ private $field;
+
+ /**
+ * @var string
+ */
+ private $op;
+
+ /**
+ * @var Value
+ */
+ private $value;
+
+ /**
+ * @param string $field
+ * @param string $operator
+ * @param mixed $value
+ */
+ public function __construct($field, $operator, $value)
+ {
+ if ( ! ($value instanceof Value)) {
+ $value = new Value($value);
+ }
+
+ $this->field = $field;
+ $this->op = $operator;
+ $this->value = $value;
+ }
+
+ /**
+ * @return string
+ */
+ public function getField()
+ {
+ return $this->field;
+ }
+
+ /**
+ * @return Value
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * @return string
+ */
+ public function getOperator()
+ {
+ return $this->op;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function visit(ExpressionVisitor $visitor)
+ {
+ return $visitor->walkComparison($this);
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php
new file mode 100644
index 00000000..3613c027
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php
@@ -0,0 +1,90 @@
+.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * Expression of Expressions combined by AND or OR operation.
+ *
+ * @author Benjamin Eberlei
+ * @since 2.3
+ */
+class CompositeExpression implements Expression
+{
+ const TYPE_AND = 'AND';
+ const TYPE_OR = 'OR';
+
+ /**
+ * @var string
+ */
+ private $type;
+
+ /**
+ * @var Expression[]
+ */
+ private $expressions = array();
+
+ /**
+ * @param string $type
+ * @param array $expressions
+ *
+ * @throws \RuntimeException
+ */
+ public function __construct($type, array $expressions)
+ {
+ $this->type = $type;
+
+ foreach ($expressions as $expr) {
+ if ($expr instanceof Value) {
+ throw new \RuntimeException("Values are not supported expressions as children of and/or expressions.");
+ }
+ if ( ! ($expr instanceof Expression)) {
+ throw new \RuntimeException("No expression given to CompositeExpression.");
+ }
+
+ $this->expressions[] = $expr;
+ }
+ }
+
+ /**
+ * Returns the list of expressions nested in this composite.
+ *
+ * @return Expression[]
+ */
+ public function getExpressionList()
+ {
+ return $this->expressions;
+ }
+
+ /**
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function visit(ExpressionVisitor $visitor)
+ {
+ return $visitor->walkCompositeExpression($this);
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Expression.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Expression.php
new file mode 100644
index 00000000..68db767c
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Expression.php
@@ -0,0 +1,35 @@
+.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * Expression for the {@link Selectable} interface.
+ *
+ * @author Benjamin Eberlei
+ */
+interface Expression
+{
+ /**
+ * @param ExpressionVisitor $visitor
+ *
+ * @return mixed
+ */
+ public function visit(ExpressionVisitor $visitor);
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php
new file mode 100644
index 00000000..080afdc6
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php
@@ -0,0 +1,82 @@
+.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * An Expression visitor walks a graph of expressions and turns them into a
+ * query for the underlying implementation.
+ *
+ * @author Benjamin Eberlei
+ */
+abstract class ExpressionVisitor
+{
+ /**
+ * Converts a comparison expression into the target query language output.
+ *
+ * @param Comparison $comparison
+ *
+ * @return mixed
+ */
+ abstract public function walkComparison(Comparison $comparison);
+
+ /**
+ * Converts a value expression into the target query language part.
+ *
+ * @param Value $value
+ *
+ * @return mixed
+ */
+ abstract public function walkValue(Value $value);
+
+ /**
+ * Converts a composite expression into the target query language output.
+ *
+ * @param CompositeExpression $expr
+ *
+ * @return mixed
+ */
+ abstract public function walkCompositeExpression(CompositeExpression $expr);
+
+ /**
+ * Dispatches walking an expression to the appropriate handler.
+ *
+ * @param Expression $expr
+ *
+ * @return mixed
+ *
+ * @throws \RuntimeException
+ */
+ public function dispatch(Expression $expr)
+ {
+ switch (true) {
+ case ($expr instanceof Comparison):
+ return $this->walkComparison($expr);
+
+ case ($expr instanceof Value):
+ return $this->walkValue($expr);
+
+ case ($expr instanceof CompositeExpression):
+ return $this->walkCompositeExpression($expr);
+
+ default:
+ throw new \RuntimeException("Unknown Expression " . get_class($expr));
+ }
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Value.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Value.php
new file mode 100644
index 00000000..7f6e8314
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Value.php
@@ -0,0 +1,52 @@
+.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+class Value implements Expression
+{
+ /**
+ * @var mixed
+ */
+ private $value;
+
+ /**
+ * @param mixed $value
+ */
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function visit(ExpressionVisitor $visitor)
+ {
+ return $visitor->walkValue($this);
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php
new file mode 100644
index 00000000..6539e3c7
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php
@@ -0,0 +1,166 @@
+.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use Doctrine\Common\Collections\Expr\Comparison;
+use Doctrine\Common\Collections\Expr\CompositeExpression;
+use Doctrine\Common\Collections\Expr\Value;
+
+/**
+ * Builder for Expressions in the {@link Selectable} interface.
+ *
+ * Important Notice for interoperable code: You have to use scalar
+ * values only for comparisons, otherwise the behavior of the comparision
+ * may be different between implementations (Array vs ORM vs ODM).
+ *
+ * @author Benjamin Eberlei
+ * @since 2.3
+ */
+class ExpressionBuilder
+{
+ /**
+ * @param mixed $x
+ *
+ * @return CompositeExpression
+ */
+ public function andX($x = null)
+ {
+ return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args());
+ }
+
+ /**
+ * @param mixed $x
+ *
+ * @return CompositeExpression
+ */
+ public function orX($x = null)
+ {
+ return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args());
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $value
+ *
+ * @return Comparison
+ */
+ public function eq($field, $value)
+ {
+ return new Comparison($field, Comparison::EQ, new Value($value));
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $value
+ *
+ * @return Comparison
+ */
+ public function gt($field, $value)
+ {
+ return new Comparison($field, Comparison::GT, new Value($value));
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $value
+ *
+ * @return Comparison
+ */
+ public function lt($field, $value)
+ {
+ return new Comparison($field, Comparison::LT, new Value($value));
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $value
+ *
+ * @return Comparison
+ */
+ public function gte($field, $value)
+ {
+ return new Comparison($field, Comparison::GTE, new Value($value));
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $value
+ *
+ * @return Comparison
+ */
+ public function lte($field, $value)
+ {
+ return new Comparison($field, Comparison::LTE, new Value($value));
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $value
+ *
+ * @return Comparison
+ */
+ public function neq($field, $value)
+ {
+ return new Comparison($field, Comparison::NEQ, new Value($value));
+ }
+
+ /**
+ * @param string $field
+ *
+ * @return Comparison
+ */
+ public function isNull($field)
+ {
+ return new Comparison($field, Comparison::EQ, new Value(null));
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $values
+ *
+ * @return Comparison
+ */
+ public function in($field, array $values)
+ {
+ return new Comparison($field, Comparison::IN, new Value($values));
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $values
+ *
+ * @return Comparison
+ */
+ public function notIn($field, array $values)
+ {
+ return new Comparison($field, Comparison::NIN, new Value($values));
+ }
+
+ /**
+ * @param string $field
+ * @param mixed $value
+ *
+ * @return Comparison
+ */
+ public function contains($field, $value)
+ {
+ return new Comparison($field, Comparison::CONTAINS, new Value($value));
+ }
+}
diff --git a/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php
new file mode 100644
index 00000000..57660ed7
--- /dev/null
+++ b/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php
@@ -0,0 +1,48 @@
+.
+ */
+
+namespace Doctrine\Common\Collections;
+
+/**
+ * Interface for collections that allow efficient filtering with an expression API.
+ *
+ * Goal of this interface is a backend independent method to fetch elements
+ * from a collections. {@link Expression} is crafted in a way that you can
+ * implement queries from both in-memory and database-backed collections.
+ *
+ * For database backed collections this allows very efficient access by
+ * utilizing the query APIs, for example SQL in the ORM. Applications using
+ * this API can implement efficient database access without having to ask the
+ * EntityManager or Repositories.
+ *
+ * @author Benjamin Eberlei
+ * @since 2.3
+ */
+interface Selectable
+{
+ /**
+ * Selects all elements from a selectable that match the expression and
+ * returns a new collection containing these elements.
+ *
+ * @param Criteria $criteria
+ *
+ * @return Collection
+ */
+ public function matching(Criteria $criteria);
+}
diff --git a/vendor/doctrine/collections/phpunit.xml.dist b/vendor/doctrine/collections/phpunit.xml.dist
new file mode 100644
index 00000000..36968e99
--- /dev/null
+++ b/vendor/doctrine/collections/phpunit.xml.dist
@@ -0,0 +1,31 @@
+
+
+
+
+
+ ./tests/Doctrine/
+
+
+
+
+
+ ./lib/Doctrine/
+
+
+
+
+
+ performance
+
+
+
diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php
new file mode 100644
index 00000000..4de82cc2
--- /dev/null
+++ b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/AbstractLazyCollectionTest.php
@@ -0,0 +1,20 @@
+assertFalse($collection->isInitialized());
+ $this->assertCount(3, $collection);
+
+ $collection->add('bar');
+ $this->assertTrue($collection->isInitialized());
+ $this->assertCount(4, $collection);
+ }
+}
diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ArrayCollectionTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ArrayCollectionTest.php
new file mode 100644
index 00000000..1b8a906f
--- /dev/null
+++ b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ArrayCollectionTest.php
@@ -0,0 +1,296 @@
+.
+ */
+
+namespace Doctrine\Tests\Common\Collections;
+
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\Common\Collections\Criteria;
+
+/**
+ * Tests for {@see \Doctrine\Common\Collections\ArrayCollection}
+ *
+ * @covers \Doctrine\Common\Collections\ArrayCollection
+ */
+class ArrayCollectionTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testToArray($elements)
+ {
+ $collection = new ArrayCollection($elements);
+
+ $this->assertSame($elements, $collection->toArray());
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testFirst($elements)
+ {
+ $collection = new ArrayCollection($elements);
+ $this->assertSame(reset($elements), $collection->first());
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testLast($elements)
+ {
+ $collection = new ArrayCollection($elements);
+ $this->assertSame(end($elements), $collection->last());
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testKey($elements)
+ {
+ $collection = new ArrayCollection($elements);
+
+ $this->assertSame(key($elements), $collection->key());
+
+ next($elements);
+ $collection->next();
+
+ $this->assertSame(key($elements), $collection->key());
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testNext($elements)
+ {
+ $collection = new ArrayCollection($elements);
+
+ while (true) {
+ $collectionNext = $collection->next();
+ $arrayNext = next($elements);
+
+ if(!$collectionNext || !$arrayNext) {
+ break;
+ }
+
+ $this->assertSame($arrayNext, $collectionNext, "Returned value of ArrayCollection::next() and next() not match");
+ $this->assertSame(key($elements), $collection->key(), "Keys not match");
+ $this->assertSame(current($elements), $collection->current(), "Current values not match");
+ }
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testCurrent($elements)
+ {
+ $collection = new ArrayCollection($elements);
+
+ $this->assertSame(current($elements), $collection->current());
+
+ next($elements);
+ $collection->next();
+
+ $this->assertSame(current($elements), $collection->current());
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testGetKeys($elements)
+ {
+ $collection = new ArrayCollection($elements);
+
+ $this->assertSame(array_keys($elements), $collection->getKeys());
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testGetValues($elements)
+ {
+ $collection = new ArrayCollection($elements);
+
+ $this->assertSame(array_values($elements), $collection->getValues());
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testCount($elements)
+ {
+ $collection = new ArrayCollection($elements);
+
+ $this->assertSame(count($elements), $collection->count());
+ }
+
+ /**
+ * @dataProvider provideDifferentElements
+ */
+ public function testIterator($elements)
+ {
+ $collection = new ArrayCollection($elements);
+
+ $iterations = 0;
+ foreach($collection->getIterator() as $key => $item) {
+ $this->assertSame($elements[$key], $item, "Item {$key} not match");
+ $iterations++;
+ }
+
+ $this->assertEquals(count($elements), $iterations, "Number of iterations not match");
+ }
+
+ /**
+ * @return array
+ */
+ public function provideDifferentElements()
+ {
+ return array(
+ 'indexed' => array(array(1, 2, 3, 4, 5)),
+ 'associative' => array(array('A' => 'a', 'B' => 'b', 'C' => 'c')),
+ 'mixed' => array(array('A' => 'a', 1, 'B' => 'b', 2, 3)),
+ );
+ }
+
+ public function testRemove()
+ {
+ $elements = array(1, 'A' => 'a', 2, 'B' => 'b', 3);
+ $collection = new ArrayCollection($elements);
+
+ $this->assertEquals(1, $collection->remove(0));
+ unset($elements[0]);
+
+ $this->assertEquals(null, $collection->remove('non-existent'));
+ unset($elements['non-existent']);
+
+ $this->assertEquals(2, $collection->remove(1));
+ unset($elements[1]);
+
+ $this->assertEquals('a', $collection->remove('A'));
+ unset($elements['A']);
+
+ $this->assertEquals($elements, $collection->toArray());
+ }
+
+ public function testRemoveElement()
+ {
+ $elements = array(1, 'A' => 'a', 2, 'B' => 'b', 3, 'A2' => 'a', 'B2' => 'b');
+ $collection = new ArrayCollection($elements);
+
+ $this->assertTrue($collection->removeElement(1));
+ unset($elements[0]);
+
+ $this->assertFalse($collection->removeElement('non-existent'));
+
+ $this->assertTrue($collection->removeElement('a'));
+ unset($elements['A']);
+
+ $this->assertTrue($collection->removeElement('a'));
+ unset($elements['A2']);
+
+ $this->assertEquals($elements, $collection->toArray());
+ }
+
+ public function testContainsKey()
+ {
+ $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'B2' => 'b');
+ $collection = new ArrayCollection($elements);
+
+ $this->assertTrue($collection->containsKey(0), "Contains index 0");
+ $this->assertTrue($collection->containsKey('A'), "Contains key \"A\"");
+ $this->assertTrue($collection->containsKey('null'), "Contains key \"null\", with value null");
+ $this->assertFalse($collection->containsKey('non-existent'), "Doesn't contain key");
+ }
+
+ public function testEmpty()
+ {
+ $collection = new ArrayCollection();
+ $this->assertTrue($collection->isEmpty(), "Empty collection");
+
+ $collection->add(1);
+ $this->assertFalse($collection->isEmpty(), "Not empty collection");
+ }
+
+ public function testContains()
+ {
+ $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'zero' => 0);
+ $collection = new ArrayCollection($elements);
+
+ $this->assertTrue($collection->contains(0), "Contains Zero");
+ $this->assertTrue($collection->contains('a'), "Contains \"a\"");
+ $this->assertTrue($collection->contains(null), "Contains Null");
+ $this->assertFalse($collection->contains('non-existent'), "Doesn't contain an element");
+ }
+
+ public function testExists()
+ {
+ $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'zero' => 0);
+ $collection = new ArrayCollection($elements);
+
+ $this->assertTrue($collection->exists(function($key, $element) {
+ return $key == 'A' && $element == 'a';
+ }), "Element exists");
+
+ $this->assertFalse($collection->exists(function($key, $element) {
+ return $key == 'non-existent' && $element == 'non-existent';
+ }), "Element not exists");
+ }
+
+ public function testIndexOf()
+ {
+ $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'zero' => 0);
+ $collection = new ArrayCollection($elements);
+
+ $this->assertSame(array_search(2, $elements, true), $collection->indexOf(2), 'Index of 2');
+ $this->assertSame(array_search(null, $elements, true), $collection->indexOf(null), 'Index of null');
+ $this->assertSame(array_search('non-existent', $elements, true), $collection->indexOf('non-existent'), 'Index of non existent');
+ }
+
+ public function testGet()
+ {
+ $elements = array(1, 'A' => 'a', 2, 'null' => null, 3, 'A2' => 'a', 'zero' => 0);
+ $collection = new ArrayCollection($elements);
+
+ $this->assertSame(2, $collection->get(1), 'Get element by index');
+ $this->assertSame('a', $collection->get('A'), 'Get element by name');
+ $this->assertSame(null, $collection->get('non-existent'), 'Get non existent element');
+ }
+
+ public function testMatchingWithSortingPreservesyKeys()
+ {
+ $object1 = new \stdClass();
+ $object2 = new \stdClass();
+
+ $object1->sortField = 2;
+ $object2->sortField = 1;
+
+ $collection = new ArrayCollection(array(
+ 'object1' => $object1,
+ 'object2' => $object2,
+ ));
+
+ $this->assertSame(
+ array(
+ 'object2' => $object2,
+ 'object1' => $object1,
+ ),
+ $collection
+ ->matching(new Criteria(null, array('sortField' => Criteria::ASC)))
+ ->toArray()
+ );
+ }
+}
diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php
new file mode 100644
index 00000000..21c2e3df
--- /dev/null
+++ b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php
@@ -0,0 +1,250 @@
+.
+ */
+
+namespace Doctrine\Tests\Common\Collections;
+
+use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor;
+use Doctrine\Common\Collections\ExpressionBuilder;
+
+/**
+ * @group DDC-1637
+ */
+class ClosureExpressionVisitorTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var ClosureExpressionVisitor
+ */
+ private $visitor;
+
+ /**
+ * @var ExpressionBuilder
+ */
+ private $builder;
+
+ protected function setUp()
+ {
+ $this->visitor = new ClosureExpressionVisitor();
+ $this->builder = new ExpressionBuilder();
+ }
+
+ public function testGetObjectFieldValueIsAccessor()
+ {
+ $object = new TestObject(1, 2, true);
+
+ $this->assertTrue($this->visitor->getObjectFieldValue($object, 'baz'));
+ }
+
+ public function testGetObjectFieldValueMagicCallMethod()
+ {
+ $object = new TestObject(1, 2, true, 3);
+
+ $this->assertEquals(3, $this->visitor->getObjectFieldValue($object, 'qux'));
+ }
+
+ public function testWalkEqualsComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->eq("foo", 1));
+
+ $this->assertTrue($closure(new TestObject(1)));
+ $this->assertFalse($closure(new TestObject(2)));
+ }
+
+ public function testWalkNotEqualsComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->neq("foo", 1));
+
+ $this->assertFalse($closure(new TestObject(1)));
+ $this->assertTrue($closure(new TestObject(2)));
+ }
+
+ public function testWalkLessThanComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->lt("foo", 1));
+
+ $this->assertFalse($closure(new TestObject(1)));
+ $this->assertTrue($closure(new TestObject(0)));
+ }
+
+ public function testWalkLessThanEqualsComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->lte("foo", 1));
+
+ $this->assertFalse($closure(new TestObject(2)));
+ $this->assertTrue($closure(new TestObject(1)));
+ $this->assertTrue($closure(new TestObject(0)));
+ }
+
+ public function testWalkGreaterThanEqualsComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->gte("foo", 1));
+
+ $this->assertTrue($closure(new TestObject(2)));
+ $this->assertTrue($closure(new TestObject(1)));
+ $this->assertFalse($closure(new TestObject(0)));
+ }
+
+ public function testWalkGreaterThanComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->gt("foo", 1));
+
+ $this->assertTrue($closure(new TestObject(2)));
+ $this->assertFalse($closure(new TestObject(1)));
+ $this->assertFalse($closure(new TestObject(0)));
+ }
+
+ public function testWalkInComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->in("foo", array(1, 2, 3)));
+
+ $this->assertTrue($closure(new TestObject(2)));
+ $this->assertTrue($closure(new TestObject(1)));
+ $this->assertFalse($closure(new TestObject(0)));
+ }
+
+ public function testWalkNotInComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->notIn("foo", array(1, 2, 3)));
+
+ $this->assertFalse($closure(new TestObject(1)));
+ $this->assertFalse($closure(new TestObject(2)));
+ $this->assertTrue($closure(new TestObject(0)));
+ $this->assertTrue($closure(new TestObject(4)));
+ }
+
+ public function testWalkContainsComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->contains('foo', 'hello'));
+
+ $this->assertTrue($closure(new TestObject('hello world')));
+ $this->assertFalse($closure(new TestObject('world')));
+ }
+
+ public function testWalkAndCompositeExpression()
+ {
+ $closure = $this->visitor->walkCompositeExpression(
+ $this->builder->andX(
+ $this->builder->eq("foo", 1),
+ $this->builder->eq("bar", 1)
+ )
+ );
+
+ $this->assertTrue($closure(new TestObject(1, 1)));
+ $this->assertFalse($closure(new TestObject(1, 0)));
+ $this->assertFalse($closure(new TestObject(0, 1)));
+ $this->assertFalse($closure(new TestObject(0, 0)));
+ }
+
+ public function testWalkOrCompositeExpression()
+ {
+ $closure = $this->visitor->walkCompositeExpression(
+ $this->builder->orX(
+ $this->builder->eq("foo", 1),
+ $this->builder->eq("bar", 1)
+ )
+ );
+
+ $this->assertTrue($closure(new TestObject(1, 1)));
+ $this->assertTrue($closure(new TestObject(1, 0)));
+ $this->assertTrue($closure(new TestObject(0, 1)));
+ $this->assertFalse($closure(new TestObject(0, 0)));
+ }
+
+ public function testSortByFieldAscending()
+ {
+ $objects = array(new TestObject("b"), new TestObject("a"), new TestObject("c"));
+ $sort = ClosureExpressionVisitor::sortByField("foo");
+
+ usort($objects, $sort);
+
+ $this->assertEquals("a", $objects[0]->getFoo());
+ $this->assertEquals("b", $objects[1]->getFoo());
+ $this->assertEquals("c", $objects[2]->getFoo());
+ }
+
+ public function testSortByFieldDescending()
+ {
+ $objects = array(new TestObject("b"), new TestObject("a"), new TestObject("c"));
+ $sort = ClosureExpressionVisitor::sortByField("foo", -1);
+
+ usort($objects, $sort);
+
+ $this->assertEquals("c", $objects[0]->getFoo());
+ $this->assertEquals("b", $objects[1]->getFoo());
+ $this->assertEquals("a", $objects[2]->getFoo());
+ }
+
+ public function testSortDelegate()
+ {
+ $objects = array(new TestObject("a", "c"), new TestObject("a", "b"), new TestObject("a", "a"));
+ $sort = ClosureExpressionVisitor::sortByField("bar", 1);
+ $sort = ClosureExpressionVisitor::sortByField("foo", 1, $sort);
+
+ usort($objects, $sort);
+
+ $this->assertEquals("a", $objects[0]->getBar());
+ $this->assertEquals("b", $objects[1]->getBar());
+ $this->assertEquals("c", $objects[2]->getBar());
+ }
+
+ public function testArrayComparison()
+ {
+ $closure = $this->visitor->walkComparison($this->builder->eq("foo", 42));
+
+ $this->assertTrue($closure(array('foo' => 42)));
+ }
+}
+
+class TestObject
+{
+ private $foo;
+ private $bar;
+ private $baz;
+ private $qux;
+
+ public function __construct($foo = null, $bar = null, $baz = null, $qux = null)
+ {
+ $this->foo = $foo;
+ $this->bar = $bar;
+ $this->baz = $baz;
+ $this->qux = $qux;
+ }
+
+ public function __call($name, $arguments)
+ {
+ if ('getqux' === $name) {
+ return $this->qux;
+ }
+ }
+
+ public function getFoo()
+ {
+ return $this->foo;
+ }
+
+ public function getBar()
+ {
+ return $this->bar;
+ }
+
+ public function isBaz()
+ {
+ return $this->baz;
+ }
+}
+
diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php
new file mode 100644
index 00000000..f3f91ad3
--- /dev/null
+++ b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php
@@ -0,0 +1,265 @@
+collection = new ArrayCollection();
+ }
+
+ public function testIssetAndUnset()
+ {
+ $this->assertFalse(isset($this->collection[0]));
+ $this->collection->add('testing');
+ $this->assertTrue(isset($this->collection[0]));
+ unset($this->collection[0]);
+ $this->assertFalse(isset($this->collection[0]));
+ }
+
+ public function testToString()
+ {
+ $this->collection->add('testing');
+ $this->assertTrue(is_string((string) $this->collection));
+ }
+
+ public function testRemovingNonExistentEntryReturnsNull()
+ {
+ $this->assertEquals(null, $this->collection->remove('testing_does_not_exist'));
+ }
+
+ public function testExists()
+ {
+ $this->collection->add("one");
+ $this->collection->add("two");
+ $exists = $this->collection->exists(function($k, $e) { return $e == "one"; });
+ $this->assertTrue($exists);
+ $exists = $this->collection->exists(function($k, $e) { return $e == "other"; });
+ $this->assertFalse($exists);
+ }
+
+ public function testMap()
+ {
+ $this->collection->add(1);
+ $this->collection->add(2);
+ $res = $this->collection->map(function($e) { return $e * 2; });
+ $this->assertEquals(array(2, 4), $res->toArray());
+ }
+
+ public function testFilter()
+ {
+ $this->collection->add(1);
+ $this->collection->add("foo");
+ $this->collection->add(3);
+ $res = $this->collection->filter(function($e) { return is_numeric($e); });
+ $this->assertEquals(array(0 => 1, 2 => 3), $res->toArray());
+ }
+
+ public function testFirstAndLast()
+ {
+ $this->collection->add('one');
+ $this->collection->add('two');
+
+ $this->assertEquals($this->collection->first(), 'one');
+ $this->assertEquals($this->collection->last(), 'two');
+ }
+
+ public function testArrayAccess()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+
+ $this->assertEquals($this->collection[0], 'one');
+ $this->assertEquals($this->collection[1], 'two');
+
+ unset($this->collection[0]);
+ $this->assertEquals($this->collection->count(), 1);
+ }
+
+ public function testContainsKey()
+ {
+ $this->collection[5] = 'five';
+ $this->assertTrue($this->collection->containsKey(5));
+ }
+
+ public function testContains()
+ {
+ $this->collection[0] = 'test';
+ $this->assertTrue($this->collection->contains('test'));
+ }
+
+ public function testSearch()
+ {
+ $this->collection[0] = 'test';
+ $this->assertEquals(0, $this->collection->indexOf('test'));
+ }
+
+ public function testGet()
+ {
+ $this->collection[0] = 'test';
+ $this->assertEquals('test', $this->collection->get(0));
+ }
+
+ public function testGetKeys()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+ $this->assertEquals(array(0, 1), $this->collection->getKeys());
+ }
+
+ public function testGetValues()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+ $this->assertEquals(array('one', 'two'), $this->collection->getValues());
+ }
+
+ public function testCount()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+ $this->assertEquals($this->collection->count(), 2);
+ $this->assertEquals(count($this->collection), 2);
+ }
+
+ public function testForAll()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+ $this->assertEquals($this->collection->forAll(function($k, $e) { return is_string($e); }), true);
+ $this->assertEquals($this->collection->forAll(function($k, $e) { return is_array($e); }), false);
+ }
+
+ public function testPartition()
+ {
+ $this->collection[] = true;
+ $this->collection[] = false;
+ $partition = $this->collection->partition(function($k, $e) { return $e == true; });
+ $this->assertEquals($partition[0][0], true);
+ $this->assertEquals($partition[1][0], false);
+ }
+
+ public function testClear()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+ $this->collection->clear();
+ $this->assertEquals($this->collection->isEmpty(), true);
+ }
+
+ public function testRemove()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+ $el = $this->collection->remove(0);
+
+ $this->assertEquals('one', $el);
+ $this->assertEquals($this->collection->contains('one'), false);
+ $this->assertNull($this->collection->remove(0));
+ }
+
+ public function testRemoveElement()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+
+ $this->assertTrue($this->collection->removeElement('two'));
+ $this->assertFalse($this->collection->contains('two'));
+ $this->assertFalse($this->collection->removeElement('two'));
+ }
+
+ public function testSlice()
+ {
+ $this->collection[] = 'one';
+ $this->collection[] = 'two';
+ $this->collection[] = 'three';
+
+ $slice = $this->collection->slice(0, 1);
+ $this->assertInternalType('array', $slice);
+ $this->assertEquals(array('one'), $slice);
+
+ $slice = $this->collection->slice(1);
+ $this->assertEquals(array(1 => 'two', 2 => 'three'), $slice);
+
+ $slice = $this->collection->slice(1, 1);
+ $this->assertEquals(array(1 => 'two'), $slice);
+ }
+
+ public function fillMatchingFixture()
+ {
+ $std1 = new \stdClass();
+ $std1->foo = "bar";
+ $this->collection[] = $std1;
+
+ $std2 = new \stdClass();
+ $std2->foo = "baz";
+ $this->collection[] = $std2;
+ }
+
+ /**
+ * @group DDC-1637
+ */
+ public function testMatching()
+ {
+ $this->fillMatchingFixture();
+
+ $col = $this->collection->matching(new Criteria(Criteria::expr()->eq("foo", "bar")));
+ $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col);
+ $this->assertNotSame($col, $this->collection);
+ $this->assertEquals(1, count($col));
+ }
+
+ /**
+ * @group DDC-1637
+ */
+ public function testMatchingOrdering()
+ {
+ $this->fillMatchingFixture();
+
+ $col = $this->collection->matching(new Criteria(null, array('foo' => 'DESC')));
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col);
+ $this->assertNotSame($col, $this->collection);
+ $this->assertEquals(2, count($col));
+ $this->assertEquals('baz', $col->first()->foo);
+ $this->assertEquals('bar', $col->last()->foo);
+ }
+
+ /**
+ * @group DDC-1637
+ */
+ public function testMatchingSlice()
+ {
+ $this->fillMatchingFixture();
+
+ $col = $this->collection->matching(new Criteria(null, null, 1, 1));
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col);
+ $this->assertNotSame($col, $this->collection);
+ $this->assertEquals(1, count($col));
+ $this->assertEquals('baz', $col[0]->foo);
+ }
+
+ public function testCanRemoveNullValuesByKey()
+ {
+ $this->collection->add(null);
+ $this->collection->remove(0);
+ $this->assertTrue($this->collection->isEmpty());
+ }
+
+ public function testCanVerifyExistingKeysWithNullValues()
+ {
+ $this->collection->set('key', null);
+ $this->assertTrue($this->collection->containsKey('key'));
+ }
+}
diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php
new file mode 100644
index 00000000..1ab058a9
--- /dev/null
+++ b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php
@@ -0,0 +1,83 @@
+assertInstanceOf('Doctrine\Common\Collections\Criteria', $criteria);
+ }
+
+ public function testConstructor()
+ {
+ $expr = new Comparison("field", "=", "value");
+ $criteria = new Criteria($expr, array("foo" => "ASC"), 10, 20);
+
+ $this->assertSame($expr, $criteria->getWhereExpression());
+ $this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings());
+ $this->assertEquals(10, $criteria->getFirstResult());
+ $this->assertEquals(20, $criteria->getMaxResults());
+ }
+
+ public function testWhere()
+ {
+ $expr = new Comparison("field", "=", "value");
+ $criteria = new Criteria();
+
+ $criteria->where($expr);
+
+ $this->assertSame($expr, $criteria->getWhereExpression());
+ }
+
+ public function testAndWhere()
+ {
+ $expr = new Comparison("field", "=", "value");
+ $criteria = new Criteria();
+
+ $criteria->where($expr);
+ $expr = $criteria->getWhereExpression();
+ $criteria->andWhere($expr);
+
+ $where = $criteria->getWhereExpression();
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $where);
+
+ $this->assertEquals(CompositeExpression::TYPE_AND, $where->getType());
+ $this->assertSame(array($expr, $expr), $where->getExpressionList());
+ }
+
+ public function testOrWhere()
+ {
+ $expr = new Comparison("field", "=", "value");
+ $criteria = new Criteria();
+
+ $criteria->where($expr);
+ $expr = $criteria->getWhereExpression();
+ $criteria->orWhere($expr);
+
+ $where = $criteria->getWhereExpression();
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $where);
+
+ $this->assertEquals(CompositeExpression::TYPE_OR, $where->getType());
+ $this->assertSame(array($expr, $expr), $where->getExpressionList());
+ }
+
+ public function testOrderings()
+ {
+ $criteria = Criteria::create()
+ ->orderBy(array("foo" => "ASC"));
+
+ $this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings());
+ }
+
+ public function testExpr()
+ {
+ $this->assertInstanceOf('Doctrine\Common\Collections\ExpressionBuilder', Criteria::expr());
+ }
+}
diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php
new file mode 100644
index 00000000..5f6b4ce2
--- /dev/null
+++ b/vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php
@@ -0,0 +1,125 @@
+builder = new ExpressionBuilder();
+ }
+
+ public function testAndX()
+ {
+ $expr = $this->builder->andX($this->builder->eq("a", "b"));
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $expr);
+ $this->assertEquals(CompositeExpression::TYPE_AND, $expr->getType());
+ }
+
+ public function testOrX()
+ {
+ $expr = $this->builder->orX($this->builder->eq("a", "b"));
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $expr);
+ $this->assertEquals(CompositeExpression::TYPE_OR, $expr->getType());
+ }
+
+ public function testInvalidAndXArgument()
+ {
+ $this->setExpectedException("RuntimeException");
+ $this->builder->andX("foo");
+ }
+
+ public function testEq()
+ {
+ $expr = $this->builder->eq("a", "b");
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::EQ, $expr->getOperator());
+ }
+
+ public function testNeq()
+ {
+ $expr = $this->builder->neq("a", "b");
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::NEQ, $expr->getOperator());
+ }
+
+ public function testLt()
+ {
+ $expr = $this->builder->lt("a", "b");
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::LT, $expr->getOperator());
+ }
+
+ public function testGt()
+ {
+ $expr = $this->builder->gt("a", "b");
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::GT, $expr->getOperator());
+ }
+
+ public function testGte()
+ {
+ $expr = $this->builder->gte("a", "b");
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::GTE, $expr->getOperator());
+ }
+
+ public function testLte()
+ {
+ $expr = $this->builder->lte("a", "b");
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::LTE, $expr->getOperator());
+ }
+
+ public function testIn()
+ {
+ $expr = $this->builder->in("a", array("b"));
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::IN, $expr->getOperator());
+ }
+
+ public function testNotIn()
+ {
+ $expr = $this->builder->notIn("a", array("b"));
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::NIN, $expr->getOperator());
+ }
+
+ public function testIsNull()
+ {
+ $expr = $this->builder->isNull("a");
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::EQ, $expr->getOperator());
+ }
+
+ public function testContains()
+ {
+ $expr = $this->builder->contains("a", "b");
+
+ $this->assertInstanceOf('Doctrine\Common\Collections\Expr\Comparison', $expr);
+ $this->assertEquals(Comparison::CONTAINS, $expr->getOperator());
+ }
+}
diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/LazyArrayCollection.php b/vendor/doctrine/collections/tests/Doctrine/Tests/LazyArrayCollection.php
new file mode 100644
index 00000000..56736b83
--- /dev/null
+++ b/vendor/doctrine/collections/tests/Doctrine/Tests/LazyArrayCollection.php
@@ -0,0 +1,22 @@
+collection = new ArrayCollection(array('a', 'b', 'c'));
+ }
+}
diff --git a/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php b/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php
new file mode 100644
index 00000000..973b5fef
--- /dev/null
+++ b/vendor/doctrine/collections/tests/Doctrine/Tests/TestInit.php
@@ -0,0 +1,21 @@
+setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
+ // new code necessary starting here
+ $reader->setIgnoreNotImportedAnnotations(true);
+ $reader->setEnableParsePhpImports(false);
+ $reader = new \Doctrine\Common\Annotations\CachedReader(
+ new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache()
+ );
+
+## Annotation Base class or @Annotation
+
+Beginning after 2.1-RC2 you have to either extend ``Doctrine\Common\Annotations\Annotation`` or add @Annotation to your annotations class-level docblock, otherwise the class will simply be ignored.
+
+## Removed methods on AnnotationReader
+
+* AnnotationReader::setAutoloadAnnotations()
+* AnnotationReader::getAutoloadAnnotations()
+* AnnotationReader::isAutoloadAnnotations()
+
+## AnnotationRegistry
+
+Autoloading through the PHP autoloader is removed from the 2.1 AnnotationReader. Instead you have to use the global AnnotationRegistry for loading purposes:
+
+ \Doctrine\Common\Annotations\AnnotationRegistry::registerFile($fileWithAnnotations);
+ \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace($namespace, $dirs = null);
+ \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespaces($namespaces);
+ \Doctrine\Common\Annotations\AnnotationRegistry::registerLoader($callable);
+
+The $callable for registering a loader accepts a class as first and only parameter and must try to silently autoload it. On success true has to be returned.
+The registerAutoloadNamespace function registers a PSR-0 compatible silent autoloader for all classes with the given namespace in the given directories.
+If null is passed as directory the include path will be used.
+
diff --git a/vendor/doctrine/common/UPGRADE_TO_2_2 b/vendor/doctrine/common/UPGRADE_TO_2_2
new file mode 100644
index 00000000..1d93a131
--- /dev/null
+++ b/vendor/doctrine/common/UPGRADE_TO_2_2
@@ -0,0 +1,61 @@
+This document details all the possible changes that you should investigate when
+updating your project from Doctrine Common 2.1 to 2.2:
+
+## Annotation Changes
+
+- AnnotationReader::setIgnoreNotImportedAnnotations has been removed, you need to
+ add ignore annotation names which are supposed to be ignored via
+ AnnotationReader::addGlobalIgnoredName
+
+- AnnotationReader::setAutoloadAnnotations was deprecated by the AnnotationRegistry
+ in 2.1 and has been removed in 2.2
+
+- AnnotationReader::setEnableParsePhpImports was added to ease transition to the new
+ annotation mechanism in 2.1 and is removed in 2.2
+
+- AnnotationReader::isParsePhpImportsEnabled is removed (see above)
+
+- AnnotationReader::setDefaultAnnotationNamespace was deprecated in favor of explicit
+ configuration in 2.1 and will be removed in 2.2 (for isolated projects where you
+ have full-control over _all_ available annotations, we offer a dedicated reader
+ class ``SimpleAnnotationReader``)
+
+- AnnotationReader::setAnnotationCreationFunction was deprecated in 2.1 and will be
+ removed in 2.2. We only offer two creation mechanisms which cannot be changed
+ anymore to allow the same reader instance to work with all annotations regardless
+ of which library they are coming from.
+
+- AnnotationReader::setAnnotationNamespaceAlias was deprecated in 2.1 and will be
+ removed in 2.2 (see setDefaultAnnotationNamespace)
+
+- If you use a class as annotation which has not the @Annotation marker in it's
+ class block, we will now throw an exception instead of silently ignoring it. You
+ can however still achieve the previous behavior using the @IgnoreAnnotation, or
+ AnnotationReader::addGlobalIgnoredName (the exception message will contain detailed
+ instructions when you run into this problem).
+
+## Cache Changes
+
+- Renamed old AbstractCache to CacheProvider
+
+- Dropped the support to the following functions of all cache providers:
+
+ - CacheProvider::deleteByWildcard
+
+ - CacheProvider::deleteByRegEx
+
+ - CacheProvider::deleteByPrefix
+
+ - CacheProvider::deleteBySuffix
+
+- CacheProvider::deleteAll will not remove ALL entries, it will only mark them as invalid
+
+- CacheProvider::flushAll will remove ALL entries, namespaced or not
+
+- Added support to MemcachedCache
+
+- Added support to WincacheCache
+
+## ClassLoader Changes
+
+- ClassLoader::fileExistsInIncludePath() no longer exists. Use the native stream_resolve_include_path() PHP function
\ No newline at end of file
diff --git a/vendor/doctrine/common/composer.json b/vendor/doctrine/common/composer.json
new file mode 100644
index 00000000..a12495ab
--- /dev/null
+++ b/vendor/doctrine/common/composer.json
@@ -0,0 +1,36 @@
+{
+ "name": "doctrine/common",
+ "type": "library",
+ "description": "Common Library for Doctrine projects",
+ "keywords": ["collections", "spl", "eventmanager", "annotations", "persistence"],
+ "homepage": "http://www.doctrine-project.org",
+ "license": "MIT",
+ "authors": [
+ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
+ {"name": "Roman Borschel", "email": "roman@code-factory.org"},
+ {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
+ {"name": "Jonathan Wage", "email": "jonwage@gmail.com"},
+ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
+ ],
+ "require": {
+ "php": "~5.5|~7.0",
+ "doctrine/inflector": "1.*",
+ "doctrine/cache": "1.*",
+ "doctrine/collections": "1.*",
+ "doctrine/lexer": "1.*",
+ "doctrine/annotations": "1.*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8|~5.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\": "lib/Doctrine/Common"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.7.x-dev"
+ }
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php b/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php
new file mode 100644
index 00000000..78eeb35d
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php
@@ -0,0 +1,280 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * A ClassLoader is an autoloader for class files that can be
+ * installed on the SPL autoload stack. It is a class loader that either loads only classes
+ * of a specific namespace or all namespaces and it is suitable for working together
+ * with other autoloaders in the SPL autoload stack.
+ *
+ * If no include path is configured through the constructor or {@link setIncludePath}, a ClassLoader
+ * relies on the PHP include_path.
+ *
+ * @author Roman Borschel
+ * @since 2.0
+ *
+ * @deprecated the ClassLoader is deprecated and will be removed in version 3.0 of doctrine/common.
+ */
+class ClassLoader
+{
+ /**
+ * PHP file extension.
+ *
+ * @var string
+ */
+ protected $fileExtension = '.php';
+
+ /**
+ * Current namespace.
+ *
+ * @var string|null
+ */
+ protected $namespace;
+
+ /**
+ * Current include path.
+ *
+ * @var string|null
+ */
+ protected $includePath;
+
+ /**
+ * PHP namespace separator.
+ *
+ * @var string
+ */
+ protected $namespaceSeparator = '\\';
+
+ /**
+ * Creates a new ClassLoader that loads classes of the
+ * specified namespace from the specified include path.
+ *
+ * If no include path is given, the ClassLoader relies on the PHP include_path.
+ * If neither a namespace nor an include path is given, the ClassLoader will
+ * be responsible for loading all classes, thereby relying on the PHP include_path.
+ *
+ * @param string|null $ns The namespace of the classes to load.
+ * @param string|null $includePath The base include path to use.
+ */
+ public function __construct($ns = null, $includePath = null)
+ {
+ $this->namespace = $ns;
+ $this->includePath = $includePath;
+ }
+
+ /**
+ * Sets the namespace separator used by classes in the namespace of this ClassLoader.
+ *
+ * @param string $sep The separator to use.
+ *
+ * @return void
+ */
+ public function setNamespaceSeparator($sep)
+ {
+ $this->namespaceSeparator = $sep;
+ }
+
+ /**
+ * Gets the namespace separator used by classes in the namespace of this ClassLoader.
+ *
+ * @return string
+ */
+ public function getNamespaceSeparator()
+ {
+ return $this->namespaceSeparator;
+ }
+
+ /**
+ * Sets the base include path for all class files in the namespace of this ClassLoader.
+ *
+ * @param string|null $includePath
+ *
+ * @return void
+ */
+ public function setIncludePath($includePath)
+ {
+ $this->includePath = $includePath;
+ }
+
+ /**
+ * Gets the base include path for all class files in the namespace of this ClassLoader.
+ *
+ * @return string|null
+ */
+ public function getIncludePath()
+ {
+ return $this->includePath;
+ }
+
+ /**
+ * Sets the file extension of class files in the namespace of this ClassLoader.
+ *
+ * @param string $fileExtension
+ *
+ * @return void
+ */
+ public function setFileExtension($fileExtension)
+ {
+ $this->fileExtension = $fileExtension;
+ }
+
+ /**
+ * Gets the file extension of class files in the namespace of this ClassLoader.
+ *
+ * @return string
+ */
+ public function getFileExtension()
+ {
+ return $this->fileExtension;
+ }
+
+ /**
+ * Registers this ClassLoader on the SPL autoload stack.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ spl_autoload_register([$this, 'loadClass']);
+ }
+
+ /**
+ * Removes this ClassLoader from the SPL autoload stack.
+ *
+ * @return void
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister([$this, 'loadClass']);
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $className The name of the class to load.
+ *
+ * @return boolean TRUE if the class has been successfully loaded, FALSE otherwise.
+ */
+ public function loadClass($className)
+ {
+ if (self::typeExists($className)) {
+ return true;
+ }
+
+ if (! $this->canLoadClass($className)) {
+ return false;
+ }
+
+ require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
+ . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className)
+ . $this->fileExtension;
+
+ return self::typeExists($className);
+ }
+
+ /**
+ * Asks this ClassLoader whether it can potentially load the class (file) with
+ * the given name.
+ *
+ * @param string $className The fully-qualified name of the class.
+ *
+ * @return boolean TRUE if this ClassLoader can load the class, FALSE otherwise.
+ */
+ public function canLoadClass($className)
+ {
+ if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) {
+ return false;
+ }
+
+ $file = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension;
+
+ if ($this->includePath !== null) {
+ return is_file($this->includePath . DIRECTORY_SEPARATOR . $file);
+ }
+
+ return (false !== stream_resolve_include_path($file));
+ }
+
+ /**
+ * Checks whether a class with a given name exists. A class "exists" if it is either
+ * already defined in the current request or if there is an autoloader on the SPL
+ * autoload stack that is a) responsible for the class in question and b) is able to
+ * load a class file in which the class definition resides.
+ *
+ * If the class is not already defined, each autoloader in the SPL autoload stack
+ * is asked whether it is able to tell if the class exists. If the autoloader is
+ * a ClassLoader, {@link canLoadClass} is used, otherwise the autoload
+ * function of the autoloader is invoked and expected to return a value that
+ * evaluates to TRUE if the class (file) exists. As soon as one autoloader reports
+ * that the class exists, TRUE is returned.
+ *
+ * Note that, depending on what kinds of autoloaders are installed on the SPL
+ * autoload stack, the class (file) might already be loaded as a result of checking
+ * for its existence. This is not the case with a ClassLoader, who separates
+ * these responsibilities.
+ *
+ * @param string $className The fully-qualified name of the class.
+ *
+ * @return boolean TRUE if the class exists as per the definition given above, FALSE otherwise.
+ */
+ public static function classExists($className)
+ {
+ return self::typeExists($className, true);
+ }
+
+ /**
+ * Gets the ClassLoader from the SPL autoload stack that is responsible
+ * for (and is able to load) the class with the given name.
+ *
+ * @param string $className The name of the class.
+ *
+ * @return ClassLoader The ClassLoader for the class or NULL if no such ClassLoader exists.
+ */
+ public static function getClassLoader($className)
+ {
+ foreach (spl_autoload_functions() as $loader) {
+ if (is_array($loader)
+ && ($classLoader = reset($loader))
+ && $classLoader instanceof ClassLoader
+ && $classLoader->canLoadClass($className)
+ ) {
+ return $classLoader;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Checks whether a given type exists
+ *
+ * @param string $type
+ * @param bool $autoload
+ *
+ * @return bool
+ */
+ private static function typeExists($type, $autoload = false)
+ {
+ return class_exists($type, $autoload)
+ || interface_exists($type, $autoload)
+ || trait_exists($type, $autoload);
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php b/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php
new file mode 100644
index 00000000..2a1a08e7
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php
@@ -0,0 +1,29 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * Base exception class for package Doctrine\Common.
+ *
+ * @author heinrich
+ */
+class CommonException extends \Exception
+{
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php b/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php
new file mode 100644
index 00000000..8cd02c9f
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php
@@ -0,0 +1,46 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * Comparable interface that allows to compare two value objects to each other for similarity.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ */
+interface Comparable
+{
+ /**
+ * Compares the current object to the passed $other.
+ *
+ * Returns 0 if they are semantically equal, 1 if the other object
+ * is less than the current one, or -1 if its more than the current one.
+ *
+ * This method should not check for identity using ===, only for semantical equality for example
+ * when two different DateTime instances point to the exact same Date + TZ.
+ *
+ * @param mixed $other
+ *
+ * @return int
+ */
+ public function compareTo($other);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php
new file mode 100644
index 00000000..75506e6a
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php
@@ -0,0 +1,67 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * EventArgs is the base class for classes containing event data.
+ *
+ * This class contains no event data. It is used by events that do not pass state
+ * information to an event handler when an event is raised. The single empty EventArgs
+ * instance can be obtained through {@link getEmptyInstance}.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+class EventArgs
+{
+ /**
+ * Single instance of EventArgs.
+ *
+ * @var EventArgs
+ */
+ private static $_emptyEventArgsInstance;
+
+ /**
+ * Gets the single, empty and immutable EventArgs instance.
+ *
+ * This instance will be used when events are dispatched without any parameter,
+ * like this: EventManager::dispatchEvent('eventname');
+ *
+ * The benefit from this is that only one empty instance is instantiated and shared
+ * (otherwise there would be instances for every dispatched in the abovementioned form).
+ *
+ * @see EventManager::dispatchEvent
+ *
+ * @link http://msdn.microsoft.com/en-us/library/system.eventargs.aspx
+ *
+ * @return EventArgs
+ */
+ public static function getEmptyInstance()
+ {
+ if ( ! self::$_emptyEventArgsInstance) {
+ self::$_emptyEventArgsInstance = new EventArgs;
+ }
+
+ return self::$_emptyEventArgsInstance;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php b/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php
new file mode 100644
index 00000000..0ee04a15
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php
@@ -0,0 +1,154 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * The EventManager is the central point of Doctrine's event listener system.
+ * Listeners are registered on the manager and events are dispatched through the
+ * manager.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+class EventManager
+{
+ /**
+ * Map of registered listeners.
+ * =>
+ *
+ * @var array
+ */
+ private $_listeners = [];
+
+ /**
+ * Dispatches an event to all registered listeners.
+ *
+ * @param string $eventName The name of the event to dispatch. The name of the event is
+ * the name of the method that is invoked on listeners.
+ * @param EventArgs|null $eventArgs The event arguments to pass to the event handlers/listeners.
+ * If not supplied, the single empty EventArgs instance is used.
+ *
+ * @return boolean
+ */
+ public function dispatchEvent($eventName, EventArgs $eventArgs = null)
+ {
+ if (isset($this->_listeners[$eventName])) {
+ $eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs;
+
+ foreach ($this->_listeners[$eventName] as $listener) {
+ $listener->$eventName($eventArgs);
+ }
+ }
+ }
+
+ /**
+ * Gets the listeners of a specific event or all listeners.
+ *
+ * @param string|null $event The name of the event.
+ *
+ * @return array The event listeners for the specified event, or all event listeners.
+ */
+ public function getListeners($event = null)
+ {
+ return $event ? $this->_listeners[$event] : $this->_listeners;
+ }
+
+ /**
+ * Checks whether an event has any registered listeners.
+ *
+ * @param string $event
+ *
+ * @return boolean TRUE if the specified event has any listeners, FALSE otherwise.
+ */
+ public function hasListeners($event)
+ {
+ return isset($this->_listeners[$event]) && $this->_listeners[$event];
+ }
+
+ /**
+ * Adds an event listener that listens on the specified events.
+ *
+ * @param string|array $events The event(s) to listen on.
+ * @param object $listener The listener object.
+ *
+ * @return void
+ */
+ public function addEventListener($events, $listener)
+ {
+ // Picks the hash code related to that listener
+ $hash = spl_object_hash($listener);
+
+ foreach ((array) $events as $event) {
+ // Overrides listener if a previous one was associated already
+ // Prevents duplicate listeners on same event (same instance only)
+ $this->_listeners[$event][$hash] = $listener;
+ }
+ }
+
+ /**
+ * Removes an event listener from the specified events.
+ *
+ * @param string|array $events
+ * @param object $listener
+ *
+ * @return void
+ */
+ public function removeEventListener($events, $listener)
+ {
+ // Picks the hash code related to that listener
+ $hash = spl_object_hash($listener);
+
+ foreach ((array) $events as $event) {
+ // Check if actually have this listener associated
+ if (isset($this->_listeners[$event][$hash])) {
+ unset($this->_listeners[$event][$hash]);
+ }
+ }
+ }
+
+ /**
+ * Adds an EventSubscriber. The subscriber is asked for all the events it is
+ * interested in and added as a listener for these events.
+ *
+ * @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
+ *
+ * @return void
+ */
+ public function addEventSubscriber(EventSubscriber $subscriber)
+ {
+ $this->addEventListener($subscriber->getSubscribedEvents(), $subscriber);
+ }
+
+ /**
+ * Removes an EventSubscriber. The subscriber is asked for all the events it is
+ * interested in and removed as a listener for these events.
+ *
+ * @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
+ *
+ * @return void
+ */
+ public function removeEventSubscriber(EventSubscriber $subscriber)
+ {
+ $this->removeEventListener($subscriber->getSubscribedEvents(), $subscriber);
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php b/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php
new file mode 100644
index 00000000..55d0f7d0
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php
@@ -0,0 +1,42 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * An EventSubscriber knows himself what events he is interested in.
+ * If an EventSubscriber is added to an EventManager, the manager invokes
+ * {@link getSubscribedEvents} and registers the subscriber as a listener for all
+ * returned events.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+interface EventSubscriber
+{
+ /**
+ * Returns an array of events this subscriber wants to listen to.
+ *
+ * @return array
+ */
+ public function getSubscribedEvents();
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php b/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
new file mode 100644
index 00000000..0aa07f85
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
@@ -0,0 +1,37 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+use Doctrine\Common\Lexer\AbstractLexer;
+
+/**
+ * Base class for writing simple lexers, i.e. for creating small DSLs.
+ *
+ * Lexer moved into its own Component Doctrine\Common\Lexer. This class
+ * only stays for being BC.
+ *
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+abstract class Lexer extends AbstractLexer
+{
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php b/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php
new file mode 100644
index 00000000..e25e9997
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php
@@ -0,0 +1,42 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * Contract for classes that provide the service of notifying listeners of
+ * changes to their properties.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+interface NotifyPropertyChanged
+{
+ /**
+ * Adds a listener that wants to be notified about property changes.
+ *
+ * @param PropertyChangedListener $listener
+ *
+ * @return void
+ */
+ public function addPropertyChangedListener(PropertyChangedListener $listener);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
new file mode 100644
index 00000000..6da54223
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
@@ -0,0 +1,264 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Abstract implementation of the ManagerRegistry contract.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Fabien Potencier
+ * @author Benjamin Eberlei
+ * @author Lukas Kahwe Smith
+ */
+abstract class AbstractManagerRegistry implements ManagerRegistry
+{
+ /**
+ * @var string
+ */
+ private $name;
+
+ /**
+ * @var array
+ */
+ private $connections;
+
+ /**
+ * @var array
+ */
+ private $managers;
+
+ /**
+ * @var string
+ */
+ private $defaultConnection;
+
+ /**
+ * @var string
+ */
+ private $defaultManager;
+
+ /**
+ * @var string
+ */
+ private $proxyInterfaceName;
+
+ /**
+ * Constructor.
+ *
+ * @param string $name
+ * @param array $connections
+ * @param array $managers
+ * @param string $defaultConnection
+ * @param string $defaultManager
+ * @param string $proxyInterfaceName
+ */
+ public function __construct($name, array $connections, array $managers, $defaultConnection, $defaultManager, $proxyInterfaceName)
+ {
+ $this->name = $name;
+ $this->connections = $connections;
+ $this->managers = $managers;
+ $this->defaultConnection = $defaultConnection;
+ $this->defaultManager = $defaultManager;
+ $this->proxyInterfaceName = $proxyInterfaceName;
+ }
+
+ /**
+ * Fetches/creates the given services.
+ *
+ * A service in this context is connection or a manager instance.
+ *
+ * @param string $name The name of the service.
+ *
+ * @return object The instance of the given service.
+ */
+ abstract protected function getService($name);
+
+ /**
+ * Resets the given services.
+ *
+ * A service in this context is connection or a manager instance.
+ *
+ * @param string $name The name of the service.
+ *
+ * @return void
+ */
+ abstract protected function resetService($name);
+
+ /**
+ * Gets the name of the registry.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getConnection($name = null)
+ {
+ if (null === $name) {
+ $name = $this->defaultConnection;
+ }
+
+ if (!isset($this->connections[$name])) {
+ throw new \InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name));
+ }
+
+ return $this->getService($this->connections[$name]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getConnectionNames()
+ {
+ return $this->connections;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getConnections()
+ {
+ $connections = [];
+ foreach ($this->connections as $name => $id) {
+ $connections[$name] = $this->getService($id);
+ }
+
+ return $connections;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getDefaultConnectionName()
+ {
+ return $this->defaultConnection;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getDefaultManagerName()
+ {
+ return $this->defaultManager;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function getManager($name = null)
+ {
+ if (null === $name) {
+ $name = $this->defaultManager;
+ }
+
+ if (!isset($this->managers[$name])) {
+ throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
+ }
+
+ return $this->getService($this->managers[$name]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getManagerForClass($class)
+ {
+ // Check for namespace alias
+ if (strpos($class, ':') !== false) {
+ list($namespaceAlias, $simpleClassName) = explode(':', $class, 2);
+ $class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName;
+ }
+
+ $proxyClass = new \ReflectionClass($class);
+
+ if ($proxyClass->implementsInterface($this->proxyInterfaceName)) {
+ if (! $parentClass = $proxyClass->getParentClass()) {
+ return null;
+ }
+
+ $class = $parentClass->getName();
+ }
+
+ foreach ($this->managers as $id) {
+ $manager = $this->getService($id);
+
+ if (!$manager->getMetadataFactory()->isTransient($class)) {
+ return $manager;
+ }
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getManagerNames()
+ {
+ return $this->managers;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getManagers()
+ {
+ $dms = [];
+ foreach ($this->managers as $name => $id) {
+ $dms[$name] = $this->getService($id);
+ }
+
+ return $dms;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getRepository($persistentObjectName, $persistentManagerName = null)
+ {
+ return $this->getManager($persistentManagerName)->getRepository($persistentObjectName);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function resetManager($name = null)
+ {
+ if (null === $name) {
+ $name = $this->defaultManager;
+ }
+
+ if (!isset($this->managers[$name])) {
+ throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
+ }
+
+ // force the creation of a new document manager
+ // if the current one is closed
+ $this->resetService($this->managers[$name]);
+
+ return $this->getManager($name);
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php
new file mode 100644
index 00000000..7c25e98a
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php
@@ -0,0 +1,62 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Contract covering connection for a Doctrine persistence layer ManagerRegistry class to implement.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Fabien Potencier
+ * @author Benjamin Eberlei
+ * @author Lukas Kahwe Smith
+ */
+interface ConnectionRegistry
+{
+ /**
+ * Gets the default connection name.
+ *
+ * @return string The default connection name.
+ */
+ public function getDefaultConnectionName();
+
+ /**
+ * Gets the named connection.
+ *
+ * @param string $name The connection name (null for the default one).
+ *
+ * @return object
+ */
+ public function getConnection($name = null);
+
+ /**
+ * Gets an array of all registered connections.
+ *
+ * @return array An array of Connection instances.
+ */
+ public function getConnections();
+
+ /**
+ * Gets all connection names.
+ *
+ * @return array An array of connection names.
+ */
+ public function getConnectionNames();
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
new file mode 100644
index 00000000..52f41c0e
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
@@ -0,0 +1,89 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Event;
+
+use Doctrine\Common\EventArgs;
+use Doctrine\Common\Persistence\ObjectManager;
+
+/**
+ * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
+ * of entities.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Roman Borschel
+ * @author Benjamin Eberlei
+ */
+class LifecycleEventArgs extends EventArgs
+{
+ /**
+ * @var ObjectManager
+ */
+ private $objectManager;
+
+ /**
+ * @var object
+ */
+ private $object;
+
+ /**
+ * Constructor.
+ *
+ * @param object $object
+ * @param ObjectManager $objectManager
+ */
+ public function __construct($object, ObjectManager $objectManager)
+ {
+ $this->object = $object;
+ $this->objectManager = $objectManager;
+ }
+
+ /**
+ * Retrieves the associated entity.
+ *
+ * @deprecated
+ *
+ * @return object
+ */
+ public function getEntity()
+ {
+ return $this->object;
+ }
+
+ /**
+ * Retrieves the associated object.
+ *
+ * @return object
+ */
+ public function getObject()
+ {
+ return $this->object;
+ }
+
+ /**
+ * Retrieves the associated ObjectManager.
+ *
+ * @return ObjectManager
+ */
+ public function getObjectManager()
+ {
+ return $this->objectManager;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
new file mode 100644
index 00000000..3d8abbe2
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
@@ -0,0 +1,75 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Event;
+
+use Doctrine\Common\EventArgs;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Persistence\ObjectManager;
+
+/**
+ * Class that holds event arguments for a loadMetadata event.
+ *
+ * @author Jonathan H. Wage
+ * @since 2.2
+ */
+class LoadClassMetadataEventArgs extends EventArgs
+{
+ /**
+ * @var ClassMetadata
+ */
+ private $classMetadata;
+
+ /**
+ * @var ObjectManager
+ */
+ private $objectManager;
+
+ /**
+ * Constructor.
+ *
+ * @param ClassMetadata $classMetadata
+ * @param ObjectManager $objectManager
+ */
+ public function __construct(ClassMetadata $classMetadata, ObjectManager $objectManager)
+ {
+ $this->classMetadata = $classMetadata;
+ $this->objectManager = $objectManager;
+ }
+
+ /**
+ * Retrieves the associated ClassMetadata.
+ *
+ * @return ClassMetadata
+ */
+ public function getClassMetadata()
+ {
+ return $this->classMetadata;
+ }
+
+ /**
+ * Retrieves the associated ObjectManager.
+ *
+ * @return ObjectManager
+ */
+ public function getObjectManager()
+ {
+ return $this->objectManager;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
new file mode 100644
index 00000000..5527d4d4
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
@@ -0,0 +1,59 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Event;
+
+use Doctrine\Common\EventArgs;
+use Doctrine\Common\Persistence\ObjectManager;
+
+/**
+ * Provides event arguments for the preFlush event.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Roman Borschel
+ * @author Benjamin Eberlei
+ */
+class ManagerEventArgs extends EventArgs
+{
+ /**
+ * @var ObjectManager
+ */
+ private $objectManager;
+
+ /**
+ * Constructor.
+ *
+ * @param ObjectManager $objectManager
+ */
+ public function __construct(ObjectManager $objectManager)
+ {
+ $this->objectManager = $objectManager;
+ }
+
+ /**
+ * Retrieves the associated ObjectManager.
+ *
+ * @return ObjectManager
+ */
+ public function getObjectManager()
+ {
+ return $this->objectManager;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
new file mode 100644
index 00000000..b78bad99
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
@@ -0,0 +1,86 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Event;
+
+use Doctrine\Common\EventArgs;
+use Doctrine\Common\Persistence\ObjectManager;
+
+/**
+ * Provides event arguments for the onClear event.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Roman Borschel
+ * @author Benjamin Eberlei
+ */
+class OnClearEventArgs extends EventArgs
+{
+ /**
+ * @var \Doctrine\Common\Persistence\ObjectManager
+ */
+ private $objectManager;
+
+ /**
+ * @var string|null
+ */
+ private $entityClass;
+
+ /**
+ * Constructor.
+ *
+ * @param ObjectManager $objectManager The object manager.
+ * @param string|null $entityClass The optional entity class.
+ */
+ public function __construct($objectManager, $entityClass = null)
+ {
+ $this->objectManager = $objectManager;
+ $this->entityClass = $entityClass;
+ }
+
+ /**
+ * Retrieves the associated ObjectManager.
+ *
+ * @return \Doctrine\Common\Persistence\ObjectManager
+ */
+ public function getObjectManager()
+ {
+ return $this->objectManager;
+ }
+
+ /**
+ * Returns the name of the entity class that is cleared, or null if all are cleared.
+ *
+ * @return string|null
+ */
+ public function getEntityClass()
+ {
+ return $this->entityClass;
+ }
+
+ /**
+ * Returns whether this event clears all entities.
+ *
+ * @return bool
+ */
+ public function clearsAllEntities()
+ {
+ return ($this->entityClass === null);
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
new file mode 100644
index 00000000..facce647
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
@@ -0,0 +1,137 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Event;
+
+use Doctrine\Common\Persistence\ObjectManager;
+
+/**
+ * Class that holds event arguments for a preUpdate event.
+ *
+ * @author Guilherme Blanco
+ * @author Roman Borschel
+ * @author Benjamin Eberlei
+ * @since 2.2
+ */
+class PreUpdateEventArgs extends LifecycleEventArgs
+{
+ /**
+ * @var array
+ */
+ private $entityChangeSet;
+
+ /**
+ * Constructor.
+ *
+ * @param object $entity
+ * @param ObjectManager $objectManager
+ * @param array $changeSet
+ */
+ public function __construct($entity, ObjectManager $objectManager, array &$changeSet)
+ {
+ parent::__construct($entity, $objectManager);
+
+ $this->entityChangeSet = &$changeSet;
+ }
+
+ /**
+ * Retrieves the entity changeset.
+ *
+ * @return array
+ */
+ public function getEntityChangeSet()
+ {
+ return $this->entityChangeSet;
+ }
+
+ /**
+ * Checks if field has a changeset.
+ *
+ * @param string $field
+ *
+ * @return boolean
+ */
+ public function hasChangedField($field)
+ {
+ return isset($this->entityChangeSet[$field]);
+ }
+
+ /**
+ * Gets the old value of the changeset of the changed field.
+ *
+ * @param string $field
+ *
+ * @return mixed
+ */
+ public function getOldValue($field)
+ {
+ $this->assertValidField($field);
+
+ return $this->entityChangeSet[$field][0];
+ }
+
+ /**
+ * Gets the new value of the changeset of the changed field.
+ *
+ * @param string $field
+ *
+ * @return mixed
+ */
+ public function getNewValue($field)
+ {
+ $this->assertValidField($field);
+
+ return $this->entityChangeSet[$field][1];
+ }
+
+ /**
+ * Sets the new value of this field.
+ *
+ * @param string $field
+ * @param mixed $value
+ *
+ * @return void
+ */
+ public function setNewValue($field, $value)
+ {
+ $this->assertValidField($field);
+
+ $this->entityChangeSet[$field][1] = $value;
+ }
+
+ /**
+ * Asserts the field exists in changeset.
+ *
+ * @param string $field
+ *
+ * @return void
+ *
+ * @throws \InvalidArgumentException
+ */
+ private function assertValidField($field)
+ {
+ if ( ! isset($this->entityChangeSet[$field])) {
+ throw new \InvalidArgumentException(sprintf(
+ 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.',
+ $field,
+ get_class($this->getEntity())
+ ));
+ }
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php
new file mode 100644
index 00000000..fce854b6
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php
@@ -0,0 +1,111 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Fabien Potencier
+ * @author Benjamin Eberlei
+ * @author Lukas Kahwe Smith
+ */
+interface ManagerRegistry extends ConnectionRegistry
+{
+ /**
+ * Gets the default object manager name.
+ *
+ * @return string The default object manager name.
+ */
+ public function getDefaultManagerName();
+
+ /**
+ * Gets a named object manager.
+ *
+ * @param string $name The object manager name (null for the default one).
+ *
+ * @return \Doctrine\Common\Persistence\ObjectManager
+ */
+ public function getManager($name = null);
+
+ /**
+ * Gets an array of all registered object managers.
+ *
+ * @return \Doctrine\Common\Persistence\ObjectManager[] An array of ObjectManager instances
+ */
+ public function getManagers();
+
+ /**
+ * Resets a named object manager.
+ *
+ * This method is useful when an object manager has been closed
+ * because of a rollbacked transaction AND when you think that
+ * it makes sense to get a new one to replace the closed one.
+ *
+ * Be warned that you will get a brand new object manager as
+ * the existing one is not useable anymore. This means that any
+ * other object with a dependency on this object manager will
+ * hold an obsolete reference. You can inject the registry instead
+ * to avoid this problem.
+ *
+ * @param string|null $name The object manager name (null for the default one).
+ *
+ * @return \Doctrine\Common\Persistence\ObjectManager
+ */
+ public function resetManager($name = null);
+
+ /**
+ * Resolves a registered namespace alias to the full namespace.
+ *
+ * This method looks for the alias in all registered object managers.
+ *
+ * @param string $alias The alias.
+ *
+ * @return string The full namespace.
+ */
+ public function getAliasNamespace($alias);
+
+ /**
+ * Gets all connection names.
+ *
+ * @return array An array of connection names.
+ */
+ public function getManagerNames();
+
+ /**
+ * Gets the ObjectRepository for an persistent object.
+ *
+ * @param string $persistentObject The name of the persistent object.
+ * @param string $persistentManagerName The object manager name (null for the default one).
+ *
+ * @return \Doctrine\Common\Persistence\ObjectRepository
+ */
+ public function getRepository($persistentObject, $persistentManagerName = null);
+
+ /**
+ * Gets the object manager associated with a given class.
+ *
+ * @param string $class A persistent object class name.
+ *
+ * @return \Doctrine\Common\Persistence\ObjectManager|null
+ */
+ public function getManagerForClass($class);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
new file mode 100644
index 00000000..cba424b0
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
@@ -0,0 +1,429 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+use Doctrine\Common\Cache\Cache;
+use Doctrine\Common\Util\ClassUtils;
+use ReflectionException;
+
+/**
+ * The ClassMetadataFactory is used to create ClassMetadata objects that contain all the
+ * metadata mapping informations of a class which describes how a class should be mapped
+ * to a relational database.
+ *
+ * This class was abstracted from the ORM ClassMetadataFactory.
+ *
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+abstract class AbstractClassMetadataFactory implements ClassMetadataFactory
+{
+ /**
+ * Salt used by specific Object Manager implementation.
+ *
+ * @var string
+ */
+ protected $cacheSalt = '$CLASSMETADATA';
+
+ /**
+ * @var \Doctrine\Common\Cache\Cache|null
+ */
+ private $cacheDriver;
+
+ /**
+ * @var ClassMetadata[]
+ */
+ private $loadedMetadata = [];
+
+ /**
+ * @var bool
+ */
+ protected $initialized = false;
+
+ /**
+ * @var ReflectionService|null
+ */
+ private $reflectionService = null;
+
+ /**
+ * Sets the cache driver used by the factory to cache ClassMetadata instances.
+ *
+ * @param \Doctrine\Common\Cache\Cache $cacheDriver
+ *
+ * @return void
+ */
+ public function setCacheDriver(Cache $cacheDriver = null)
+ {
+ $this->cacheDriver = $cacheDriver;
+ }
+
+ /**
+ * Gets the cache driver used by the factory to cache ClassMetadata instances.
+ *
+ * @return \Doctrine\Common\Cache\Cache|null
+ */
+ public function getCacheDriver()
+ {
+ return $this->cacheDriver;
+ }
+
+ /**
+ * Returns an array of all the loaded metadata currently in memory.
+ *
+ * @return ClassMetadata[]
+ */
+ public function getLoadedMetadata()
+ {
+ return $this->loadedMetadata;
+ }
+
+ /**
+ * Forces the factory to load the metadata of all classes known to the underlying
+ * mapping driver.
+ *
+ * @return array The ClassMetadata instances of all mapped classes.
+ */
+ public function getAllMetadata()
+ {
+ if ( ! $this->initialized) {
+ $this->initialize();
+ }
+
+ $driver = $this->getDriver();
+ $metadata = [];
+ foreach ($driver->getAllClassNames() as $className) {
+ $metadata[] = $this->getMetadataFor($className);
+ }
+
+ return $metadata;
+ }
+
+ /**
+ * Lazy initialization of this stuff, especially the metadata driver,
+ * since these are not needed at all when a metadata cache is active.
+ *
+ * @return void
+ */
+ abstract protected function initialize();
+
+ /**
+ * Gets the fully qualified class-name from the namespace alias.
+ *
+ * @param string $namespaceAlias
+ * @param string $simpleClassName
+ *
+ * @return string
+ */
+ abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName);
+
+ /**
+ * Returns the mapping driver implementation.
+ *
+ * @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
+ */
+ abstract protected function getDriver();
+
+ /**
+ * Wakes up reflection after ClassMetadata gets unserialized from cache.
+ *
+ * @param ClassMetadata $class
+ * @param ReflectionService $reflService
+ *
+ * @return void
+ */
+ abstract protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService);
+
+ /**
+ * Initializes Reflection after ClassMetadata was constructed.
+ *
+ * @param ClassMetadata $class
+ * @param ReflectionService $reflService
+ *
+ * @return void
+ */
+ abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService);
+
+ /**
+ * Checks whether the class metadata is an entity.
+ *
+ * This method should return false for mapped superclasses or embedded classes.
+ *
+ * @param ClassMetadata $class
+ *
+ * @return boolean
+ */
+ abstract protected function isEntity(ClassMetadata $class);
+
+ /**
+ * Gets the class metadata descriptor for a class.
+ *
+ * @param string $className The name of the class.
+ *
+ * @return ClassMetadata
+ *
+ * @throws ReflectionException
+ * @throws MappingException
+ */
+ public function getMetadataFor($className)
+ {
+ if (isset($this->loadedMetadata[$className])) {
+ return $this->loadedMetadata[$className];
+ }
+
+ // Check for namespace alias
+ if (strpos($className, ':') !== false) {
+ list($namespaceAlias, $simpleClassName) = explode(':', $className, 2);
+
+ $realClassName = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName);
+ } else {
+ $realClassName = ClassUtils::getRealClass($className);
+ }
+
+ if (isset($this->loadedMetadata[$realClassName])) {
+ // We do not have the alias name in the map, include it
+ return $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
+ }
+
+ $loadingException = null;
+
+ try {
+ if ($this->cacheDriver) {
+ if (($cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt)) instanceof ClassMetadata) {
+ $this->loadedMetadata[$realClassName] = $cached;
+
+ $this->wakeupReflection($cached, $this->getReflectionService());
+ } else {
+ foreach ($this->loadMetadata($realClassName) as $loadedClassName) {
+ $this->cacheDriver->save(
+ $loadedClassName . $this->cacheSalt,
+ $this->loadedMetadata[$loadedClassName],
+ null
+ );
+ }
+ }
+ } else {
+ $this->loadMetadata($realClassName);
+ }
+ } catch (MappingException $loadingException) {
+ if (! $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName)) {
+ throw $loadingException;
+ }
+
+ $this->loadedMetadata[$realClassName] = $fallbackMetadataResponse;
+ }
+
+ if ($className !== $realClassName) {
+ // We do not have the alias name in the map, include it
+ $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
+ }
+
+ return $this->loadedMetadata[$className];
+ }
+
+ /**
+ * Checks whether the factory has the metadata for a class loaded already.
+ *
+ * @param string $className
+ *
+ * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
+ */
+ public function hasMetadataFor($className)
+ {
+ return isset($this->loadedMetadata[$className]);
+ }
+
+ /**
+ * Sets the metadata descriptor for a specific class.
+ *
+ * NOTE: This is only useful in very special cases, like when generating proxy classes.
+ *
+ * @param string $className
+ * @param ClassMetadata $class
+ *
+ * @return void
+ */
+ public function setMetadataFor($className, $class)
+ {
+ $this->loadedMetadata[$className] = $class;
+ }
+
+ /**
+ * Gets an array of parent classes for the given entity class.
+ *
+ * @param string $name
+ *
+ * @return array
+ */
+ protected function getParentClasses($name)
+ {
+ // Collect parent classes, ignoring transient (not-mapped) classes.
+ $parentClasses = [];
+ foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) {
+ if ( ! $this->getDriver()->isTransient($parentClass)) {
+ $parentClasses[] = $parentClass;
+ }
+ }
+ return $parentClasses;
+ }
+
+ /**
+ * Loads the metadata of the class in question and all it's ancestors whose metadata
+ * is still not loaded.
+ *
+ * Important: The class $name does not necesarily exist at this point here.
+ * Scenarios in a code-generation setup might have access to XML/YAML
+ * Mapping files without the actual PHP code existing here. That is why the
+ * {@see Doctrine\Common\Persistence\Mapping\ReflectionService} interface
+ * should be used for reflection.
+ *
+ * @param string $name The name of the class for which the metadata should get loaded.
+ *
+ * @return array
+ */
+ protected function loadMetadata($name)
+ {
+ if ( ! $this->initialized) {
+ $this->initialize();
+ }
+
+ $loaded = [];
+
+ $parentClasses = $this->getParentClasses($name);
+ $parentClasses[] = $name;
+
+ // Move down the hierarchy of parent classes, starting from the topmost class
+ $parent = null;
+ $rootEntityFound = false;
+ $visited = [];
+ $reflService = $this->getReflectionService();
+ foreach ($parentClasses as $className) {
+ if (isset($this->loadedMetadata[$className])) {
+ $parent = $this->loadedMetadata[$className];
+ if ($this->isEntity($parent)) {
+ $rootEntityFound = true;
+ array_unshift($visited, $className);
+ }
+ continue;
+ }
+
+ $class = $this->newClassMetadataInstance($className);
+ $this->initializeReflection($class, $reflService);
+
+ $this->doLoadMetadata($class, $parent, $rootEntityFound, $visited);
+
+ $this->loadedMetadata[$className] = $class;
+
+ $parent = $class;
+
+ if ($this->isEntity($class)) {
+ $rootEntityFound = true;
+ array_unshift($visited, $className);
+ }
+
+ $this->wakeupReflection($class, $reflService);
+
+ $loaded[] = $className;
+ }
+
+ return $loaded;
+ }
+
+ /**
+ * Provides a fallback hook for loading metadata when loading failed due to reflection/mapping exceptions
+ *
+ * Override this method to implement a fallback strategy for failed metadata loading
+ *
+ * @param string $className
+ *
+ * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata|null
+ */
+ protected function onNotFoundMetadata($className)
+ {
+ return null;
+ }
+
+ /**
+ * Actually loads the metadata from the underlying metadata.
+ *
+ * @param ClassMetadata $class
+ * @param ClassMetadata|null $parent
+ * @param bool $rootEntityFound
+ * @param array $nonSuperclassParents All parent class names
+ * that are not marked as mapped superclasses.
+ *
+ * @return void
+ */
+ abstract protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents);
+
+ /**
+ * Creates a new ClassMetadata instance for the given class name.
+ *
+ * @param string $className
+ *
+ * @return ClassMetadata
+ */
+ abstract protected function newClassMetadataInstance($className);
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isTransient($class)
+ {
+ if ( ! $this->initialized) {
+ $this->initialize();
+ }
+
+ // Check for namespace alias
+ if (strpos($class, ':') !== false) {
+ list($namespaceAlias, $simpleClassName) = explode(':', $class, 2);
+ $class = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName);
+ }
+
+ return $this->getDriver()->isTransient($class);
+ }
+
+ /**
+ * Sets the reflectionService.
+ *
+ * @param ReflectionService $reflectionService
+ *
+ * @return void
+ */
+ public function setReflectionService(ReflectionService $reflectionService)
+ {
+ $this->reflectionService = $reflectionService;
+ }
+
+ /**
+ * Gets the reflection service associated with this metadata factory.
+ *
+ * @return ReflectionService
+ */
+ public function getReflectionService()
+ {
+ if ($this->reflectionService === null) {
+ $this->reflectionService = new RuntimeReflectionService();
+ }
+ return $this->reflectionService;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
new file mode 100644
index 00000000..b8445f1b
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
@@ -0,0 +1,174 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+/**
+ * Contract for a Doctrine persistence layer ClassMetadata class to implement.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.1
+ * @author Benjamin Eberlei
+ * @author Jonathan Wage
+ */
+interface ClassMetadata
+{
+ /**
+ * Gets the fully-qualified class name of this persistent class.
+ *
+ * @return string
+ */
+ public function getName();
+
+ /**
+ * Gets the mapped identifier field name.
+ *
+ * The returned structure is an array of the identifier field names.
+ *
+ * @return array
+ */
+ public function getIdentifier();
+
+ /**
+ * Gets the ReflectionClass instance for this mapped class.
+ *
+ * @return \ReflectionClass
+ */
+ public function getReflectionClass();
+
+ /**
+ * Checks if the given field name is a mapped identifier for this class.
+ *
+ * @param string $fieldName
+ *
+ * @return boolean
+ */
+ public function isIdentifier($fieldName);
+
+ /**
+ * Checks if the given field is a mapped property for this class.
+ *
+ * @param string $fieldName
+ *
+ * @return boolean
+ */
+ public function hasField($fieldName);
+
+ /**
+ * Checks if the given field is a mapped association for this class.
+ *
+ * @param string $fieldName
+ *
+ * @return boolean
+ */
+ public function hasAssociation($fieldName);
+
+ /**
+ * Checks if the given field is a mapped single valued association for this class.
+ *
+ * @param string $fieldName
+ *
+ * @return boolean
+ */
+ public function isSingleValuedAssociation($fieldName);
+
+ /**
+ * Checks if the given field is a mapped collection valued association for this class.
+ *
+ * @param string $fieldName
+ *
+ * @return boolean
+ */
+ public function isCollectionValuedAssociation($fieldName);
+
+ /**
+ * A numerically indexed list of field names of this persistent class.
+ *
+ * This array includes identifier fields if present on this class.
+ *
+ * @return array
+ */
+ public function getFieldNames();
+
+ /**
+ * Returns an array of identifier field names numerically indexed.
+ *
+ * @return array
+ */
+ public function getIdentifierFieldNames();
+
+ /**
+ * Returns a numerically indexed list of association names of this persistent class.
+ *
+ * This array includes identifier associations if present on this class.
+ *
+ * @return array
+ */
+ public function getAssociationNames();
+
+ /**
+ * Returns a type name of this field.
+ *
+ * This type names can be implementation specific but should at least include the php types:
+ * integer, string, boolean, float/double, datetime.
+ *
+ * @param string $fieldName
+ *
+ * @return string
+ */
+ public function getTypeOfField($fieldName);
+
+ /**
+ * Returns the target class name of the given association.
+ *
+ * @param string $assocName
+ *
+ * @return string
+ */
+ public function getAssociationTargetClass($assocName);
+
+ /**
+ * Checks if the association is the inverse side of a bidirectional association.
+ *
+ * @param string $assocName
+ *
+ * @return boolean
+ */
+ public function isAssociationInverseSide($assocName);
+
+ /**
+ * Returns the target field of the owning side of the association.
+ *
+ * @param string $assocName
+ *
+ * @return string
+ */
+ public function getAssociationMappedByTargetField($assocName);
+
+ /**
+ * Returns the identifier of this object as an array with field name as key.
+ *
+ * Has to return an empty array if no identifier isset.
+ *
+ * @param object $object
+ *
+ * @return array
+ */
+ public function getIdentifierValues($object);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
new file mode 100644
index 00000000..3d828811
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
@@ -0,0 +1,76 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+/**
+ * Contract for a Doctrine persistence layer ClassMetadata class to implement.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.1
+ * @author Benjamin Eberlei
+ * @author Jonathan Wage
+ */
+interface ClassMetadataFactory
+{
+ /**
+ * Forces the factory to load the metadata of all classes known to the underlying
+ * mapping driver.
+ *
+ * @return array The ClassMetadata instances of all mapped classes.
+ */
+ public function getAllMetadata();
+
+ /**
+ * Gets the class metadata descriptor for a class.
+ *
+ * @param string $className The name of the class.
+ *
+ * @return ClassMetadata
+ */
+ public function getMetadataFor($className);
+
+ /**
+ * Checks whether the factory has the metadata for a class loaded already.
+ *
+ * @param string $className
+ *
+ * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
+ */
+ public function hasMetadataFor($className);
+
+ /**
+ * Sets the metadata descriptor for a specific class.
+ *
+ * @param string $className
+ *
+ * @param ClassMetadata $class
+ */
+ public function setMetadataFor($className, $class);
+
+ /**
+ * Returns whether the class with the specified name should have its metadata loaded.
+ * This is only the case if it is either mapped directly or as a MappedSuperclass.
+ *
+ * @param string $className
+ *
+ * @return boolean
+ */
+ public function isTransient($className);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
new file mode 100644
index 00000000..deb82c0c
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
@@ -0,0 +1,256 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * The AnnotationDriver reads the mapping metadata from docblock annotations.
+ *
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan H. Wage
+ * @author Roman Borschel
+ */
+abstract class AnnotationDriver implements MappingDriver
+{
+ /**
+ * The AnnotationReader.
+ *
+ * @var AnnotationReader
+ */
+ protected $reader;
+
+ /**
+ * The paths where to look for mapping files.
+ *
+ * @var array
+ */
+ protected $paths = [];
+
+ /**
+ * The paths excluded from path where to look for mapping files.
+ *
+ * @var array
+ */
+ protected $excludePaths = [];
+
+ /**
+ * The file extension of mapping documents.
+ *
+ * @var string
+ */
+ protected $fileExtension = '.php';
+
+ /**
+ * Cache for AnnotationDriver#getAllClassNames().
+ *
+ * @var array|null
+ */
+ protected $classNames;
+
+ /**
+ * Name of the entity annotations as keys.
+ *
+ * @var array
+ */
+ protected $entityAnnotationClasses = [];
+
+ /**
+ * Initializes a new AnnotationDriver that uses the given AnnotationReader for reading
+ * docblock annotations.
+ *
+ * @param AnnotationReader $reader The AnnotationReader to use, duck-typed.
+ * @param string|array|null $paths One or multiple paths where mapping classes can be found.
+ */
+ public function __construct($reader, $paths = null)
+ {
+ $this->reader = $reader;
+ if ($paths) {
+ $this->addPaths((array) $paths);
+ }
+ }
+
+ /**
+ * Appends lookup paths to metadata driver.
+ *
+ * @param array $paths
+ *
+ * @return void
+ */
+ public function addPaths(array $paths)
+ {
+ $this->paths = array_unique(array_merge($this->paths, $paths));
+ }
+
+ /**
+ * Retrieves the defined metadata lookup paths.
+ *
+ * @return array
+ */
+ public function getPaths()
+ {
+ return $this->paths;
+ }
+
+ /**
+ * Append exclude lookup paths to metadata driver.
+ *
+ * @param array $paths
+ */
+ public function addExcludePaths(array $paths)
+ {
+ $this->excludePaths = array_unique(array_merge($this->excludePaths, $paths));
+ }
+
+ /**
+ * Retrieve the defined metadata lookup exclude paths.
+ *
+ * @return array
+ */
+ public function getExcludePaths()
+ {
+ return $this->excludePaths;
+ }
+
+ /**
+ * Retrieve the current annotation reader
+ *
+ * @return AnnotationReader
+ */
+ public function getReader()
+ {
+ return $this->reader;
+ }
+
+ /**
+ * Gets the file extension used to look for mapping files under.
+ *
+ * @return string
+ */
+ public function getFileExtension()
+ {
+ return $this->fileExtension;
+ }
+
+ /**
+ * Sets the file extension used to look for mapping files under.
+ *
+ * @param string $fileExtension The file extension to set.
+ *
+ * @return void
+ */
+ public function setFileExtension($fileExtension)
+ {
+ $this->fileExtension = $fileExtension;
+ }
+
+ /**
+ * Returns whether the class with the specified name is transient. Only non-transient
+ * classes, that is entities and mapped superclasses, should have their metadata loaded.
+ *
+ * A class is non-transient if it is annotated with an annotation
+ * from the {@see AnnotationDriver::entityAnnotationClasses}.
+ *
+ * @param string $className
+ *
+ * @return boolean
+ */
+ public function isTransient($className)
+ {
+ $classAnnotations = $this->reader->getClassAnnotations(new \ReflectionClass($className));
+
+ foreach ($classAnnotations as $annot) {
+ if (isset($this->entityAnnotationClasses[get_class($annot)])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAllClassNames()
+ {
+ if ($this->classNames !== null) {
+ return $this->classNames;
+ }
+
+ if (!$this->paths) {
+ throw MappingException::pathRequired();
+ }
+
+ $classes = [];
+ $includedFiles = [];
+
+ foreach ($this->paths as $path) {
+ if ( ! is_dir($path)) {
+ throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
+ }
+
+ $iterator = new \RegexIterator(
+ new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ ),
+ '/^.+' . preg_quote($this->fileExtension) . '$/i',
+ \RecursiveRegexIterator::GET_MATCH
+ );
+
+ foreach ($iterator as $file) {
+ $sourceFile = $file[0];
+
+ if ( ! preg_match('(^phar:)i', $sourceFile)) {
+ $sourceFile = realpath($sourceFile);
+ }
+
+ foreach ($this->excludePaths as $excludePath) {
+ $exclude = str_replace('\\', '/', realpath($excludePath));
+ $current = str_replace('\\', '/', $sourceFile);
+
+ if (strpos($current, $exclude) !== false) {
+ continue 2;
+ }
+ }
+
+ require_once $sourceFile;
+
+ $includedFiles[] = $sourceFile;
+ }
+ }
+
+ $declared = get_declared_classes();
+
+ foreach ($declared as $className) {
+ $rc = new \ReflectionClass($className);
+ $sourceFile = $rc->getFileName();
+ if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) {
+ $classes[] = $className;
+ }
+ }
+
+ $this->classNames = $classes;
+
+ return $classes;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
new file mode 100644
index 00000000..6ed7f6d0
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
@@ -0,0 +1,173 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * Locates the file that contains the metadata information for a given class name.
+ *
+ * This behavior is independent of the actual content of the file. It just detects
+ * the file which is responsible for the given class name.
+ *
+ * @author Benjamin Eberlei
+ * @author Johannes M. Schmitt
+ */
+class DefaultFileLocator implements FileLocator
+{
+ /**
+ * The paths where to look for mapping files.
+ *
+ * @var array
+ */
+ protected $paths = [];
+
+ /**
+ * The file extension of mapping documents.
+ *
+ * @var string|null
+ */
+ protected $fileExtension;
+
+ /**
+ * Initializes a new FileDriver that looks in the given path(s) for mapping
+ * documents and operates in the specified operating mode.
+ *
+ * @param string|array $paths One or multiple paths where mapping documents can be found.
+ * @param string|null $fileExtension The file extension of mapping documents, usually prefixed with a dot.
+ */
+ public function __construct($paths, $fileExtension = null)
+ {
+ $this->addPaths((array) $paths);
+ $this->fileExtension = $fileExtension;
+ }
+
+ /**
+ * Appends lookup paths to metadata driver.
+ *
+ * @param array $paths
+ *
+ * @return void
+ */
+ public function addPaths(array $paths)
+ {
+ $this->paths = array_unique(array_merge($this->paths, $paths));
+ }
+
+ /**
+ * Retrieves the defined metadata lookup paths.
+ *
+ * @return array
+ */
+ public function getPaths()
+ {
+ return $this->paths;
+ }
+
+ /**
+ * Gets the file extension used to look for mapping files under.
+ *
+ * @return string|null
+ */
+ public function getFileExtension()
+ {
+ return $this->fileExtension;
+ }
+
+ /**
+ * Sets the file extension used to look for mapping files under.
+ *
+ * @param string|null $fileExtension The file extension to set.
+ *
+ * @return void
+ */
+ public function setFileExtension($fileExtension)
+ {
+ $this->fileExtension = $fileExtension;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function findMappingFile($className)
+ {
+ $fileName = str_replace('\\', '.', $className) . $this->fileExtension;
+
+ // Check whether file exists
+ foreach ($this->paths as $path) {
+ if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) {
+ return $path . DIRECTORY_SEPARATOR . $fileName;
+ }
+ }
+
+ throw MappingException::mappingFileNotFound($className, $fileName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAllClassNames($globalBasename)
+ {
+ $classes = [];
+
+ if ($this->paths) {
+ foreach ($this->paths as $path) {
+ if ( ! is_dir($path)) {
+ throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
+ }
+
+ $iterator = new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($path),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ );
+
+ foreach ($iterator as $file) {
+ $fileName = $file->getBasename($this->fileExtension);
+
+ if ($fileName == $file->getBasename() || $fileName == $globalBasename) {
+ continue;
+ }
+
+ // NOTE: All files found here means classes are not transient!
+ $classes[] = str_replace('.', '\\', $fileName);
+ }
+ }
+ }
+
+ return $classes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function fileExists($className)
+ {
+ $fileName = str_replace('\\', '.', $className) . $this->fileExtension;
+
+ // Check whether file exists
+ foreach ((array) $this->paths as $path) {
+ if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
new file mode 100644
index 00000000..dc799d5c
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
@@ -0,0 +1,214 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * Base driver for file-based metadata drivers.
+ *
+ * A file driver operates in a mode where it loads the mapping files of individual
+ * classes on demand. This requires the user to adhere to the convention of 1 mapping
+ * file per class and the file names of the mapping files must correspond to the full
+ * class name, including namespace, with the namespace delimiters '\', replaced by dots '.'.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan H. Wage
+ * @author Roman Borschel
+ */
+abstract class FileDriver implements MappingDriver
+{
+ /**
+ * @var FileLocator
+ */
+ protected $locator;
+
+ /**
+ * @var array|null
+ */
+ protected $classCache;
+
+ /**
+ * @var string|null
+ */
+ protected $globalBasename;
+
+ /**
+ * Initializes a new FileDriver that looks in the given path(s) for mapping
+ * documents and operates in the specified operating mode.
+ *
+ * @param string|array|FileLocator $locator A FileLocator or one/multiple paths
+ * where mapping documents can be found.
+ * @param string|null $fileExtension
+ */
+ public function __construct($locator, $fileExtension = null)
+ {
+ if ($locator instanceof FileLocator) {
+ $this->locator = $locator;
+ } else {
+ $this->locator = new DefaultFileLocator((array)$locator, $fileExtension);
+ }
+ }
+
+ /**
+ * Sets the global basename.
+ *
+ * @param string $file
+ *
+ * @return void
+ */
+ public function setGlobalBasename($file)
+ {
+ $this->globalBasename = $file;
+ }
+
+ /**
+ * Retrieves the global basename.
+ *
+ * @return string|null
+ */
+ public function getGlobalBasename()
+ {
+ return $this->globalBasename;
+ }
+
+ /**
+ * Gets the element of schema meta data for the class from the mapping file.
+ * This will lazily load the mapping file if it is not loaded yet.
+ *
+ * @param string $className
+ *
+ * @return array The element of schema meta data.
+ *
+ * @throws MappingException
+ */
+ public function getElement($className)
+ {
+ if ($this->classCache === null) {
+ $this->initialize();
+ }
+
+ if (isset($this->classCache[$className])) {
+ return $this->classCache[$className];
+ }
+
+ $result = $this->loadMappingFile($this->locator->findMappingFile($className));
+ if (!isset($result[$className])) {
+ throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension());
+ }
+
+ return $result[$className];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isTransient($className)
+ {
+ if ($this->classCache === null) {
+ $this->initialize();
+ }
+
+ if (isset($this->classCache[$className])) {
+ return false;
+ }
+
+ return !$this->locator->fileExists($className);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAllClassNames()
+ {
+ if ($this->classCache === null) {
+ $this->initialize();
+ }
+
+ if (! $this->classCache) {
+ return (array) $this->locator->getAllClassNames($this->globalBasename);
+ }
+
+ return array_merge(
+ array_keys($this->classCache),
+ (array) $this->locator->getAllClassNames($this->globalBasename)
+ );
+ }
+
+ /**
+ * Loads a mapping file with the given name and returns a map
+ * from class/entity names to their corresponding file driver elements.
+ *
+ * @param string $file The mapping file to load.
+ *
+ * @return array
+ */
+ abstract protected function loadMappingFile($file);
+
+ /**
+ * Initializes the class cache from all the global files.
+ *
+ * Using this feature adds a substantial performance hit to file drivers as
+ * more metadata has to be loaded into memory than might actually be
+ * necessary. This may not be relevant to scenarios where caching of
+ * metadata is in place, however hits very hard in scenarios where no
+ * caching is used.
+ *
+ * @return void
+ */
+ protected function initialize()
+ {
+ $this->classCache = [];
+ if (null !== $this->globalBasename) {
+ foreach ($this->locator->getPaths() as $path) {
+ $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension();
+ if (is_file($file)) {
+ $this->classCache = array_merge(
+ $this->classCache,
+ $this->loadMappingFile($file)
+ );
+ }
+ }
+ }
+ }
+
+ /**
+ * Retrieves the locator used to discover mapping files by className.
+ *
+ * @return FileLocator
+ */
+ public function getLocator()
+ {
+ return $this->locator;
+ }
+
+ /**
+ * Sets the locator used to discover mapping files by className.
+ *
+ * @param FileLocator $locator
+ */
+ public function setLocator(FileLocator $locator)
+ {
+ $this->locator = $locator;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
new file mode 100644
index 00000000..f622856d
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
@@ -0,0 +1,73 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+/**
+ * Locates the file that contains the metadata information for a given class name.
+ *
+ * This behavior is independent of the actual content of the file. It just detects
+ * the file which is responsible for the given class name.
+ *
+ * @author Benjamin Eberlei
+ * @author Johannes M. Schmitt
+ */
+interface FileLocator
+{
+ /**
+ * Locates mapping file for the given class name.
+ *
+ * @param string $className
+ *
+ * @return string
+ */
+ public function findMappingFile($className);
+
+ /**
+ * Gets all class names that are found with this file locator.
+ *
+ * @param string $globalBasename Passed to allow excluding the basename.
+ *
+ * @return array
+ */
+ public function getAllClassNames($globalBasename);
+
+ /**
+ * Checks if a file can be found for this class name.
+ *
+ * @param string $className
+ *
+ * @return bool
+ */
+ public function fileExists($className);
+
+ /**
+ * Gets all the paths that this file locator looks for mapping files.
+ *
+ * @return array
+ */
+ public function getPaths();
+
+ /**
+ * Gets the file extension that mapping files are suffixed with.
+ *
+ * @return string
+ */
+ public function getFileExtension();
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
new file mode 100644
index 00000000..b5d7ec03
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
@@ -0,0 +1,58 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+
+/**
+ * Contract for metadata drivers.
+ *
+ * @since 2.2
+ * @author Jonathan H. Wage
+ */
+interface MappingDriver
+{
+ /**
+ * Loads the metadata for the specified class into the provided container.
+ *
+ * @param string $className
+ * @param ClassMetadata $metadata
+ *
+ * @return void
+ */
+ public function loadMetadataForClass($className, ClassMetadata $metadata);
+
+ /**
+ * Gets the names of all mapped classes known to this driver.
+ *
+ * @return array The names of all mapped classes known to this driver.
+ */
+ public function getAllClassNames();
+
+ /**
+ * Returns whether the class with the specified name should have its metadata loaded.
+ * This is only the case if it is either mapped as an Entity or a MappedSuperclass.
+ *
+ * @param string $className
+ *
+ * @return boolean
+ */
+ public function isTransient($className);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
new file mode 100644
index 00000000..50d9785b
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
@@ -0,0 +1,165 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * The DriverChain allows you to add multiple other mapping drivers for
+ * certain namespaces.
+ *
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan H. Wage
+ * @author Roman Borschel
+ */
+class MappingDriverChain implements MappingDriver
+{
+ /**
+ * The default driver.
+ *
+ * @var MappingDriver|null
+ */
+ private $defaultDriver;
+
+ /**
+ * @var array
+ */
+ private $drivers = [];
+
+ /**
+ * Gets the default driver.
+ *
+ * @return MappingDriver|null
+ */
+ public function getDefaultDriver()
+ {
+ return $this->defaultDriver;
+ }
+
+ /**
+ * Set the default driver.
+ *
+ * @param MappingDriver $driver
+ *
+ * @return void
+ */
+ public function setDefaultDriver(MappingDriver $driver)
+ {
+ $this->defaultDriver = $driver;
+ }
+
+ /**
+ * Adds a nested driver.
+ *
+ * @param MappingDriver $nestedDriver
+ * @param string $namespace
+ *
+ * @return void
+ */
+ public function addDriver(MappingDriver $nestedDriver, $namespace)
+ {
+ $this->drivers[$namespace] = $nestedDriver;
+ }
+
+ /**
+ * Gets the array of nested drivers.
+ *
+ * @return array $drivers
+ */
+ public function getDrivers()
+ {
+ return $this->drivers;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function loadMetadataForClass($className, ClassMetadata $metadata)
+ {
+ /* @var $driver MappingDriver */
+ foreach ($this->drivers as $namespace => $driver) {
+ if (strpos($className, $namespace) === 0) {
+ $driver->loadMetadataForClass($className, $metadata);
+ return;
+ }
+ }
+
+ if (null !== $this->defaultDriver) {
+ $this->defaultDriver->loadMetadataForClass($className, $metadata);
+ return;
+ }
+
+ throw MappingException::classNotFoundInNamespaces($className, array_keys($this->drivers));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAllClassNames()
+ {
+ $classNames = [];
+ $driverClasses = [];
+
+ /* @var $driver MappingDriver */
+ foreach ($this->drivers AS $namespace => $driver) {
+ $oid = spl_object_hash($driver);
+
+ if (!isset($driverClasses[$oid])) {
+ $driverClasses[$oid] = $driver->getAllClassNames();
+ }
+
+ foreach ($driverClasses[$oid] AS $className) {
+ if (strpos($className, $namespace) === 0) {
+ $classNames[$className] = true;
+ }
+ }
+ }
+
+ if (null !== $this->defaultDriver) {
+ foreach ($this->defaultDriver->getAllClassNames() as $className) {
+ $classNames[$className] = true;
+ }
+ }
+
+ return array_keys($classNames);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isTransient($className)
+ {
+ /* @var $driver MappingDriver */
+ foreach ($this->drivers AS $namespace => $driver) {
+ if (strpos($className, $namespace) === 0) {
+ return $driver->isTransient($className);
+ }
+ }
+
+ if ($this->defaultDriver !== null) {
+ return $this->defaultDriver->isTransient($className);
+ }
+
+ return true;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php
new file mode 100644
index 00000000..efffa6aa
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php
@@ -0,0 +1,70 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+
+/**
+ * The PHPDriver includes php files which just populate ClassMetadataInfo
+ * instances with plain PHP code.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan H. Wage
+ * @author Roman Borschel
+ */
+class PHPDriver extends FileDriver
+{
+ /**
+ * @var ClassMetadata
+ */
+ protected $metadata;
+
+ /**
+ * {@inheritDoc}
+ */
+ public function __construct($locator, $fileExtension = null)
+ {
+ parent::__construct($locator, '.php');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function loadMetadataForClass($className, ClassMetadata $metadata)
+ {
+ $this->metadata = $metadata;
+
+ $this->loadMappingFile($this->locator->findMappingFile($className));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function loadMappingFile($file)
+ {
+ $metadata = $this->metadata;
+ include $file;
+
+ return [$metadata->getName() => $metadata];
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php
new file mode 100644
index 00000000..8e37e5a7
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php
@@ -0,0 +1,142 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * The StaticPHPDriver calls a static loadMetadata() method on your entity
+ * classes where you can manually populate the ClassMetadata instance.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.2
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan H. Wage
+ * @author Roman Borschel
+ */
+class StaticPHPDriver implements MappingDriver
+{
+ /**
+ * Paths of entity directories.
+ *
+ * @var array
+ */
+ private $paths = [];
+
+ /**
+ * Map of all class names.
+ *
+ * @var array
+ */
+ private $classNames;
+
+ /**
+ * Constructor.
+ *
+ * @param array|string $paths
+ */
+ public function __construct($paths)
+ {
+ $this->addPaths((array) $paths);
+ }
+
+ /**
+ * Adds paths.
+ *
+ * @param array $paths
+ *
+ * @return void
+ */
+ public function addPaths(array $paths)
+ {
+ $this->paths = array_unique(array_merge($this->paths, $paths));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function loadMetadataForClass($className, ClassMetadata $metadata)
+ {
+ $className::loadMetadata($metadata);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @todo Same code exists in AnnotationDriver, should we re-use it somehow or not worry about it?
+ */
+ public function getAllClassNames()
+ {
+ if ($this->classNames !== null) {
+ return $this->classNames;
+ }
+
+ if (!$this->paths) {
+ throw MappingException::pathRequired();
+ }
+
+ $classes = [];
+ $includedFiles = [];
+
+ foreach ($this->paths as $path) {
+ if (!is_dir($path)) {
+ throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
+ }
+
+ $iterator = new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($path),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ );
+
+ foreach ($iterator as $file) {
+ if ($file->getBasename('.php') == $file->getBasename()) {
+ continue;
+ }
+
+ $sourceFile = realpath($file->getPathName());
+ require_once $sourceFile;
+ $includedFiles[] = $sourceFile;
+ }
+ }
+
+ $declared = get_declared_classes();
+
+ foreach ($declared as $className) {
+ $rc = new \ReflectionClass($className);
+ $sourceFile = $rc->getFileName();
+ if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) {
+ $classes[] = $className;
+ }
+ }
+
+ $this->classNames = $classes;
+
+ return $classes;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isTransient($className)
+ {
+ return ! method_exists($className, 'loadMetadata');
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php
new file mode 100644
index 00000000..4588cfec
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php
@@ -0,0 +1,239 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * The Symfony File Locator makes a simplifying assumptions compared
+ * to the DefaultFileLocator. By assuming paths only contain entities of a certain
+ * namespace the mapping files consists of the short classname only.
+ *
+ * @author Fabien Potencier
+ * @author Benjamin Eberlei
+ * @license MIT
+ */
+class SymfonyFileLocator implements FileLocator
+{
+ /**
+ * The paths where to look for mapping files.
+ *
+ * @var array
+ */
+ protected $paths = [];
+
+ /**
+ * A map of mapping directory path to namespace prefix used to expand class shortnames.
+ *
+ * @var array
+ */
+ protected $prefixes = [];
+
+ /**
+ * File extension that is searched for.
+ *
+ * @var string|null
+ */
+ protected $fileExtension;
+
+ /**
+ * Represents PHP namespace delimiters when looking for files
+ *
+ * @var string
+ */
+ private $nsSeparator;
+
+ /**
+ * Constructor.
+ *
+ * @param array $prefixes
+ * @param string|null $fileExtension
+ * @param string $nsSeparator String which would be used when converting FQCN to filename and vice versa. Should not be empty
+ */
+ public function __construct(array $prefixes, $fileExtension = null, $nsSeparator = '.')
+ {
+ $this->addNamespacePrefixes($prefixes);
+ $this->fileExtension = $fileExtension;
+
+ if (empty($nsSeparator)) {
+ throw new \InvalidArgumentException('Namespace separator should not be empty');
+ }
+
+ $this->nsSeparator = (string) $nsSeparator;
+ }
+
+ /**
+ * Adds Namespace Prefixes.
+ *
+ * @param array $prefixes
+ *
+ * @return void
+ */
+ public function addNamespacePrefixes(array $prefixes)
+ {
+ $this->prefixes = array_merge($this->prefixes, $prefixes);
+ $this->paths = array_merge($this->paths, array_keys($prefixes));
+ }
+
+ /**
+ * Gets Namespace Prefixes.
+ *
+ * @return array
+ */
+ public function getNamespacePrefixes()
+ {
+ return $this->prefixes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPaths()
+ {
+ return $this->paths;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getFileExtension()
+ {
+ return $this->fileExtension;
+ }
+
+ /**
+ * Sets the file extension used to look for mapping files under.
+ *
+ * @param string $fileExtension The file extension to set.
+ *
+ * @return void
+ */
+ public function setFileExtension($fileExtension)
+ {
+ $this->fileExtension = $fileExtension;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function fileExists($className)
+ {
+ $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension;
+ foreach ($this->paths as $path) {
+ if (!isset($this->prefixes[$path])) {
+ // global namespace class
+ if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) {
+ return true;
+ }
+
+ continue;
+ }
+
+ $prefix = $this->prefixes[$path];
+
+ if (0 !== strpos($className, $prefix.'\\')) {
+ continue;
+ }
+
+ $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', $this->nsSeparator).$this->fileExtension;
+ if (is_file($filename)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAllClassNames($globalBasename = null)
+ {
+ $classes = [];
+
+ if ($this->paths) {
+ foreach ((array) $this->paths as $path) {
+ if (!is_dir($path)) {
+ throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
+ }
+
+ $iterator = new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($path),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ );
+
+ foreach ($iterator as $file) {
+ $fileName = $file->getBasename($this->fileExtension);
+
+ if ($fileName == $file->getBasename() || $fileName == $globalBasename) {
+ continue;
+ }
+
+ // NOTE: All files found here means classes are not transient!
+ if (isset($this->prefixes[$path])) {
+
+ // Calculate namespace suffix for given prefix as a relative path from basepath to file path
+ $nsSuffix = strtr(
+ substr(realpath($file->getPath()), strlen(realpath($path))),
+ $this->nsSeparator,
+ '\\'
+ );
+
+ $classes[] = $this->prefixes[$path] . str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix) . '\\' .str_replace($this->nsSeparator, '\\', $fileName);
+ } else {
+ $classes[] = str_replace($this->nsSeparator, '\\', $fileName);
+ }
+ }
+ }
+ }
+
+ return $classes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function findMappingFile($className)
+ {
+ $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension;
+ foreach ($this->paths as $path) {
+ if (!isset($this->prefixes[$path])) {
+ if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) {
+ return $path.DIRECTORY_SEPARATOR.$defaultFileName;
+ }
+
+ continue;
+ }
+
+ $prefix = $this->prefixes[$path];
+
+ if (0 !== strpos($className, $prefix.'\\')) {
+ continue;
+ }
+
+ $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', $this->nsSeparator ).$this->fileExtension;
+ if (is_file($filename)) {
+ return $filename;
+ }
+ }
+
+ throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension);
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php
new file mode 100644
index 00000000..6e97485e
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php
@@ -0,0 +1,98 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+/**
+ * A MappingException indicates that something is wrong with the mapping setup.
+ *
+ * @since 2.2
+ */
+class MappingException extends \Exception
+{
+ /**
+ * @param string $className
+ * @param array $namespaces
+ *
+ * @return self
+ */
+ public static function classNotFoundInNamespaces($className, $namespaces)
+ {
+ return new self("The class '" . $className . "' was not found in the ".
+ "chain configured namespaces " . implode(", ", $namespaces));
+ }
+
+ /**
+ * @return self
+ */
+ public static function pathRequired()
+ {
+ return new self("Specifying the paths to your entities is required ".
+ "in the AnnotationDriver to retrieve all class names.");
+ }
+
+ /**
+ * @param string|null $path
+ *
+ * @return self
+ */
+ public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null)
+ {
+ if ( ! empty($path)) {
+ $path = '[' . $path . ']';
+ }
+
+ return new self(
+ 'File mapping drivers must have a valid directory path, ' .
+ 'however the given path ' . $path . ' seems to be incorrect!'
+ );
+ }
+
+ /**
+ * @param string $entityName
+ * @param string $fileName
+ *
+ * @return self
+ */
+ public static function mappingFileNotFound($entityName, $fileName)
+ {
+ return new self("No mapping file found named '$fileName' for class '$entityName'.");
+ }
+
+ /**
+ * @param string $entityName
+ * @param string $fileName
+ *
+ * @return self
+ */
+ public static function invalidMappingFile($entityName, $fileName)
+ {
+ return new self("Invalid mapping file '$fileName' for class '$entityName'.");
+ }
+
+ /**
+ * @param string $className
+ *
+ * @return self
+ */
+ public static function nonExistingClass($className)
+ {
+ return new self("Class '$className' does not exist");
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php
new file mode 100644
index 00000000..0088ed5e
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php
@@ -0,0 +1,87 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+/**
+ * Very simple reflection service abstraction.
+ *
+ * This is required inside metadata layers that may require either
+ * static or runtime reflection.
+ *
+ * @author Benjamin Eberlei
+ */
+interface ReflectionService
+{
+ /**
+ * Returns an array of the parent classes (not interfaces) for the given class.
+ *
+ * @param string $class
+ *
+ * @throws \Doctrine\Common\Persistence\Mapping\MappingException
+ *
+ * @return array
+ */
+ public function getParentClasses($class);
+
+ /**
+ * Returns the shortname of a class.
+ *
+ * @param string $class
+ *
+ * @return string
+ */
+ public function getClassShortName($class);
+
+ /**
+ * @param string $class
+ *
+ * @return string
+ */
+ public function getClassNamespace($class);
+
+ /**
+ * Returns a reflection class instance or null.
+ *
+ * @param string $class
+ *
+ * @return \ReflectionClass|null
+ */
+ public function getClass($class);
+
+ /**
+ * Returns an accessible property (setAccessible(true)) or null.
+ *
+ * @param string $class
+ * @param string $property
+ *
+ * @return \ReflectionProperty|null
+ */
+ public function getAccessibleProperty($class, $property);
+
+ /**
+ * Checks if the class have a public method with the given name.
+ *
+ * @param mixed $class
+ * @param mixed $method
+ *
+ * @return bool
+ */
+ public function hasPublicMethod($class, $method);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
new file mode 100644
index 00000000..4598d5af
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
@@ -0,0 +1,104 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+use Doctrine\Common\Reflection\RuntimePublicReflectionProperty;
+use ReflectionClass;
+use ReflectionException;
+use ReflectionMethod;
+use ReflectionProperty;
+
+/**
+ * PHP Runtime Reflection Service.
+ *
+ * @author Benjamin Eberlei
+ */
+class RuntimeReflectionService implements ReflectionService
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function getParentClasses($class)
+ {
+ if ( ! class_exists($class)) {
+ throw MappingException::nonExistingClass($class);
+ }
+
+ return class_parents($class);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassShortName($class)
+ {
+ $reflectionClass = new ReflectionClass($class);
+
+ return $reflectionClass->getShortName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassNamespace($class)
+ {
+ $reflectionClass = new ReflectionClass($class);
+
+ return $reflectionClass->getNamespaceName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClass($class)
+ {
+ return new ReflectionClass($class);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAccessibleProperty($class, $property)
+ {
+ $reflectionProperty = new ReflectionProperty($class, $property);
+
+ if ($reflectionProperty->isPublic()) {
+ $reflectionProperty = new RuntimePublicReflectionProperty($class, $property);
+ }
+
+ $reflectionProperty->setAccessible(true);
+
+ return $reflectionProperty;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function hasPublicMethod($class, $method)
+ {
+ try {
+ $reflectionMethod = new ReflectionMethod($class, $method);
+ } catch (ReflectionException $e) {
+ return false;
+ }
+
+ return $reflectionMethod->isPublic();
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php
new file mode 100644
index 00000000..7d017664
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php
@@ -0,0 +1,83 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+/**
+ * PHP Runtime Reflection Service.
+ *
+ * @author Benjamin Eberlei
+ */
+class StaticReflectionService implements ReflectionService
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function getParentClasses($class)
+ {
+ return [];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassShortName($className)
+ {
+ if (strpos($className, '\\') !== false) {
+ $className = substr($className, strrpos($className, "\\")+1);
+ }
+ return $className;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClassNamespace($className)
+ {
+ $namespace = '';
+ if (strpos($className, '\\') !== false) {
+ $namespace = strrev(substr( strrev($className), strpos(strrev($className), '\\')+1 ));
+ }
+ return $namespace;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClass($class)
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getAccessibleProperty($class, $property)
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function hasPublicMethod($class, $method)
+ {
+ return true;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php
new file mode 100644
index 00000000..02208c9d
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php
@@ -0,0 +1,169 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Contract for a Doctrine persistence layer ObjectManager class to implement.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.1
+ * @author Benjamin Eberlei
+ * @author Jonathan Wage
+ */
+interface ObjectManager
+{
+ /**
+ * Finds an object by its identifier.
+ *
+ * This is just a convenient shortcut for getRepository($className)->find($id).
+ *
+ * @param string $className The class name of the object to find.
+ * @param mixed $id The identity of the object to find.
+ *
+ * @return object The found object.
+ */
+ public function find($className, $id);
+
+ /**
+ * Tells the ObjectManager to make an instance managed and persistent.
+ *
+ * The object will be entered into the database as a result of the flush operation.
+ *
+ * NOTE: The persist operation always considers objects that are not yet known to
+ * this ObjectManager as NEW. Do not pass detached objects to the persist operation.
+ *
+ * @param object $object The instance to make managed and persistent.
+ *
+ * @return void
+ */
+ public function persist($object);
+
+ /**
+ * Removes an object instance.
+ *
+ * A removed object will be removed from the database as a result of the flush operation.
+ *
+ * @param object $object The object instance to remove.
+ *
+ * @return void
+ */
+ public function remove($object);
+
+ /**
+ * Merges the state of a detached object into the persistence context
+ * of this ObjectManager and returns the managed copy of the object.
+ * The object passed to merge will not become associated/managed with this ObjectManager.
+ *
+ * @param object $object
+ *
+ * @return object
+ */
+ public function merge($object);
+
+ /**
+ * Clears the ObjectManager. All objects that are currently managed
+ * by this ObjectManager become detached.
+ *
+ * @param string|null $objectName if given, only objects of this type will get detached.
+ *
+ * @return void
+ */
+ public function clear($objectName = null);
+
+ /**
+ * Detaches an object from the ObjectManager, causing a managed object to
+ * become detached. Unflushed changes made to the object if any
+ * (including removal of the object), will not be synchronized to the database.
+ * Objects which previously referenced the detached object will continue to
+ * reference it.
+ *
+ * @param object $object The object to detach.
+ *
+ * @return void
+ */
+ public function detach($object);
+
+ /**
+ * Refreshes the persistent state of an object from the database,
+ * overriding any local changes that have not yet been persisted.
+ *
+ * @param object $object The object to refresh.
+ *
+ * @return void
+ */
+ public function refresh($object);
+
+ /**
+ * Flushes all changes to objects that have been queued up to now to the database.
+ * This effectively synchronizes the in-memory state of managed objects with the
+ * database.
+ *
+ * @return void
+ */
+ public function flush();
+
+ /**
+ * Gets the repository for a class.
+ *
+ * @param string $className
+ *
+ * @return \Doctrine\Common\Persistence\ObjectRepository
+ */
+ public function getRepository($className);
+
+ /**
+ * Returns the ClassMetadata descriptor for a class.
+ *
+ * The class name must be the fully-qualified class name without a leading backslash
+ * (as it is returned by get_class($obj)).
+ *
+ * @param string $className
+ *
+ * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata
+ */
+ public function getClassMetadata($className);
+
+ /**
+ * Gets the metadata factory used to gather the metadata of classes.
+ *
+ * @return \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
+ */
+ public function getMetadataFactory();
+
+ /**
+ * Helper method to initialize a lazy loading proxy or persistent collection.
+ *
+ * This method is a no-op for other objects.
+ *
+ * @param object $obj
+ *
+ * @return void
+ */
+ public function initializeObject($obj);
+
+ /**
+ * Checks if the object is part of the current UnitOfWork and therefore managed.
+ *
+ * @param object $object
+ *
+ * @return bool
+ */
+ public function contains($object);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php
new file mode 100644
index 00000000..9bc248a5
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php
@@ -0,0 +1,51 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+
+/**
+ * Makes a Persistent Objects aware of its own object-manager.
+ *
+ * Using this interface the managing object manager and class metadata instances
+ * are injected into the persistent object after construction. This allows
+ * you to implement ActiveRecord functionality on top of the persistence-ignorance
+ * that Doctrine propagates.
+ *
+ * Word of Warning: This is a very powerful hook to change how you can work with your domain models.
+ * Using this hook will break the Single Responsibility Principle inside your Domain Objects
+ * and increase the coupling of database and objects.
+ *
+ * Every ObjectManager has to implement this functionality itself.
+ *
+ * @author Benjamin Eberlei
+ */
+interface ObjectManagerAware
+{
+ /**
+ * Injects responsible ObjectManager and the ClassMetadata into this persistent object.
+ *
+ * @param ObjectManager $objectManager
+ * @param ClassMetadata $classMetadata
+ *
+ * @return void
+ */
+ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php
new file mode 100644
index 00000000..8946475d
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php
@@ -0,0 +1,140 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Base class to simplify ObjectManager decorators
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ * @link www.doctrine-project.org
+ * @since 2.4
+ * @author Lars Strojny
+ */
+abstract class ObjectManagerDecorator implements ObjectManager
+{
+ /**
+ * @var ObjectManager
+ */
+ protected $wrapped;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function find($className, $id)
+ {
+ return $this->wrapped->find($className, $id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function persist($object)
+ {
+ return $this->wrapped->persist($object);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function remove($object)
+ {
+ return $this->wrapped->remove($object);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function merge($object)
+ {
+ return $this->wrapped->merge($object);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clear($objectName = null)
+ {
+ return $this->wrapped->clear($objectName);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function detach($object)
+ {
+ return $this->wrapped->detach($object);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function refresh($object)
+ {
+ return $this->wrapped->refresh($object);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function flush()
+ {
+ return $this->wrapped->flush();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getRepository($className)
+ {
+ return $this->wrapped->getRepository($className);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getClassMetadata($className)
+ {
+ return $this->wrapped->getClassMetadata($className);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getMetadataFactory()
+ {
+ return $this->wrapped->getMetadataFactory();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function initializeObject($obj)
+ {
+ return $this->wrapped->initializeObject($obj);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function contains($object)
+ {
+ return $this->wrapped->contains($object);
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php
new file mode 100644
index 00000000..f6072191
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php
@@ -0,0 +1,81 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Contract for a Doctrine persistence layer ObjectRepository class to implement.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.1
+ * @author Benjamin Eberlei
+ * @author Jonathan Wage
+ */
+interface ObjectRepository
+{
+ /**
+ * Finds an object by its primary key / identifier.
+ *
+ * @param mixed $id The identifier.
+ *
+ * @return object The object.
+ */
+ public function find($id);
+
+ /**
+ * Finds all objects in the repository.
+ *
+ * @return array The objects.
+ */
+ public function findAll();
+
+ /**
+ * Finds objects by a set of criteria.
+ *
+ * Optionally sorting and limiting details can be passed. An implementation may throw
+ * an UnexpectedValueException if certain values of the sorting or limiting details are
+ * not supported.
+ *
+ * @param array $criteria
+ * @param array|null $orderBy
+ * @param int|null $limit
+ * @param int|null $offset
+ *
+ * @return array The objects.
+ *
+ * @throws \UnexpectedValueException
+ */
+ public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null);
+
+ /**
+ * Finds a single object by a set of criteria.
+ *
+ * @param array $criteria The criteria.
+ *
+ * @return object The object.
+ */
+ public function findOneBy(array $criteria);
+
+ /**
+ * Returns the class name of the object managed by the repository.
+ *
+ * @return string
+ */
+ public function getClassName();
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php
new file mode 100644
index 00000000..990642e7
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php
@@ -0,0 +1,254 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\Common\Collections\Collection;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+
+/**
+ * PersistentObject base class that implements getter/setter methods for all mapped fields and associations
+ * by overriding __call.
+ *
+ * This class is a forward compatible implementation of the PersistentObject trait.
+ *
+ * Limitations:
+ *
+ * 1. All persistent objects have to be associated with a single ObjectManager, multiple
+ * ObjectManagers are not supported. You can set the ObjectManager with `PersistentObject#setObjectManager()`.
+ * 2. Setters and getters only work if a ClassMetadata instance was injected into the PersistentObject.
+ * This is either done on `postLoad` of an object or by accessing the global object manager.
+ * 3. There are no hooks for setters/getters. Just implement the method yourself instead of relying on __call().
+ * 4. Slower than handcoded implementations: An average of 7 method calls per access to a field and 11 for an association.
+ * 5. Only the inverse side associations get autoset on the owning side as well. Setting objects on the owning side
+ * will not set the inverse side associations.
+ *
+ * @example
+ *
+ * PersistentObject::setObjectManager($em);
+ *
+ * class Foo extends PersistentObject
+ * {
+ * private $id;
+ * }
+ *
+ * $foo = new Foo();
+ * $foo->getId(); // method exists through __call
+ *
+ * @author Benjamin Eberlei
+ */
+abstract class PersistentObject implements ObjectManagerAware
+{
+ /**
+ * @var ObjectManager|null
+ */
+ private static $objectManager = null;
+
+ /**
+ * @var ClassMetadata|null
+ */
+ private $cm = null;
+
+ /**
+ * Sets the object manager responsible for all persistent object base classes.
+ *
+ * @param ObjectManager|null $objectManager
+ *
+ * @return void
+ */
+ static public function setObjectManager(ObjectManager $objectManager = null)
+ {
+ self::$objectManager = $objectManager;
+ }
+
+ /**
+ * @return ObjectManager|null
+ */
+ static public function getObjectManager()
+ {
+ return self::$objectManager;
+ }
+
+ /**
+ * Injects the Doctrine Object Manager.
+ *
+ * @param ObjectManager $objectManager
+ * @param ClassMetadata $classMetadata
+ *
+ * @return void
+ *
+ * @throws \RuntimeException
+ */
+ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata)
+ {
+ if ($objectManager !== self::$objectManager) {
+ throw new \RuntimeException("Trying to use PersistentObject with different ObjectManager instances. " .
+ "Was PersistentObject::setObjectManager() called?");
+ }
+
+ $this->cm = $classMetadata;
+ }
+
+ /**
+ * Sets a persistent fields value.
+ *
+ * @param string $field
+ * @param array $args
+ *
+ * @return void
+ *
+ * @throws \BadMethodCallException When no persistent field exists by that name.
+ * @throws \InvalidArgumentException When the wrong target object type is passed to an association.
+ */
+ private function set($field, $args)
+ {
+ $this->initializeDoctrine();
+
+ if ($this->cm->hasField($field) && !$this->cm->isIdentifier($field)) {
+ $this->$field = $args[0];
+ } else if ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) {
+ $targetClass = $this->cm->getAssociationTargetClass($field);
+ if (!($args[0] instanceof $targetClass) && $args[0] !== null) {
+ throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'");
+ }
+ $this->$field = $args[0];
+ $this->completeOwningSide($field, $targetClass, $args[0]);
+ } else {
+ throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'");
+ }
+ }
+
+ /**
+ * Gets a persistent field value.
+ *
+ * @param string $field
+ *
+ * @return mixed
+ *
+ * @throws \BadMethodCallException When no persistent field exists by that name.
+ */
+ private function get($field)
+ {
+ $this->initializeDoctrine();
+
+ if ( $this->cm->hasField($field) || $this->cm->hasAssociation($field) ) {
+ return $this->$field;
+ } else {
+ throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'");
+ }
+ }
+
+ /**
+ * If this is an inverse side association, completes the owning side.
+ *
+ * @param string $field
+ * @param ClassMetadata $targetClass
+ * @param object $targetObject
+ *
+ * @return void
+ */
+ private function completeOwningSide($field, $targetClass, $targetObject)
+ {
+ // add this object on the owning side as well, for obvious infinite recursion
+ // reasons this is only done when called on the inverse side.
+ if ($this->cm->isAssociationInverseSide($field)) {
+ $mappedByField = $this->cm->getAssociationMappedByTargetField($field);
+ $targetMetadata = self::$objectManager->getClassMetadata($targetClass);
+
+ $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? "add" : "set").$mappedByField;
+ $targetObject->$setter($this);
+ }
+ }
+
+ /**
+ * Adds an object to a collection.
+ *
+ * @param string $field
+ * @param array $args
+ *
+ * @return void
+ *
+ * @throws \BadMethodCallException
+ * @throws \InvalidArgumentException
+ */
+ private function add($field, $args)
+ {
+ $this->initializeDoctrine();
+
+ if ($this->cm->hasAssociation($field) && $this->cm->isCollectionValuedAssociation($field)) {
+ $targetClass = $this->cm->getAssociationTargetClass($field);
+ if (!($args[0] instanceof $targetClass)) {
+ throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'");
+ }
+ if (!($this->$field instanceof Collection)) {
+ $this->$field = new ArrayCollection($this->$field ?: []);
+ }
+ $this->$field->add($args[0]);
+ $this->completeOwningSide($field, $targetClass, $args[0]);
+ } else {
+ throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getName());
+ }
+ }
+
+ /**
+ * Initializes Doctrine Metadata for this class.
+ *
+ * @return void
+ *
+ * @throws \RuntimeException
+ */
+ private function initializeDoctrine()
+ {
+ if ($this->cm !== null) {
+ return;
+ }
+
+ if (!self::$objectManager) {
+ throw new \RuntimeException("No runtime object manager set. Call PersistentObject#setObjectManager().");
+ }
+
+ $this->cm = self::$objectManager->getClassMetadata(get_class($this));
+ }
+
+ /**
+ * Magic methods.
+ *
+ * @param string $method
+ * @param array $args
+ *
+ * @return mixed
+ *
+ * @throws \BadMethodCallException
+ */
+ public function __call($method, $args)
+ {
+ $command = substr($method, 0, 3);
+ $field = lcfirst(substr($method, 3));
+ if ($command == "set") {
+ $this->set($field, $args);
+ } else if ($command == "get") {
+ return $this->get($field);
+ } else if ($command == "add") {
+ $this->add($field, $args);
+ } else {
+ throw new \BadMethodCallException("There is no method ".$method." on ".$this->cm->getName());
+ }
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php
new file mode 100644
index 00000000..3369eb94
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php
@@ -0,0 +1,59 @@
+.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Interface for proxy classes.
+ *
+ * @author Roman Borschel
+ * @since 2.2
+ */
+interface Proxy
+{
+ /**
+ * Marker for Proxy class names.
+ *
+ * @var string
+ */
+ const MARKER = '__CG__';
+
+ /**
+ * Length of the proxy marker.
+ *
+ * @var integer
+ */
+ const MARKER_LENGTH = 6;
+
+ /**
+ * Initializes this proxy if its not yet initialized.
+ *
+ * Acts as a no-op if already initialized.
+ *
+ * @return void
+ */
+ public function __load();
+
+ /**
+ * Returns whether this proxy is initialized or not.
+ *
+ * @return bool
+ */
+ public function __isInitialized();
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php b/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php
new file mode 100644
index 00000000..1a59cd4d
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php
@@ -0,0 +1,45 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * Contract for classes that are potential listeners of a NotifyPropertyChanged
+ * implementor.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
+interface PropertyChangedListener
+{
+ /**
+ * Notifies the listener of a property change.
+ *
+ * @param object $sender The object on which the property changed.
+ * @param string $propertyName The name of the property that changed.
+ * @param mixed $oldValue The old value of the property that changed.
+ * @param mixed $newValue The new value of the property that changed.
+ *
+ * @return void
+ */
+ function propertyChanged($sender, $propertyName, $oldValue, $newValue);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
new file mode 100644
index 00000000..7eb216bf
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
@@ -0,0 +1,248 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
+use Doctrine\Common\Proxy\Exception\InvalidArgumentException;
+use Doctrine\Common\Proxy\Exception\OutOfBoundsException;
+use Doctrine\Common\Util\ClassUtils;
+
+/**
+ * Abstract factory for proxy objects.
+ *
+ * @author Benjamin Eberlei
+ */
+abstract class AbstractProxyFactory
+{
+ /**
+ * Never autogenerate a proxy and rely that it was generated by some
+ * process before deployment.
+ *
+ * @var integer
+ */
+ const AUTOGENERATE_NEVER = 0;
+
+ /**
+ * Always generates a new proxy in every request.
+ *
+ * This is only sane during development.
+ *
+ * @var integer
+ */
+ const AUTOGENERATE_ALWAYS = 1;
+
+ /**
+ * Autogenerate the proxy class when the proxy file does not exist.
+ *
+ * This strategy causes a file exists call whenever any proxy is used the
+ * first time in a request.
+ *
+ * @var integer
+ */
+ const AUTOGENERATE_FILE_NOT_EXISTS = 2;
+
+ /**
+ * Generate the proxy classes using eval().
+ *
+ * This strategy is only sane for development, and even then it gives me
+ * the creeps a little.
+ *
+ * @var integer
+ */
+ const AUTOGENERATE_EVAL = 3;
+
+ /**
+ * @var \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
+ */
+ private $metadataFactory;
+
+ /**
+ * @var \Doctrine\Common\Proxy\ProxyGenerator the proxy generator responsible for creating the proxy classes/files.
+ */
+ private $proxyGenerator;
+
+ /**
+ * @var bool Whether to automatically (re)generate proxy classes.
+ */
+ private $autoGenerate;
+
+ /**
+ * @var \Doctrine\Common\Proxy\ProxyDefinition[]
+ */
+ private $definitions = [];
+
+ /**
+ * @param \Doctrine\Common\Proxy\ProxyGenerator $proxyGenerator
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory $metadataFactory
+ * @param bool|int $autoGenerate
+ */
+ public function __construct(ProxyGenerator $proxyGenerator, ClassMetadataFactory $metadataFactory, $autoGenerate)
+ {
+ $this->proxyGenerator = $proxyGenerator;
+ $this->metadataFactory = $metadataFactory;
+ $this->autoGenerate = (int)$autoGenerate;
+ }
+
+ /**
+ * Gets a reference proxy instance for the entity of the given type and identified by
+ * the given identifier.
+ *
+ * @param string $className
+ * @param array $identifier
+ *
+ * @return \Doctrine\Common\Proxy\Proxy
+ *
+ * @throws \Doctrine\Common\Proxy\Exception\OutOfBoundsException
+ */
+ public function getProxy($className, array $identifier)
+ {
+ $definition = isset($this->definitions[$className])
+ ? $this->definitions[$className]
+ : $this->getProxyDefinition($className);
+ $fqcn = $definition->proxyClassName;
+ $proxy = new $fqcn($definition->initializer, $definition->cloner);
+
+ foreach ($definition->identifierFields as $idField) {
+ if (! isset($identifier[$idField])) {
+ throw OutOfBoundsException::missingPrimaryKeyValue($className, $idField);
+ }
+
+ $definition->reflectionFields[$idField]->setValue($proxy, $identifier[$idField]);
+ }
+
+ return $proxy;
+ }
+
+ /**
+ * Generates proxy classes for all given classes.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata[] $classes The classes (ClassMetadata instances)
+ * for which to generate proxies.
+ * @param string $proxyDir The target directory of the proxy classes. If not specified, the
+ * directory configured on the Configuration of the EntityManager used
+ * by this factory is used.
+ * @return int Number of generated proxies.
+ */
+ public function generateProxyClasses(array $classes, $proxyDir = null)
+ {
+ $generated = 0;
+
+ foreach ($classes as $class) {
+ if ($this->skipClass($class)) {
+ continue;
+ }
+
+ $proxyFileName = $this->proxyGenerator->getProxyFileName($class->getName(), $proxyDir);
+
+ $this->proxyGenerator->generateProxyClass($class, $proxyFileName);
+
+ $generated += 1;
+ }
+
+ return $generated;
+ }
+
+ /**
+ * Reset initialization/cloning logic for an un-initialized proxy
+ *
+ * @param \Doctrine\Common\Proxy\Proxy $proxy
+ *
+ * @return \Doctrine\Common\Proxy\Proxy
+ *
+ * @throws \Doctrine\Common\Proxy\Exception\InvalidArgumentException
+ */
+ public function resetUninitializedProxy(Proxy $proxy)
+ {
+ if ($proxy->__isInitialized()) {
+ throw InvalidArgumentException::unitializedProxyExpected($proxy);
+ }
+
+ $className = ClassUtils::getClass($proxy);
+ $definition = isset($this->definitions[$className])
+ ? $this->definitions[$className]
+ : $this->getProxyDefinition($className);
+
+ $proxy->__setInitializer($definition->initializer);
+ $proxy->__setCloner($definition->cloner);
+
+ return $proxy;
+ }
+
+ /**
+ * Get a proxy definition for the given class name.
+ *
+ * @param string $className
+ *
+ * @return ProxyDefinition
+ */
+ private function getProxyDefinition($className)
+ {
+ $classMetadata = $this->metadataFactory->getMetadataFor($className);
+ $className = $classMetadata->getName(); // aliases and case sensitivity
+
+ $this->definitions[$className] = $this->createProxyDefinition($className);
+ $proxyClassName = $this->definitions[$className]->proxyClassName;
+
+ if ( ! class_exists($proxyClassName, false)) {
+ $fileName = $this->proxyGenerator->getProxyFileName($className);
+
+ switch ($this->autoGenerate) {
+ case self::AUTOGENERATE_NEVER:
+ require $fileName;
+ break;
+
+ case self::AUTOGENERATE_FILE_NOT_EXISTS:
+ if ( ! file_exists($fileName)) {
+ $this->proxyGenerator->generateProxyClass($classMetadata, $fileName);
+ }
+ require $fileName;
+ break;
+
+ case self::AUTOGENERATE_ALWAYS:
+ $this->proxyGenerator->generateProxyClass($classMetadata, $fileName);
+ require $fileName;
+ break;
+
+ case self::AUTOGENERATE_EVAL:
+ $this->proxyGenerator->generateProxyClass($classMetadata, false);
+ break;
+ }
+ }
+
+ return $this->definitions[$className];
+ }
+
+ /**
+ * Determine if this class should be skipped during proxy generation.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata
+ *
+ * @return bool
+ */
+ abstract protected function skipClass(ClassMetadata $metadata);
+
+ /**
+ * @param string $className
+ *
+ * @return ProxyDefinition
+ */
+ abstract protected function createProxyDefinition($className);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php
new file mode 100644
index 00000000..0aa930b2
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php
@@ -0,0 +1,92 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy;
+
+use Doctrine\Common\Proxy\Exception\InvalidArgumentException;
+
+/**
+ * Special Autoloader for Proxy classes, which are not PSR-0 compliant.
+ *
+ * @author Benjamin Eberlei
+ */
+class Autoloader
+{
+ /**
+ * Resolves proxy class name to a filename based on the following pattern.
+ *
+ * 1. Remove Proxy namespace from class name.
+ * 2. Remove namespace separators from remaining class name.
+ * 3. Return PHP filename from proxy-dir with the result from 2.
+ *
+ * @param string $proxyDir
+ * @param string $proxyNamespace
+ * @param string $className
+ *
+ * @return string
+ *
+ * @throws InvalidArgumentException
+ */
+ public static function resolveFile($proxyDir, $proxyNamespace, $className)
+ {
+ if (0 !== strpos($className, $proxyNamespace)) {
+ throw InvalidArgumentException::notProxyClass($className, $proxyNamespace);
+ }
+
+ $className = str_replace('\\', '', substr($className, strlen($proxyNamespace) + 1));
+
+ return $proxyDir . DIRECTORY_SEPARATOR . $className . '.php';
+ }
+
+ /**
+ * Registers and returns autoloader callback for the given proxy dir and namespace.
+ *
+ * @param string $proxyDir
+ * @param string $proxyNamespace
+ * @param callable|null $notFoundCallback Invoked when the proxy file is not found.
+ *
+ * @return \Closure
+ *
+ * @throws InvalidArgumentException
+ */
+ public static function register($proxyDir, $proxyNamespace, $notFoundCallback = null)
+ {
+ $proxyNamespace = ltrim($proxyNamespace, '\\');
+
+ if ( ! (null === $notFoundCallback || is_callable($notFoundCallback))) {
+ throw InvalidArgumentException::invalidClassNotFoundCallback($notFoundCallback);
+ }
+
+ $autoloader = function ($className) use ($proxyDir, $proxyNamespace, $notFoundCallback) {
+ if (0 === strpos($className, $proxyNamespace)) {
+ $file = Autoloader::resolveFile($proxyDir, $proxyNamespace, $className);
+
+ if ($notFoundCallback && ! file_exists($file)) {
+ call_user_func($notFoundCallback, $proxyDir, $proxyNamespace, $className);
+ }
+
+ require $file;
+ }
+ };
+
+ spl_autoload_register($autoloader);
+
+ return $autoloader;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php
new file mode 100644
index 00000000..dff54d9f
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php
@@ -0,0 +1,92 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy\Exception;
+
+use Doctrine\Common\Persistence\Proxy;
+use InvalidArgumentException as BaseInvalidArgumentException;
+
+/**
+ * Proxy Invalid Argument Exception.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.4
+ * @author Marco Pivetta
+ */
+class InvalidArgumentException extends BaseInvalidArgumentException implements ProxyException
+{
+ /**
+ * @return self
+ */
+ public static function proxyDirectoryRequired()
+ {
+ return new self('You must configure a proxy directory. See docs for details');
+ }
+
+ /**
+ * @param string $className
+ * @param string $proxyNamespace
+ *
+ * @return self
+ */
+ public static function notProxyClass($className, $proxyNamespace)
+ {
+ return new self(sprintf('The class "%s" is not part of the proxy namespace "%s"', $className, $proxyNamespace));
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return self
+ */
+ public static function invalidPlaceholder($name)
+ {
+ return new self(sprintf('Provided placeholder for "%s" must be either a string or a valid callable', $name));
+ }
+
+ /**
+ * @return self
+ */
+ public static function proxyNamespaceRequired()
+ {
+ return new self('You must configure a proxy namespace');
+ }
+
+ /**
+ * @param Proxy $proxy
+ *
+ * @return self
+ */
+ public static function unitializedProxyExpected(Proxy $proxy)
+ {
+ return new self(sprintf('Provided proxy of type "%s" must not be initialized.', get_class($proxy)));
+ }
+
+ /**
+ * @param mixed $callback
+ *
+ * @return self
+ */
+ public static function invalidClassNotFoundCallback($callback)
+ {
+ $type = is_object($callback) ? get_class($callback) : gettype($callback);
+
+ return new self(sprintf('Invalid \$notFoundCallback given: must be a callable, "%s" given', $type));
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php
new file mode 100644
index 00000000..3c7415c6
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php
@@ -0,0 +1,42 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy\Exception;
+
+use OutOfBoundsException as BaseOutOfBoundsException;
+
+/**
+ * Proxy Invalid Argument Exception.
+ *
+ * @link www.doctrine-project.org
+ * @author Fredrik Wendel
+ */
+class OutOfBoundsException extends BaseOutOfBoundsException implements ProxyException
+{
+ /**
+ * @param string $className
+ * @param string $idField
+ *
+ * @return self
+ */
+ public static function missingPrimaryKeyValue($className, $idField)
+ {
+ return new self(sprintf("Missing value for primary key %s on %s", $idField, $className));
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php
new file mode 100644
index 00000000..0d1ff140
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php
@@ -0,0 +1,31 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy\Exception;
+
+/**
+ * Base exception interface for proxy exceptions.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.4
+ * @author Marco Pivetta
+ */
+interface ProxyException
+{
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php
new file mode 100644
index 00000000..154b9177
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php
@@ -0,0 +1,64 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy\Exception;
+
+use UnexpectedValueException as BaseUnexpectedValueException;
+
+/**
+ * Proxy Unexpected Value Exception.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.4
+ * @author Marco Pivetta
+ */
+class UnexpectedValueException extends BaseUnexpectedValueException implements ProxyException
+{
+ /**
+ * @param string $proxyDirectory
+ *
+ * @return self
+ */
+ public static function proxyDirectoryNotWritable($proxyDirectory)
+ {
+ return new self(sprintf('Your proxy directory "%s" must be writable', $proxyDirectory));
+ }
+
+ /**
+ * @param string $className
+ * @param string $methodName
+ * @param string $parameterName
+ * @param \Exception $previous
+ *
+ * @return self
+ */
+ public static function invalidParameterTypeHint($className, $methodName, $parameterName, \Exception $previous)
+ {
+ return new self(
+ sprintf(
+ 'The type hint of parameter "%s" in method "%s" in class "%s" is invalid.',
+ $parameterName,
+ $methodName,
+ $className
+ ),
+ 0,
+ $previous
+ );
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php
new file mode 100644
index 00000000..bd2b0887
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php
@@ -0,0 +1,90 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy;
+
+use Closure;
+use Doctrine\Common\Persistence\Proxy as BaseProxy;
+
+/**
+ * Interface for proxy classes.
+ *
+ * @author Roman Borschel
+ * @author Marco Pivetta
+ * @since 2.4
+ */
+interface Proxy extends BaseProxy
+{
+ /**
+ * Marks the proxy as initialized or not.
+ *
+ * @param boolean $initialized
+ *
+ * @return void
+ */
+ public function __setInitialized($initialized);
+
+ /**
+ * Sets the initializer callback to be used when initializing the proxy. That
+ * initializer should accept 3 parameters: $proxy, $method and $params. Those
+ * are respectively the proxy object that is being initialized, the method name
+ * that triggered initialization and the parameters passed to that method.
+ *
+ * @param Closure|null $initializer
+ *
+ * @return void
+ */
+ public function __setInitializer(Closure $initializer = null);
+
+ /**
+ * Retrieves the initializer callback used to initialize the proxy.
+ *
+ * @see __setInitializer
+ *
+ * @return Closure|null
+ */
+ public function __getInitializer();
+
+ /**
+ * Sets the callback to be used when cloning the proxy. That initializer should accept
+ * a single parameter, which is the cloned proxy instance itself.
+ *
+ * @param Closure|null $cloner
+ *
+ * @return void
+ */
+ public function __setCloner(Closure $cloner = null);
+
+ /**
+ * Retrieves the callback to be used when cloning the proxy.
+ *
+ * @see __setCloner
+ *
+ * @return Closure|null
+ */
+ public function __getCloner();
+
+ /**
+ * Retrieves the list of lazy loaded properties for a given proxy
+ *
+ * @return array Keys are the property names, and values are the default values
+ * for those properties.
+ */
+ public function __getLazyProperties();
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php
new file mode 100644
index 00000000..48b149a3
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php
@@ -0,0 +1,70 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy;
+
+/**
+ * Definition structure how to create a proxy.
+ *
+ * @author Benjamin Eberlei
+ */
+class ProxyDefinition
+{
+ /**
+ * @var string
+ */
+ public $proxyClassName;
+
+ /**
+ * @var array
+ */
+ public $identifierFields;
+
+ /**
+ * @var \ReflectionProperty[]
+ */
+ public $reflectionFields;
+
+ /**
+ * @var callable
+ */
+ public $initializer;
+
+ /**
+ * @var callable
+ */
+ public $cloner;
+
+ /**
+ * @param string $proxyClassName
+ * @param array $identifierFields
+ * @param array $reflectionFields
+ * @param callable $initializer
+ * @param callable $cloner
+ */
+ public function __construct($proxyClassName, array $identifierFields, array $reflectionFields, $initializer, $cloner)
+ {
+ $this->proxyClassName = $proxyClassName;
+ $this->identifierFields = $identifierFields;
+ $this->reflectionFields = $reflectionFields;
+ $this->initializer = $initializer;
+ $this->cloner = $cloner;
+ }
+}
+
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php
new file mode 100644
index 00000000..925dcd1b
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php
@@ -0,0 +1,1037 @@
+.
+ */
+
+namespace Doctrine\Common\Proxy;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Proxy\Exception\InvalidArgumentException;
+use Doctrine\Common\Proxy\Exception\UnexpectedValueException;
+use Doctrine\Common\Util\ClassUtils;
+
+/**
+ * This factory is used to generate proxy classes.
+ * It builds proxies from given parameters, a template and class metadata.
+ *
+ * @author Marco Pivetta
+ * @since 2.4
+ */
+class ProxyGenerator
+{
+ /**
+ * Used to match very simple id methods that don't need
+ * to be decorated since the identifier is known.
+ */
+ const PATTERN_MATCH_ID_METHOD = '((public\s+)?(function\s+%s\s*\(\)\s*)\s*{\s*return\s*\$this->%s;\s*})i';
+
+ /**
+ * The namespace that contains all proxy classes.
+ *
+ * @var string
+ */
+ private $proxyNamespace;
+
+ /**
+ * The directory that contains all proxy classes.
+ *
+ * @var string
+ */
+ private $proxyDirectory;
+
+ /**
+ * Map of callables used to fill in placeholders set in the template.
+ *
+ * @var string[]|callable[]
+ */
+ protected $placeholders = [
+ 'baseProxyInterface' => Proxy::class,
+ 'additionalProperties' => '',
+ ];
+
+ /**
+ * Template used as a blueprint to generate proxies.
+ *
+ * @var string
+ */
+ protected $proxyClassTemplate = ';
+
+/**
+ * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE\'S PROXY GENERATOR
+ */
+class extends \ implements \
+{
+ /**
+ * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
+ * three parameters, being respectively the proxy object to be initialized, the method that triggered the
+ * initialization process and an array of ordered parameters that were passed to that method.
+ *
+ * @see \Doctrine\Common\Persistence\Proxy::__setInitializer
+ */
+ public $__initializer__;
+
+ /**
+ * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object
+ *
+ * @see \Doctrine\Common\Persistence\Proxy::__setCloner
+ */
+ public $__cloner__;
+
+ /**
+ * @var boolean flag indicating if this object was already initialized
+ *
+ * @see \Doctrine\Common\Persistence\Proxy::__isInitialized
+ */
+ public $__isInitialized__ = false;
+
+ /**
+ * @var array properties to be lazy loaded, with keys being the property
+ * names and values being their default values
+ *
+ * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties
+ */
+ public static $lazyPropertiesDefaults = [];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /**
+ * Forces initialization of the proxy
+ */
+ public function __load()
+ {
+ $this->__initializer__ && $this->__initializer__->__invoke($this, \'__load\', []);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @internal generated method: use only when explicitly handling proxy specific loading logic
+ */
+ public function __isInitialized()
+ {
+ return $this->__isInitialized__;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @internal generated method: use only when explicitly handling proxy specific loading logic
+ */
+ public function __setInitialized($initialized)
+ {
+ $this->__isInitialized__ = $initialized;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @internal generated method: use only when explicitly handling proxy specific loading logic
+ */
+ public function __setInitializer(\Closure $initializer = null)
+ {
+ $this->__initializer__ = $initializer;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @internal generated method: use only when explicitly handling proxy specific loading logic
+ */
+ public function __getInitializer()
+ {
+ return $this->__initializer__;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @internal generated method: use only when explicitly handling proxy specific loading logic
+ */
+ public function __setCloner(\Closure $cloner = null)
+ {
+ $this->__cloner__ = $cloner;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @internal generated method: use only when explicitly handling proxy specific cloning logic
+ */
+ public function __getCloner()
+ {
+ return $this->__cloner__;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @internal generated method: use only when explicitly handling proxy specific loading logic
+ * @static
+ */
+ public function __getLazyProperties()
+ {
+ return self::$lazyPropertiesDefaults;
+ }
+
+
+}
+';
+
+ /**
+ * Initializes a new instance of the ProxyFactory class that is
+ * connected to the given EntityManager.
+ *
+ * @param string $proxyDirectory The directory to use for the proxy classes. It must exist.
+ * @param string $proxyNamespace The namespace to use for the proxy classes.
+ *
+ * @throws InvalidArgumentException
+ */
+ public function __construct($proxyDirectory, $proxyNamespace)
+ {
+ if ( ! $proxyDirectory) {
+ throw InvalidArgumentException::proxyDirectoryRequired();
+ }
+
+ if ( ! $proxyNamespace) {
+ throw InvalidArgumentException::proxyNamespaceRequired();
+ }
+
+ $this->proxyDirectory = $proxyDirectory;
+ $this->proxyNamespace = $proxyNamespace;
+ }
+
+ /**
+ * Sets a placeholder to be replaced in the template.
+ *
+ * @param string $name
+ * @param string|callable $placeholder
+ *
+ * @throws InvalidArgumentException
+ */
+ public function setPlaceholder($name, $placeholder)
+ {
+ if ( ! is_string($placeholder) && ! is_callable($placeholder)) {
+ throw InvalidArgumentException::invalidPlaceholder($name);
+ }
+
+ $this->placeholders[$name] = $placeholder;
+ }
+
+ /**
+ * Sets the base template used to create proxy classes.
+ *
+ * @param string $proxyClassTemplate
+ */
+ public function setProxyClassTemplate($proxyClassTemplate)
+ {
+ $this->proxyClassTemplate = (string) $proxyClassTemplate;
+ }
+
+ /**
+ * Generates a proxy class file.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class Metadata for the original class.
+ * @param string|bool $fileName Filename (full path) for the generated class. If none is given, eval() is used.
+ *
+ * @throws UnexpectedValueException
+ */
+ public function generateProxyClass(ClassMetadata $class, $fileName = false)
+ {
+ preg_match_all('(<([a-zA-Z]+)>)', $this->proxyClassTemplate, $placeholderMatches);
+
+ $placeholderMatches = array_combine($placeholderMatches[0], $placeholderMatches[1]);
+ $placeholders = [];
+
+ foreach ($placeholderMatches as $placeholder => $name) {
+ $placeholders[$placeholder] = isset($this->placeholders[$name])
+ ? $this->placeholders[$name]
+ : [$this, 'generate' . $name];
+ }
+
+ foreach ($placeholders as & $placeholder) {
+ if (is_callable($placeholder)) {
+ $placeholder = call_user_func($placeholder, $class);
+ }
+ }
+
+ $proxyCode = strtr($this->proxyClassTemplate, $placeholders);
+
+ if ( ! $fileName) {
+ $proxyClassName = $this->generateNamespace($class) . '\\' . $this->generateProxyShortClassName($class);
+
+ if ( ! class_exists($proxyClassName)) {
+ eval(substr($proxyCode, 5));
+ }
+
+ return;
+ }
+
+ $parentDirectory = dirname($fileName);
+
+ if ( ! is_dir($parentDirectory) && (false === @mkdir($parentDirectory, 0775, true))) {
+ throw UnexpectedValueException::proxyDirectoryNotWritable($this->proxyDirectory);
+ }
+
+ if ( ! is_writable($parentDirectory)) {
+ throw UnexpectedValueException::proxyDirectoryNotWritable($this->proxyDirectory);
+ }
+
+ $tmpFileName = $fileName . '.' . uniqid('', true);
+
+ file_put_contents($tmpFileName, $proxyCode);
+ @chmod($tmpFileName, 0664);
+ rename($tmpFileName, $fileName);
+ }
+
+ /**
+ * Generates the proxy short class name to be used in the template.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateProxyShortClassName(ClassMetadata $class)
+ {
+ $proxyClassName = ClassUtils::generateProxyClassName($class->getName(), $this->proxyNamespace);
+ $parts = explode('\\', strrev($proxyClassName), 2);
+
+ return strrev($parts[0]);
+ }
+
+ /**
+ * Generates the proxy namespace.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateNamespace(ClassMetadata $class)
+ {
+ $proxyClassName = ClassUtils::generateProxyClassName($class->getName(), $this->proxyNamespace);
+ $parts = explode('\\', strrev($proxyClassName), 2);
+
+ return strrev($parts[1]);
+ }
+
+ /**
+ * Generates the original class name.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateClassName(ClassMetadata $class)
+ {
+ return ltrim($class->getName(), '\\');
+ }
+
+ /**
+ * Generates the array representation of lazy loaded public properties and their default values.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateLazyPropertiesDefaults(ClassMetadata $class)
+ {
+ $lazyPublicProperties = $this->getLazyLoadedPublicProperties($class);
+ $values = [];
+
+ foreach ($lazyPublicProperties as $key => $value) {
+ $values[] = var_export($key, true) . ' => ' . var_export($value, true);
+ }
+
+ return implode(', ', $values);
+ }
+
+ /**
+ * Generates the constructor code (un-setting public lazy loaded properties, setting identifier field values).
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateConstructorImpl(ClassMetadata $class)
+ {
+ $constructorImpl = <<<'EOT'
+ /**
+ * @param \Closure $initializer
+ * @param \Closure $cloner
+ */
+ public function __construct($initializer = null, $cloner = null)
+ {
+
+EOT;
+ $toUnset = [];
+
+ foreach ($this->getLazyLoadedPublicProperties($class) as $lazyPublicProperty => $unused) {
+ $toUnset[] = '$this->' . $lazyPublicProperty;
+ }
+
+ $constructorImpl .= (empty($toUnset) ? '' : ' unset(' . implode(', ', $toUnset) . ");\n")
+ . <<<'EOT'
+
+ $this->__initializer__ = $initializer;
+ $this->__cloner__ = $cloner;
+ }
+EOT;
+
+ return $constructorImpl;
+ }
+
+ /**
+ * Generates the magic getter invoked when lazy loaded public properties are requested.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateMagicGet(ClassMetadata $class)
+ {
+ $lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class));
+ $reflectionClass = $class->getReflectionClass();
+ $hasParentGet = false;
+ $returnReference = '';
+ $inheritDoc = '';
+
+ if ($reflectionClass->hasMethod('__get')) {
+ $hasParentGet = true;
+ $inheritDoc = '{@inheritDoc}';
+
+ if ($reflectionClass->getMethod('__get')->returnsReference()) {
+ $returnReference = '& ';
+ }
+ }
+
+ if (empty($lazyPublicProperties) && ! $hasParentGet) {
+ return '';
+ }
+
+ $magicGet = <<__getLazyProperties())) {
+ $this->__initializer__ && $this->__initializer__->__invoke($this, '__get', [$name]);
+
+ return $this->$name;
+ }
+
+
+EOT;
+ }
+
+ if ($hasParentGet) {
+ $magicGet .= <<<'EOT'
+ $this->__initializer__ && $this->__initializer__->__invoke($this, '__get', [$name]);
+
+ return parent::__get($name);
+
+EOT;
+ } else {
+ $magicGet .= <<<'EOT'
+ trigger_error(sprintf('Undefined property: %s::$%s', __CLASS__, $name), E_USER_NOTICE);
+
+EOT;
+ }
+
+ $magicGet .= " }";
+
+ return $magicGet;
+ }
+
+ /**
+ * Generates the magic setter (currently unused).
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateMagicSet(ClassMetadata $class)
+ {
+ $lazyPublicProperties = $this->getLazyLoadedPublicProperties($class);
+ $hasParentSet = $class->getReflectionClass()->hasMethod('__set');
+
+ if (empty($lazyPublicProperties) && ! $hasParentSet) {
+ return '';
+ }
+
+ $inheritDoc = $hasParentSet ? '{@inheritDoc}' : '';
+ $magicSet = <<__getLazyProperties())) {
+ $this->__initializer__ && $this->__initializer__->__invoke($this, '__set', [$name, $value]);
+
+ $this->$name = $value;
+
+ return;
+ }
+
+
+EOT;
+ }
+
+ if ($hasParentSet) {
+ $magicSet .= <<<'EOT'
+ $this->__initializer__ && $this->__initializer__->__invoke($this, '__set', [$name, $value]);
+
+ return parent::__set($name, $value);
+EOT;
+ } else {
+ $magicSet .= " \$this->\$name = \$value;";
+ }
+
+ $magicSet .= "\n }";
+
+ return $magicSet;
+ }
+
+ /**
+ * Generates the magic issetter invoked when lazy loaded public properties are checked against isset().
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateMagicIsset(ClassMetadata $class)
+ {
+ $lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class));
+ $hasParentIsset = $class->getReflectionClass()->hasMethod('__isset');
+
+ if (empty($lazyPublicProperties) && ! $hasParentIsset) {
+ return '';
+ }
+
+ $inheritDoc = $hasParentIsset ? '{@inheritDoc}' : '';
+ $magicIsset = <<__getLazyProperties())) {
+ $this->__initializer__ && $this->__initializer__->__invoke($this, '__isset', [$name]);
+
+ return isset($this->$name);
+ }
+
+
+EOT;
+ }
+
+ if ($hasParentIsset) {
+ $magicIsset .= <<<'EOT'
+ $this->__initializer__ && $this->__initializer__->__invoke($this, '__isset', [$name]);
+
+ return parent::__isset($name);
+
+EOT;
+ } else {
+ $magicIsset .= " return false;";
+ }
+
+ return $magicIsset . "\n }";
+ }
+
+ /**
+ * Generates implementation for the `__sleep` method of proxies.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateSleepImpl(ClassMetadata $class)
+ {
+ $hasParentSleep = $class->getReflectionClass()->hasMethod('__sleep');
+ $inheritDoc = $hasParentSleep ? '{@inheritDoc}' : '';
+ $sleepImpl = <<__isInitialized__) {
+ $properties = array_diff($properties, array_keys($this->__getLazyProperties()));
+ }
+
+ return $properties;
+ }
+EOT;
+ }
+
+ $allProperties = ['__isInitialized__'];
+
+ /* @var $prop \ReflectionProperty */
+ foreach ($class->getReflectionClass()->getProperties() as $prop) {
+ if ($prop->isStatic()) {
+ continue;
+ }
+
+ $allProperties[] = $prop->isPrivate()
+ ? "\0" . $prop->getDeclaringClass()->getName() . "\0" . $prop->getName()
+ : $prop->getName();
+ }
+
+ $lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class));
+ $protectedProperties = array_diff($allProperties, $lazyPublicProperties);
+
+ foreach ($allProperties as &$property) {
+ $property = var_export($property, true);
+ }
+
+ foreach ($protectedProperties as &$property) {
+ $property = var_export($property, true);
+ }
+
+ $allProperties = implode(', ', $allProperties);
+ $protectedProperties = implode(', ', $protectedProperties);
+
+ return $sleepImpl . <<__isInitialized__) {
+ return [$allProperties];
+ }
+
+ return [$protectedProperties];
+ }
+EOT;
+ }
+
+ /**
+ * Generates implementation for the `__wakeup` method of proxies.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateWakeupImpl(ClassMetadata $class)
+ {
+ $unsetPublicProperties = [];
+ $hasWakeup = $class->getReflectionClass()->hasMethod('__wakeup');
+
+ foreach (array_keys($this->getLazyLoadedPublicProperties($class)) as $lazyPublicProperty) {
+ $unsetPublicProperties[] = '$this->' . $lazyPublicProperty;
+ }
+
+ $shortName = $this->generateProxyShortClassName($class);
+ $inheritDoc = $hasWakeup ? '{@inheritDoc}' : '';
+ $wakeupImpl = <<__isInitialized__) {
+ \$this->__initializer__ = function ($shortName \$proxy) {
+ \$proxy->__setInitializer(null);
+ \$proxy->__setCloner(null);
+
+ \$existingProperties = get_object_vars(\$proxy);
+
+ foreach (\$proxy->__getLazyProperties() as \$property => \$defaultValue) {
+ if ( ! array_key_exists(\$property, \$existingProperties)) {
+ \$proxy->\$property = \$defaultValue;
+ }
+ }
+ };
+
+EOT;
+
+ if ( ! empty($unsetPublicProperties)) {
+ $wakeupImpl .= "\n unset(" . implode(', ', $unsetPublicProperties) . ");";
+ }
+
+ $wakeupImpl .= "\n }";
+
+ if ($hasWakeup) {
+ $wakeupImpl .= "\n parent::__wakeup();";
+ }
+
+ $wakeupImpl .= "\n }";
+
+ return $wakeupImpl;
+ }
+
+ /**
+ * Generates implementation for the `__clone` method of proxies.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateCloneImpl(ClassMetadata $class)
+ {
+ $hasParentClone = $class->getReflectionClass()->hasMethod('__clone');
+ $inheritDoc = $hasParentClone ? '{@inheritDoc}' : '';
+ $callParentClone = $hasParentClone ? "\n parent::__clone();\n" : '';
+
+ return <<__cloner__ && \$this->__cloner__->__invoke(\$this, '__clone', []);
+$callParentClone }
+EOT;
+ }
+
+ /**
+ * Generates decorated methods by picking those available in the parent class.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return string
+ */
+ private function generateMethods(ClassMetadata $class)
+ {
+ $methods = '';
+ $methodNames = [];
+ $reflectionMethods = $class->getReflectionClass()->getMethods(\ReflectionMethod::IS_PUBLIC);
+ $skippedMethods = [
+ '__sleep' => true,
+ '__clone' => true,
+ '__wakeup' => true,
+ '__get' => true,
+ '__set' => true,
+ '__isset' => true,
+ ];
+
+ foreach ($reflectionMethods as $method) {
+ $name = $method->getName();
+
+ if (
+ $method->isConstructor() ||
+ isset($skippedMethods[strtolower($name)]) ||
+ isset($methodNames[$name]) ||
+ $method->isFinal() ||
+ $method->isStatic() ||
+ ( ! $method->isPublic())
+ ) {
+ continue;
+ }
+
+ $methodNames[$name] = true;
+ $methods .= "\n /**\n"
+ . " * {@inheritDoc}\n"
+ . " */\n"
+ . ' public function ';
+
+ if ($method->returnsReference()) {
+ $methods .= '&';
+ }
+
+ $methods .= $name . '(' . $this->buildParametersString($class, $method, $method->getParameters()) . ')';
+ $methods .= $this->getMethodReturnType($method);
+ $methods .= "\n" . ' {' . "\n";
+
+ if ($this->isShortIdentifierGetter($method, $class)) {
+ $identifier = lcfirst(substr($name, 3));
+ $fieldType = $class->getTypeOfField($identifier);
+ $cast = in_array($fieldType, ['integer', 'smallint']) ? '(int) ' : '';
+
+ $methods .= ' if ($this->__isInitialized__ === false) {' . "\n";
+ $methods .= ' return ' . $cast . ' parent::' . $method->getName() . "();\n";
+ $methods .= ' }' . "\n\n";
+ }
+
+ $invokeParamsString = implode(', ', $this->getParameterNamesForInvoke($method->getParameters()));
+ $callParamsString = implode(', ', $this->getParameterNamesForParentCall($method->getParameters()));
+
+ $methods .= "\n \$this->__initializer__ "
+ . "&& \$this->__initializer__->__invoke(\$this, " . var_export($name, true)
+ . ", [" . $invokeParamsString . "]);"
+ . "\n\n return parent::" . $name . '(' . $callParamsString . ');'
+ . "\n" . ' }' . "\n";
+ }
+
+ return $methods;
+ }
+
+ /**
+ * Generates the Proxy file name.
+ *
+ * @param string $className
+ * @param string $baseDirectory Optional base directory for proxy file name generation.
+ * If not specified, the directory configured on the Configuration of the
+ * EntityManager will be used by this factory.
+ *
+ * @return string
+ */
+ public function getProxyFileName($className, $baseDirectory = null)
+ {
+ $baseDirectory = $baseDirectory ?: $this->proxyDirectory;
+
+ return rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . Proxy::MARKER
+ . str_replace('\\', '', $className) . '.php';
+ }
+
+ /**
+ * Checks if the method is a short identifier getter.
+ *
+ * What does this mean? For proxy objects the identifier is already known,
+ * however accessing the getter for this identifier usually triggers the
+ * lazy loading, leading to a query that may not be necessary if only the
+ * ID is interesting for the userland code (for example in views that
+ * generate links to the entity, but do not display anything else).
+ *
+ * @param \ReflectionMethod $method
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return boolean
+ */
+ private function isShortIdentifierGetter($method, ClassMetadata $class)
+ {
+ $identifier = lcfirst(substr($method->getName(), 3));
+ $startLine = $method->getStartLine();
+ $endLine = $method->getEndLine();
+ $cheapCheck = (
+ $method->getNumberOfParameters() == 0
+ && substr($method->getName(), 0, 3) == 'get'
+ && in_array($identifier, $class->getIdentifier(), true)
+ && $class->hasField($identifier)
+ && (($endLine - $startLine) <= 4)
+ );
+
+ if ($cheapCheck) {
+ $code = file($method->getDeclaringClass()->getFileName());
+ $code = trim(implode(' ', array_slice($code, $startLine - 1, $endLine - $startLine + 1)));
+
+ $pattern = sprintf(self::PATTERN_MATCH_ID_METHOD, $method->getName(), $identifier);
+
+ if (preg_match($pattern, $code)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Generates the list of public properties to be lazy loaded, with their default values.
+ *
+ * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
+ *
+ * @return mixed[]
+ */
+ private function getLazyLoadedPublicProperties(ClassMetadata $class)
+ {
+ $defaultProperties = $class->getReflectionClass()->getDefaultProperties();
+ $properties = [];
+
+ foreach ($class->getReflectionClass()->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
+ $name = $property->getName();
+
+ if (($class->hasField($name) || $class->hasAssociation($name)) && ! $class->isIdentifier($name)) {
+ $properties[$name] = $defaultProperties[$name];
+ }
+ }
+
+ return $properties;
+ }
+
+ /**
+ * @param ClassMetadata $class
+ * @param \ReflectionMethod $method
+ * @param \ReflectionParameter[] $parameters
+ *
+ * @return string
+ */
+ private function buildParametersString(ClassMetadata $class, \ReflectionMethod $method, array $parameters)
+ {
+ $parameterDefinitions = [];
+
+ /* @var $param \ReflectionParameter */
+ foreach ($parameters as $param) {
+ $parameterDefinition = '';
+
+ if ($parameterType = $this->getParameterType($class, $method, $param)) {
+ $parameterDefinition .= $parameterType . ' ';
+ }
+
+ if ($param->isPassedByReference()) {
+ $parameterDefinition .= '&';
+ }
+
+ if (method_exists($param, 'isVariadic') && $param->isVariadic()) {
+ $parameterDefinition .= '...';
+ }
+
+ $parameters[] = '$' . $param->getName();
+ $parameterDefinition .= '$' . $param->getName();
+
+ if ($param->isDefaultValueAvailable()) {
+ $parameterDefinition .= ' = ' . var_export($param->getDefaultValue(), true);
+ }
+
+ $parameterDefinitions[] = $parameterDefinition;
+ }
+
+ return implode(', ', $parameterDefinitions);
+ }
+
+ /**
+ * @param ClassMetadata $class
+ * @param \ReflectionMethod $method
+ * @param \ReflectionParameter $parameter
+ *
+ * @return string|null
+ */
+ private function getParameterType(ClassMetadata $class, \ReflectionMethod $method, \ReflectionParameter $parameter)
+ {
+
+ // We need to pick the type hint class too
+ if ($parameter->isArray()) {
+ return 'array';
+ }
+
+ if ($parameter->isCallable()) {
+ return 'callable';
+ }
+
+ if (method_exists($parameter, 'hasType') && $parameter->hasType() && $parameter->getType()->isBuiltin()) {
+ return (string) $parameter->getType();
+ }
+
+ try {
+ $parameterClass = $parameter->getClass();
+
+ if ($parameterClass) {
+ return '\\' . $parameterClass->getName();
+ }
+ } catch (\ReflectionException $previous) {
+ throw UnexpectedValueException::invalidParameterTypeHint(
+ $class->getName(),
+ $method->getName(),
+ $parameter->getName(),
+ $previous
+ );
+ }
+
+ return null;
+ }
+
+ /**
+ * @param \ReflectionParameter[] $parameters
+ *
+ * @return string[]
+ */
+ private function getParameterNamesForInvoke(array $parameters)
+ {
+ return array_map(
+ function (\ReflectionParameter $parameter) {
+ return '$' . $parameter->getName();
+ },
+ $parameters
+ );
+ }
+
+ /**
+ * @param \ReflectionParameter[] $parameters
+ *
+ * @return string[]
+ */
+ private function getParameterNamesForParentCall(array $parameters)
+ {
+ return array_map(
+ function (\ReflectionParameter $parameter) {
+ $name = '';
+
+ if (method_exists($parameter, 'isVariadic') && $parameter->isVariadic()) {
+ $name .= '...';
+ }
+
+ $name .= '$' . $parameter->getName();
+
+ return $name;
+ },
+ $parameters
+ );
+ }
+
+ /**
+ * @Param \ReflectionMethod $method
+ *
+ * @return string
+ */
+ private function getMethodReturnType(\ReflectionMethod $method)
+ {
+ if (! (method_exists($method, 'hasReturnType') && $method->hasReturnType())) {
+ return '';
+ }
+
+ $returnType = $method->getReturnType();
+
+ if ($returnType->isBuiltin()) {
+ return ': ' . $returnType;
+ }
+
+ $nameLower = strtolower((string) $returnType);
+
+ if ('self' === $nameLower) {
+ return ': \\' . $method->getDeclaringClass()->getName();
+ }
+
+ if ('parent' === $nameLower) {
+ return ': \\' . $method->getDeclaringClass()->getParentClass()->getName();
+ }
+
+ return ': \\' . (string) $returnType;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php
new file mode 100644
index 00000000..639fd69a
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php
@@ -0,0 +1,37 @@
+.
+ */
+
+namespace Doctrine\Common\Reflection;
+
+/**
+ * Finds a class in a PSR-0 structure.
+ *
+ * @author Karoly Negyesi
+ */
+interface ClassFinderInterface
+{
+ /**
+ * Finds a class.
+ *
+ * @param string $class The name of the class.
+ *
+ * @return string|null The name of the class or NULL if not found.
+ */
+ public function findFile($class);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php
new file mode 100644
index 00000000..418bb0f7
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php
@@ -0,0 +1,79 @@
+.
+ */
+
+namespace Doctrine\Common\Reflection;
+
+/**
+ * Finds a class in a PSR-0 structure.
+ *
+ * @author Karoly Negyesi
+ */
+class Psr0FindFile implements ClassFinderInterface
+{
+ /**
+ * The PSR-0 prefixes.
+ *
+ * @var array
+ */
+ protected $prefixes;
+
+ /**
+ * @param array $prefixes An array of prefixes. Each key is a PHP namespace and each value is
+ * a list of directories.
+ */
+ public function __construct($prefixes)
+ {
+ $this->prefixes = $prefixes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function findFile($class)
+ {
+ $lastNsPos = strrpos($class, '\\');
+ if ('\\' == $class[0]) {
+ $class = substr($class, 1);
+ }
+
+ if (false !== $lastNsPos) {
+ // namespaced class name
+ $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $lastNsPos)) . DIRECTORY_SEPARATOR;
+ $className = substr($class, $lastNsPos + 1);
+ } else {
+ // PEAR-like class name
+ $classPath = null;
+ $className = $class;
+ }
+
+ $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
+
+ foreach ($this->prefixes as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (is_file($dir . DIRECTORY_SEPARATOR . $classPath)) {
+ return $dir . DIRECTORY_SEPARATOR . $classPath;
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php
new file mode 100644
index 00000000..3d970eee
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php
@@ -0,0 +1,48 @@
+.
+ */
+
+namespace Doctrine\Common\Reflection;
+
+interface ReflectionProviderInterface
+{
+ /**
+ * Gets the ReflectionClass equivalent for this class.
+ *
+ * @return \ReflectionClass
+ */
+ public function getReflectionClass();
+
+ /**
+ * Gets the ReflectionMethod equivalent for this class.
+ *
+ * @param string $name
+ *
+ * @return \ReflectionMethod
+ */
+ public function getReflectionMethod($name);
+
+ /**
+ * Gets the ReflectionProperty equivalent for this class.
+ *
+ * @param string $name
+ *
+ * @return \ReflectionProperty
+ */
+ public function getReflectionProperty($name);
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php
new file mode 100644
index 00000000..4e8ef530
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php
@@ -0,0 +1,76 @@
+.
+ */
+
+namespace Doctrine\Common\Reflection;
+
+use Doctrine\Common\Proxy\Proxy;
+use ReflectionProperty;
+
+/**
+ * PHP Runtime Reflection Public Property - special overrides for public properties.
+ *
+ * @author Marco Pivetta
+ * @since 2.4
+ */
+class RuntimePublicReflectionProperty extends ReflectionProperty
+{
+ /**
+ * {@inheritDoc}
+ *
+ * Checks is the value actually exist before fetching it.
+ * This is to avoid calling `__get` on the provided $object if it
+ * is a {@see \Doctrine\Common\Proxy\Proxy}.
+ */
+ public function getValue($object = null)
+ {
+ $name = $this->getName();
+
+ if ($object instanceof Proxy && ! $object->__isInitialized()) {
+ $originalInitializer = $object->__getInitializer();
+ $object->__setInitializer(null);
+ $val = isset($object->$name) ? $object->$name : null;
+ $object->__setInitializer($originalInitializer);
+
+ return $val;
+ }
+
+ return isset($object->$name) ? parent::getValue($object) : null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Avoids triggering lazy loading via `__set` if the provided object
+ * is a {@see \Doctrine\Common\Proxy\Proxy}.
+ * @link https://bugs.php.net/bug.php?id=63463
+ */
+ public function setValue($object, $value = null)
+ {
+ if ( ! ($object instanceof Proxy && ! $object->__isInitialized())) {
+ parent::setValue($object, $value);
+
+ return;
+ }
+
+ $originalInitializer = $object->__getInitializer();
+ $object->__setInitializer(null);
+ parent::setValue($object, $value);
+ $object->__setInitializer($originalInitializer);
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php
new file mode 100644
index 00000000..2d0f5b00
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php
@@ -0,0 +1,433 @@
+.
+ */
+
+namespace Doctrine\Common\Reflection;
+
+use ReflectionClass;
+use ReflectionException;
+
+class StaticReflectionClass extends ReflectionClass
+{
+ /**
+ * The static reflection parser object.
+ *
+ * @var StaticReflectionParser
+ */
+ private $staticReflectionParser;
+
+ /**
+ * @param StaticReflectionParser $staticReflectionParser
+ */
+ public function __construct(StaticReflectionParser $staticReflectionParser)
+ {
+ $this->staticReflectionParser = $staticReflectionParser;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
+ {
+ return $this->staticReflectionParser->getClassName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getDocComment()
+ {
+ return $this->staticReflectionParser->getDocComment();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getNamespaceName()
+ {
+ return $this->staticReflectionParser->getNamespaceName();
+ }
+
+ /**
+ * @return array
+ */
+ public function getUseStatements()
+ {
+ return $this->staticReflectionParser->getUseStatements();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethod($name)
+ {
+ return $this->staticReflectionParser->getReflectionMethod($name);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getProperty($name)
+ {
+ return $this->staticReflectionParser->getReflectionProperty($name);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public static function export($argument, $return = false)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getConstant($name)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getConstants()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getConstructor()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getDefaultProperties()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getEndLine()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getExtension()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getExtensionName()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getFileName()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getInterfaceNames()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getInterfaces()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getMethods($filter = null)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getModifiers()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getParentClass()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getProperties($filter = null)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getShortName()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getStartLine()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getStaticProperties()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getStaticPropertyValue($name, $default = '')
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getTraitAliases()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getTraitNames()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getTraits()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function hasConstant($name)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function hasMethod($name)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function hasProperty($name)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function implementsInterface($interface)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function inNamespace()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isAbstract()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isCloneable()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isFinal()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isInstance($object)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isInstantiable()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isInterface()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isInternal()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isIterateable()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isSubclassOf($class)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isTrait()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isUserDefined()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function newInstance($args)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function newInstanceArgs(array $args = [])
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function newInstanceWithoutConstructor()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function setStaticPropertyValue($name, $value)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function __toString()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php
new file mode 100644
index 00000000..8d5380b3
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php
@@ -0,0 +1,362 @@
+.
+ */
+
+namespace Doctrine\Common\Reflection;
+
+use ReflectionException;
+use ReflectionMethod;
+
+class StaticReflectionMethod extends ReflectionMethod
+{
+ /**
+ * The PSR-0 parser object.
+ *
+ * @var StaticReflectionParser
+ */
+ protected $staticReflectionParser;
+
+ /**
+ * The name of the method.
+ *
+ * @var string
+ */
+ protected $methodName;
+
+ /**
+ * @param StaticReflectionParser $staticReflectionParser
+ * @param string $methodName
+ */
+ public function __construct(StaticReflectionParser $staticReflectionParser, $methodName)
+ {
+ $this->staticReflectionParser = $staticReflectionParser;
+ $this->methodName = $methodName;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
+ {
+ return $this->methodName;
+ }
+
+ /**
+ * @return StaticReflectionParser
+ */
+ protected function getStaticReflectionParser()
+ {
+ return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('method', $this->methodName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getDeclaringClass()
+ {
+ return $this->getStaticReflectionParser()->getReflectionClass();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getNamespaceName()
+ {
+ return $this->getStaticReflectionParser()->getNamespaceName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getDocComment()
+ {
+ return $this->getStaticReflectionParser()->getDocComment('method', $this->methodName);
+ }
+
+ /**
+ * @return array
+ */
+ public function getUseStatements()
+ {
+ return $this->getStaticReflectionParser()->getUseStatements();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public static function export($class, $name, $return = false)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClosure($object)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getModifiers()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPrototype()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function invoke($object, $parameter = null)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function invokeArgs($object, array $args)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isAbstract()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isConstructor()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isDestructor()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isFinal()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isPrivate()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isProtected()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isPublic()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isStatic()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function setAccessible($accessible)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function __toString()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getClosureThis()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getEndLine()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getExtension()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getExtensionName()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getFileName()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getNumberOfParameters()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getNumberOfRequiredParameters()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getParameters()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getShortName()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getStartLine()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getStaticVariables()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function inNamespace()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isClosure()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isDeprecated()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isInternal()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isUserDefined()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function returnsReference()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php
new file mode 100644
index 00000000..c48e9ba7
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php
@@ -0,0 +1,307 @@
+.
+ */
+
+namespace Doctrine\Common\Reflection;
+
+use Doctrine\Common\Annotations\TokenParser;
+use ReflectionException;
+
+/**
+ * Parses a file for namespaces/use/class declarations.
+ *
+ * @author Karoly Negyesi
+ */
+class StaticReflectionParser implements ReflectionProviderInterface
+{
+ /**
+ * The fully qualified class name.
+ *
+ * @var string
+ */
+ protected $className;
+
+ /**
+ * The short class name.
+ *
+ * @var string
+ */
+ protected $shortClassName;
+
+ /**
+ * Whether the caller only wants class annotations.
+ *
+ * @var boolean.
+ */
+ protected $classAnnotationOptimize;
+
+ /**
+ * Whether the parser has run.
+ *
+ * @var boolean
+ */
+ protected $parsed = false;
+
+ /**
+ * The namespace of the class.
+ *
+ * @var string
+ */
+ protected $namespace = '';
+
+ /**
+ * The use statements of the class.
+ *
+ * @var array
+ */
+ protected $useStatements = [];
+
+ /**
+ * The docComment of the class.
+ *
+ * @var string
+ */
+ protected $docComment = [
+ 'class' => '',
+ 'property' => [],
+ 'method' => []
+ ];
+
+ /**
+ * The name of the class this class extends, if any.
+ *
+ * @var string
+ */
+ protected $parentClassName = '';
+
+ /**
+ * The parent PSR-0 Parser.
+ *
+ * @var \Doctrine\Common\Reflection\StaticReflectionParser
+ */
+ protected $parentStaticReflectionParser;
+
+ /**
+ * Parses a class residing in a PSR-0 hierarchy.
+ *
+ * @param string $className The full, namespaced class name.
+ * @param ClassFinderInterface $finder A ClassFinder object which finds the class.
+ * @param boolean $classAnnotationOptimize Only retrieve the class docComment.
+ * Presumes there is only one statement per line.
+ */
+ public function __construct($className, $finder, $classAnnotationOptimize = false)
+ {
+ $this->className = ltrim($className, '\\');
+ $lastNsPos = strrpos($this->className, '\\');
+
+ if ($lastNsPos !== false) {
+ $this->namespace = substr($this->className, 0, $lastNsPos);
+ $this->shortClassName = substr($this->className, $lastNsPos + 1);
+ } else {
+ $this->shortClassName = $this->className;
+ }
+
+ $this->finder = $finder;
+ $this->classAnnotationOptimize = $classAnnotationOptimize;
+ }
+
+ /**
+ * @return void
+ */
+ protected function parse()
+ {
+ if ($this->parsed || !$fileName = $this->finder->findFile($this->className)) {
+ return;
+ }
+ $this->parsed = true;
+ $contents = file_get_contents($fileName);
+ if ($this->classAnnotationOptimize) {
+ if (preg_match("/\A.*^\s*((abstract|final)\s+)?class\s+{$this->shortClassName}\s+/sm", $contents, $matches)) {
+ $contents = $matches[0];
+ }
+ }
+ $tokenParser = new TokenParser($contents);
+ $docComment = '';
+ while ($token = $tokenParser->next(false)) {
+ if (is_array($token)) {
+ switch ($token[0]) {
+ case T_USE:
+ $this->useStatements = array_merge($this->useStatements, $tokenParser->parseUseStatement());
+ break;
+ case T_DOC_COMMENT:
+ $docComment = $token[1];
+ break;
+ case T_CLASS:
+ $this->docComment['class'] = $docComment;
+ $docComment = '';
+ break;
+ case T_VAR:
+ case T_PRIVATE:
+ case T_PROTECTED:
+ case T_PUBLIC:
+ $token = $tokenParser->next();
+ if ($token[0] === T_VARIABLE) {
+ $propertyName = substr($token[1], 1);
+ $this->docComment['property'][$propertyName] = $docComment;
+ continue 2;
+ }
+ if ($token[0] !== T_FUNCTION) {
+ // For example, it can be T_FINAL.
+ continue 2;
+ }
+ // No break.
+ case T_FUNCTION:
+ // The next string after function is the name, but
+ // there can be & before the function name so find the
+ // string.
+ while (($token = $tokenParser->next()) && $token[0] !== T_STRING);
+ $methodName = $token[1];
+ $this->docComment['method'][$methodName] = $docComment;
+ $docComment = '';
+ break;
+ case T_EXTENDS:
+ $this->parentClassName = $tokenParser->parseClass();
+ $nsPos = strpos($this->parentClassName, '\\');
+ $fullySpecified = false;
+ if ($nsPos === 0) {
+ $fullySpecified = true;
+ } else {
+ if ($nsPos) {
+ $prefix = strtolower(substr($this->parentClassName, 0, $nsPos));
+ $postfix = substr($this->parentClassName, $nsPos);
+ } else {
+ $prefix = strtolower($this->parentClassName);
+ $postfix = '';
+ }
+ foreach ($this->useStatements as $alias => $use) {
+ if ($alias == $prefix) {
+ $this->parentClassName = '\\' . $use . $postfix;
+ $fullySpecified = true;
+ }
+ }
+ }
+ if (!$fullySpecified) {
+ $this->parentClassName = '\\' . $this->namespace . '\\' . $this->parentClassName;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * @return StaticReflectionParser
+ */
+ protected function getParentStaticReflectionParser()
+ {
+ if (empty($this->parentStaticReflectionParser)) {
+ $this->parentStaticReflectionParser = new static($this->parentClassName, $this->finder);
+ }
+
+ return $this->parentStaticReflectionParser;
+ }
+
+ /**
+ * @return string
+ */
+ public function getClassName()
+ {
+ return $this->className;
+ }
+
+ /**
+ * @return string
+ */
+ public function getNamespaceName()
+ {
+ return $this->namespace;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getReflectionClass()
+ {
+ return new StaticReflectionClass($this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getReflectionMethod($methodName)
+ {
+ return new StaticReflectionMethod($this, $methodName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getReflectionProperty($propertyName)
+ {
+ return new StaticReflectionProperty($this, $propertyName);
+ }
+
+ /**
+ * Gets the use statements from this file.
+ *
+ * @return array
+ */
+ public function getUseStatements()
+ {
+ $this->parse();
+
+ return $this->useStatements;
+ }
+
+ /**
+ * Gets the doc comment.
+ *
+ * @param string $type The type: 'class', 'property' or 'method'.
+ * @param string $name The name of the property or method, not needed for 'class'.
+ *
+ * @return string The doc comment, empty string if none.
+ */
+ public function getDocComment($type = 'class', $name = '')
+ {
+ $this->parse();
+
+ return $name ? $this->docComment[$type][$name] : $this->docComment[$type];
+ }
+
+ /**
+ * Gets the PSR-0 parser for the declaring class.
+ *
+ * @param string $type The type: 'property' or 'method'.
+ * @param string $name The name of the property or method.
+ *
+ * @return StaticReflectionParser A static reflection parser for the declaring class.
+ *
+ * @throws ReflectionException
+ */
+ public function getStaticReflectionParserForDeclaringClass($type, $name)
+ {
+ $this->parse();
+ if (isset($this->docComment[$type][$name])) {
+ return $this;
+ }
+ if (!empty($this->parentClassName)) {
+ return $this->getParentStaticReflectionParser()->getStaticReflectionParserForDeclaringClass($type, $name);
+ }
+ throw new ReflectionException('Invalid ' . $type . ' "' . $name . '"');
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php
new file mode 100644
index 00000000..7f6522bb
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php
@@ -0,0 +1,178 @@
+.
+ */
+
+namespace Doctrine\Common\Reflection;
+
+use ReflectionException;
+use ReflectionProperty;
+
+class StaticReflectionProperty extends ReflectionProperty
+{
+ /**
+ * The PSR-0 parser object.
+ *
+ * @var StaticReflectionParser
+ */
+ protected $staticReflectionParser;
+
+ /**
+ * The name of the property.
+ *
+ * @var string|null
+ */
+ protected $propertyName;
+
+ /**
+ * @param StaticReflectionParser $staticReflectionParser
+ * @param string|null $propertyName
+ */
+ public function __construct(StaticReflectionParser $staticReflectionParser, $propertyName)
+ {
+ $this->staticReflectionParser = $staticReflectionParser;
+ $this->propertyName = $propertyName;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
+ {
+ return $this->propertyName;
+ }
+
+ /**
+ * @return StaticReflectionParser
+ */
+ protected function getStaticReflectionParser()
+ {
+ return $this->staticReflectionParser->getStaticReflectionParserForDeclaringClass('property', $this->propertyName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getDeclaringClass()
+ {
+ return $this->getStaticReflectionParser()->getReflectionClass();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getDocComment()
+ {
+ return $this->getStaticReflectionParser()->getDocComment('property', $this->propertyName);
+ }
+
+ /**
+ * @return array
+ */
+ public function getUseStatements()
+ {
+ return $this->getStaticReflectionParser()->getUseStatements();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public static function export($class, $name, $return = false)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getModifiers()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getValue($object = null)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isDefault()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isPrivate()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isProtected()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isPublic()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isStatic()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function setAccessible($accessible)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function setValue($object, $value = null)
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function __toString()
+ {
+ throw new ReflectionException('Method not implemented');
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php
new file mode 100644
index 00000000..49dc7bb1
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php
@@ -0,0 +1,109 @@
+.
+ */
+
+namespace Doctrine\Common\Util;
+
+use Doctrine\Common\Persistence\Proxy;
+
+/**
+ * Class and reflection related functionality for objects that
+ * might or not be proxy objects at the moment.
+ *
+ * @author Benjamin Eberlei
+ * @author Johannes Schmitt
+ */
+class ClassUtils
+{
+ /**
+ * Gets the real class name of a class name that could be a proxy.
+ *
+ * @param string $class
+ *
+ * @return string
+ */
+ public static function getRealClass($class)
+ {
+ if (false === $pos = strrpos($class, '\\'.Proxy::MARKER.'\\')) {
+ return $class;
+ }
+
+ return substr($class, $pos + Proxy::MARKER_LENGTH + 2);
+ }
+
+ /**
+ * Gets the real class name of an object (even if its a proxy).
+ *
+ * @param object $object
+ *
+ * @return string
+ */
+ public static function getClass($object)
+ {
+ return self::getRealClass(get_class($object));
+ }
+
+ /**
+ * Gets the real parent class name of a class or object.
+ *
+ * @param string $className
+ *
+ * @return string
+ */
+ public static function getParentClass($className)
+ {
+ return get_parent_class( self::getRealClass( $className ) );
+ }
+
+ /**
+ * Creates a new reflection class.
+ *
+ * @param string $class
+ *
+ * @return \ReflectionClass
+ */
+ public static function newReflectionClass($class)
+ {
+ return new \ReflectionClass( self::getRealClass( $class ) );
+ }
+
+ /**
+ * Creates a new reflection object.
+ *
+ * @param object $object
+ *
+ * @return \ReflectionObject
+ */
+ public static function newReflectionObject($object)
+ {
+ return self::newReflectionClass( self::getClass( $object ) );
+ }
+
+ /**
+ * Given a class name and a proxy namespace returns the proxy name.
+ *
+ * @param string $className
+ * @param string $proxyNamespace
+ *
+ * @return string
+ */
+ public static function generateProxyClassName($className, $proxyNamespace)
+ {
+ return rtrim($proxyNamespace, '\\') . '\\'.Proxy::MARKER.'\\' . ltrim($className, '\\');
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php
new file mode 100644
index 00000000..7f675328
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php
@@ -0,0 +1,158 @@
+.
+ */
+
+namespace Doctrine\Common\Util;
+
+use Doctrine\Common\Collections\Collection;
+use Doctrine\Common\Persistence\Proxy;
+
+/**
+ * Static class containing most used debug methods.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Giorgio Sironi
+ */
+final class Debug
+{
+ /**
+ * Private constructor (prevents instantiation).
+ */
+ private function __construct()
+ {
+ }
+
+ /**
+ * Prints a dump of the public, protected and private properties of $var.
+ *
+ * @link http://xdebug.org/
+ *
+ * @param mixed $var The variable to dump.
+ * @param integer $maxDepth The maximum nesting level for object properties.
+ * @param boolean $stripTags Whether output should strip HTML tags.
+ * @param boolean $echo Send the dumped value to the output buffer
+ *
+ * @return string
+ */
+ public static function dump($var, $maxDepth = 2, $stripTags = true, $echo = true)
+ {
+ $html = ini_get('html_errors');
+
+ if ($html !== true) {
+ ini_set('html_errors', true);
+ }
+
+ if (extension_loaded('xdebug')) {
+ ini_set('xdebug.var_display_max_depth', $maxDepth);
+ }
+
+ $var = self::export($var, $maxDepth++);
+
+ ob_start();
+ var_dump($var);
+
+ $dump = ob_get_contents();
+
+ ob_end_clean();
+
+ $dumpText = ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump);
+
+ ini_set('html_errors', $html);
+
+ if ($echo) {
+ echo $dumpText;
+ }
+
+ return $dumpText;
+ }
+
+ /**
+ * @param mixed $var
+ * @param int $maxDepth
+ *
+ * @return mixed
+ */
+ public static function export($var, $maxDepth)
+ {
+ $return = null;
+ $isObj = is_object($var);
+
+ if ($var instanceof Collection) {
+ $var = $var->toArray();
+ }
+
+ if ($maxDepth) {
+ if (is_array($var)) {
+ $return = [];
+
+ foreach ($var as $k => $v) {
+ $return[$k] = self::export($v, $maxDepth - 1);
+ }
+ } else if ($isObj) {
+ $return = new \stdclass();
+ if ($var instanceof \DateTime) {
+ $return->__CLASS__ = "DateTime";
+ $return->date = $var->format('c');
+ $return->timezone = $var->getTimeZone()->getName();
+ } else {
+ $reflClass = ClassUtils::newReflectionObject($var);
+ $return->__CLASS__ = ClassUtils::getClass($var);
+
+ if ($var instanceof Proxy) {
+ $return->__IS_PROXY__ = true;
+ $return->__PROXY_INITIALIZED__ = $var->__isInitialized();
+ }
+
+ if ($var instanceof \ArrayObject || $var instanceof \ArrayIterator) {
+ $return->__STORAGE__ = self::export($var->getArrayCopy(), $maxDepth - 1);
+ }
+
+ foreach ($reflClass->getProperties() as $reflProperty) {
+ $name = $reflProperty->getName();
+
+ $reflProperty->setAccessible(true);
+ $return->$name = self::export($reflProperty->getValue($var), $maxDepth - 1);
+ }
+ }
+ } else {
+ $return = $var;
+ }
+ } else {
+ $return = is_object($var) ? get_class($var)
+ : (is_array($var) ? 'Array(' . count($var) . ')' : $var);
+ }
+
+ return $return;
+ }
+
+ /**
+ * Returns a string representation of an object.
+ *
+ * @param object $obj
+ *
+ * @return string
+ */
+ public static function toString($obj)
+ {
+ return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_hash($obj);
+ }
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php
new file mode 100644
index 00000000..082dc789
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php
@@ -0,0 +1,31 @@
+.
+ */
+
+namespace Doctrine\Common\Util;
+
+use Doctrine\Common\Inflector\Inflector as BaseInflector;
+
+/**
+ * Doctrine inflector has static methods for inflecting text.
+ *
+ * Kept for backwards compatibility reasons, was moved to its own component.
+ */
+class Inflector extends BaseInflector
+{
+}
diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Version.php b/vendor/doctrine/common/lib/Doctrine/Common/Version.php
new file mode 100644
index 00000000..872f169a
--- /dev/null
+++ b/vendor/doctrine/common/lib/Doctrine/Common/Version.php
@@ -0,0 +1,53 @@
+.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * Class to store and retrieve the version of Doctrine.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage