diff --git a/composer.json b/composer.json
index 5fc2504..dca14bf 100644
--- a/composer.json
+++ b/composer.json
@@ -5,15 +5,15 @@
"license": "GPL-2.0+",
"require": {
"sdboyer/gliph": "0.1.*",
- "symfony/class-loader": "2.3.*",
- "symfony/dependency-injection": "2.3.*",
- "symfony/event-dispatcher": "2.3.*",
- "symfony/http-foundation": "2.3.*",
- "symfony/http-kernel": "2.3.*",
- "symfony/routing": "2.3.*",
- "symfony/serializer": "2.3.*",
- "symfony/validator": "2.3.*",
- "symfony/yaml": "2.3.*",
+ "symfony/class-loader": "2.4.*",
+ "symfony/dependency-injection": "2.4.*",
+ "symfony/event-dispatcher": "2.4.*",
+ "symfony/http-foundation": "2.4.*",
+ "symfony/http-kernel": "2.4.*",
+ "symfony/routing": "2.4.*",
+ "symfony/serializer": "2.4.*",
+ "symfony/validator": "2.4.*",
+ "symfony/yaml": "2.4.*",
"twig/twig": "1.15.*",
"doctrine/common": "dev-master#a45d110f71c323e29f41eb0696fa230e3fa1b1b5",
"doctrine/annotations": "dev-master#463d926a8dcc49271cb7db5a08364a70ed6e3cd3",
diff --git a/composer.lock b/composer.lock
index cdfad62..e30fb48 100644
--- a/composer.lock
+++ b/composer.lock
@@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
- "hash": "f6456b9e0dbaab50041a3766d73c954e",
+ "hash": "ac2a8ee2f49fcb0535259847306a2bdc",
"packages": [
{
"name": "doctrine/annotations",
@@ -1220,17 +1220,17 @@
},
{
"name": "symfony/class-loader",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/ClassLoader",
"source": {
"type": "git",
"url": "https://github.com/symfony/ClassLoader.git",
- "reference": "622d370a07321329f5259c6f96d5c636104ad46b"
+ "reference": "6a2ebedbc780130f07b3a15363743d08eb46820c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/622d370a07321329f5259c6f96d5c636104ad46b",
- "reference": "622d370a07321329f5259c6f96d5c636104ad46b",
+ "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/6a2ebedbc780130f07b3a15363743d08eb46820c",
+ "reference": "6a2ebedbc780130f07b3a15363743d08eb46820c",
"shasum": ""
},
"require": {
@@ -1242,7 +1242,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1266,7 +1266,7 @@
],
"description": "Symfony ClassLoader Component",
"homepage": "http://symfony.com",
- "time": "2013-08-13 20:18:00"
+ "time": "2013-11-26 16:40:27"
},
{
"name": "symfony/debug",
@@ -1326,17 +1326,17 @@
},
{
"name": "symfony/dependency-injection",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection.git",
- "reference": "3678aa969e5bfeb8515a1f3047c63e8104723f5c"
+ "reference": "7e5bde3a607dde1f8ddef5180759068ad53d259c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/3678aa969e5bfeb8515a1f3047c63e8104723f5c",
- "reference": "3678aa969e5bfeb8515a1f3047c63e8104723f5c",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/7e5bde3a607dde1f8ddef5180759068ad53d259c",
+ "reference": "7e5bde3a607dde1f8ddef5180759068ad53d259c",
"shasum": ""
},
"require": {
@@ -1344,6 +1344,7 @@
},
"require-dev": {
"symfony/config": "~2.2",
+ "symfony/expression-language": "~2.4",
"symfony/yaml": "~2.0"
},
"suggest": {
@@ -1354,7 +1355,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1378,21 +1379,21 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com",
- "time": "2013-07-25 17:13:25"
+ "time": "2014-01-01 09:02:49"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8"
+ "reference": "e3ba42f6a70554ed05749e61b829550f6ac33601"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/41c9826457c65fa3cf746f214985b7ca9cba42f8",
- "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e3ba42f6a70554ed05749e61b829550f6ac33601",
+ "reference": "e3ba42f6a70554ed05749e61b829550f6ac33601",
"shasum": ""
},
"require": {
@@ -1408,7 +1409,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1432,21 +1433,21 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "time": "2013-12-28 08:12:03"
},
{
"name": "symfony/http-foundation",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
- "reference": "fdf130fe65457aedbc4639a22f4ef9d3be5c002c"
+ "reference": "6c6b8a7bcd7e2cc920cd6acace563fdbf121d844"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/fdf130fe65457aedbc4639a22f4ef9d3be5c002c",
- "reference": "fdf130fe65457aedbc4639a22f4ef9d3be5c002c",
+ "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/6c6b8a7bcd7e2cc920cd6acace563fdbf121d844",
+ "reference": "6c6b8a7bcd7e2cc920cd6acace563fdbf121d844",
"shasum": ""
},
"require": {
@@ -1455,7 +1456,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1482,21 +1483,21 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com",
- "time": "2013-08-26 05:49:51"
+ "time": "2014-01-05 02:10:50"
},
{
"name": "symfony/http-kernel",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel.git",
- "reference": "9d35da40f07bbe7a4f8dfbc41555d2b69de674bf"
+ "reference": "0605eedeb52c4d3a3144128d8336395a57be60d4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/9d35da40f07bbe7a4f8dfbc41555d2b69de674bf",
- "reference": "9d35da40f07bbe7a4f8dfbc41555d2b69de674bf",
+ "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/0605eedeb52c4d3a3144128d8336395a57be60d4",
+ "reference": "0605eedeb52c4d3a3144128d8336395a57be60d4",
"shasum": ""
},
"require": {
@@ -1504,7 +1505,7 @@
"psr/log": "~1.0",
"symfony/debug": "~2.3",
"symfony/event-dispatcher": "~2.1",
- "symfony/http-foundation": "~2.2"
+ "symfony/http-foundation": "~2.4"
},
"require-dev": {
"symfony/browser-kit": "~2.2",
@@ -1529,7 +1530,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1553,7 +1554,7 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com",
- "time": "2013-08-27 08:58:24"
+ "time": "2014-01-05 02:12:11"
},
{
"name": "symfony/process",
@@ -1603,38 +1604,98 @@
"time": "2013-08-22 06:42:25"
},
{
+ "name": "symfony/property-access",
+ "version": "v2.4.1",
+ "target-dir": "Symfony/Component/PropertyAccess",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/PropertyAccess.git",
+ "reference": "274951234150e303c83099a2429be6be35629fe9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/PropertyAccess/zipball/274951234150e303c83099a2429be6be35629fe9",
+ "reference": "274951234150e303c83099a2429be6be35629fe9",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\PropertyAccess\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony PropertyAccess Component",
+ "homepage": "http://symfony.com",
+ "keywords": [
+ "access",
+ "array",
+ "extraction",
+ "index",
+ "injection",
+ "object",
+ "property",
+ "property path",
+ "reflection"
+ ],
+ "time": "2013-11-13 21:30:16"
+ },
+ {
"name": "symfony/routing",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing.git",
- "reference": "69af3f07dbf3ae93dd513dbc373f561cb2e7f143"
+ "reference": "4abfb500aab8be458c9e3a227ea56b190584f78a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Routing/zipball/69af3f07dbf3ae93dd513dbc373f561cb2e7f143",
- "reference": "69af3f07dbf3ae93dd513dbc373f561cb2e7f143",
+ "url": "https://api.github.com/repos/symfony/Routing/zipball/4abfb500aab8be458c9e3a227ea56b190584f78a",
+ "reference": "4abfb500aab8be458c9e3a227ea56b190584f78a",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "doctrine/common": "~2.2",
+ "doctrine/annotations": "~1.0",
"psr/log": "~1.0",
"symfony/config": "~2.2",
+ "symfony/expression-language": "~2.4",
"symfony/yaml": "~2.0"
},
"suggest": {
- "doctrine/common": "",
- "symfony/config": "",
- "symfony/yaml": ""
+ "doctrine/annotations": "For using the annotation loader",
+ "symfony/config": "For using the all-in-one router or any loader",
+ "symfony/expression-language": "For using expression matching",
+ "symfony/yaml": "For using the YAML loader"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1658,21 +1719,27 @@
],
"description": "Symfony Routing Component",
"homepage": "http://symfony.com",
- "time": "2013-08-23 15:14:07"
+ "keywords": [
+ "router",
+ "routing",
+ "uri",
+ "url"
+ ],
+ "time": "2014-01-05 02:10:50"
},
{
"name": "symfony/serializer",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/Serializer",
"source": {
"type": "git",
"url": "https://github.com/symfony/Serializer.git",
- "reference": "457ba76395955926a67ea692957b0872dead5278"
+ "reference": "60c54346958604379392672a3a998650a169a7f4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Serializer/zipball/457ba76395955926a67ea692957b0872dead5278",
- "reference": "457ba76395955926a67ea692957b0872dead5278",
+ "url": "https://api.github.com/repos/symfony/Serializer/zipball/60c54346958604379392672a3a998650a169a7f4",
+ "reference": "60c54346958604379392672a3a998650a169a7f4",
"shasum": ""
},
"require": {
@@ -1681,7 +1748,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1695,17 +1762,39 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com",
+ "homepage": "http://www.jwage.com/",
+ "role": "Creator"
},
{
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com",
+ "homepage": "http://www.instaclick.com"
+ },
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com",
+ "homepage": "http://jmsyst.com",
+ "role": "Developer of wrapped JMSSerializerBundle"
}
],
- "description": "Symfony Serializer Component",
- "homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "description": "Docblock Annotations Parser",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "parser"
+ ],
+ "time": "2014-01-01 08:14:50"
},
{
"name": "symfony/translation",
@@ -1764,31 +1853,35 @@
},
{
"name": "symfony/validator",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/Validator",
"source": {
"type": "git",
"url": "https://github.com/symfony/Validator.git",
- "reference": "8f6f6be47fb8e1179cd225b1f949630e26221e42"
+ "reference": "7ea4e53f8d68bf3ae9cca28765d49d7930618730"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Validator/zipball/8f6f6be47fb8e1179cd225b1f949630e26221e42",
- "reference": "8f6f6be47fb8e1179cd225b1f949630e26221e42",
+ "url": "https://api.github.com/repos/symfony/Validator/zipball/7ea4e53f8d68bf3ae9cca28765d49d7930618730",
+ "reference": "7ea4e53f8d68bf3ae9cca28765d49d7930618730",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
+ "symfony/property-access": "~2.2",
"symfony/translation": "~2.0"
},
"require-dev": {
+ "doctrine/annotations": "~1.0",
+ "doctrine/cache": "~1.0",
"symfony/config": "~2.2",
"symfony/http-foundation": "~2.1",
"symfony/intl": "~2.3",
"symfony/yaml": "~2.0"
},
"suggest": {
- "doctrine/common": "",
+ "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
+ "doctrine/cache": "For using the default cached annotation reader",
"symfony/config": "",
"symfony/http-foundation": "",
"symfony/intl": "",
@@ -1797,7 +1890,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1821,21 +1914,21 @@
],
"description": "Symfony Validator Component",
"homepage": "http://symfony.com",
- "time": "2013-08-24 15:26:22"
+ "time": "2014-01-01 08:14:50"
},
{
"name": "symfony/yaml",
- "version": "v2.3.4",
+ "version": "v2.4.1",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
- "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847"
+ "reference": "4e1a237fc48145fae114b96458d799746ad89aa0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
- "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/4e1a237fc48145fae114b96458d799746ad89aa0",
+ "reference": "4e1a237fc48145fae114b96458d799746ad89aa0",
"shasum": ""
},
"require": {
@@ -1844,7 +1937,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"autoload": {
@@ -1868,7 +1961,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
- "time": "2013-08-24 15:26:22"
+ "time": "2013-12-28 08:12:03"
},
{
"name": "twig/twig",
diff --git a/core/includes/update.inc b/core/includes/update.inc
index c45e013..6af163a 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -92,7 +92,7 @@ function update_check_incompatibility($name, $type = 'module') {
* No access check has been performed when this function is called, so no
* irreversible changes to the database are made here.
*/
-function update_prepare_d8_bootstrap() {
+function ul pdate_prepare_d8_bootstrap() {
include_once __DIR__ . '/install.inc';
include_once __DIR__ . '/schema.inc';
// Bootstrap to configuration.
diff --git a/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php
index a72ca44..eacb5c4 100644
--- a/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php
+++ b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php
@@ -162,7 +162,7 @@ public function processOutbound($path, &$options = array(), Request $request = N
list(, $port) = explode(':', $normalized_base_url);
$options['base_url'] .= ':' . $port;
}
- elseif ($port != 80) {
+ elseif (($url_scheme == 'http' && $port != 80) || ($url_scheme == 'https' && $port != 443)) {
$options['base_url'] .= ':' . $port;
}
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
index 847348e..09cb363 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
@@ -124,7 +124,9 @@ function testDomainNameNegotiationPort() {
// URLs as well.
$index_php = strpos(url('', array('absolute' => TRUE)), 'index.php') !== FALSE;
- $request = $this->prepareRequestForGenerator(TRUE, array('SERVER_PORT' => '88'));
+ $request = Request::createFromGlobals();
+ $server = $request->server->all();
+ $request = $this->prepareRequestForGenerator(TRUE, array('HTTP_HOST' => $server['HTTP_HOST'] . ':88'));
// Create an absolute French link.
$language = language_load('fr');
diff --git a/core/vendor/autoload.php b/core/vendor/autoload.php
index 6b2b286..761d3c9 100644
--- a/core/vendor/autoload.php
+++ b/core/vendor/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInitc8a0ebe8345566b52e82e4437041f111::getLoader();
+return ComposerAutoloaderInitc5ae741a411c3a3172982eb53dd1ca81::getLoader();
diff --git a/core/vendor/composer/autoload_namespaces.php b/core/vendor/composer/autoload_namespaces.php
index f6dbb7c..83fb6ed 100644
--- a/core/vendor/composer/autoload_namespaces.php
+++ b/core/vendor/composer/autoload_namespaces.php
@@ -15,6 +15,7 @@
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'),
'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
+ 'Symfony\\Component\\PropertyAccess\\' => array($vendorDir . '/symfony/property-access'),
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
diff --git a/core/vendor/composer/autoload_real.php b/core/vendor/composer/autoload_real.php
index fecdbf7..43ad6f3 100644
--- a/core/vendor/composer/autoload_real.php
+++ b/core/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInitc8a0ebe8345566b52e82e4437041f111
+class ComposerAutoloaderInitc5ae741a411c3a3172982eb53dd1ca81
{
private static $loader;
@@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInitc8a0ebe8345566b52e82e4437041f111', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInitc5ae741a411c3a3172982eb53dd1ca81', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInitc8a0ebe8345566b52e82e4437041f111', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInitc5ae741a411c3a3172982eb53dd1ca81', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json
index 58681c1..bae5625 100644
--- a/core/vendor/composer/installed.json
+++ b/core/vendor/composer/installed.json
@@ -1088,28 +1088,34 @@
]
},
{
- "name": "symfony/class-loader",
+ "name": "symfony/debug",
"version": "v2.3.4",
"version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/ClassLoader",
+ "target-dir": "Symfony/Component/Debug",
"source": {
"type": "git",
- "url": "https://github.com/symfony/ClassLoader.git",
- "reference": "622d370a07321329f5259c6f96d5c636104ad46b"
+ "url": "https://github.com/symfony/Debug.git",
+ "reference": "729f6d19cfc401c4942e43fcc1059103bd6df130"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/622d370a07321329f5259c6f96d5c636104ad46b",
- "reference": "622d370a07321329f5259c6f96d5c636104ad46b",
+ "url": "https://api.github.com/repos/symfony/Debug/zipball/729f6d19cfc401c4942e43fcc1059103bd6df130",
+ "reference": "729f6d19cfc401c4942e43fcc1059103bd6df130",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "symfony/finder": "~2.0"
+ "symfony/http-foundation": "~2.1",
+ "symfony/http-kernel": "~2.1"
+ },
+ "suggest": {
+ "symfony/class-loader": "",
+ "symfony/http-foundation": "",
+ "symfony/http-kernel": ""
},
- "time": "2013-08-13 20:18:00",
+ "time": "2013-08-08 14:16:10",
"type": "library",
"extra": {
"branch-alias": {
@@ -1119,7 +1125,7 @@
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\ClassLoader\\": ""
+ "Symfony\\Component\\Debug\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1136,38 +1142,37 @@
"homepage": "http://symfony.com/contributors"
}
],
- "description": "Symfony ClassLoader Component",
+ "description": "Symfony Debug Component",
"homepage": "http://symfony.com"
},
{
- "name": "symfony/dependency-injection",
+ "name": "symfony/translation",
"version": "v2.3.4",
"version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/DependencyInjection",
+ "target-dir": "Symfony/Component/Translation",
"source": {
"type": "git",
- "url": "https://github.com/symfony/DependencyInjection.git",
- "reference": "3678aa969e5bfeb8515a1f3047c63e8104723f5c"
+ "url": "https://github.com/symfony/Translation.git",
+ "reference": "65f888291f0896ad492f9abc6dc05c998373aded"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/3678aa969e5bfeb8515a1f3047c63e8104723f5c",
- "reference": "3678aa969e5bfeb8515a1f3047c63e8104723f5c",
+ "url": "https://api.github.com/repos/symfony/Translation/zipball/65f888291f0896ad492f9abc6dc05c998373aded",
+ "reference": "65f888291f0896ad492f9abc6dc05c998373aded",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "symfony/config": "~2.2",
- "symfony/yaml": "~2.0"
+ "symfony/config": "~2.0",
+ "symfony/yaml": "~2.2"
},
"suggest": {
"symfony/config": "",
- "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony/yaml": ""
},
- "time": "2013-07-25 17:13:25",
+ "time": "2013-08-26 05:49:51",
"type": "library",
"extra": {
"branch-alias": {
@@ -1177,7 +1182,7 @@
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\DependencyInjection\\": ""
+ "Symfony\\Component\\Translation\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1194,38 +1199,29 @@
"homepage": "http://symfony.com/contributors"
}
],
- "description": "Symfony DependencyInjection Component",
+ "description": "Symfony Translation Component",
"homepage": "http://symfony.com"
},
{
- "name": "symfony/debug",
+ "name": "symfony/process",
"version": "v2.3.4",
"version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/Debug",
+ "target-dir": "Symfony/Component/Process",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Debug.git",
- "reference": "729f6d19cfc401c4942e43fcc1059103bd6df130"
+ "url": "https://github.com/symfony/Process.git",
+ "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Debug/zipball/729f6d19cfc401c4942e43fcc1059103bd6df130",
- "reference": "729f6d19cfc401c4942e43fcc1059103bd6df130",
+ "url": "https://api.github.com/repos/symfony/Process/zipball/1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
+ "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "require-dev": {
- "symfony/http-foundation": "~2.1",
- "symfony/http-kernel": "~2.1"
- },
- "suggest": {
- "symfony/class-loader": "",
- "symfony/http-foundation": "",
- "symfony/http-kernel": ""
- },
- "time": "2013-08-08 14:16:10",
+ "time": "2013-08-22 06:42:25",
"type": "library",
"extra": {
"branch-alias": {
@@ -1235,61 +1231,9 @@
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\Debug\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
- }
- ],
- "description": "Symfony Debug Component",
- "homepage": "http://symfony.com"
- },
- {
- "name": "symfony/http-foundation",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/HttpFoundation",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/HttpFoundation.git",
- "reference": "fdf130fe65457aedbc4639a22f4ef9d3be5c002c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/fdf130fe65457aedbc4639a22f4ef9d3be5c002c",
- "reference": "fdf130fe65457aedbc4639a22f4ef9d3be5c002c",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "time": "2013-08-26 05:49:51",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3-dev"
+ "Symfony\\Component\\Process\\": ""
}
},
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Symfony\\Component\\HttpFoundation\\": ""
- },
- "classmap": [
- "Symfony/Component/HttpFoundation/Resources/stubs"
- ]
- },
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
@@ -1304,46 +1248,33 @@
"homepage": "http://symfony.com/contributors"
}
],
- "description": "Symfony HttpFoundation Component",
+ "description": "Symfony Process Component",
"homepage": "http://symfony.com"
},
{
- "name": "symfony/event-dispatcher",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/EventDispatcher",
+ "name": "sdboyer/gliph",
+ "version": "0.1.4",
+ "version_normalized": "0.1.4.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8"
+ "url": "https://github.com/sdboyer/gliph.git",
+ "reference": "aad932ef7d808105341cc9a36538e9fe2cb5ee82"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/41c9826457c65fa3cf746f214985b7ca9cba42f8",
- "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8",
+ "url": "https://api.github.com/repos/sdboyer/gliph/zipball/aad932ef7d808105341cc9a36538e9fe2cb5ee82",
+ "reference": "aad932ef7d808105341cc9a36538e9fe2cb5ee82",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "symfony/dependency-injection": "~2.0"
- },
- "suggest": {
- "symfony/dependency-injection": "",
- "symfony/http-kernel": ""
+ "php": ">=5.3"
},
- "time": "2013-07-21 12:12:18",
+ "time": "2013-09-27 01:15:21",
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3-dev"
- }
- },
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\EventDispatcher\\": ""
+ "Gliph": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1352,71 +1283,61 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "name": "Sam Boyer",
+ "email": "tech@samboyer.org"
}
],
- "description": "Symfony EventDispatcher Component",
- "homepage": "http://symfony.com"
+ "description": "A graph library for PHP.",
+ "homepage": "http://github.com/sdboyer/gliph",
+ "keywords": [
+ "gliph",
+ "graph",
+ "library",
+ "php",
+ "spl"
+ ]
},
{
- "name": "symfony/http-kernel",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/HttpKernel",
+ "name": "symfony-cmf/routing",
+ "version": "1.1.0",
+ "version_normalized": "1.1.0.0",
+ "target-dir": "Symfony/Cmf/Component/Routing",
"source": {
"type": "git",
- "url": "https://github.com/symfony/HttpKernel.git",
- "reference": "9d35da40f07bbe7a4f8dfbc41555d2b69de674bf"
+ "url": "https://github.com/symfony-cmf/Routing.git",
+ "reference": "9f8607950cbf888ec678713a35f3d0088857c85f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/9d35da40f07bbe7a4f8dfbc41555d2b69de674bf",
- "reference": "9d35da40f07bbe7a4f8dfbc41555d2b69de674bf",
+ "url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/9f8607950cbf888ec678713a35f3d0088857c85f",
+ "reference": "9f8607950cbf888ec678713a35f3d0088857c85f",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"psr/log": "~1.0",
- "symfony/debug": "~2.3",
- "symfony/event-dispatcher": "~2.1",
- "symfony/http-foundation": "~2.2"
+ "symfony/http-kernel": "~2.2",
+ "symfony/routing": "~2.2"
},
"require-dev": {
- "symfony/browser-kit": "~2.2",
- "symfony/class-loader": "~2.1",
- "symfony/config": "~2.0",
- "symfony/console": "~2.2",
+ "symfony/config": "~2.2",
"symfony/dependency-injection": "~2.0",
- "symfony/finder": "~2.0",
- "symfony/process": "~2.0",
- "symfony/routing": "~2.2",
- "symfony/stopwatch": "~2.2",
- "symfony/templating": "~2.2"
+ "symfony/event-dispatcher": "~2.1"
},
"suggest": {
- "symfony/browser-kit": "",
- "symfony/class-loader": "",
- "symfony/config": "",
- "symfony/console": "",
- "symfony/dependency-injection": "",
- "symfony/finder": ""
+ "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version ~2.1"
},
- "time": "2013-08-27 08:58:24",
+ "time": "2013-10-14 15:32:46",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "1.1-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\HttpKernel\\": ""
+ "Symfony\\Cmf\\Component\\Routing": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1425,107 +1346,97 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "name": "Symfony CMF Community",
+ "homepage": "https://github.com/symfony-cmf/Routing/contributors"
}
],
- "description": "Symfony HttpKernel Component",
- "homepage": "http://symfony.com"
+ "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers",
+ "homepage": "http://cmf.symfony.com",
+ "keywords": [
+ "database",
+ "routing"
+ ]
},
{
- "name": "symfony/routing",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/Routing",
+ "name": "phpunit/php-file-iterator",
+ "version": "1.3.4",
+ "version_normalized": "1.3.4.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Routing.git",
- "reference": "69af3f07dbf3ae93dd513dbc373f561cb2e7f143"
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Routing/zipball/69af3f07dbf3ae93dd513dbc373f561cb2e7f143",
- "reference": "69af3f07dbf3ae93dd513dbc373f561cb2e7f143",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
+ "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "require-dev": {
- "doctrine/common": "~2.2",
- "psr/log": "~1.0",
- "symfony/config": "~2.2",
- "symfony/yaml": "~2.0"
- },
- "suggest": {
- "doctrine/common": "",
- "symfony/config": "",
- "symfony/yaml": ""
- },
- "time": "2013-08-23 15:14:07",
+ "time": "2013-10-10 15:34:57",
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3-dev"
- }
- },
"installation-source": "dist",
"autoload": {
- "psr-0": {
- "Symfony\\Component\\Routing\\": ""
- }
+ "classmap": [
+ "File/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
"license": [
- "MIT"
+ "BSD-3-Clause"
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
}
],
- "description": "Symfony Routing Component",
- "homepage": "http://symfony.com"
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ]
},
{
- "name": "symfony/serializer",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/Serializer",
+ "name": "doctrine/annotations",
+ "version": "dev-master",
+ "version_normalized": "9999999-dev",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Serializer.git",
- "reference": "457ba76395955926a67ea692957b0872dead5278"
+ "url": "https://github.com/doctrine/annotations.git",
+ "reference": "463d926a8dcc49271cb7db5a08364a70ed6e3cd3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Serializer/zipball/457ba76395955926a67ea692957b0872dead5278",
- "reference": "457ba76395955926a67ea692957b0872dead5278",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/463d926a8dcc49271cb7db5a08364a70ed6e3cd3",
+ "reference": "463d926a8dcc49271cb7db5a08364a70ed6e3cd3",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "doctrine/lexer": "1.*",
+ "php": ">=5.3.2"
},
- "time": "2013-07-21 12:12:18",
+ "require-dev": {
+ "doctrine/cache": "1.*"
+ },
+ "time": "2013-11-19 05:59:59",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "1.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\Serializer\\": ""
+ "Doctrine\\Common\\Annotations\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1534,55 +1445,72 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com",
+ "homepage": "http://www.jwage.com/",
+ "role": "Creator"
},
{
- "name": "Symfony Community",
- "homepage": "http://symfony.com/contributors"
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com",
+ "homepage": "http://www.instaclick.com"
+ },
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com",
+ "homepage": "http://jmsyst.com",
+ "role": "Developer of wrapped JMSSerializerBundle"
}
],
- "description": "Symfony Serializer Component",
- "homepage": "http://symfony.com"
+ "description": "Docblock Annotations Parser",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "parser"
+ ]
},
{
- "name": "symfony/translation",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/Translation",
+ "name": "symfony/class-loader",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/ClassLoader",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Translation.git",
- "reference": "65f888291f0896ad492f9abc6dc05c998373aded"
+ "url": "https://github.com/symfony/ClassLoader.git",
+ "reference": "6a2ebedbc780130f07b3a15363743d08eb46820c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Translation/zipball/65f888291f0896ad492f9abc6dc05c998373aded",
- "reference": "65f888291f0896ad492f9abc6dc05c998373aded",
+ "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/6a2ebedbc780130f07b3a15363743d08eb46820c",
+ "reference": "6a2ebedbc780130f07b3a15363743d08eb46820c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
- "symfony/config": "~2.0",
- "symfony/yaml": "~2.2"
- },
- "suggest": {
- "symfony/config": "",
- "symfony/yaml": ""
+ "symfony/finder": "~2.0"
},
- "time": "2013-08-26 05:49:51",
+ "time": "2013-11-26 16:40:27",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\Translation\\": ""
+ "Symfony\\Component\\ClassLoader\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1599,53 +1527,49 @@
"homepage": "http://symfony.com/contributors"
}
],
- "description": "Symfony Translation Component",
+ "description": "Symfony ClassLoader Component",
"homepage": "http://symfony.com"
},
{
- "name": "symfony/validator",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/Validator",
+ "name": "symfony/dependency-injection",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Validator.git",
- "reference": "8f6f6be47fb8e1179cd225b1f949630e26221e42"
+ "url": "https://github.com/symfony/DependencyInjection.git",
+ "reference": "7e5bde3a607dde1f8ddef5180759068ad53d259c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Validator/zipball/8f6f6be47fb8e1179cd225b1f949630e26221e42",
- "reference": "8f6f6be47fb8e1179cd225b1f949630e26221e42",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/7e5bde3a607dde1f8ddef5180759068ad53d259c",
+ "reference": "7e5bde3a607dde1f8ddef5180759068ad53d259c",
"shasum": ""
},
"require": {
- "php": ">=5.3.3",
- "symfony/translation": "~2.0"
+ "php": ">=5.3.3"
},
"require-dev": {
"symfony/config": "~2.2",
- "symfony/http-foundation": "~2.1",
- "symfony/intl": "~2.3",
+ "symfony/expression-language": "~2.4",
"symfony/yaml": "~2.0"
},
"suggest": {
- "doctrine/common": "",
"symfony/config": "",
- "symfony/http-foundation": "",
- "symfony/intl": "",
+ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony/yaml": ""
},
- "time": "2013-08-24 15:26:22",
+ "time": "2014-01-01 09:02:49",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\Validator\\": ""
+ "Symfony\\Component\\DependencyInjection\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1662,40 +1586,43 @@
"homepage": "http://symfony.com/contributors"
}
],
- "description": "Symfony Validator Component",
+ "description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com"
},
{
- "name": "symfony/yaml",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/Yaml",
+ "name": "symfony/http-foundation",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Yaml.git",
- "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847"
+ "url": "https://github.com/symfony/HttpFoundation.git",
+ "reference": "6c6b8a7bcd7e2cc920cd6acace563fdbf121d844"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
- "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
+ "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/6c6b8a7bcd7e2cc920cd6acace563fdbf121d844",
+ "reference": "6c6b8a7bcd7e2cc920cd6acace563fdbf121d844",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "time": "2013-08-24 15:26:22",
+ "time": "2014-01-05 02:10:50",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\Yaml\\": ""
- }
+ "Symfony\\Component\\HttpFoundation\\": ""
+ },
+ "classmap": [
+ "Symfony/Component/HttpFoundation/Resources/stubs"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1711,39 +1638,46 @@
"homepage": "http://symfony.com/contributors"
}
],
- "description": "Symfony Yaml Component",
+ "description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com"
},
{
- "name": "symfony/process",
- "version": "v2.3.4",
- "version_normalized": "2.3.4.0",
- "target-dir": "Symfony/Component/Process",
+ "name": "symfony/event-dispatcher",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Process.git",
- "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b"
+ "url": "https://github.com/symfony/EventDispatcher.git",
+ "reference": "e3ba42f6a70554ed05749e61b829550f6ac33601"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Process/zipball/1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
- "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e3ba42f6a70554ed05749e61b829550f6ac33601",
+ "reference": "e3ba42f6a70554ed05749e61b829550f6ac33601",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "time": "2013-08-22 06:42:25",
+ "require-dev": {
+ "symfony/dependency-injection": "~2.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "time": "2013-12-28 08:12:03",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Component\\Process\\": ""
+ "Symfony\\Component\\EventDispatcher\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1760,96 +1694,63 @@
"homepage": "http://symfony.com/contributors"
}
],
- "description": "Symfony Process Component",
- "homepage": "http://symfony.com"
- },
- {
- "name": "sdboyer/gliph",
- "version": "0.1.4",
- "version_normalized": "0.1.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/sdboyer/gliph.git",
- "reference": "aad932ef7d808105341cc9a36538e9fe2cb5ee82"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sdboyer/gliph/zipball/aad932ef7d808105341cc9a36538e9fe2cb5ee82",
- "reference": "aad932ef7d808105341cc9a36538e9fe2cb5ee82",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "time": "2013-09-27 01:15:21",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Gliph": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Sam Boyer",
- "email": "tech@samboyer.org"
- }
- ],
- "description": "A graph library for PHP.",
- "homepage": "http://github.com/sdboyer/gliph",
- "keywords": [
- "gliph",
- "graph",
- "library",
- "php",
- "spl"
- ]
- },
- {
- "name": "symfony-cmf/routing",
- "version": "1.1.0",
- "version_normalized": "1.1.0.0",
- "target-dir": "Symfony/Cmf/Component/Routing",
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "http://symfony.com"
+ },
+ {
+ "name": "symfony/http-kernel",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
- "url": "https://github.com/symfony-cmf/Routing.git",
- "reference": "9f8607950cbf888ec678713a35f3d0088857c85f"
+ "url": "https://github.com/symfony/HttpKernel.git",
+ "reference": "0605eedeb52c4d3a3144128d8336395a57be60d4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/9f8607950cbf888ec678713a35f3d0088857c85f",
- "reference": "9f8607950cbf888ec678713a35f3d0088857c85f",
+ "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/0605eedeb52c4d3a3144128d8336395a57be60d4",
+ "reference": "0605eedeb52c4d3a3144128d8336395a57be60d4",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"psr/log": "~1.0",
- "symfony/http-kernel": "~2.2",
- "symfony/routing": "~2.2"
+ "symfony/debug": "~2.3",
+ "symfony/event-dispatcher": "~2.1",
+ "symfony/http-foundation": "~2.4"
},
"require-dev": {
- "symfony/config": "~2.2",
+ "symfony/browser-kit": "~2.2",
+ "symfony/class-loader": "~2.1",
+ "symfony/config": "~2.0",
+ "symfony/console": "~2.2",
"symfony/dependency-injection": "~2.0",
- "symfony/event-dispatcher": "~2.1"
+ "symfony/finder": "~2.0",
+ "symfony/process": "~2.0",
+ "symfony/routing": "~2.2",
+ "symfony/stopwatch": "~2.2",
+ "symfony/templating": "~2.2"
},
"suggest": {
- "symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version ~2.1"
+ "symfony/browser-kit": "",
+ "symfony/class-loader": "",
+ "symfony/config": "",
+ "symfony/console": "",
+ "symfony/dependency-injection": "",
+ "symfony/finder": ""
},
- "time": "2013-10-14 15:32:46",
+ "time": "2014-01-05 02:12:11",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1-dev"
+ "dev-master": "2.4-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Symfony\\Cmf\\Component\\Routing": ""
+ "Symfony\\Component\\HttpKernel\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1858,97 +1759,115 @@
],
"authors": [
{
- "name": "Symfony CMF Community",
- "homepage": "https://github.com/symfony-cmf/Routing/contributors"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
}
],
- "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers",
- "homepage": "http://cmf.symfony.com",
- "keywords": [
- "database",
- "routing"
- ]
+ "description": "Symfony HttpKernel Component",
+ "homepage": "http://symfony.com"
},
{
- "name": "phpunit/php-file-iterator",
- "version": "1.3.4",
- "version_normalized": "1.3.4.0",
+ "name": "symfony/routing",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
+ "url": "https://github.com/symfony/Routing.git",
+ "reference": "4abfb500aab8be458c9e3a227ea56b190584f78a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
- "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
+ "url": "https://api.github.com/repos/symfony/Routing/zipball/4abfb500aab8be458c9e3a227ea56b190584f78a",
+ "reference": "4abfb500aab8be458c9e3a227ea56b190584f78a",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "time": "2013-10-10 15:34:57",
+ "require-dev": {
+ "doctrine/annotations": "~1.0",
+ "psr/log": "~1.0",
+ "symfony/config": "~2.2",
+ "symfony/expression-language": "~2.4",
+ "symfony/yaml": "~2.0"
+ },
+ "suggest": {
+ "doctrine/annotations": "For using the annotation loader",
+ "symfony/config": "For using the all-in-one router or any loader",
+ "symfony/expression-language": "For using expression matching",
+ "symfony/yaml": "For using the YAML loader"
+ },
+ "time": "2014-01-05 02:10:50",
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4-dev"
+ }
+ },
"installation-source": "dist",
"autoload": {
- "classmap": [
- "File/"
- ]
+ "psr-0": {
+ "Symfony\\Component\\Routing\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
- "include-path": [
- ""
- ],
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
}
],
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "description": "Symfony Routing Component",
+ "homepage": "http://symfony.com",
"keywords": [
- "filesystem",
- "iterator"
+ "router",
+ "routing",
+ "uri",
+ "url"
]
},
{
- "name": "doctrine/annotations",
- "version": "dev-master",
- "version_normalized": "9999999-dev",
+ "name": "symfony/serializer",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/Serializer",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/annotations.git",
- "reference": "463d926a8dcc49271cb7db5a08364a70ed6e3cd3"
+ "url": "https://github.com/symfony/Serializer.git",
+ "reference": "60c54346958604379392672a3a998650a169a7f4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/463d926a8dcc49271cb7db5a08364a70ed6e3cd3",
- "reference": "463d926a8dcc49271cb7db5a08364a70ed6e3cd3",
+ "url": "https://api.github.com/repos/symfony/Serializer/zipball/60c54346958604379392672a3a998650a169a7f4",
+ "reference": "60c54346958604379392672a3a998650a169a7f4",
"shasum": ""
},
"require": {
- "doctrine/lexer": "1.*",
- "php": ">=5.3.2"
- },
- "require-dev": {
- "doctrine/cache": "1.*"
+ "php": ">=5.3.3"
},
- "time": "2013-11-19 05:59:59",
+ "time": "2014-01-01 08:14:50",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "2.4-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
- "Doctrine\\Common\\Annotations\\": "lib/"
+ "Symfony\\Component\\Serializer\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2120,5 +2039,181 @@
"persistence",
"spl"
]
+ },
+ {
+ "name": "symfony/property-access",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/PropertyAccess",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/PropertyAccess.git",
+ "reference": "274951234150e303c83099a2429be6be35629fe9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/PropertyAccess/zipball/274951234150e303c83099a2429be6be35629fe9",
+ "reference": "274951234150e303c83099a2429be6be35629fe9",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "time": "2013-11-13 21:30:16",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\PropertyAccess\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony PropertyAccess Component",
+ "homepage": "http://symfony.com",
+ "keywords": [
+ "access",
+ "array",
+ "extraction",
+ "index",
+ "injection",
+ "object",
+ "property",
+ "property path",
+ "reflection"
+ ]
+ },
+ {
+ "name": "symfony/validator",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/Validator",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Validator.git",
+ "reference": "7ea4e53f8d68bf3ae9cca28765d49d7930618730"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Validator/zipball/7ea4e53f8d68bf3ae9cca28765d49d7930618730",
+ "reference": "7ea4e53f8d68bf3ae9cca28765d49d7930618730",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/property-access": "~2.2",
+ "symfony/translation": "~2.0"
+ },
+ "require-dev": {
+ "doctrine/annotations": "~1.0",
+ "doctrine/cache": "~1.0",
+ "symfony/config": "~2.2",
+ "symfony/http-foundation": "~2.1",
+ "symfony/intl": "~2.3",
+ "symfony/yaml": "~2.0"
+ },
+ "suggest": {
+ "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
+ "doctrine/cache": "For using the default cached annotation reader",
+ "symfony/config": "",
+ "symfony/http-foundation": "",
+ "symfony/intl": "",
+ "symfony/yaml": ""
+ },
+ "time": "2014-01-01 08:14:50",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Validator\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Validator Component",
+ "homepage": "http://symfony.com"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v2.4.1",
+ "version_normalized": "2.4.1.0",
+ "target-dir": "Symfony/Component/Yaml",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Yaml.git",
+ "reference": "4e1a237fc48145fae114b96458d799746ad89aa0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/4e1a237fc48145fae114b96458d799746ad89aa0",
+ "reference": "4e1a237fc48145fae114b96458d799746ad89aa0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "time": "2013-12-28 08:12:03",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.4-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Yaml\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "http://symfony.com"
}
]
diff --git a/core/vendor/doctrine/common/.gitignore b/core/vendor/doctrine/common/.gitignore
deleted file mode 100644
index b15c686..0000000
--- a/core/vendor/doctrine/common/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-build/
-logs/
-reports/
-dist/
-tests/Doctrine/Tests/Common/Proxy/generated/
-vendor/
-.idea
-composer.lock
-doctrine-common-*.tar
-doctrine-common-*.tar.gz
diff --git a/core/vendor/doctrine/common/.gitmodules b/core/vendor/doctrine/common/.gitmodules
deleted file mode 100644
index 51f0843..0000000
--- a/core/vendor/doctrine/common/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "lib/vendor/doctrine-build-common"]
- path = lib/vendor/doctrine-build-common
- url = git://github.com/doctrine/doctrine-build-common.git
diff --git a/core/vendor/doctrine/common/.travis.yml b/core/vendor/doctrine/common/.travis.yml
deleted file mode 100644
index 3344d11..0000000
--- a/core/vendor/doctrine/common/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-language: php
-
-php:
- - 5.3.3
- - 5.3
- - 5.4
- - 5.5
- - hhvm
-
-before_script:
- - composer --prefer-source install
-
-script:
- - ./vendor/bin/phpunit
-
-matrix:
- allow_failures:
- - php: hhvm
diff --git a/core/vendor/doctrine/common/README.md b/core/vendor/doctrine/common/README.md
deleted file mode 100644
index c63f762..0000000
--- a/core/vendor/doctrine/common/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Doctrine Common
-
-[](http://travis-ci.org/doctrine/common)
-
-The Doctrine Common project is a library that provides extensions to core PHP functionality.
-
-## More resources:
-
-* [Website](http://www.doctrine-project.org)
-* [Documentation](http://www.doctrine-project.org/projects/common/current/docs/en)
-* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DCOM)
-* [Downloads](http://github.com/doctrine/common/downloads)
diff --git a/core/vendor/doctrine/common/UPGRADE_TO_2_1 b/core/vendor/doctrine/common/UPGRADE_TO_2_1
deleted file mode 100644
index 891a2e5..0000000
--- a/core/vendor/doctrine/common/UPGRADE_TO_2_1
+++ /dev/null
@@ -1,39 +0,0 @@
-This document details all the possible changes that you should investigate when updating
-your project from Doctrine Common 2.0.x to 2.1
-
-## AnnotationReader changes
-
-The annotation reader was heavily refactored between 2.0 and 2.1-RC1. In theory the operation of the new reader should be backwards compatible, but it has to be setup differently to work that way:
-
- $reader = new \Doctrine\Common\Annotations\AnnotationReader();
- $reader->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/core/vendor/doctrine/common/UPGRADE_TO_2_2 b/core/vendor/doctrine/common/UPGRADE_TO_2_2
deleted file mode 100644
index 1d93a13..0000000
--- a/core/vendor/doctrine/common/UPGRADE_TO_2_2
+++ /dev/null
@@ -1,61 +0,0 @@
-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/core/vendor/doctrine/common/build.properties b/core/vendor/doctrine/common/build.properties
deleted file mode 100644
index ef51d20..0000000
--- a/core/vendor/doctrine/common/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# Version class and file
-project.version_class = Doctrine\\Common\\Version
-project.version_file = lib/Doctrine/Common/Version.php
diff --git a/core/vendor/doctrine/common/build.xml b/core/vendor/doctrine/common/build.xml
deleted file mode 100644
index 429b768..0000000
--- a/core/vendor/doctrine/common/build.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/core/vendor/doctrine/common/composer.json b/core/vendor/doctrine/common/composer.json
deleted file mode 100644
index 4f4f215..0000000
--- a/core/vendor/doctrine/common/composer.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "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.3.2",
- "doctrine/inflector": "1.*",
- "doctrine/cache": "1.*",
- "doctrine/collections": "1.*",
- "doctrine/lexer": "1.*",
- "doctrine/annotations": "1.*"
- },
- "minimum-stability": "dev",
- "require-dev": {
- "phpunit/phpunit": "~3.7"
- },
- "autoload": {
- "psr-0": { "Doctrine\\Common\\": "lib/" }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "2.5.x-dev"
- }
- },
- "archive": {
- "exclude": ["!vendor", "tests", "*phpunit.xml", ".travis.yml", "build.xml", "build.properties", "composer.phar"]
- }
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php b/core/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php
deleted file mode 100644
index 632805e..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php
+++ /dev/null
@@ -1,288 +0,0 @@
-.
- */
-
-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
- */
-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(array($this, 'loadClass'));
- }
-
- /**
- * Removes this ClassLoader from the SPL autoload stack.
- *
- * @return void
- */
- public function unregister()
- {
- spl_autoload_unregister(array($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 ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) {
- return false;
- }
-
- require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
- . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className)
- . $this->fileExtension;
-
- return true;
- }
-
- /**
- * 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)
- {
- if (class_exists($className, false) || interface_exists($className, false)) {
- return true;
- }
-
- foreach (spl_autoload_functions() as $loader) {
- if (is_array($loader)) { // array(???, ???)
- if (is_object($loader[0])) {
- if ($loader[0] instanceof ClassLoader) { // array($obj, 'methodName')
- if ($loader[0]->canLoadClass($className)) {
- return true;
- }
- } else if ($loader[0]->{$loader[1]}($className)) {
- return true;
- }
- } else if ($loader[0]::$loader[1]($className)) { // array('ClassName', 'methodName')
- return true;
- }
- } else if ($loader instanceof \Closure) { // function($className) {..}
- if ($loader($className)) {
- return true;
- }
- } else if (is_string($loader) && $loader($className)) { // "MyClass::loadClass"
- return true;
- }
-
- if (class_exists($className, false) || interface_exists($className, false)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * 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)
- && $loader[0] instanceof ClassLoader
- && $loader[0]->canLoadClass($className)
- ) {
- return $loader[0];
- }
- }
-
- return null;
- }
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php
deleted file mode 100644
index 2a1a08e..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php
+++ /dev/null
@@ -1,29 +0,0 @@
-.
- */
-
-namespace Doctrine\Common;
-
-/**
- * Base exception class for package Doctrine\Common.
- *
- * @author heinrich
- */
-class CommonException extends \Exception
-{
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php
deleted file mode 100644
index 8cd02c9..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php
+++ /dev/null
@@ -1,46 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php
deleted file mode 100644
index 75506e6..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php
+++ /dev/null
@@ -1,67 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php b/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php
deleted file mode 100644
index 69eb17e..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php
+++ /dev/null
@@ -1,154 +0,0 @@
-.
- */
-
-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 = array();
-
- /**
- * 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/core/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php b/core/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php
deleted file mode 100644
index 55d0f7d..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php
+++ /dev/null
@@ -1,42 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
deleted file mode 100644
index 0aa07f8..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
+++ /dev/null
@@ -1,37 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php b/core/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php
deleted file mode 100644
index e25e999..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php
+++ /dev/null
@@ -1,42 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
deleted file mode 100644
index 15b5aa3..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
+++ /dev/null
@@ -1,259 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence;
-
-use Doctrine\Common\Persistence\ManagerRegistry;
-
-/**
- * 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 = array();
- 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);
- $class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName;
- }
-
- $proxyClass = new \ReflectionClass($class);
- if ($proxyClass->implementsInterface($this->proxyInterfaceName)) {
- $class = $proxyClass->getParentClass()->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 = array();
- 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]);
- }
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php
deleted file mode 100644
index 7c25e98..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php
+++ /dev/null
@@ -1,62 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
deleted file mode 100644
index 52f41c0..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
+++ /dev/null
@@ -1,89 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
deleted file mode 100644
index 07770bb..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
+++ /dev/null
@@ -1,75 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence\Event;
-
-use Doctrine\Common\EventArgs;
-use Doctrine\Common\Persistence\ObjectManager;
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
-
-/**
- * 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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
deleted file mode 100644
index 5527d4d..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
+++ /dev/null
@@ -1,59 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
deleted file mode 100644
index b78bad9..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
+++ /dev/null
@@ -1,86 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
deleted file mode 100644
index d34de84..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
+++ /dev/null
@@ -1,138 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence\Event;
-
-use Doctrine\Common\EventArgs;
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php
deleted file mode 100644
index fce854b..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php
+++ /dev/null
@@ -1,111 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
deleted file mode 100644
index 01ad58f..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
+++ /dev/null
@@ -1,401 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence\Mapping;
-
-use Doctrine\Common\Cache\Cache;
-use Doctrine\Common\Util\ClassUtils;
-
-/**
- * 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 array
- */
- private $loadedMetadata = array();
-
- /**
- * @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 array
- */
- 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 = array();
- 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 \Doctrine\Common\Persistence\Mapping\ClassMetadata
- */
- public function getMetadataFor($className)
- {
- if (isset($this->loadedMetadata[$className])) {
- return $this->loadedMetadata[$className];
- }
-
- $realClassName = $className;
-
- // Check for namespace alias
- if (strpos($className, ':') !== false) {
- list($namespaceAlias, $simpleClassName) = explode(':', $className);
- $realClassName = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName);
- } else {
- $realClassName = ClassUtils::getRealClass($realClassName);
- }
-
- if (isset($this->loadedMetadata[$realClassName])) {
- // We do not have the alias name in the map, include it
- $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
-
- return $this->loadedMetadata[$realClassName];
- }
-
- if ($this->cacheDriver) {
- if (($cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt)) !== false) {
- $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);
- }
-
- 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 = array();
- 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 = array();
-
- $parentClasses = $this->getParentClasses($name);
- $parentClasses[] = $name;
-
- // Move down the hierarchy of parent classes, starting from the topmost class
- $parent = null;
- $rootEntityFound = false;
- $visited = array();
- $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;
- }
-
- /**
- * 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);
- $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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
deleted file mode 100644
index b8445f1..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
+++ /dev/null
@@ -1,174 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
deleted file mode 100644
index 3d82881..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
+++ /dev/null
@@ -1,76 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
deleted file mode 100644
index 1737243..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
+++ /dev/null
@@ -1,217 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence\Mapping\Driver;
-
-use Doctrine\Common\Annotations\AnnotationReader;
-use Doctrine\Common\Annotations\AnnotationRegistry;
-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 = array();
-
- /**
- * 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 = array();
-
- /**
- * 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;
- }
-
- /**
- * Retrieves 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 = array();
- $includedFiles = array();
-
- 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 = realpath($file[0]);
-
- 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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
deleted file mode 100644
index 6a9e276..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
+++ /dev/null
@@ -1,173 +0,0 @@
-.
- */
-
-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 = array();
-
- /**
- * 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.
- */
- 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 = array();
-
- 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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
deleted file mode 100644
index ccc64fa..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
+++ /dev/null
@@ -1,211 +0,0 @@
-.
- */
-
-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();
- }
-
- $classNames = (array)$this->locator->getAllClassNames($this->globalBasename);
- if ($this->classCache) {
- $classNames = array_merge(array_keys($this->classCache), $classNames);
- }
- return $classNames;
- }
-
- /**
- * 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 = array();
- 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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
deleted file mode 100644
index f622856..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
+++ /dev/null
@@ -1,73 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
deleted file mode 100644
index b5d7ec0..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
+++ /dev/null
@@ -1,58 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
deleted file mode 100644
index 5fa9a7a..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
+++ /dev/null
@@ -1,166 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence\Mapping\Driver;
-
-use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
-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 = null;
-
- /**
- * @var array
- */
- private $drivers = array();
-
- /**
- * 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 = array();
- $driverClasses = array();
-
- /* @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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php
deleted file mode 100644
index 31651f3..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php
+++ /dev/null
@@ -1,70 +0,0 @@
-.
- */
-
-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
-{
- /**
- * {@inheritDoc}
- */
- protected $metadata;
-
- /**
- * {@inheritDoc}
- */
- public function __construct($locator, $fileExtension = null)
- {
- $fileExtension = ".php";
- parent::__construct($locator, $fileExtension);
- }
-
- /**
- * {@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 array($metadata->getName() => $metadata);
- }
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php
deleted file mode 100644
index df8f477..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php
+++ /dev/null
@@ -1,142 +0,0 @@
-.
- */
-
-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 = array();
-
- /**
- * 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 = array();
- $includedFiles = array();
-
- 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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php
deleted file mode 100644
index dd4d741..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php
+++ /dev/null
@@ -1,217 +0,0 @@
-.
- */
-
-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 = array();
-
- /**
- * A map of mapping directory path to namespace prefix used to expand class shortnames.
- *
- * @var array
- */
- protected $prefixes = array();
-
- /**
- * File extension that is searched for.
- *
- * @var string|null
- */
- protected $fileExtension;
-
- /**
- * Constructor.
- *
- * @param array $prefixes
- * @param string|null $fileExtension
- */
- public function __construct(array $prefixes, $fileExtension = null)
- {
- $this->addNamespacePrefixes($prefixes);
- $this->fileExtension = $fileExtension;
- }
-
- /**
- * 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('\\', '.', $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->fileExtension;
- return is_file($filename);
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public function getAllClassNames($globalBasename = null)
- {
- $classes = array();
-
- 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])) {
- $classes[] = $this->prefixes[$path].'\\'.str_replace('.', '\\', $fileName);
- } else {
- $classes[] = str_replace('.', '\\', $fileName);
- }
- }
- }
- }
-
- return $classes;
- }
-
- /**
- * {@inheritDoc}
- */
- public function findMappingFile($className)
- {
- $defaultFileName = str_replace('\\', '.', $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->fileExtension;
- if (is_file($filename)) {
- return $filename;
- }
-
- throw MappingException::mappingFileNotFound($className, $filename);
- }
-
- throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension);
- }
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php
deleted file mode 100644
index c8c32b2..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php
+++ /dev/null
@@ -1,98 +0,0 @@
-.
- */
-
-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 MappingException
- */
- public static function classNotFoundInNamespaces($className, $namespaces)
- {
- return new self("The class '" . $className . "' was not found in the ".
- "chain configured namespaces " . implode(", ", $namespaces));
- }
-
- /**
- * @return MappingException
- */
- 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 MappingException
- */
- 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 MappingException
- */
- 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 MappingException
- */
- public static function invalidMappingFile($entityName, $fileName)
- {
- return new self("Invalid mapping file '$fileName' for class '$entityName'.");
- }
-
- /**
- * @param string $className
- *
- * @return \Doctrine\Common\Persistence\Mapping\MappingException
- */
- public static function nonExistingClass($className)
- {
- return new self("Class '$className' does not exist");
- }
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php
deleted file mode 100644
index 0088ed5..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php
+++ /dev/null
@@ -1,87 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
deleted file mode 100644
index c5a37a8..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
+++ /dev/null
@@ -1,97 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence\Mapping;
-
-use ReflectionClass;
-use ReflectionProperty;
-use Doctrine\Common\Reflection\RuntimePublicReflectionProperty;
-use Doctrine\Common\Persistence\Mapping\MappingException;
-
-/**
- * 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)
- {
- return method_exists($class, $method) && is_callable(array($class, $method));
- }
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php
deleted file mode 100644
index f903097..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php
+++ /dev/null
@@ -1,83 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence\Mapping;
-
-/**
- * PHP Runtime Reflection Service.
- *
- * @author Benjamin Eberlei
- */
-class StaticReflectionService implements ReflectionService
-{
- /**
- * {@inheritDoc}
- */
- public function getParentClasses($class)
- {
- return array();
- }
-
- /**
- * {@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 method_exists($class, $method) && is_callable(array($class, $method));
- }
-}
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php
deleted file mode 100644
index 02208c9..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php
+++ /dev/null
@@ -1,169 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php
deleted file mode 100644
index 9bc248a..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php
+++ /dev/null
@@ -1,51 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php
deleted file mode 100644
index 8946475..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerDecorator.php
+++ /dev/null
@@ -1,140 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php
deleted file mode 100644
index f607219..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php
+++ /dev/null
@@ -1,81 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php
deleted file mode 100644
index 08c6942..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php
+++ /dev/null
@@ -1,254 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Persistence;
-
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
-use Doctrine\Common\Collections\ArrayCollection;
-use Doctrine\Common\Collections\Collection;
-
-/**
- * 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 ?: array());
- }
- $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/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php
deleted file mode 100644
index 3369eb9..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php
+++ /dev/null
@@ -1,59 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php b/core/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php
deleted file mode 100644
index 1a59cd4..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php
+++ /dev/null
@@ -1,45 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
deleted file mode 100644
index dd1ae1b..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
+++ /dev/null
@@ -1,244 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Proxy;
-
-use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
-use Doctrine\Common\Proxy\Exception\InvalidArgumentException;
-use Doctrine\Common\Proxy\Exception\OutOfBoundsException;
-use Doctrine\Common\Util\ClassUtils;
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
-
-/**
- * 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 = array();
-
- /**
- * @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.
- *
- * @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);
-
- /**
- * @return ProxyDefinition
- */
- abstract protected function createProxyDefinition($className);
-}
-
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php
deleted file mode 100644
index 0aa930b..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Autoloader.php
+++ /dev/null
@@ -1,92 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php
deleted file mode 100644
index 24a2194..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php
+++ /dev/null
@@ -1,90 +0,0 @@
-.
- */
-
-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');
- }
-
- /**
- * @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/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php
deleted file mode 100644
index 348cfcb..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php
+++ /dev/null
@@ -1,43 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Proxy\Exception;
-
-use Doctrine\Common\Persistence\Proxy;
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php
deleted file mode 100644
index 0d1ff14..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/ProxyException.php
+++ /dev/null
@@ -1,31 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php
deleted file mode 100644
index 2b8e638..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php
+++ /dev/null
@@ -1,62 +0,0 @@
-.
- */
-
-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
-{
- /**
- * @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/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php
deleted file mode 100644
index 8368430..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Proxy.php
+++ /dev/null
@@ -1,90 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Proxy;
-
-use Doctrine\Common\Persistence\Proxy as BaseProxy;
-use Closure;
-
-/**
- * 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/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php
deleted file mode 100644
index 48b149a..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyDefinition.php
+++ /dev/null
@@ -1,70 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php
deleted file mode 100644
index 4c5a239..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php
+++ /dev/null
@@ -1,932 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Proxy;
-
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
-use Doctrine\Common\Util\ClassUtils;
-use Doctrine\Common\Proxy\Exception\InvalidArgumentException;
-use Doctrine\Common\Proxy\Exception\UnexpectedValueException;
-
-/**
- * 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{1,}%s\s?\(\)\s{1,})\s{0,}{\s{0,}return\s{0,}\$this->%s;\s{0,}})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 = array(
- 'baseProxyInterface' => 'Doctrine\Common\Proxy\Proxy',
- '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 = array();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /**
- * Forces initialization of the proxy
- */
- public function __load()
- {
- $this->__initializer__ && $this->__initializer__->__invoke($this, \'__load\', array());
- }
-
- /**
- * {@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 = array();
-
- foreach ($placeholderMatches as $placeholder => $name) {
- $placeholders[$placeholder] = isset($this->placeholders[$name])
- ? $this->placeholders[$name]
- : array($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);
- 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 = array();
-
- 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 = array();
-
- 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', array($name));
-
- return $this->$name;
- }
-
-
-EOT;
- }
-
- if ($hasParentGet) {
- $magicGet .= <<<'EOT'
- $this->__initializer__ && $this->__initializer__->__invoke($this, '__get', array($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', array($name, $value));
-
- $this->$name = $value;
-
- return;
- }
-
-
-EOT;
- }
-
- if ($hasParentSet) {
- $magicSet .= <<<'EOT'
- $this->__initializer__ && $this->__initializer__->__invoke($this, '__set', array($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', array($name));
-
- return isset($this->$name);
- }
-
-
-EOT;
- }
-
- if ($hasParentIsset) {
- $magicIsset .= <<<'EOT'
- $this->__initializer__ && $this->__initializer__->__invoke($this, '__isset', array($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 = array('__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 array($allProperties);
- }
-
- return array($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 = array();
- $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', array());
-$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 = array();
- $reflectionMethods = $class->getReflectionClass()->getMethods(\ReflectionMethod::IS_PUBLIC);
- $skippedMethods = array(
- '__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 . '(';
-
- $firstParam = true;
- $parameterString = '';
- $argumentString = '';
- $parameters = array();
-
- foreach ($method->getParameters() as $param) {
- if ($firstParam) {
- $firstParam = false;
- } else {
- $parameterString .= ', ';
- $argumentString .= ', ';
- }
-
- try {
- $paramClass = $param->getClass();
- } catch (\ReflectionException $previous) {
- throw UnexpectedValueException::invalidParameterTypeHint(
- $class->getName(),
- $method->getName(),
- $param->getName(),
- $previous
- );
- }
-
- // We need to pick the type hint class too
- if (null !== $paramClass) {
- $parameterString .= '\\' . $paramClass->getName() . ' ';
- } elseif ($param->isArray()) {
- $parameterString .= 'array ';
- } elseif (method_exists($param, 'isCallable') && $param->isCallable()) {
- $parameterString .= 'callable ';
- }
-
- if ($param->isPassedByReference()) {
- $parameterString .= '&';
- }
-
- $parameters[] = '$' . $param->getName();
- $parameterString .= '$' . $param->getName();
- $argumentString .= '$' . $param->getName();
-
- if ($param->isDefaultValueAvailable()) {
- $parameterString .= ' = ' . var_export($param->getDefaultValue(), true);
- }
- }
-
- $methods .= $parameterString . ')';
- $methods .= "\n" . ' {' . "\n";
-
- if ($this->isShortIdentifierGetter($method, $class)) {
- $identifier = lcfirst(substr($name, 3));
- $fieldType = $class->getTypeOfField($identifier);
- $cast = in_array($fieldType, array('integer', 'smallint')) ? '(int) ' : '';
-
- $methods .= ' if ($this->__isInitialized__ === false) {' . "\n";
- $methods .= ' return ' . $cast . ' parent::' . $method->getName() . "();\n";
- $methods .= ' }' . "\n\n";
- }
-
- $methods .= "\n \$this->__initializer__ "
- . "&& \$this->__initializer__->__invoke(\$this, " . var_export($name, true)
- . ", array(" . implode(', ', $parameters) . "));"
- . "\n\n return parent::" . $name . '(' . $argumentString . ');'
- . "\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 = array();
-
- 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;
- }
-}
-
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php
deleted file mode 100644
index 639fd69..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php
+++ /dev/null
@@ -1,37 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php
deleted file mode 100644
index 418bb0f..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php
+++ /dev/null
@@ -1,79 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php
deleted file mode 100644
index 3d970ee..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php
+++ /dev/null
@@ -1,48 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php
deleted file mode 100644
index f155c45..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php
+++ /dev/null
@@ -1,76 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Reflection;
-
-use ReflectionProperty;
-use Doctrine\Common\Proxy\Proxy;
-
-/**
- * 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/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php
deleted file mode 100644
index b65979a..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php
+++ /dev/null
@@ -1,433 +0,0 @@
-.
- */
-
-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 = array())
- {
- 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/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php
deleted file mode 100644
index 311e1304..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php
+++ /dev/null
@@ -1,362 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Reflection;
-
-use ReflectionMethod;
-use ReflectionException;
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php
deleted file mode 100644
index aac1f90..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php
+++ /dev/null
@@ -1,307 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Reflection;
-
-use ReflectionException;
-use Doctrine\Common\Annotations\TokenParser;
-
-/**
- * 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 = array();
-
- /**
- * The docComment of the class.
- *
- * @var string
- */
- protected $docComment = array(
- 'class' => '',
- 'property' => array(),
- 'method' => array()
- );
-
- /**
- * 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/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php
deleted file mode 100644
index 1664822..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php
+++ /dev/null
@@ -1,178 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Reflection;
-
-use ReflectionProperty;
-use ReflectionException;
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php
deleted file mode 100644
index 49dc7bb..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php
+++ /dev/null
@@ -1,109 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php
deleted file mode 100644
index 0959ce5..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php
+++ /dev/null
@@ -1,157 +0,0 @@
-.
- */
-
-namespace Doctrine\Common\Util;
-
-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 ($isObj && in_array('Doctrine\Common\Collections\Collection', class_implements($var))) {
- $var = $var->toArray();
- }
-
- if ($maxDepth) {
- if (is_array($var)) {
- $return = array();
-
- 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/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php
deleted file mode 100644
index 082dc78..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php
+++ /dev/null
@@ -1,31 +0,0 @@
-.
- */
-
-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/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php
deleted file mode 100644
index bc9e2bd..0000000
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php
+++ /dev/null
@@ -1,53 +0,0 @@
-.
- */
-
-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
- * @author Roman Borschel
- */
-class Version
-{
- /**
- * Current Doctrine Version.
- */
- const VERSION = '2.5.0-DEV';
-
- /**
- * Compares a Doctrine version with the current one.
- *
- * @param string $version Doctrine version to compare.
- *
- * @return int -1 if older, 0 if it is the same, 1 if version passed as argument is newer.
- */
- public static function compare($version)
- {
- $currentVersion = str_replace(' ', '', strtolower(self::VERSION));
- $version = str_replace(' ', '', $version);
-
- return version_compare($version, $currentVersion);
- }
-}
diff --git a/core/vendor/doctrine/common/phpunit.xml.dist b/core/vendor/doctrine/common/phpunit.xml.dist
deleted file mode 100644
index b9d3b34..0000000
--- a/core/vendor/doctrine/common/phpunit.xml.dist
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- ./tests/Doctrine/
-
-
-
-
-
- ./lib/Doctrine/
-
-
-
-
-
- performance
-
-
-
diff --git a/core/vendor/doctrine/common/tests/.gitignore b/core/vendor/doctrine/common/tests/.gitignore
deleted file mode 100644
index 7210405..0000000
--- a/core/vendor/doctrine/common/tests/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Doctrine/Tests/Proxies/
-Doctrine/Tests/ORM/Proxy/generated/
-Doctrine/Tests/ORM/Tools/Export/export
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php
deleted file mode 100644
index 1eb2216..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-setIncludePath(__DIR__);
- $classLoader->setFileExtension('.class.php');
- $classLoader->setNamespaceSeparator('_');
-
- $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassA'));
- $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassB'));
- $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassC'));
- $this->assertFalse($classLoader->canLoadClass('OtherClass'));
- $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassA'), true);
- $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassB'), true);
- $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassC'), true);
- }
-
- public function testClassExists()
- {
- $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\ClassD'));
- $badLoader = function($className) {
- require __DIR__ . '/ClassLoaderTest/ClassD.php';
- return true;
- };
- spl_autoload_register($badLoader);
- $this->assertTrue(ClassLoader::classExists('ClassLoaderTest\ClassD'));
- spl_autoload_unregister($badLoader);
- }
-
- public function testGetClassLoader()
- {
- $cl = new ClassLoader('ClassLoaderTest', __DIR__);
- $cl->register();
- $this->assertTrue(ClassLoader::getClassLoader('ClassLoaderTest\ClassD') instanceof \Doctrine\Common\ClassLoader);
- $this->assertNull(ClassLoader::getClassLoader('This\Class\Does\Not\Exist'));
- $cl->unregister();
- }
-
- public function testClassExistsWithSilentAutoloader()
- {
- $test = $this;
- $silentLoader = function ($className) use ($test) {
- $test->assertSame('ClassLoaderTest\ClassE', $className);
- require __DIR__ . '/ClassLoaderTest/ClassE.php';
- };
- $additionalLoader = function () use ($test) {
- $test->fail('Should not call this loader, class was already loaded');
- };
-
- $this->assertFalse(ClassLoader::classExists('ClassLoaderTest\ClassE'));
- spl_autoload_register($silentLoader);
- spl_autoload_register($additionalLoader);
- $this->assertTrue(ClassLoader::classExists('ClassLoaderTest\ClassE'));
- spl_autoload_unregister($additionalLoader);
- spl_autoload_unregister($silentLoader);
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php
deleted file mode 100644
index 8554654..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php
+++ /dev/null
@@ -1,6 +0,0 @@
-_eventManager = new EventManager;
- $this->_preFooInvoked = false;
- $this->_postFooInvoked = false;
- }
-
- public function testInitialState()
- {
- $this->assertEquals(array(), $this->_eventManager->getListeners());
- $this->assertFalse($this->_eventManager->hasListeners(self::preFoo));
- $this->assertFalse($this->_eventManager->hasListeners(self::postFoo));
- }
-
- public function testAddEventListener()
- {
- $this->_eventManager->addEventListener(array('preFoo', 'postFoo'), $this);
- $this->assertTrue($this->_eventManager->hasListeners(self::preFoo));
- $this->assertTrue($this->_eventManager->hasListeners(self::postFoo));
- $this->assertEquals(1, count($this->_eventManager->getListeners(self::preFoo)));
- $this->assertEquals(1, count($this->_eventManager->getListeners(self::postFoo)));
- $this->assertEquals(2, count($this->_eventManager->getListeners()));
- }
-
- public function testDispatchEvent()
- {
- $this->_eventManager->addEventListener(array('preFoo', 'postFoo'), $this);
- $this->_eventManager->dispatchEvent(self::preFoo);
- $this->assertTrue($this->_preFooInvoked);
- $this->assertFalse($this->_postFooInvoked);
- }
-
- public function testRemoveEventListener()
- {
- $this->_eventManager->addEventListener(array('preBar'), $this);
- $this->assertTrue($this->_eventManager->hasListeners(self::preBar));
- $this->_eventManager->removeEventListener(array('preBar'), $this);
- $this->assertFalse($this->_eventManager->hasListeners(self::preBar));
- }
-
- public function testAddEventSubscriber()
- {
- $eventSubscriber = new TestEventSubscriber();
- $this->_eventManager->addEventSubscriber($eventSubscriber);
- $this->assertTrue($this->_eventManager->hasListeners(self::preFoo));
- $this->assertTrue($this->_eventManager->hasListeners(self::postFoo));
- }
-
- /* Listener methods */
-
- public function preFoo(EventArgs $e)
- {
- $this->_preFooInvoked = true;
- }
-
- public function postFoo(EventArgs $e)
- {
- $this->_postFooInvoked = true;
- }
-}
-
-class TestEventSubscriber implements \Doctrine\Common\EventSubscriber
-{
- public function getSubscribedEvents()
- {
- return array('preFoo', 'postFoo');
- }
-}
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php
deleted file mode 100644
index f9edd10..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php
+++ /dev/null
@@ -1,152 +0,0 @@
-getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
-
- $chain = new MappingDriverChain();
-
- $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $driver1->expects($this->never())
- ->method('loadMetadataForClass');
- $driver1->expectS($this->never())
- ->method('isTransient');
-
- $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $driver2->expects($this->at(0))
- ->method('loadMetadataForClass')
- ->with($this->equalTo($className), $this->equalTo($classMetadata));
- $driver2->expects($this->at(1))
- ->method('isTransient')
- ->with($this->equalTo($className))
- ->will($this->returnValue( true ));
-
- $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company');
- $chain->addDriver($driver2, 'Doctrine\Tests\Common\Persistence\Mapping');
-
- $chain->loadMetadataForClass($className, $classMetadata);
-
- $this->assertTrue( $chain->isTransient($className) );
- }
-
- public function testLoadMetadata_NoDelegatorFound_ThrowsMappingException()
- {
- $className = 'Doctrine\Tests\Common\Persistence\Mapping\DriverChainEntity';
- $classMetadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
-
- $chain = new MappingDriverChain();
-
- $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException');
- $chain->loadMetadataForClass($className, $classMetadata);
- }
-
- public function testGatherAllClassNames()
- {
- $className = 'Doctrine\Tests\Common\Persistence\Mapping\DriverChainEntity';
- $classMetadata = $this->getMock('Doctrine\Common\Persistence\ClassMetadata');
-
- $chain = new MappingDriverChain();
-
- $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $driver1->expects($this->once())
- ->method('getAllClassNames')
- ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo')));
-
- $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $driver2->expects($this->once())
- ->method('getAllClassNames')
- ->will($this->returnValue(array('Doctrine\Tests\ORM\Mapping\Bar', 'Doctrine\Tests\ORM\Mapping\Baz', 'FooBarBaz')));
-
- $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company');
- $chain->addDriver($driver2, 'Doctrine\Tests\ORM\Mapping');
-
- $this->assertEquals(array(
- 'Doctrine\Tests\Models\Company\Foo',
- 'Doctrine\Tests\ORM\Mapping\Bar',
- 'Doctrine\Tests\ORM\Mapping\Baz'
- ), $chain->getAllClassNames());
- }
-
- /**
- * @group DDC-706
- */
- public function testIsTransient()
- {
- $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $chain = new MappingDriverChain();
- $chain->addDriver($driver1, 'Doctrine\Tests\Models\CMS');
-
- $this->assertTrue($chain->isTransient('stdClass'), "stdClass isTransient");
- }
-
- /**
- * @group DDC-1412
- */
- public function testDefaultDriver()
- {
- $companyDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $defaultDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $entityClassName = 'Doctrine\Tests\ORM\Mapping\DriverChainEntity';
- $managerClassName = 'Doctrine\Tests\Models\Company\CompanyManager';
- $chain = new MappingDriverChain();
-
- $companyDriver->expects($this->never())
- ->method('loadMetadataForClass');
- $companyDriver->expects($this->once())
- ->method('isTransient')
- ->with($this->equalTo($managerClassName))
- ->will($this->returnValue(false));
-
- $defaultDriver->expects($this->never())
- ->method('loadMetadataForClass');
- $defaultDriver->expects($this->once())
- ->method('isTransient')
- ->with($this->equalTo($entityClassName))
- ->will($this->returnValue(true));
-
- $this->assertNull($chain->getDefaultDriver());
-
- $chain->setDefaultDriver($defaultDriver);
- $chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company');
-
- $this->assertSame($defaultDriver, $chain->getDefaultDriver());
-
- $this->assertTrue($chain->isTransient($entityClassName));
- $this->assertFalse($chain->isTransient($managerClassName));
- }
-
- public function testDefaultDriverGetAllClassNames()
- {
- $companyDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $defaultDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $chain = new MappingDriverChain();
-
- $companyDriver->expects($this->once())
- ->method('getAllClassNames')
- ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo')));
-
- $defaultDriver->expects($this->once())
- ->method('getAllClassNames')
- ->will($this->returnValue(array('Other\Class')));
-
- $chain->setDefaultDriver($defaultDriver);
- $chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company');
-
- $classNames = $chain->getAllClassNames();
-
- $this->assertEquals(array('Doctrine\Tests\Models\Company\Foo', 'Other\Class'), $classNames);
- }
-}
-
-class DriverChainEntity
-{
-
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php
deleted file mode 100644
index c5a457f..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php
+++ /dev/null
@@ -1,145 +0,0 @@
-getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
- $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $this->cmf = new TestClassMetadataFactory($driver, $metadata);
- }
-
- public function testGetCacheDriver()
- {
- $this->assertNull($this->cmf->getCacheDriver());
- $cache = new ArrayCache();
- $this->cmf->setCacheDriver($cache);
- $this->assertSame($cache, $this->cmf->getCacheDriver());
- }
-
- public function testGetMetadataFor()
- {
- $metadata = $this->cmf->getMetadataFor('stdClass');
-
- $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadata', $metadata);
- $this->assertTrue($this->cmf->hasMetadataFor('stdClass'));
- }
-
- public function testGetMetadataForAbsentClass()
- {
- $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException');
- $this->cmf->getMetadataFor(__NAMESPACE__ . '\AbsentClass');
- }
-
- public function testGetParentMetadata()
- {
- $metadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity');
-
- $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadata', $metadata);
- $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity'));
- $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\RootEntity'));
- }
-
- public function testGetCachedMetadata()
- {
- $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $cache = new ArrayCache();
- $cache->save(__NAMESPACE__. '\ChildEntity$CLASSMETADATA', $metadata);
-
- $this->cmf->setCacheDriver($cache);
-
- $loadedMetadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity');
- $this->assertSame($loadedMetadata, $metadata);
- }
-
- public function testCacheGetMetadataFor()
- {
- $cache = new ArrayCache();
- $this->cmf->setCacheDriver($cache);
-
- $loadedMetadata = $this->cmf->getMetadataFor(__NAMESPACE__ . '\ChildEntity');
-
- $this->assertSame($loadedMetadata, $cache->fetch(__NAMESPACE__. '\ChildEntity$CLASSMETADATA'));
- }
-
- public function testGetAliasedMetadata()
- {
- $loadedMetadata = $this->cmf->getMetadataFor('prefix:ChildEntity');
-
- $this->assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity'));
- $this->assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity'));
- }
-}
-
-class TestClassMetadataFactory extends AbstractClassMetadataFactory
-{
- public $driver;
- public $metadata;
-
- public function __construct($driver, $metadata)
- {
- $this->driver = $driver;
- $this->metadata = $metadata;
- }
-
- protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents)
- {
-
- }
-
- protected function getFqcnFromAlias($namespaceAlias, $simpleClassName)
- {
- return __NAMESPACE__ . '\\' . $simpleClassName;
- }
-
- protected function initialize()
- {
-
- }
-
- protected function newClassMetadataInstance($className)
- {
- return $this->metadata;
- }
-
- protected function getDriver()
- {
- return $this->driver;
- }
- protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService)
- {
- }
-
- protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService)
- {
- }
-
- protected function isEntity(ClassMetadata $class)
- {
- return true;
- }
-}
-
-class RootEntity
-{
-
-}
-
-class ChildEntity extends RootEntity
-{
-
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php
deleted file mode 100644
index 37072de..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php
+++ /dev/null
@@ -1,90 +0,0 @@
-assertEquals(array($path), $locator->getPaths());
-
- $locator = new DefaultFileLocator($path);
- $this->assertEquals(array($path), $locator->getPaths());
- }
-
- public function testGetFileExtension()
- {
- $locator = new DefaultFileLocator(array(), ".yml");
- $this->assertEquals(".yml", $locator->getFileExtension());
- $locator->setFileExtension(".xml");
- $this->assertEquals(".xml", $locator->getFileExtension());
- }
-
- public function testUniquePaths()
- {
- $path = __DIR__ . "/_files";
-
- $locator = new DefaultFileLocator(array($path, $path));
- $this->assertEquals(array($path), $locator->getPaths());
- }
-
- public function testFindMappingFile()
- {
- $path = __DIR__ . "/_files";
-
- $locator = new DefaultFileLocator(array($path), ".yml");
-
- $this->assertEquals(__DIR__ . '/_files' . DIRECTORY_SEPARATOR . 'stdClass.yml', $locator->findMappingFile('stdClass'));
- }
-
- public function testFindMappingFileNotFound()
- {
- $path = __DIR__ . "/_files";
-
- $locator = new DefaultFileLocator(array($path), ".yml");
-
- $this->setExpectedException(
- 'Doctrine\Common\Persistence\Mapping\MappingException',
- "No mapping file found named 'stdClass2.yml' for class 'stdClass2'"
- );
- $locator->findMappingFile('stdClass2');
- }
-
- public function testGetAllClassNames()
- {
- $path = __DIR__ . "/_files";
-
- $locator = new DefaultFileLocator(array($path), ".yml");
- $classes = $locator->getAllClassNames(null);
- sort($classes);
-
- $this->assertEquals(array('global', 'stdClass'), $classes);
- $this->assertEquals(array('stdClass'), $locator->getAllClassNames("global"));
- }
-
- public function testGetAllClassNamesNonMatchingFileExtension()
- {
- $path = __DIR__ . "/_files";
-
- $locator = new DefaultFileLocator(array($path), ".xml");
- $this->assertEquals(array(), $locator->getAllClassNames("global"));
- }
-
- public function testFileExists()
- {
- $path = __DIR__ . "/_files";
-
- $locator = new DefaultFileLocator(array($path), ".yml");
-
- $this->assertTrue($locator->fileExists("stdClass"));
- $this->assertFalse($locator->fileExists("stdClass2"));
- $this->assertTrue($locator->fileExists("global"));
- $this->assertFalse($locator->fileExists("global2"));
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php
deleted file mode 100644
index 020c242..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php
+++ /dev/null
@@ -1,142 +0,0 @@
-assertNull($driver->getGlobalBasename());
-
- $driver->setGlobalBasename("global");
- $this->assertEquals("global", $driver->getGlobalBasename());
- }
-
- public function testGetElementFromGlobalFile()
- {
- $driver = new TestFileDriver($this->newLocator());
- $driver->setGlobalBasename("global");
-
- $element = $driver->getElement('stdGlobal');
-
- $this->assertEquals('stdGlobal', $element);
- }
-
- public function testGetElementFromFile()
- {
- $locator = $this->newLocator();
- $locator->expects($this->once())
- ->method('findMappingFile')
- ->with($this->equalTo('stdClass'))
- ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml'));
-
- $driver = new TestFileDriver($locator);
-
- $this->assertEquals('stdClass', $driver->getElement('stdClass'));
- }
-
- public function testGetAllClassNamesGlobalBasename()
- {
- $driver = new TestFileDriver($this->newLocator());
- $driver->setGlobalBasename("global");
-
- $classNames = $driver->getAllClassNames();
-
- $this->assertEquals(array('stdGlobal', 'stdGlobal2'), $classNames);
- }
-
- public function testGetAllClassNamesFromMappingFile()
- {
- $locator = $this->newLocator();
- $locator->expects($this->any())
- ->method('getAllClassNames')
- ->with($this->equalTo(null))
- ->will($this->returnValue(array('stdClass')));
- $driver = new TestFileDriver($locator);
-
- $classNames = $driver->getAllClassNames();
-
- $this->assertEquals(array('stdClass'), $classNames);
- }
-
- public function testGetAllClassNamesBothSources()
- {
- $locator = $this->newLocator();
- $locator->expects($this->any())
- ->method('getAllClassNames')
- ->with($this->equalTo('global'))
- ->will($this->returnValue(array('stdClass')));
- $driver = new TestFileDriver($locator);
- $driver->setGlobalBasename("global");
-
- $classNames = $driver->getAllClassNames();
-
- $this->assertEquals(array('stdGlobal', 'stdGlobal2', 'stdClass'), $classNames);
- }
-
- public function testIsNotTransient()
- {
- $locator = $this->newLocator();
- $locator->expects($this->once())
- ->method('fileExists')
- ->with($this->equalTo('stdClass'))
- ->will($this->returnValue( true ));
-
- $driver = new TestFileDriver($locator);
- $driver->setGlobalBasename("global");
-
- $this->assertFalse($driver->isTransient('stdClass'));
- $this->assertFalse($driver->isTransient('stdGlobal'));
- $this->assertFalse($driver->isTransient('stdGlobal2'));
- }
-
- public function testIsTransient()
- {
- $locator = $this->newLocator();
- $locator->expects($this->once())
- ->method('fileExists')
- ->with($this->equalTo('stdClass2'))
- ->will($this->returnValue( false ));
-
- $driver = new TestFileDriver($locator);
-
- $this->assertTrue($driver->isTransient('stdClass2'));
- }
-
- public function testNonLocatorFallback()
- {
- $driver = new TestFileDriver(__DIR__ . '/_files', '.yml');
- $this->assertTrue($driver->isTransient('stdClass2'));
- $this->assertFalse($driver->isTransient('stdClass'));
- }
-
- private function newLocator()
- {
- $locator = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\FileLocator');
- $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml'));
- $locator->expects($this->any())->method('getPaths')->will($this->returnValue(array(__DIR__ . "/_files")));
- return $locator;
- }
-}
-
-class TestFileDriver extends FileDriver
-{
- protected function loadMappingFile($file)
- {
- if (strpos($file, "global.yml") !== false) {
- return array('stdGlobal' => 'stdGlobal', 'stdGlobal2' => 'stdGlobal2');
- }
- return array('stdClass' => 'stdClass');
- }
-
- public function loadMetadataForClass($className, ClassMetadata $metadata)
- {
-
- }
-}
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php
deleted file mode 100644
index 8fc4d80..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php
+++ /dev/null
@@ -1,18 +0,0 @@
-getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $metadata->expects($this->once())->method('getFieldNames');
-
- $driver = new PHPDriver(array(__DIR__ . "/_files"));
- $driver->loadMetadataForClass('TestEntity', $metadata);
- }
-}
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php
deleted file mode 100644
index 767ccd6..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-.
- */
-
-namespace Doctrine\Tests\Common\Persistence\Mapping;
-
-use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService;
-
-/**
- * @group DCOM-93
- */
-class RuntimeReflectionServiceTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var RuntimeReflectionService
- */
- private $reflectionService;
-
- public $unusedPublicProperty;
-
- public function setUp()
- {
- $this->reflectionService = new RuntimeReflectionService();
- }
-
- public function testShortname()
- {
- $this->assertEquals("RuntimeReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__));
- }
-
- public function testClassNamespaceName()
- {
- $this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__));
- }
-
- public function testGetParentClasses()
- {
- $classes = $this->reflectionService->getParentClasses(__CLASS__);
- $this->assertTrue(count($classes) >= 1, "The test class ".__CLASS__." should have at least one parent.");
- }
-
- public function testGetParentClassesForAbsentClass()
- {
- $this->setExpectedException('Doctrine\Common\Persistence\Mapping\MappingException');
- $this->reflectionService->getParentClasses(__NAMESPACE__ . '\AbsentClass');
- }
-
- public function testGetReflectionClass()
- {
- $class = $this->reflectionService->getClass(__CLASS__);
- $this->assertInstanceOf("ReflectionClass", $class);
- }
-
- public function testGetMethods()
- {
- $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods"));
- $this->assertFalse($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2"));
- }
-
- public function testGetAccessibleProperty()
- {
- $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService");
- $this->assertInstanceOf("ReflectionProperty", $reflProp);
-
- $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "unusedPublicProperty");
- $this->assertInstanceOf("Doctrine\Common\Reflection\RuntimePublicReflectionProperty", $reflProp);
- }
-}
-
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php
deleted file mode 100644
index 9f1c568..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $metadata->expects($this->once())->method('getFieldNames');
-
- $driver = new StaticPHPDriver(array(__DIR__));
- $driver->loadMetadataForClass(__NAMESPACE__ . '\\TestEntity', $metadata);
- }
-
- public function testGetAllClassNames()
- {
- $driver = new StaticPHPDriver(array(__DIR__));
- $classNames = $driver->getAllClassNames();
-
- $this->assertContains(
- 'Doctrine\Tests\Common\Persistence\Mapping\TestEntity', $classNames);
- }
-}
-
-class TestEntity
-{
- static public function loadMetadata($metadata)
- {
- $metadata->getFieldNames();
- }
-}
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php
deleted file mode 100644
index 1dd7a7a..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-.
- */
-
-namespace Doctrine\Tests\Common\Persistence\Mapping;
-
-use Doctrine\Common\Persistence\Mapping\StaticReflectionService;
-
-/**
- * @group DCOM-93
- */
-class StaticReflectionServiceTest extends \PHPUnit_Framework_TestCase
-{
- private $reflectionService;
-
- public function setUp()
- {
- $this->reflectionService = new StaticReflectionService();
- }
-
- public function testShortname()
- {
- $this->assertEquals("StaticReflectionServiceTest", $this->reflectionService->getClassShortName(__CLASS__));
- }
-
- public function testClassNamespaceName()
- {
- $this->assertEquals("Doctrine\Tests\Common\Persistence\Mapping", $this->reflectionService->getClassNamespace(__CLASS__));
- }
-
- public function testGetParentClasses()
- {
- $classes = $this->reflectionService->getParentClasses(__CLASS__);
- $this->assertTrue(count($classes) == 0, "The test class ".__CLASS__." should have no parents according to static reflection.");
- }
-
- public function testGetReflectionClass()
- {
- $class = $this->reflectionService->getClass(__CLASS__);
- $this->assertNull($class);
- }
-
- public function testGetMethods()
- {
- $this->assertTrue($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods"));
- $this->assertFalse($this->reflectionService->hasPublicMethod(__CLASS__, "testGetMethods2"));
- }
-
- public function testGetAccessibleProperty()
- {
- $reflProp = $this->reflectionService->getAccessibleProperty(__CLASS__, "reflectionService");
- $this->assertNull($reflProp);
- }
-}
-
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php
deleted file mode 100644
index b51162e..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
- $prefix));
- $this->assertEquals(array($path), $locator->getPaths());
-
- $locator = new SymfonyFileLocator(array($path => $prefix));
- $this->assertEquals(array($path), $locator->getPaths());
- }
-
- public function testGetPrefixes()
- {
- $path = __DIR__ . "/_files";
- $prefix = "Foo";
-
- $locator = new SymfonyFileLocator(array($path => $prefix));
- $this->assertEquals(array($path => $prefix), $locator->getNamespacePrefixes());
- }
-
- public function testGetFileExtension()
- {
- $locator = new SymfonyFileLocator(array(), ".yml");
- $this->assertEquals(".yml", $locator->getFileExtension());
- $locator->setFileExtension(".xml");
- $this->assertEquals(".xml", $locator->getFileExtension());
- }
-
- public function testFileExists()
- {
- $path = __DIR__ . "/_files";
- $prefix = "Foo";
-
- $locator = new SymfonyFileLocator(array($path => $prefix), ".yml");
-
- $this->assertTrue($locator->fileExists("Foo\stdClass"));
- $this->assertTrue($locator->fileExists("Foo\global"));
- $this->assertFalse($locator->fileExists("Foo\stdClass2"));
- $this->assertFalse($locator->fileExists("Foo\global2"));
- }
-
- public function testGetAllClassNames()
- {
- $path = __DIR__ . "/_files";
- $prefix = "Foo";
-
- $locator = new SymfonyFileLocator(array($path => $prefix), ".yml");
- $classes = $locator->getAllClassNames(null);
- sort($classes);
-
- $this->assertEquals(array("Foo\\global", "Foo\\stdClass"), $classes);
- $this->assertEquals(array("Foo\\stdClass"), $locator->getAllClassNames("global"));
- }
-
- public function testFindMappingFile()
- {
- $path = __DIR__ . "/_files";
- $prefix = "Foo";
-
- $locator = new SymfonyFileLocator(array($path => $prefix), ".yml");
-
- $this->assertEquals(__DIR__ . "/_files/stdClass.yml", $locator->findMappingFile("Foo\\stdClass"));
- }
-
- public function testFindMappingFileNotFound()
- {
- $path = __DIR__ . "/_files";
- $prefix = "Foo";
-
- $locator = new SymfonyFileLocator(array($path => $prefix), ".yml");
-
- $this->setExpectedException(
- "Doctrine\Common\Persistence\Mapping\MappingException",
- "No mapping file found named '".__DIR__."/_files/stdClass2.yml' for class 'Foo\stdClass2'."
- );
- $locator->findMappingFile("Foo\\stdClass2");
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php
deleted file mode 100644
index d0e9976..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php
+++ /dev/null
@@ -1,3 +0,0 @@
-getFieldNames();
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml
deleted file mode 100644
index 30d74d2..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml
+++ /dev/null
@@ -1 +0,0 @@
-test
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml
deleted file mode 100644
index 30d74d2..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml
+++ /dev/null
@@ -1 +0,0 @@
-test
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ObjectManagerDecoratorTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ObjectManagerDecoratorTest.php
deleted file mode 100644
index 768b4d3..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ObjectManagerDecoratorTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-wrapped = $wrapped;
- }
-}
-
-class ObjectManagerDecoratorTest extends \PHPUnit_Framework_TestCase
-{
- private $wrapped;
- private $decorated;
-
- public function setUp()
- {
- $this->wrapped = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
- $this->decorated = new NullObjectManagerDecorator($this->wrapped);
- }
-
- public function getMethodParameters()
- {
- $class = new \ReflectionClass('Doctrine\Common\Persistence\ObjectManager');
-
- $methods = array();
- foreach ($class->getMethods() as $method) {
- if ($method->getNumberOfRequiredParameters() === 0) {
- $methods[] = array($method->getName(), array());
- } elseif ($method->getNumberOfRequiredParameters() > 0) {
- $methods[] = array($method->getName(), array_fill(0, $method->getNumberOfRequiredParameters(), 'req') ?: array());
- }
- if ($method->getNumberOfParameters() != $method->getNumberOfRequiredParameters()) {
- $methods[] = array($method->getName(), array_fill(0, $method->getNumberOfParameters(), 'all') ?: array());
- }
- }
-
- return $methods;
- }
-
- /**
- * @dataProvider getMethodParameters
- */
- public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, array $parameters)
- {
- $stub = $this->wrapped
- ->expects($this->once())
- ->method($method)
- ->will($this->returnValue('INNER VALUE FROM ' . $method));
-
- call_user_func_array(array($stub, 'with'), $parameters);
-
- $this->assertSame('INNER VALUE FROM ' . $method, call_user_func_array(array($this->decorated, $method), $parameters));
- }
-}
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php
deleted file mode 100644
index 180d0f0..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php
+++ /dev/null
@@ -1,247 +0,0 @@
-cm = new TestObjectMetadata;
- $this->om = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
- $this->om->expects($this->any())->method('getClassMetadata')
- ->will($this->returnValue($this->cm));
- $this->object = new TestObject;
- PersistentObject::setObjectManager($this->om);
- $this->object->injectObjectManager($this->om, $this->cm);
- }
-
- public function testGetObjectManager()
- {
- $this->assertSame($this->om, PersistentObject::getObjectManager());
- }
-
- public function testNonMatchingObjectManager()
- {
- $this->setExpectedException('RuntimeException');
- $om = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
- $this->object->injectObjectManager($om, $this->cm);
- }
-
- public function testGetField()
- {
- $this->assertEquals('beberlei', $this->object->getName());
- }
-
- public function testSetField()
- {
- $this->object->setName("test");
- $this->assertEquals("test", $this->object->getName());
- }
-
- public function testGetIdentifier()
- {
- $this->assertEquals(1, $this->object->getId());
- }
-
- public function testSetIdentifier()
- {
- $this->setExpectedException('BadMethodCallException');
- $this->object->setId(2);
- }
-
- public function testSetUnknownField()
- {
- $this->setExpectedException('BadMethodCallException');
- $this->object->setUnknown("test");
- }
-
- public function testGetUnknownField()
- {
- $this->setExpectedException('BadMethodCallException');
- $this->object->getUnknown();
- }
-
- public function testGetToOneAssociation()
- {
- $this->assertNull($this->object->getParent());
- }
-
- public function testSetToOneAssociation()
- {
- $parent = new TestObject();
- $this->object->setParent($parent);
- $this->assertSame($parent, $this->object->getParent($parent));
- }
-
- public function testSetInvalidToOneAssociation()
- {
- $parent = new \stdClass();
-
- $this->setExpectedException('InvalidArgumentException');
- $this->object->setParent($parent);
- }
-
- public function testSetToOneAssociationNull()
- {
- $parent = new TestObject();
- $this->object->setParent($parent);
- $this->object->setParent(null);
- $this->assertNull($this->object->getParent());
- }
-
- public function testAddToManyAssociation()
- {
- $child = new TestObject();
- $this->object->addChildren($child);
-
- $this->assertSame($this->object, $child->getParent());
- $this->assertEquals(1, count($this->object->getChildren()));
-
- $child = new TestObject();
- $this->object->addChildren($child);
-
- $this->assertEquals(2, count($this->object->getChildren()));
- }
-
- public function testAddInvalidToManyAssociation()
- {
- $this->setExpectedException('InvalidArgumentException');
- $this->object->addChildren(new \stdClass());
- }
-
- public function testNoObjectManagerSet()
- {
- PersistentObject::setObjectManager(null);
- $child = new TestObject();
-
- $this->setExpectedException('RuntimeException');
- $child->setName("test");
- }
-
- public function testInvalidMethod()
- {
- $this->setExpectedException('BadMethodCallException');
- $this->object->asdf();
- }
-
- public function testAddInvalidCollection()
- {
- $this->setExpectedException('BadMethodCallException');
- $this->object->addAsdf(new \stdClass());
- }
-}
-
-class TestObject extends PersistentObject
-{
- protected $id = 1;
- protected $name = 'beberlei';
- protected $parent;
- protected $children;
-}
-
-class TestObjectMetadata implements ClassMetadata
-{
-
- public function getAssociationMappedByTargetField($assocName)
- {
- $assoc = array('children' => 'parent');
- return $assoc[$assocName];
- }
-
- public function getAssociationNames()
- {
- return array('parent', 'children');
- }
-
- public function getAssociationTargetClass($assocName)
- {
- return __NAMESPACE__ . '\TestObject';
- }
-
- public function getFieldNames()
- {
- return array('id', 'name');
- }
-
- public function getIdentifier()
- {
- return array('id');
- }
-
- public function getName()
- {
- return __NAMESPACE__ . '\TestObject';
- }
-
- public function getReflectionClass()
- {
- return new \ReflectionClass($this->getName());
- }
-
- public function getTypeOfField($fieldName)
- {
- $types = array('id' => 'integer', 'name' => 'string');
- return $types[$fieldName];
- }
-
- public function hasAssociation($fieldName)
- {
- return in_array($fieldName, array('parent', 'children'));
- }
-
- public function hasField($fieldName)
- {
- return in_array($fieldName, array('id', 'name'));
- }
-
- public function isAssociationInverseSide($assocName)
- {
- return ($assocName === 'children');
- }
-
- public function isCollectionValuedAssociation($fieldName)
- {
- return ($fieldName === 'children');
- }
-
- public function isIdentifier($fieldName)
- {
- return $fieldName === 'id';
- }
-
- public function isSingleValuedAssociation($fieldName)
- {
- return $fieldName === 'parent';
- }
-
- public function getIdentifierValues($entity)
- {
-
- }
-
- public function getIdentifierFieldNames()
- {
-
- }
-
- public function initializeReflection(ReflectionService $reflService)
- {
-
- }
-
- public function wakeupReflection(ReflectionService $reflService)
- {
-
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php
deleted file mode 100644
index 6ae9316..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php
+++ /dev/null
@@ -1,146 +0,0 @@
-getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false);
-
- $proxyGenerator
- ->expects($this->once())
- ->method('getProxyFileName');
- $proxyGenerator
- ->expects($this->once())
- ->method('generateProxyClass');
-
- $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory');
- $proxyFactory = $this->getMockForAbstractClass(
- 'Doctrine\Common\Proxy\AbstractProxyFactory',
- array($proxyGenerator, $metadataFactory, true)
- );
-
- $proxyFactory
- ->expects($this->any())
- ->method('skipClass')
- ->will($this->returnValue(false));
-
- $generated = $proxyFactory->generateProxyClasses(array($metadata), sys_get_temp_dir());
-
- $this->assertEquals(1, $generated, 'One proxy was generated');
- }
-
- public function testGetProxy()
- {
- $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy');
- $definition = new ProxyDefinition(get_class($proxy), array(), array(), null, null);
- $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false);
- $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory');
-
- $metadataFactory
- ->expects($this->once())
- ->method('getMetadataFor')
- ->will($this->returnValue($metadata));
-
- $proxyFactory = $this->getMockForAbstractClass(
- 'Doctrine\Common\Proxy\AbstractProxyFactory',
- array($proxyGenerator, $metadataFactory, true)
- );
-
- $proxyFactory
- ->expects($this->any())
- ->method('createProxyDefinition')
- ->will($this->returnValue($definition));
-
- $generatedProxy = $proxyFactory->getProxy('Class', array('id' => 1));
-
- $this->assertInstanceOf(get_class($proxy), $generatedProxy);
- }
-
- public function testResetUnitializedProxy()
- {
- $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy');
- $definition = new ProxyDefinition(get_class($proxy), array(), array(), null, null);
- $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false);
- $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory');
-
- $metadataFactory
- ->expects($this->once())
- ->method('getMetadataFor')
- ->will($this->returnValue($metadata));
-
- $proxyFactory = $this->getMockForAbstractClass(
- 'Doctrine\Common\Proxy\AbstractProxyFactory',
- array($proxyGenerator, $metadataFactory, true)
- );
-
- $proxyFactory
- ->expects($this->any())
- ->method('createProxyDefinition')
- ->will($this->returnValue($definition));
-
- $proxy
- ->expects($this->once())
- ->method('__isInitialized')
- ->will($this->returnValue(false));
- $proxy
- ->expects($this->once())
- ->method('__setInitializer');
- $proxy
- ->expects($this->once())
- ->method('__setCloner');
-
- $proxyFactory->resetUninitializedProxy($proxy);
- }
-
- public function testDisallowsResettingInitializedProxy()
- {
- $proxyFactory = $this->getMockForAbstractClass('Doctrine\Common\Proxy\AbstractProxyFactory', array(), '', false);
- $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy');
-
- $proxy
- ->expects($this->any())
- ->method('__isInitialized')
- ->will($this->returnValue(true));
-
- $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException');
-
- $proxyFactory->resetUninitializedProxy($proxy);
- }
-
- public function testMissingPrimaryKeyValue()
- {
- $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy');
- $definition = new ProxyDefinition(get_class($proxy), array('missingKey'), array(), null, null);
- $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false);
- $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory');
-
- $metadataFactory
- ->expects($this->once())
- ->method('getMetadataFor')
- ->will($this->returnValue($metadata));
-
- $proxyFactory = $this->getMockForAbstractClass(
- 'Doctrine\Common\Proxy\AbstractProxyFactory',
- array($proxyGenerator, $metadataFactory, true)
- );
-
- $proxyFactory
- ->expects($this->any())
- ->method('createProxyDefinition')
- ->will($this->returnValue($definition));
-
- $this->setExpectedException('\OutOfBoundsException');
-
- $generatedProxy = $proxyFactory->getProxy('Class', array());
- }
-}
-
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php
deleted file mode 100644
index be713fc..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AutoloaderTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-.
- */
-
-namespace Doctrine\Tests\Common\Proxy;
-
-use PHPUnit_Framework_TestCase;
-use Doctrine\Common\Proxy\Autoloader;
-
-/**
- * @group DDC-1698
- */
-class AutoloaderTest extends PHPUnit_Framework_TestCase
-{
- public static function dataResolveFile()
- {
- return array(
- array('/tmp', 'MyProxy', 'MyProxy\__CG__\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__RealClass.php'),
- array('/tmp', 'MyProxy\Subdir', 'MyProxy\Subdir\__CG__\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__RealClass.php'),
- array('/tmp', 'MyProxy', 'MyProxy\__CG__\Other\RealClass', '/tmp' . DIRECTORY_SEPARATOR . '__CG__OtherRealClass.php'),
- );
- }
-
- /**
- * @dataProvider dataResolveFile
- */
- public function testResolveFile($proxyDir, $proxyNamespace, $className, $expectedProxyFile)
- {
- $actualProxyFile = Autoloader::resolveFile($proxyDir, $proxyNamespace, $className);
- $this->assertEquals($expectedProxyFile, $actualProxyFile);
- }
-
- public function testAutoload()
- {
- if (file_exists(sys_get_temp_dir() ."/AutoloaderTestClass.php")) {
- unlink(sys_get_temp_dir() ."/AutoloaderTestClass.php");
- }
-
- $autoloader = Autoloader::register(sys_get_temp_dir(), 'ProxyAutoloaderTest', function($proxyDir, $proxyNamespace, $className) {
- file_put_contents(sys_get_temp_dir() . "/AutoloaderTestClass.php", "assertTrue(class_exists('ProxyAutoloaderTest\AutoloaderTestClass', true));
- unlink(sys_get_temp_dir() ."/AutoloaderTestClass.php");
- }
-
- public function testRegisterWithInvalidCallback()
- {
- $this->setExpectedException(
- 'Doctrine\Common\Proxy\Exception\InvalidArgumentException',
- 'Invalid \$notFoundCallback given: must be a callable, "stdClass" given'
- );
-
- Autoloader::register('', '', new \stdClass());
- }
-}
-
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php
deleted file mode 100644
index f5fccb0..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/CallableTypeHintClass.php
+++ /dev/null
@@ -1,16 +0,0 @@
-.
- */
-
-namespace Doctrine\Tests\Common\Proxy;
-
-/**
- * Test asset representing a lazy loadable object
- *
- * @author Marco Pivetta
- * @since 2.4
- */
-class LazyLoadableObject
-{
- /**
- * @var string
- */
- public $publicIdentifierField;
-
- /**
- * @var string
- */
- protected $protectedIdentifierField;
-
- /**
- * @var string
- */
- public $publicTransientField = 'publicTransientFieldValue';
-
- /**
- * @var string
- */
- protected $protectedTransientField = 'protectedTransientFieldValue';
-
- /**
- * @var string
- */
- public $publicPersistentField = 'publicPersistentFieldValue';
-
- /**
- * @var string
- */
- protected $protectedPersistentField = 'protectedPersistentFieldValue';
-
- /**
- * @var string
- */
- public $publicAssociation = 'publicAssociationValue';
-
- /**
- * @var string
- */
- protected $protectedAssociation = 'protectedAssociationValue';
-
- /**
- * @return string
- */
- public function getProtectedIdentifierField()
- {
- return $this->protectedIdentifierField;
- }
-
- /**
- * @return string
- */
- public function testInitializationTriggeringMethod()
- {
- return 'testInitializationTriggeringMethod';
- }
-
- /**
- * @return string
- */
- public function getProtectedAssociation()
- {
- return $this->protectedAssociation;
- }
-
- /**
- * @param \stdClass $param
- */
- public function publicTypeHintedMethod(\stdClass $param)
- {
- }
-
- /**
- *
- */
- public function &byRefMethod()
- {
- }
-
- /**
- * @param mixed $thisIsNotByRef
- * @param &mixed $thisIsByRef
- */
- public function byRefParamMethod($thisIsNotByRef, &$thisIsByRef)
- {
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php
deleted file mode 100644
index 167386e..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/LazyLoadableObjectClassMetadata.php
+++ /dev/null
@@ -1,195 +0,0 @@
-.
- */
-
-namespace Doctrine\Tests\Common\Proxy;
-
-use ReflectionClass;
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
-
-/**
- * Class metadata test asset for @see LazyLoadableObject
- *
- * @author Marco Pivetta
- * @since 2.4
- */
-class LazyLoadableObjectClassMetadata implements ClassMetadata
-{
- /**
- * @var ReflectionClass
- */
- protected $reflectionClass;
-
- /**
- * @var array
- */
- protected $identifier = array(
- 'publicIdentifierField' => true,
- 'protectedIdentifierField' => true,
- );
-
- /**
- * @var array
- */
- protected $fields = array(
- 'publicIdentifierField' => true,
- 'protectedIdentifierField' => true,
- 'publicPersistentField' => true,
- 'protectedPersistentField' => true,
- );
-
- /**
- * @var array
- */
- protected $associations = array(
- 'publicAssociation' => true,
- 'protectedAssociation' => true,
- );
-
- /**
- * {@inheritDoc}
- */
- public function getName()
- {
- return $this->getReflectionClass()->getName();
- }
-
- /**
- * {@inheritDoc}
- */
- public function getIdentifier()
- {
- return array_keys($this->identifier);
- }
-
- /**
- * {@inheritDoc}
- */
- public function getReflectionClass()
- {
- if (null === $this->reflectionClass) {
- $this->reflectionClass = new \ReflectionClass(__NAMESPACE__ . '\LazyLoadableObject');
- }
-
- return $this->reflectionClass;
- }
-
- /**
- * {@inheritDoc}
- */
- public function isIdentifier($fieldName)
- {
- return isset($this->identifier[$fieldName]);
- }
-
- /**
- * {@inheritDoc}
- */
- public function hasField($fieldName)
- {
- return isset($this->fields[$fieldName]);
- }
-
- /**
- * {@inheritDoc}
- */
- public function hasAssociation($fieldName)
- {
- return isset($this->associations[$fieldName]);
- }
-
- /**
- * {@inheritDoc}
- */
- public function isSingleValuedAssociation($fieldName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- /**
- * {@inheritDoc}
- */
- public function isCollectionValuedAssociation($fieldName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- /**
- * {@inheritDoc}
- */
- public function getFieldNames()
- {
- return array_keys($this->fields);
- }
-
- /**
- * {@inheritDoc}
- */
- public function getIdentifierFieldNames()
- {
- return $this->getIdentifier();
- }
-
- /**
- * {@inheritDoc}
- */
- public function getAssociationNames()
- {
- return array_keys($this->associations);
- }
-
- /**
- * {@inheritDoc}
- */
- public function getTypeOfField($fieldName)
- {
- return 'string';
- }
-
- /**
- * {@inheritDoc}
- */
- public function getAssociationTargetClass($assocName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- /**
- * {@inheritDoc}
- */
- public function isAssociationInverseSide($assocName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- /**
- * {@inheritDoc}
- */
- public function getAssociationMappedByTargetField($assocName)
- {
- throw new \BadMethodCallException('not implemented');
- }
-
- /**
- * {@inheritDoc}
- */
- public function getIdentifierValues($object)
- {
- throw new \BadMethodCallException('not implemented');
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php
deleted file mode 100644
index 33b983d..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicCloneClass.php
+++ /dev/null
@@ -1,37 +0,0 @@
-clonedValue = 'newClonedValue';
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php
deleted file mode 100644
index 6adf1f5..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetByRefClass.php
+++ /dev/null
@@ -1,51 +0,0 @@
-.
- */
-
-namespace Doctrine\Tests\Common\Proxy;
-
-use InvalidArgumentException;
-
-/**
- * Test asset class
- *
- * @since 2.4
- */
-class MagicGetByRefClass
-{
- /**
- * @var mixed
- */
- public $valueField;
-
- /**
- * @param string $name
- *
- * @return mixed
- *
- * @throws \InvalidArgumentException
- */
- public function & __get($name)
- {
- if ($name === 'value') {
- return $this->valueField;
- }
-
- throw new InvalidArgumentException();
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php
deleted file mode 100644
index 0cab36a..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicGetClass.php
+++ /dev/null
@@ -1,38 +0,0 @@
-testAttribute = $value;
- }
-
- if ($name === 'publicField' || $name === 'id') {
- throw new \BadMethodCallException('Should never be called for "publicField" or "id"');
- }
-
- $this->testAttribute = $value;
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php
deleted file mode 100644
index 3934a05..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/MagicSleepClass.php
+++ /dev/null
@@ -1,37 +0,0 @@
-wakeupValue = 'newWakeupValue';
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php
deleted file mode 100644
index 45d45e5..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php
+++ /dev/null
@@ -1,228 +0,0 @@
-.
- */
-
-
-namespace Doctrine\Tests\Common\Proxy;
-
-use Doctrine\Common\Proxy\ProxyGenerator;
-use ReflectionClass;
-use ReflectionMethod;
-use PHPUnit_Framework_TestCase;
-
-/**
- * Test the proxy generator. Its work is generating on-the-fly subclasses of a given model, which implement the Proxy
- * pattern.
- *
- * @author Giorgio Sironi
- * @author Marco Pivetta
- */
-class ProxyClassGeneratorTest extends PHPUnit_Framework_TestCase
-{
- /**
- * @var string
- */
- protected $proxyClass = 'Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\LazyLoadableObject';
-
- /**
- * @var LazyLoadableObjectClassMetadata
- */
- protected $metadata;
-
- /**
- * @var ProxyGenerator
- */
- protected $proxyGenerator;
-
- /**
- * {@inheritDoc}
- */
- protected function setUp()
- {
- $this->metadata = new LazyLoadableObjectClassMetadata();
- $this->proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
-
- if (class_exists($this->proxyClass, false)) {
- return;
- }
-
- $this->generateAndRequire($this->proxyGenerator, $this->metadata);
- }
-
- public function testReferenceProxyRespectsMethodsParametersTypeHinting()
- {
- $method = new ReflectionMethod($this->proxyClass, 'publicTypeHintedMethod');
- $params = $method->getParameters();
-
- $this->assertEquals(1, count($params));
- $this->assertEquals('stdClass', $params[0]->getClass()->getName());
- }
-
- public function testProxyRespectsMethodsWhichReturnValuesByReference()
- {
- $method = new ReflectionMethod($this->proxyClass, 'byRefMethod');
-
- $this->assertTrue($method->returnsReference());
- }
-
- public function testProxyRespectsByRefMethodParameters()
- {
- $method = new ReflectionMethod($this->proxyClass, 'byRefParamMethod');
- $parameters = $method->getParameters();
- $this->assertSame('thisIsNotByRef', $parameters[0]->getName());
- $this->assertFalse($parameters[0]->isPassedByReference());
- $this->assertSame('thisIsByRef', $parameters[1]->getName());
- $this->assertTrue($parameters[1]->isPassedByReference());
- }
-
- public function testCreatesAssociationProxyAsSubclassOfTheOriginalOne()
- {
- $this->assertTrue(is_subclass_of($this->proxyClass, $this->metadata->getName()));
- }
-
- public function testNonNamespacedProxyGeneration()
- {
- $classCode = file_get_contents($this->proxyGenerator->getProxyFileName($this->metadata->getName()));
-
- $this->assertNotContains("class LazyLoadableObject extends \\\\" . $this->metadata->getName(), $classCode);
- $this->assertContains("class LazyLoadableObject extends \\" . $this->metadata->getName(), $classCode);
- }
-
- public function testClassWithSleepProxyGeneration()
- {
- if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\SleepClass', false)) {
- $className = 'Doctrine\Tests\Common\Proxy\SleepClass';
- $metadata = $this->createClassMetadata($className, array('id'));
- $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
-
- $this->generateAndRequire($proxyGenerator, $metadata);
- }
-
- $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxySleepClass.php');
- $this->assertEquals(1, substr_count($classCode, 'function __sleep'));
- $this->assertEquals(1, substr_count($classCode, 'parent::__sleep()'));
- }
-
- /**
- * Check that the proxy doesn't serialize static properties (in __sleep() method)
- * @group DCOM-212
- */
- public function testClassWithStaticPropertyProxyGeneration()
- {
- if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\StaticPropertyClass', false)) {
- $className = 'Doctrine\Tests\Common\Proxy\StaticPropertyClass';
- $metadata = $this->createClassMetadata($className, array());
- $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
-
- $this->generateAndRequire($proxyGenerator, $metadata);
- }
-
- $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyStaticPropertyClass.php');
- $this->assertEquals(1, substr_count($classCode, 'function __sleep'));
- $this->assertNotContains('protectedStaticProperty', $classCode);
- }
-
- private function generateAndRequire($proxyGenerator, $metadata)
- {
- $proxyGenerator->generateProxyClass($metadata, $proxyGenerator->getProxyFileName($metadata->getName()));
-
- require_once $proxyGenerator->getProxyFileName($metadata->getName());
- }
-
- public function testClassWithCallableTypeHintOnProxiedMethod()
- {
- if (PHP_VERSION_ID < 50400) {
- $this->markTestSkipped('`callable` is only supported in PHP >=5.4.0');
- }
-
- if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\CallableTypeHintClass', false)) {
- $className = 'Doctrine\Tests\Common\Proxy\CallableTypeHintClass';
- $metadata = $this->createClassMetadata($className, array('id'));
-
- $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
- $this->generateAndRequire($proxyGenerator, $metadata);
- }
-
- $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyCallableTypeHintClass.php');
-
- $this->assertEquals(1, substr_count($classCode, 'call(callable $foo)'));
- }
-
- public function testClassWithInvalidTypeHintOnProxiedMethod()
- {
- $className = 'Doctrine\Tests\Common\Proxy\InvalidTypeHintClass';
- $metadata = $this->createClassMetadata($className, array('id'));
- $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
-
- $this->setExpectedException(
- 'Doctrine\Common\Proxy\Exception\UnexpectedValueException',
- 'The type hint of parameter "foo" in method "invalidTypeHintMethod"'
- .' in class "' . $className . '" is invalid.'
- );
- $proxyGenerator->generateProxyClass($metadata);
- }
-
- public function testNoConfigDirThrowsException()
- {
- $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException');
- new ProxyGenerator(null, null);
- }
-
- public function testNoNamespaceThrowsException()
- {
- $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException');
- new ProxyGenerator(__DIR__ . '/generated', null);
- }
-
- public function testInvalidPlaceholderThrowsException()
- {
- $this->setExpectedException('Doctrine\Common\Proxy\Exception\InvalidArgumentException');
- $generator = new ProxyGenerator(__DIR__ . '/generated', 'SomeNamespace');
- $generator->setPlaceholder('', array());
- }
-
- public function testUseEvalIfNoFilenameIsGiven()
- {
- $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
-
- $className = __NAMESPACE__ . '\\EvalBase';
-
- $metadata = $this->createClassMetadata($className, array('id'));
-
- $proxyGenerator->generateProxyClass($metadata);
-
- $reflClass = new ReflectionClass('Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\EvalBase');
-
- $this->assertContains("eval()'d code", $reflClass->getFileName());
- }
-
- private function createClassMetadata($className, array $ids)
- {
- $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
- $reflClass = new ReflectionClass($className);
- $metadata->expects($this->any())->method('getReflectionClass')->will($this->returnValue($reflClass));
- $metadata->expects($this->any())->method('getIdentifierFieldNames')->will($this->returnValue($ids));
- $metadata->expects($this->any())->method('getName')->will($this->returnValue($className));
-
- return $metadata;
- }
-}
-
-class EvalBase
-{
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php
deleted file mode 100644
index 9a5173c..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyLogicTest.php
+++ /dev/null
@@ -1,696 +0,0 @@
-.
- */
-
-namespace Doctrine\Tests\Common\Proxy;
-
-use Doctrine\Common\Proxy\ProxyGenerator;
-use Doctrine\Common\Proxy\Proxy;
-use Doctrine\Common\Proxy\Exception\UnexpectedValueException;
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
-use PHPUnit_Framework_TestCase;
-
-/**
- * Test the generated proxies behavior. These tests make assumptions about the structure of LazyLoadableObject
- *
- * @author Marco Pivetta
- */
-class ProxyLogicTest extends PHPUnit_Framework_TestCase
-{
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject
- */
- protected $proxyLoader;
-
- /**
- * @var ClassMetadata
- */
- protected $lazyLoadableObjectMetadata;
-
- /**
- * @var LazyLoadableObject|Proxy
- */
- protected $lazyObject;
-
- protected $identifier = array(
- 'publicIdentifierField' => 'publicIdentifierFieldValue',
- 'protectedIdentifierField' => 'protectedIdentifierFieldValue',
- );
-
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject|Callable
- */
- protected $initializerCallbackMock;
-
- /**
- * {@inheritDoc}
- */
- public function setUp()
- {
- $this->proxyLoader = $loader = $this->getMock('stdClass', array('load'), array(), '', false);
- $this->initializerCallbackMock = $this->getMock('stdClass', array('__invoke'));
- $identifier = $this->identifier;
- $this->lazyLoadableObjectMetadata = $metadata = new LazyLoadableObjectClassMetadata();
-
- // emulating what should happen in a proxy factory
- $cloner = function (LazyLoadableObject $proxy) use ($loader, $identifier, $metadata) {
- /* @var $proxy LazyLoadableObject|Proxy */
- if ($proxy->__isInitialized()) {
- return;
- }
-
- $proxy->__setInitialized(true);
- $proxy->__setInitializer(null);
- $original = $loader->load($identifier);
-
- if (null === $original) {
- throw new UnexpectedValueException();
- }
-
- foreach ($metadata->getReflectionClass()->getProperties() as $reflProperty) {
- $propertyName = $reflProperty->getName();
-
- if ($metadata->hasField($propertyName) || $metadata->hasAssociation($propertyName)) {
- $reflProperty->setAccessible(true);
- $reflProperty->setValue($proxy, $reflProperty->getValue($original));
- }
- }
- };
-
- $proxyClassName = 'Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\LazyLoadableObject';
-
- // creating the proxy class
- if (!class_exists($proxyClassName, false)) {
- $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true);
- $proxyGenerator->generateProxyClass($metadata);
- require_once $proxyGenerator->getProxyFileName($metadata->getName());
- }
-
- $this->lazyObject = new $proxyClassName($this->getClosure($this->initializerCallbackMock), $cloner);
-
- // setting identifiers in the proxy via reflection
- foreach ($metadata->getIdentifierFieldNames() as $idField) {
- $prop = $metadata->getReflectionClass()->getProperty($idField);
- $prop->setAccessible(true);
- $prop->setValue($this->lazyObject, $identifier[$idField]);
- }
-
- $this->assertFalse($this->lazyObject->__isInitialized());
- }
-
- public function testFetchingPublicIdentifierDoesNotCauseLazyLoading()
- {
- $this->configureInitializerMock(0);
-
- $this->assertSame('publicIdentifierFieldValue', $this->lazyObject->publicIdentifierField);
- }
-
- public function testFetchingIdentifiersViaPublicGetterDoesNotCauseLazyLoading()
- {
- $this->configureInitializerMock(0);
-
- $this->assertSame('protectedIdentifierFieldValue', $this->lazyObject->getProtectedIdentifierField());
- }
-
- public function testCallingMethodCausesLazyLoading()
- {
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, 'testInitializationTriggeringMethod', array()),
- function (Proxy $proxy) {
- $proxy->__setInitializer(null);
- }
- );
-
- $this->lazyObject->testInitializationTriggeringMethod();
- $this->lazyObject->testInitializationTriggeringMethod();
- }
-
- public function testFetchingPublicFieldsCausesLazyLoading()
- {
- $test = $this;
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, '__get', array('publicPersistentField')),
- function () use ($test) {
- $test->setProxyValue('publicPersistentField', 'loadedValue');
- }
- );
-
- $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField);
- $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField);
- }
-
- public function testFetchingPublicAssociationCausesLazyLoading()
- {
- $test = $this;
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, '__get', array('publicAssociation')),
- function () use ($test) {
- $test->setProxyValue('publicAssociation', 'loadedAssociation');
- }
- );
-
- $this->assertSame('loadedAssociation', $this->lazyObject->publicAssociation);
- $this->assertSame('loadedAssociation', $this->lazyObject->publicAssociation);
- }
-
- public function testFetchingProtectedAssociationViaPublicGetterCausesLazyLoading()
- {
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, 'getProtectedAssociation', array()),
- function (Proxy $proxy) {
- $proxy->__setInitializer(null);
- }
- );
-
- $this->assertSame('protectedAssociationValue', $this->lazyObject->getProtectedAssociation());
- $this->assertSame('protectedAssociationValue', $this->lazyObject->getProtectedAssociation());
- }
-
- public function testLazyLoadingTriggeredOnlyAtFirstPublicPropertyRead()
- {
- $test = $this;
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, '__get', array('publicPersistentField')),
- function () use ($test) {
- $test->setProxyValue('publicPersistentField', 'loadedValue');
- $test->setProxyValue('publicAssociation', 'publicAssociationValue');
- }
- );
-
- $this->assertSame('loadedValue', $this->lazyObject->publicPersistentField);
- $this->assertSame('publicAssociationValue', $this->lazyObject->publicAssociation);
- }
-
- public function testNoticeWhenReadingNonExistentPublicProperties()
- {
- $this->configureInitializerMock(0);
-
- $class = get_class($this->lazyObject);
- $this->setExpectedException(
- 'PHPUnit_Framework_Error_Notice',
- 'Undefined property: ' . $class . '::$non_existing_property'
- );
-
- $this->lazyObject->non_existing_property;
- }
-
- public function testFalseWhenCheckingNonExistentProperty()
- {
- $this->configureInitializerMock(0);
-
- $this->assertFalse(isset($this->lazyObject->non_existing_property));
- }
-
- public function testNoErrorWhenSettingNonExistentProperty()
- {
- $this->configureInitializerMock(0);
-
- $this->lazyObject->non_existing_property = 'now has a value';
- $this->assertSame('now has a value', $this->lazyObject->non_existing_property);
- }
-
- public function testCloningCallsClonerWithClonedObject()
- {
- $lazyObject = $this->lazyObject;
- $test = $this;
- $cb = $this->getMock('stdClass', array('cb'));
- $cb
- ->expects($this->once())
- ->method('cb')
- ->will($this->returnCallback(function (LazyLoadableObject $proxy) use ($lazyObject, $test) {
- /* @var $proxy LazyLoadableObject|Proxy */
- $test->assertNotSame($proxy, $lazyObject);
- $proxy->__setInitializer(null);
- $proxy->publicAssociation = 'clonedAssociation';
- }));
-
- $this->lazyObject->__setCloner($this->getClosure(array($cb, 'cb')));
-
- $cloned = clone $this->lazyObject;
- $this->assertSame('clonedAssociation', $cloned->publicAssociation);
- $this->assertNotSame($cloned, $lazyObject, 'a clone of the lazy object is retrieved');
- }
-
- public function testFetchingTransientPropertiesWillNotTriggerLazyLoading()
- {
- $this->configureInitializerMock(0);
-
- $this->assertSame(
- 'publicTransientFieldValue',
- $this->lazyObject->publicTransientField,
- 'fetching public transient field won\'t trigger lazy loading'
- );
- $property = $this
- ->lazyLoadableObjectMetadata
- ->getReflectionClass()
- ->getProperty('protectedTransientField');
- $property->setAccessible(true);
- $this->assertSame(
- 'protectedTransientFieldValue',
- $property->getValue($this->lazyObject),
- 'fetching protected transient field via reflection won\'t trigger lazy loading'
- );
- }
-
- /**
- * Provided to guarantee backwards compatibility
- */
- public function testLoadProxyMethod()
- {
- $this->configureInitializerMock(2, array($this->lazyObject, '__load', array()));
-
- $this->lazyObject->__load();
- $this->lazyObject->__load();
- }
-
- public function testLoadingWithPersisterWillBeTriggeredOnlyOnce()
- {
- $this
- ->proxyLoader
- ->expects($this->once())
- ->method('load')
- ->with(
- array(
- 'publicIdentifierField' => 'publicIdentifierFieldValue',
- 'protectedIdentifierField' => 'protectedIdentifierFieldValue',
- ),
- $this->lazyObject
- )
- ->will($this->returnCallback(function ($id, LazyLoadableObject $lazyObject) {
- // setting a value to verify that the persister can actually set something in the object
- $lazyObject->publicAssociation = $id['publicIdentifierField'] . '-test';
- return true;
- }));
- $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation());
-
- $this->lazyObject->__load();
- $this->lazyObject->__load();
- $this->assertSame('publicIdentifierFieldValue-test', $this->lazyObject->publicAssociation);
- }
-
- public function testFailedLoadingWillThrowException()
- {
- $this->proxyLoader->expects($this->any())->method('load')->will($this->returnValue(null));
- $this->setExpectedException('UnexpectedValueException');
- $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation());
-
- $this->lazyObject->__load();
- }
-
- public function testCloningWithPersister()
- {
- $this->lazyObject->publicTransientField = 'should-not-change';
- $this
- ->proxyLoader
- ->expects($this->exactly(2))
- ->method('load')
- ->with(array(
- 'publicIdentifierField' => 'publicIdentifierFieldValue',
- 'protectedIdentifierField' => 'protectedIdentifierFieldValue',
- ))
- ->will($this->returnCallback(function () {
- $blueprint = new LazyLoadableObject();
- $blueprint->publicPersistentField = 'checked-persistent-field';
- $blueprint->publicAssociation = 'checked-association-field';
- $blueprint->publicTransientField = 'checked-transient-field';
-
- return $blueprint;
- }));
-
- $firstClone = clone $this->lazyObject;
- $this->assertSame(
- 'checked-persistent-field',
- $firstClone->publicPersistentField,
- 'Persistent fields are cloned correctly'
- );
- $this->assertSame(
- 'checked-association-field',
- $firstClone->publicAssociation,
- 'Associations are cloned correctly'
- );
- $this->assertSame(
- 'should-not-change',
- $firstClone->publicTransientField,
- 'Transient fields are not overwritten'
- );
-
- $secondClone = clone $this->lazyObject;
- $this->assertSame(
- 'checked-persistent-field',
- $secondClone->publicPersistentField,
- 'Persistent fields are cloned correctly'
- );
- $this->assertSame(
- 'checked-association-field',
- $secondClone->publicAssociation,
- 'Associations are cloned correctly'
- );
- $this->assertSame(
- 'should-not-change',
- $secondClone->publicTransientField,
- 'Transient fields are not overwritten'
- );
-
- // those should not trigger lazy loading
- $firstClone->__load();
- $secondClone->__load();
- }
-
- public function testNotInitializedProxyUnserialization()
- {
- $this->configureInitializerMock();
-
- $serialized = serialize($this->lazyObject);
- /* @var $unserialized LazyLoadableObject|Proxy */
- $unserialized = unserialize($serialized);
- $reflClass = $this->lazyLoadableObjectMetadata->getReflectionClass();
-
- $this->assertFalse($unserialized->__isInitialized(), 'serialization didn\'t cause intialization');
-
- // Checking identifiers
- $this->assertSame('publicIdentifierFieldValue', $unserialized->publicIdentifierField, 'identifiers are kept');
- $protectedIdentifierField = $reflClass->getProperty('protectedIdentifierField');
- $protectedIdentifierField->setAccessible(true);
- $this->assertSame(
- 'protectedIdentifierFieldValue',
- $protectedIdentifierField->getValue($unserialized),
- 'identifiers are kept'
- );
-
- // Checking transient fields
- $this->assertSame(
- 'publicTransientFieldValue',
- $unserialized->publicTransientField,
- 'transient fields are kept'
- );
- $protectedTransientField = $reflClass->getProperty('protectedTransientField');
- $protectedTransientField->setAccessible(true);
- $this->assertSame(
- 'protectedTransientFieldValue',
- $protectedTransientField->getValue($unserialized),
- 'transient fields are kept'
- );
-
- // Checking persistent fields
- $this->assertSame(
- 'publicPersistentFieldValue',
- $unserialized->publicPersistentField,
- 'persistent fields are kept'
- );
- $protectedPersistentField = $reflClass->getProperty('protectedPersistentField');
- $protectedPersistentField->setAccessible(true);
- $this->assertSame(
- 'protectedPersistentFieldValue',
- $protectedPersistentField->getValue($unserialized),
- 'persistent fields are kept'
- );
-
- // Checking associations
- $this->assertSame('publicAssociationValue', $unserialized->publicAssociation, 'associations are kept');
- $protectedAssociationField = $reflClass->getProperty('protectedAssociation');
- $protectedAssociationField->setAccessible(true);
- $this->assertSame(
- 'protectedAssociationValue',
- $protectedAssociationField->getValue($unserialized),
- 'associations are kept'
- );
- }
-
- public function testInitializedProxyUnserialization()
- {
- // persister will retrieve the lazy object itself, so that we don't have to re-define all field values
- $this->proxyLoader->expects($this->once())->method('load')->will($this->returnValue($this->lazyObject));
- $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation());
- $this->lazyObject->__load();
-
- $serialized = serialize($this->lazyObject);
- $reflClass = $this->lazyLoadableObjectMetadata->getReflectionClass();
- /* @var $unserialized LazyLoadableObject|Proxy */
- $unserialized = unserialize($serialized);
-
- $this->assertTrue($unserialized->__isInitialized(), 'serialization didn\'t cause intialization');
-
- // Checking transient fields
- $this->assertSame(
- 'publicTransientFieldValue',
- $unserialized->publicTransientField,
- 'transient fields are kept'
- );
- $protectedTransientField = $reflClass->getProperty('protectedTransientField');
- $protectedTransientField->setAccessible(true);
- $this->assertSame(
- 'protectedTransientFieldValue',
- $protectedTransientField->getValue($unserialized),
- 'transient fields are kept'
- );
-
- // Checking persistent fields
- $this->assertSame(
- 'publicPersistentFieldValue',
- $unserialized->publicPersistentField,
- 'persistent fields are kept'
- );
- $protectedPersistentField = $reflClass->getProperty('protectedPersistentField');
- $protectedPersistentField->setAccessible(true);
- $this->assertSame(
- 'protectedPersistentFieldValue',
- $protectedPersistentField->getValue($unserialized),
- 'persistent fields are kept'
- );
-
- // Checking identifiers
- $this->assertSame(
- 'publicIdentifierFieldValue',
- $unserialized->publicIdentifierField,
- 'identifiers are kept'
- );
- $protectedIdentifierField = $reflClass->getProperty('protectedIdentifierField');
- $protectedIdentifierField->setAccessible(true);
- $this->assertSame(
- 'protectedIdentifierFieldValue',
- $protectedIdentifierField->getValue($unserialized),
- 'identifiers are kept'
- );
-
- // Checking associations
- $this->assertSame('publicAssociationValue', $unserialized->publicAssociation, 'associations are kept');
- $protectedAssociationField = $reflClass->getProperty('protectedAssociation');
- $protectedAssociationField->setAccessible(true);
- $this->assertSame(
- 'protectedAssociationValue',
- $protectedAssociationField->getValue($unserialized),
- 'associations are kept'
- );
- }
-
- public function testInitializationRestoresDefaultPublicLazyLoadedFieldValues()
- {
- // setting noop persister
- $this->proxyLoader->expects($this->once())->method('load')->will($this->returnValue($this->lazyObject));
- $this->lazyObject->__setInitializer($this->getSuggestedInitializerImplementation());
-
- $this->assertSame(
- 'publicPersistentFieldValue',
- $this->lazyObject->publicPersistentField,
- 'Persistent field is restored to default value'
- );
- $this->assertSame(
- 'publicAssociationValue',
- $this->lazyObject->publicAssociation,
- 'Association is restored to default value'
- );
- }
-
- public function testSettingPublicFieldsCausesLazyLoading()
- {
- $test = $this;
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, '__set', array('publicPersistentField', 'newPublicPersistentFieldValue')),
- function () use ($test) {
- $test->setProxyValue('publicPersistentField', 'overrideValue');
- $test->setProxyValue('publicAssociation', 'newAssociationValue');
- }
- );
-
- $this->lazyObject->publicPersistentField = 'newPublicPersistentFieldValue';
- $this->assertSame('newPublicPersistentFieldValue', $this->lazyObject->publicPersistentField);
- $this->assertSame('newAssociationValue', $this->lazyObject->publicAssociation);
- }
-
- public function testSettingPublicAssociationCausesLazyLoading()
- {
- $test = $this;
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, '__set', array('publicAssociation', 'newPublicAssociationValue')),
- function () use ($test) {
- $test->setProxyValue('publicPersistentField', 'newPublicPersistentFieldValue');
- $test->setProxyValue('publicAssociation', 'overrideValue');
- }
- );
-
- $this->lazyObject->publicAssociation = 'newPublicAssociationValue';
- $this->assertSame('newPublicAssociationValue', $this->lazyObject->publicAssociation);
- $this->assertSame('newPublicPersistentFieldValue', $this->lazyObject->publicPersistentField);
- }
-
- public function testCheckingPublicFieldsCausesLazyLoading()
- {
- $test = $this;
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, '__isset', array('publicPersistentField')),
- function () use ($test) {
- $test->setProxyValue('publicPersistentField', null);
- $test->setProxyValue('publicAssociation', 'setPublicAssociation');
- }
- );
-
- $this->assertFalse(isset($this->lazyObject->publicPersistentField));
- $this->assertNull($this->lazyObject->publicPersistentField);
- $this->assertTrue(isset($this->lazyObject->publicAssociation));
- $this->assertSame('setPublicAssociation', $this->lazyObject->publicAssociation);
- }
-
- public function testCheckingPublicAssociationCausesLazyLoading()
- {
- $test = $this;
- $this->configureInitializerMock(
- 1,
- array($this->lazyObject, '__isset', array('publicAssociation')),
- function () use ($test) {
- $test->setProxyValue('publicPersistentField', 'newPersistentFieldValue');
- $test->setProxyValue('publicAssociation', 'setPublicAssociation');
- }
- );
-
- $this->assertTrue(isset($this->lazyObject->publicAssociation));
- $this->assertSame('setPublicAssociation', $this->lazyObject->publicAssociation);
- $this->assertTrue(isset($this->lazyObject->publicPersistentField));
- $this->assertSame('newPersistentFieldValue', $this->lazyObject->publicPersistentField);
- }
-
- /**
- * Converts a given callable into a closure
- *
- * @param callable $callable
- * @return \Closure
- */
- public function getClosure($callable) {
- return function () use ($callable) {
- call_user_func_array($callable, func_get_args());
- };
- }
-
- /**
- * Configures the current initializer callback mock with provided matcher params
- *
- * @param int $expectedCallCount the number of invocations to be expected. If a value< 0 is provided, `any` is used
- * @param array $callParamsMatch an ordered array of parameters to be expected
- * @param callable $callbackClosure a return callback closure
- *
- * @return \PHPUnit_Framework_MockObject_MockObject|
- */
- protected function configureInitializerMock(
- $expectedCallCount = 0,
- array $callParamsMatch = null,
- \Closure $callbackClosure = null
- ) {
- if (!$expectedCallCount) {
- $invocationCountMatcher = $this->exactly((int) $expectedCallCount);
- } else {
- $invocationCountMatcher = $expectedCallCount < 0 ? $this->any() : $this->exactly($expectedCallCount);
- }
-
- $invocationMocker = $this->initializerCallbackMock->expects($invocationCountMatcher)->method('__invoke');
-
- if (null !== $callParamsMatch) {
- call_user_func_array(array($invocationMocker, 'with'), $callParamsMatch);
- }
-
- if ($callbackClosure) {
- $invocationMocker->will($this->returnCallback($callbackClosure));
- }
- }
-
- /**
- * Sets a value in the current proxy object without triggering lazy loading through `__set`
- *
- * @link https://bugs.php.net/bug.php?id=63463
- *
- * @param string $property
- * @param mixed $value
- */
- public function setProxyValue($property, $value)
- {
- $reflectionProperty = new \ReflectionProperty($this->lazyObject, $property);
- $initializer = $this->lazyObject->__getInitializer();
-
- // disabling initializer since setting `publicPersistentField` triggers `__set`/`__get`
- $this->lazyObject->__setInitializer(null);
- $reflectionProperty->setValue($this->lazyObject, $value);
- $this->lazyObject->__setInitializer($initializer);
- }
-
- /**
- * Retrieves the suggested implementation of an initializer that proxy factories in O*M
- * are currently following, and that should be used to initialize the current proxy object
- *
- * @return \Closure
- */
- protected function getSuggestedInitializerImplementation()
- {
- $loader = $this->proxyLoader;
- $identifier = $this->identifier;
-
- return function (LazyLoadableObject $proxy) use ($loader, $identifier) {
- /* @var $proxy LazyLoadableObject|Proxy */
- $proxy->__setInitializer(null);
- $proxy->__setCloner(null);
-
-
- if ($proxy->__isInitialized()) {
- return;
- }
-
- $properties = $proxy->__getLazyProperties();
-
- foreach ($properties as $propertyName => $property) {
- if (!isset($proxy->$propertyName)) {
- $proxy->$propertyName = $properties[$propertyName];
- }
- }
-
- $proxy->__setInitialized(true);
-
- if (method_exists($proxy, '__wakeup')) {
- $proxy->__wakeup();
- }
-
- if (null === $loader->load($identifier, $proxy)) {
- throw new \UnexpectedValueException('Couldn\'t load');
- }
- };
- }
-}
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php
deleted file mode 100644
index 1ed9d92..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php
+++ /dev/null
@@ -1,327 +0,0 @@
-.
- */
-
-namespace Doctrine\Tests\Common\Proxy;
-
-use Doctrine\Common\Proxy\ProxyGenerator;
-use Doctrine\Common\Proxy\Proxy;
-use Doctrine\Common\Proxy\Exception\UnexpectedValueException;
-use PHPUnit_Framework_TestCase;
-use ReflectionClass;
-
-/**
- * Test for behavior of proxies with inherited magic methods
- *
- * @author Marco Pivetta
- */
-class ProxyMagicMethodsTest extends PHPUnit_Framework_TestCase
-{
- /**
- * @var \Doctrine\Common\Proxy\ProxyGenerator
- */
- protected $proxyGenerator;
-
- /**
- * @var LazyLoadableObject|Proxy
- */
- protected $lazyObject;
-
- protected $identifier = array(
- 'publicIdentifierField' => 'publicIdentifierFieldValue',
- 'protectedIdentifierField' => 'protectedIdentifierFieldValue',
- );
-
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject|Callable
- */
- protected $initializerCallbackMock;
-
- /**
- * {@inheritDoc}
- */
- public function setUp()
- {
- $this->proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . '\\MagicMethodProxy');
- }
-
- public static function tearDownAfterClass()
- {
-
- }
-
- public function testInheritedMagicGet()
- {
- $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicGetClass');
- $proxy = new $proxyClassName(
- function (Proxy $proxy, $method, $params) use (&$counter) {
- if ( ! in_array($params[0], array('publicField', 'test', 'notDefined'))) {
- throw new \InvalidArgumentException('Unexpected access to field "' . $params[0] . '"');
- }
-
- $initializer = $proxy->__getInitializer();
-
- $proxy->__setInitializer(null);
-
- $proxy->publicField = 'modifiedPublicField';
- $counter += 1;
-
- $proxy->__setInitializer($initializer);
-
- }
- );
-
- $this->assertSame('id', $proxy->id);
- $this->assertSame('modifiedPublicField', $proxy->publicField);
- $this->assertSame('test', $proxy->test);
- $this->assertSame('not defined', $proxy->notDefined);
-
- $this->assertSame(3, $counter);
- }
-
- /**
- * @group DCOM-194
- */
- public function testInheritedMagicGetByRef()
- {
- $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicGetByRefClass');
- /* @var $proxy \Doctrine\Tests\Common\Proxy\MagicGetByRefClass */
- $proxy = new $proxyClassName();
- $proxy->valueField = 123;
- $value = & $proxy->__get('value');
-
- $this->assertSame(123, $value);
-
- $value = 456;
-
- $this->assertSame(456, $proxy->__get('value'), 'Value was fetched by reference');
-
- $this->setExpectedException('InvalidArgumentException');
-
- $undefined = $proxy->nonExisting;
- }
-
- public function testInheritedMagicSet()
- {
- $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicSetClass');
- $proxy = new $proxyClassName(
- function (Proxy $proxy, $method, $params) use (&$counter) {
- if ( ! in_array($params[0], array('publicField', 'test', 'notDefined'))) {
- throw new \InvalidArgumentException('Unexpected access to field "' . $params[0] . '"');
- }
-
- $counter += 1;
- }
- );
-
- $this->assertSame('id', $proxy->id);
-
- $proxy->publicField = 'publicFieldValue';
-
- $this->assertSame('publicFieldValue', $proxy->publicField);
-
- $proxy->test = 'testValue';
-
- $this->assertSame('testValue', $proxy->testAttribute);
-
- $proxy->notDefined = 'not defined';
-
- $this->assertSame('not defined', $proxy->testAttribute);
- $this->assertSame(3, $counter);
- }
-
- public function testInheritedMagicSleep()
- {
- $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicSleepClass');
- $proxy = new $proxyClassName();
-
- $this->assertSame('defaultValue', $proxy->serializedField);
- $this->assertSame('defaultValue', $proxy->nonSerializedField);
-
- $proxy->serializedField = 'changedValue';
- $proxy->nonSerializedField = 'changedValue';
-
- $unserialized = unserialize(serialize($proxy));
-
- $this->assertSame('changedValue', $unserialized->serializedField);
- $this->assertSame('defaultValue', $unserialized->nonSerializedField, 'Field was not returned by "__sleep"');
- }
-
- public function testInheritedMagicWakeup()
- {
- $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicWakeupClass');
- $proxy = new $proxyClassName();
-
- $this->assertSame('defaultValue', $proxy->wakeupValue);
-
- $proxy->wakeupValue = 'changedValue';
- $unserialized = unserialize(serialize($proxy));
-
- $this->assertSame('newWakeupValue', $unserialized->wakeupValue, '"__wakeup" was called');
-
- $unserialized->__setInitializer(function (Proxy $proxy) {
- $proxy->__setInitializer(null);
-
- $proxy->publicField = 'newPublicFieldValue';
- });
-
- $this->assertSame('newPublicFieldValue', $unserialized->publicField, 'Proxy can still be initialized');
- }
-
- public function testInheritedMagicIsset()
- {
- $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicIssetClass');
- $proxy = new $proxyClassName(function (Proxy $proxy, $method, $params) use (&$counter) {
- if (in_array($params[0], array('publicField', 'test', 'nonExisting'))) {
- $initializer = $proxy->__getInitializer();
-
- $proxy->__setInitializer(null);
-
- $proxy->publicField = 'modifiedPublicField';
- $counter += 1;
-
- $proxy->__setInitializer($initializer);
-
- return;
- }
-
- throw new \InvalidArgumentException(
- sprintf('Should not be initialized when checking isset("%s")', $params[0])
- );
- });
-
- $this->assertTrue(isset($proxy->id));
- $this->assertTrue(isset($proxy->publicField));
- $this->assertTrue(isset($proxy->test));
- $this->assertFalse(isset($proxy->nonExisting));
-
- $this->assertSame(3, $counter);
- }
-
- public function testInheritedMagicClone()
- {
- $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\MagicCloneClass');
- $proxy = new $proxyClassName(
- null,
- function ($proxy) {
- $proxy->cloned = true;
- }
- );
-
- $cloned = clone $proxy;
-
- $this->assertSame('newClonedValue', $cloned->clonedValue);
- $this->assertFalse($proxy->cloned);
- $this->assertTrue($cloned->cloned);
- }
-
- /**
- * @group DCOM-175
- */
- public function testClonesPrivateProperties()
- {
- $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\SerializedClass');
- /* @var $proxy SerializedClass */
- $proxy = new $proxyClassName();
-
- $proxy->setFoo(1);
- $proxy->setBar(2);
- $proxy->setBaz(3);
-
- $unserialized = unserialize(serialize($proxy));
-
- $this->assertSame(1, $unserialized->getFoo());
- $this->assertSame(2, $unserialized->getBar());
- $this->assertSame(3, $unserialized->getBaz());
- }
-
- /**
- * @param $className
- *
- * @return string
- */
- private function generateProxyClass($className)
- {
- $proxyClassName = 'Doctrine\\Tests\\Common\\Proxy\\MagicMethodProxy\\__CG__\\' . $className;
-
- if (class_exists($proxyClassName, false)) {
- return $proxyClassName;
- }
-
- $metadata = $this->getMock('Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata');
-
- $metadata
- ->expects($this->any())
- ->method('getName')
- ->will($this->returnValue($className));
-
- $metadata
- ->expects($this->any())
- ->method('getIdentifier')
- ->will($this->returnValue(array('id')));
-
- $metadata
- ->expects($this->any())
- ->method('getReflectionClass')
- ->will($this->returnValue(new ReflectionClass($className)));
-
- $metadata
- ->expects($this->any())
- ->method('isIdentifier')
- ->will($this->returnCallback(function ($fieldName) {
- return 'id' === $fieldName;
- }));
-
- $metadata
- ->expects($this->any())
- ->method('hasField')
- ->will($this->returnCallback(function ($fieldName) {
- return in_array($fieldName, array('id', 'publicField'));
- }));
-
- $metadata
- ->expects($this->any())
- ->method('hasAssociation')
- ->will($this->returnValue(false));
-
- $metadata
- ->expects($this->any())
- ->method('getFieldNames')
- ->will($this->returnValue(array('id', 'publicField')));
-
- $metadata
- ->expects($this->any())
- ->method('getIdentifierFieldNames')
- ->will($this->returnValue(array('id')));
-
- $metadata
- ->expects($this->any())
- ->method('getAssociationNames')
- ->will($this->returnValue(array()));
-
- $metadata
- ->expects($this->any())
- ->method('getTypeOfField')
- ->will($this->returnValue('string'));
-
- $this->proxyGenerator->generateProxyClass($metadata, $this->proxyGenerator->getProxyFileName($className));
- require_once $this->proxyGenerator->getProxyFileName($className);
-
- return $proxyClassName;
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php
deleted file mode 100644
index a36c3bb..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php
+++ /dev/null
@@ -1,72 +0,0 @@
-foo = $foo;
- }
-
- /**
- * @return mixed|string
- */
- public function getFoo()
- {
- return $this->foo;
- }
-
- /**
- * @param $bar
- */
- public function setBar($bar)
- {
- $this->bar = $bar;
- }
-
- /**
- * @return mixed|string
- */
- public function getBar()
- {
- return $this->bar;
- }
-
- /**
- * @param $baz
- */
- public function setBaz($baz)
- {
- $this->baz = $baz;
- }
-
- /**
- * @return mixed|string
- */
- public function getBaz()
- {
- return $this->baz;
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php
deleted file mode 100644
index 3c6ffcd..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SleepClass.php
+++ /dev/null
@@ -1,19 +0,0 @@
-getMock('stdClass', array('callGet'));
- $getCheckMock->expects($this->never())->method('callGet');
- $initializer = function () use ($getCheckMock) {
- call_user_func($getCheckMock);
- };
-
- $mockProxy = new RuntimePublicReflectionPropertyTestProxyMock();
- $mockProxy->__setInitializer($initializer);
-
- $reflProperty = new RuntimePublicReflectionProperty(
- __NAMESPACE__ . '\RuntimePublicReflectionPropertyTestProxyMock',
- 'checkedProperty'
- );
-
- $this->assertSame('testValue', $reflProperty->getValue($mockProxy));
- unset($mockProxy->checkedProperty);
- $this->assertNull($reflProperty->getValue($mockProxy));
- }
-
- public function testSetValueOnProxyPublicProperty()
- {
- $setCheckMock = $this->getMock('stdClass', array('neverCallSet'));
- $setCheckMock->expects($this->never())->method('neverCallSet');
- $initializer = function () use ($setCheckMock) {
- call_user_func(array($setCheckMock, 'neverCallSet'));
- };
-
- $mockProxy = new RuntimePublicReflectionPropertyTestProxyMock();
- $mockProxy->__setInitializer($initializer);
-
- $reflProperty = new RuntimePublicReflectionProperty(
- __NAMESPACE__ . '\RuntimePublicReflectionPropertyTestProxyMock',
- 'checkedProperty'
- );
-
- $reflProperty->setValue($mockProxy, 'newValue');
- $this->assertSame('newValue', $mockProxy->checkedProperty);
-
- unset($mockProxy->checkedProperty);
- $reflProperty->setValue($mockProxy, 'otherNewValue');
- $this->assertSame('otherNewValue', $mockProxy->checkedProperty);
-
- $setCheckMock = $this->getMock('stdClass', array('callSet'));
- $setCheckMock->expects($this->once())->method('callSet');
- $initializer = function () use ($setCheckMock) {
- call_user_func(array($setCheckMock, 'callSet'));
- };
-
- $mockProxy->__setInitializer($initializer);
- $mockProxy->__setInitialized(true);
-
- unset($mockProxy->checkedProperty);
- $reflProperty->setValue($mockProxy, 'againNewValue');
- $this->assertSame('againNewValue', $mockProxy->checkedProperty);
- }
-}
-
-/**
- * Mock that simulates proxy public property lazy loading
- */
-class RuntimePublicReflectionPropertyTestProxyMock implements Proxy
-{
- /**
- * @var \Closure|null
- */
- private $initializer = null;
-
- /**
- * @var \Closure|null
- */
- private $initialized = false;
-
- /**
- * @var string
- */
- public $checkedProperty = 'testValue';
-
- /**
- * {@inheritDoc}
- */
- public function __getInitializer()
- {
- return $this->initializer;
- }
-
- /**
- * {@inheritDoc}
- */
- public function __setInitializer(\Closure $initializer = null)
- {
- $this->initializer = $initializer;
- }
-
- /**
- * {@inheritDoc}
- */
- public function __getLazyProperties()
- {
- }
-
- /**
- * {@inheritDoc}
- */
- public function __load()
- {
- }
-
- /**
- * {@inheritDoc}
- */
- public function __isInitialized()
- {
- return $this->initialized;
- }
-
- /**
- * {@inheritDoc}
- */
- public function __setInitialized($initialized)
- {
- $this->initialized = (bool) $initialized;
- }
-
- /**
- * @param string $name
- */
- public function __get($name)
- {
- if ($this->initializer) {
- $cb = $this->initializer;
- $cb();
- }
-
- return $this->checkedProperty;
- }
-
- /**
- * @param string $name
- * @param mixed $value
- */
- public function __set($name, $value)
- {
- if ($this->initializer) {
- $cb = $this->initializer;
- $cb();
- }
-
- // triggers notices if `$name` is used: see https://bugs.php.net/bug.php?id=63463
- $this->checkedProperty = $value;
- }
-
- /**
- * @param string $name
- *
- * @return integer
- */
- public function __isset($name)
- {
- if ($this->initializer) {
- $cb = $this->initializer;
- $cb();
- }
-
- return isset($this->checkedProperty);
- }
-
- /**
- * {@inheritDoc}
- */
- public function __setCloner(\Closure $cloner = null)
- {
- }
-
- /**
- * {@inheritDoc}
- */
- public function __getCloner()
- {
- }
-}
\ No newline at end of file
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php
deleted file mode 100644
index 844d4a5..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php
+++ /dev/null
@@ -1,7 +0,0 @@
-setExpectedException('ReflectionException');
- }
-
- $testsRoot = substr(__DIR__, 0, -strlen(__NAMESPACE__) - 1);
- $paths = array(
- 'Doctrine\\Tests' => array($testsRoot),
- );
- $staticReflectionParser = new StaticReflectionParser($parsedClassName, new Psr0FindFile($paths), $classAnnotationOptimize);
- $declaringClassName = $staticReflectionParser->getStaticReflectionParserForDeclaringClass('property', 'test')->getClassName();
- $this->assertEquals($expectedClassName, $declaringClassName);
-
- }
-
- /**
- * @return array
- */
- public function parentClassData()
- {
- $data = array();
- $noParentClassName = 'Doctrine\\Tests\\Common\\Reflection\\NoParent';
- $dummyParentClassName = 'Doctrine\\Tests\\Common\\Reflection\\Dummies\\NoParent';
- foreach (array(false, true) as $classAnnotationOptimize) {
- $data[] = array(
- $classAnnotationOptimize, $noParentClassName, $noParentClassName,
- );
- $data[] = array(
- $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\FullyClassifiedParent', $noParentClassName,
- );
- $data[] = array(
- $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\SameNamespaceParent', $noParentClassName,
- );
- $data[] = array(
- $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\DeeperNamespaceParent', $dummyParentClassName,
- );
- $data[] = array(
- $classAnnotationOptimize, 'Doctrine\\Tests\\Common\\Reflection\\UseParent', $dummyParentClassName,
- );
- }
- return $data;
- }
-
- /**
- * @dataProvider classAnnotationOptimize
- */
- public function testClassAnnotationOptimizedParsing($classAnnotationOptimize) {
- $testsRoot = substr(__DIR__, 0, -strlen(__NAMESPACE__) - 1);
- $paths = array(
- 'Doctrine\\Tests' => array($testsRoot),
- );
- $staticReflectionParser = new StaticReflectionParser('Doctrine\\Tests\\Common\\Reflection\\ExampleAnnotationClass', new Psr0FindFile($paths), $classAnnotationOptimize);
- $expectedDocComment = '/**
- * @Annotation(
- * key = "value"
- * )
- */';
- $this->assertEquals($expectedDocComment, $staticReflectionParser->getDocComment('class'));
- }
-
- /**
- * @return array
- */
- public function classAnnotationOptimize()
- {
- return array(
- array(false),
- array(true)
- );
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php
deleted file mode 100644
index dd512d4..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php
+++ /dev/null
@@ -1,9 +0,0 @@
-assertEquals($expectedClassName, ClassUtils::getRealClass($className));
- }
-
- /**
- * @dataProvider dataGetClass
- */
- public function testGetClass( $className, $expectedClassName )
- {
- $object = new $className();
- $this->assertEquals($expectedClassName, ClassUtils::getClass($object));
- }
-
- public function testGetParentClass()
- {
- $parentClass = ClassUtils::getParentClass( 'MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject' );
- $this->assertEquals('stdClass', $parentClass);
- }
-
- public function testGenerateProxyClassName()
- {
- $this->assertEquals( 'Proxies\__CG__\stdClass', ClassUtils::generateProxyClassName( 'stdClass', 'Proxies' ) );
- }
-
- /**
- * @dataProvider dataGetClass
- */
- public function testNewReflectionClass( $className, $expectedClassName )
- {
- $reflClass = ClassUtils::newReflectionClass( $className );
- $this->assertEquals( $expectedClassName, $reflClass->getName() );
- }
-
- /**
- * @dataProvider dataGetClass
- */
- public function testNewReflectionObject( $className, $expectedClassName )
- {
- $object = new $className;
- $reflClass = ClassUtils::newReflectionObject( $object );
- $this->assertEquals( $expectedClassName, $reflClass->getName() );
- }
- }
-
- class ChildObject extends \stdClass
- {
- }
-}
-
-namespace MyProject\Proxies\__CG__
-{
- class stdClass extends \stdClass
- {
- }
-}
-
-namespace MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util
-{
- class ChildObject extends \Doctrine\Tests\Common\Util\ChildObject
- {
- }
-}
-
-namespace MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__
-{
- class stdClass extends \MyProject\Proxies\__CG__\stdClass
- {
- }
-}
-
-namespace MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\Doctrine\Tests\Common\Util
-{
- class ChildObject extends \MyProject\Proxies\__CG__\Doctrine\Tests\Common\Util\ChildObject
- {
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php
deleted file mode 100644
index 66e8337..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-foo = "bar";
- $obj->bar = 1234;
-
- $var = Debug::export($obj, 2);
- $this->assertEquals( "stdClass", $var->__CLASS__ );
- }
-
- public function testExportDateTime()
- {
- $obj = new \DateTime( "2010-10-10 10:10:10" );
-
- $var = Debug::export( $obj, 2 );
- $this->assertEquals( "DateTime", $var->__CLASS__ );
- }
-
- public function testExportArrayTraversable()
- {
- $obj = new \ArrayObject(array('foobar'));
-
- $var = Debug::export($obj, 2);
- $this->assertContains('foobar', $var->__STORAGE__);
-
- $it = new \ArrayIterator(array('foobar'));
-
- $var = Debug::export($it, 5);
- $this->assertContains('foobar', $var->__STORAGE__);
- }
-
- public function testReturnsOutput()
- {
- ob_start();
-
- $dump = Debug::dump('foo');
- $outputValue = ob_get_contents();
-
- ob_end_clean();
-
- $this->assertSame($outputValue, $dump);
- }
-
- public function testDisablesOutput()
- {
- ob_start();
-
- $dump = Debug::dump('foo', 2, true, false);
- $outputValue = ob_get_contents();
-
- ob_end_clean();
-
- $this->assertEmpty($outputValue);
- $this->assertNotSame($outputValue, $dump);
- }
-}
diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php
deleted file mode 100644
index e8323d2..0000000
--- a/core/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
- */
-class NativePhpunitTask extends Task
-{
- private $test;
- private $testfile;
- private $testdirectory;
- private $configuration = null;
- private $coverageClover = null;
- private $junitlogfile = null;
- private $haltonfailure = true;
- private $haltonerror = true;
-
- public function setTestdirectory($directory) {
- $this->testdirectory = $directory;
- }
-
- public function setTest($test) {
- $this->test = $test;
- }
-
- public function setTestfile($testfile) {
- $this->testfile = $testfile;
- }
-
- public function setJunitlogfile($junitlogfile) {
- if (strlen($junitlogfile) == 0) {
- $junitlogfile = NULL;
- }
-
- $this->junitlogfile = $junitlogfile;
- }
-
- public function setConfiguration($configuration) {
- if (strlen($configuration) == 0) {
- $configuration = NULL;
- }
-
- $this->configuration = $configuration;
- }
-
- public function setCoverageClover($coverageClover) {
- if (strlen($coverageClover) == 0) {
- $coverageClover = NULL;
- }
-
- $this->coverageClover = $coverageClover;
- }
-
- public function setHaltonfailure($haltonfailures) {
- $this->haltonfailure = $haltonfailures;
- }
-
- public function setHaltonerror($haltonerrors) {
- $this->haltonerror = $haltonerrors;
- }
-
- public function init()
- {
- require_once "PHPUnit/Runner/Version.php";
- $version = PHPUnit_Runner_Version::id();
-
- if (version_compare($version, '3.4.0') < 0) {
- throw new BuildException("NativePHPUnitTask requires PHPUnit version >= 3.2.0", $this->getLocation());
- }
-
- require_once 'PHPUnit/Util/Filter.php';
-
- // point PHPUnit_MAIN_METHOD define to non-existing method
- if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'PHPUnitTask::undefined');
- }
- }
-
- public function main()
- {
- if (!is_dir(realpath($this->testdirectory))) {
- throw new BuildException("NativePHPUnitTask requires a Test Directory path given, '".$this->testdirectory."' given.");
- }
- set_include_path(realpath($this->testdirectory) . PATH_SEPARATOR . get_include_path());
-
- $printer = new NativePhpunitPrinter();
-
- $arguments = array(
- 'configuration' => $this->configuration,
- 'coverageClover' => $this->coverageClover,
- 'junitLogfile' => $this->junitlogfile,
- 'printer' => $printer,
- );
-
- $runner = new PHPUnit_TextUI_TestRunner();
- $suite = $runner->getTest($this->test, $this->testfile, true);
-
- try {
- $result = $runner->doRun($suite, $arguments);
- /* @var $result PHPUnit_Framework_TestResult */
-
- if ( ($this->haltonfailure && $result->failureCount() > 0) || ($this->haltonerror && $result->errorCount() > 0) ) {
- throw new BuildException("PHPUnit: ".$result->failureCount()." Failures and ".$result->errorCount()." Errors, ".
- "last failure message: ".$printer->getMessages());
- }
-
- $this->log("PHPUnit Success: ".count($result->passed())." tests passed, no ".
- "failures (".$result->skippedCount()." skipped, ".$result->notImplementedCount()." not implemented)");
-
- // Hudson for example doesn't like the backslash in class names
- if (is_file($this->coverageClover)) {
- $this->log("Generated Clover Coverage XML to: ".$this->coverageClover);
- $content = file_get_contents($this->coverageClover);
- $content = str_replace("\\", ".", $content);
- file_put_contents($this->coverageClover, $content);
- unset($content);
- }
-
- } catch(\Exception $e) {
- throw new BuildException("NativePhpunitTask failed: ".$e->getMessage());
- }
- }
-}
-
-class NativePhpunitPrinter extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener
-{
- private $_messages = array();
-
- public function write($buffer)
- {
- // do nothing
- }
-
- public function getMessages()
- {
- return $this->_messages;
- }
-
- /**
- * An error occurred.
- *
- * @param PHPUnit_Framework_Test $test
- * @param Exception $e
- * @param float $time
- */
- public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
- {
- $this->_messages[] = "Test ERROR: ".$test->getName().": ".$e->getMessage();
- }
-
- /**
- * A failure occurred.
- *
- * @param PHPUnit_Framework_Test $test
- * @param PHPUnit_Framework_AssertionFailedError $e
- * @param float $time
- */
- public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
- {
- $this->_messages[] = "Test FAILED: ".$test->getName().": ".$e->getMessage();
- }
-
- /**
- * Incomplete test.
- *
- * @param PHPUnit_Framework_Test $test
- * @param Exception $e
- * @param float $time
- */
- public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time)
- {
-
- }
-
- /**
- * Skipped test.
- *
- * @param PHPUnit_Framework_Test $test
- * @param Exception $e
- * @param float $time
- * @since Method available since Release 3.0.0
- */
- public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time)
- {
-
- }
-
- /**
- * A test suite started.
- *
- * @param PHPUnit_Framework_TestSuite $suite
- * @since Method available since Release 2.2.0
- */
- public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
- {
-
- }
-
- /**
- * A test suite ended.
- *
- * @param PHPUnit_Framework_TestSuite $suite
- * @since Method available since Release 2.2.0
- */
- public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
- {
-
- }
-
- /**
- * A test started.
- *
- * @param PHPUnit_Framework_Test $test
- */
- public function startTest(PHPUnit_Framework_Test $test)
- {
-
- }
-
- /**
- * A test ended.
- *
- * @param PHPUnit_Framework_Test $test
- * @param float $time
- */
- public function endTest(PHPUnit_Framework_Test $test, $time)
- {
-
- }
-}
diff --git a/core/vendor/doctrine/common/tests/README.markdown b/core/vendor/doctrine/common/tests/README.markdown
deleted file mode 100644
index e6f1703..0000000
--- a/core/vendor/doctrine/common/tests/README.markdown
+++ /dev/null
@@ -1,27 +0,0 @@
-# Running the Doctrine 2 Testsuite
-
-## Running tests
-
-Execute PHPUnit in the root folder of your doctrine-common clone.
-
- phpunit
-
-## Testing Lock-Support
-
-The Lock support in Doctrine 2 is tested using Gearman, which allows to run concurrent tasks in parallel.
-Install Gearman with PHP as follows:
-
-1. Go to http://www.gearman.org and download the latest Gearman Server
-2. Compile it and then call ldconfig
-3. Start it up "gearmand -vvvv"
-4. Install pecl/gearman by calling "gearman-beta"
-
-You can then go into tests/ and start up two workers:
-
- php Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php
-
-Then run the locking test-suite:
-
- phpunit --configuration Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php
-
-This can run considerable time, because it is using sleep() to test for the timing ranges of locks.
\ No newline at end of file
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/CHANGELOG.md b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/CHANGELOG.md
index 54ffb64..b770166 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/CHANGELOG.md
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========
+2.4.0
+-----
+
+ * deprecated the DebugClassLoader as it has been moved to the Debug component instead
+
2.3.0
-----
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php
index be1c7e2..b2be33a 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassCollectionLoader.php
@@ -53,7 +53,7 @@ public static function load($classes, $cacheDir, $name, $autoReload, $adaptive =
$classes = array_diff($classes, $declared);
// the cache is different depending on which classes are already declared
- $name = $name.'-'.substr(md5(implode('|', $classes)), 0, 5);
+ $name = $name.'-'.substr(hash('sha256', implode('|', $classes)), 0, 5);
}
$classes = array_unique($classes);
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassMapGenerator.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassMapGenerator.php
index 3b09305..59c99d0 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassMapGenerator.php
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassMapGenerator.php
@@ -39,7 +39,7 @@ public static function dump($dirs, $file)
/**
* Iterate over all files in the given directory searching for classes
*
- * @param Iterator|string $dir The directory to search in or an iterator
+ * @param \Iterator|string $dir The directory to search in or an iterator
*
* @return array A class map array
*/
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php
index 842f474..8edd4c1 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php
@@ -22,6 +22,8 @@
* @author Christophe Coevoet
*
* @api
+ *
+ * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the DebugClassLoader provided by the Debug component instead.
*/
class DebugClassLoader
{
@@ -40,6 +42,16 @@ public function __construct($classFinder)
}
/**
+ * Gets the wrapped class loader.
+ *
+ * @return object a class loader instance
+ */
+ public function getClassLoader()
+ {
+ return $this->classFinder;
+ }
+
+ /**
* Replaces all autoloaders implementing a findFile method by a DebugClassLoader wrapper.
*/
public static function enable()
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/README.md b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/README.md
index 5ac31c6..fc222b1 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/README.md
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/README.md
@@ -65,5 +65,5 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/ClassLoader/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php
index dfa51e3..7b71854 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php
@@ -189,7 +189,7 @@ public function getFixNamespaceDeclarationsDataWithoutTokenizer()
}
/**
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
*/
public function testUnableToLoadClassException()
{
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php
index 9dae537..a870935 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassLoaderTest.php
@@ -72,7 +72,7 @@ public function testLoadNonexistentClass($className, $testClassName, $message)
public function getLoadNonexistentClassTests()
{
return array(
- array('\\Pearlike3_Bar', '\\Pearlike3_Bar', '->loadClass() loads non exising Pearlike3_Bar class with a leading slash'),
+ array('\\Pearlike3_Bar', '\\Pearlike3_Bar', '->loadClass() loads non existing Pearlike3_Bar class with a leading slash'),
);
}
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php
index 18f64f7..b8600fc 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php
@@ -120,10 +120,6 @@ public function getTestCreateMapTests()
public function testCreateMapFinderSupport()
{
- if (!class_exists('Symfony\\Component\\Finder\\Finder')) {
- $this->markTestSkipped('Finder component is not available');
- }
-
$finder = new \Symfony\Component\Finder\Finder();
$finder->files()->in(__DIR__.'/Fixtures/beta/NamespaceCollision');
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/DebugClassLoaderTest.php b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/DebugClassLoaderTest.php
deleted file mode 100644
index 873515c..0000000
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/Tests/DebugClassLoaderTest.php
+++ /dev/null
@@ -1,52 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use Symfony\Component\ClassLoader\ClassLoader;
-use Symfony\Component\ClassLoader\DebugClassLoader;
-
-class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
-{
- private $loader;
-
- protected function setUp()
- {
- $this->loader = new ClassLoader();
- spl_autoload_register(array($this->loader, 'loadClass'));
- }
-
- protected function tearDown()
- {
- spl_autoload_unregister(array($this->loader, 'loadClass'));
- }
-
- public function testIdempotence()
- {
- DebugClassLoader::enable();
- DebugClassLoader::enable();
-
- $functions = spl_autoload_functions();
- foreach ($functions as $function) {
- if (is_array($function) && $function[0] instanceof DebugClassLoader) {
- $reflClass = new \ReflectionClass($function[0]);
- $reflProp = $reflClass->getProperty('classFinder');
- $reflProp->setAccessible(true);
-
- $this->assertNotInstanceOf('Symfony\Component\ClassLoader\DebugClassLoader', $reflProp->getValue($function[0]));
-
- return;
- }
- }
-
- throw new \Exception('DebugClassLoader did not register');
- }
-}
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json
index 06a1c62..b28f4f5 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json
+++ b/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json
@@ -28,7 +28,7 @@
"target-dir": "Symfony/Component/ClassLoader",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md
index 4839bd8..9a41e85 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md
@@ -1,6 +1,12 @@
CHANGELOG
=========
+2.4.0
+-----
+
+ * added support for expressions in service definitions
+ * added ContainerAwareTrait to add default container aware behavior to a class
+
2.2.0
-----
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php
index 03528fe..e81110d 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php
@@ -28,6 +28,7 @@ class CheckCircularReferencesPass implements CompilerPassInterface
{
private $currentId;
private $currentPath;
+ private $checkedNodes;
/**
* Checks the ContainerBuilder object for circular references.
@@ -38,6 +39,7 @@ public function process(ContainerBuilder $container)
{
$graph = $container->getCompiler()->getServiceReferenceGraph();
+ $this->checkedNodes = array();
foreach ($graph->getNodes() as $id => $node) {
$this->currentId = $id;
$this->currentPath = array($id);
@@ -58,15 +60,20 @@ private function checkOutEdges(array $edges)
foreach ($edges as $edge) {
$node = $edge->getDestNode();
$id = $node->getId();
- $searchKey = array_search($id, $this->currentPath);
- $this->currentPath[] = $id;
- if (false !== $searchKey) {
- throw new ServiceCircularReferenceException($id, array_slice($this->currentPath, $searchKey));
- }
+ if (empty($this->checkedNodes[$id])) {
+ $searchKey = array_search($id, $this->currentPath);
+ $this->currentPath[] = $id;
- $this->checkOutEdges($node->getOutEdges());
- array_pop($this->currentPath);
+ if (false !== $searchKey) {
+ throw new ServiceCircularReferenceException($id, array_slice($this->currentPath, $searchKey));
+ }
+
+ $this->checkOutEdges($node->getOutEdges());
+
+ $this->checkedNodes[$id] = true;
+ array_pop($this->currentPath);
+ }
}
}
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php
index e536331..c8978f3 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php
@@ -74,6 +74,17 @@ public function process(ContainerBuilder $container)
$id
));
}
+
+ // tag attribute values must be scalars
+ foreach ($definition->getTags() as $name => $tags) {
+ foreach ($tags as $attributes) {
+ foreach ($attributes as $attribute => $value) {
+ if (!is_scalar($value) && null !== $value) {
+ throw new RuntimeException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $id, $name, $attribute));
+ }
+ }
+ }
+ }
}
}
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php
index 01f224b..4dfa9cf 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Compiler\PassConfig;
/**
* This class is used to remove circular dependencies between individual passes.
@@ -24,7 +23,7 @@
class Compiler
{
private $passConfig;
- private $log;
+ private $log = array();
private $loggingFormatter;
private $serviceReferenceGraph;
@@ -36,7 +35,6 @@ public function __construct()
$this->passConfig = new PassConfig();
$this->serviceReferenceGraph = new ServiceReferenceGraph();
$this->loggingFormatter = new LoggingFormatter();
- $this->log = array();
}
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
index ab8895a..ba1688f 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
@@ -117,7 +117,7 @@ private function isInlineableDefinition(ContainerBuilder $container, $id, Defini
return true;
}
- if ($definition->isPublic()) {
+ if ($definition->isPublic() || $definition->isLazy()) {
return false;
}
@@ -125,6 +125,10 @@ private function isInlineableDefinition(ContainerBuilder $container, $id, Defini
return true;
}
+ if ($this->currentId == $id) {
+ return false;
+ }
+
$ids = array();
foreach ($this->graph->getNode($id)->getInEdges() as $edge) {
$ids[] = $edge->getSourceNode()->getId();
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
index e863f75..ac395db 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
@@ -31,9 +31,9 @@ class PassConfig
const TYPE_REMOVE = 'removing';
private $mergePass;
- private $afterRemovingPasses;
- private $beforeOptimizationPasses;
- private $beforeRemovingPasses;
+ private $afterRemovingPasses = array();
+ private $beforeOptimizationPasses = array();
+ private $beforeRemovingPasses = array();
private $optimizationPasses;
private $removingPasses;
@@ -44,10 +44,6 @@ public function __construct()
{
$this->mergePass = new MergeExtensionConfigurationPass();
- $this->afterRemovingPasses = array();
- $this->beforeOptimizationPasses = array();
- $this->beforeRemovingPasses = array();
-
$this->optimizationPasses = array(
new ResolveDefinitionTemplatesPass(),
new ResolveParameterPlaceHoldersPass(),
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php
index c5187f3..4699ac3 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php
@@ -112,7 +112,7 @@ private function resolveDefinition($id, DefinitionDecorator $definition)
if (isset($changes['public'])) {
$def->setPublic($definition->isPublic());
}
- if (isset($changes['lazy'])){
+ if (isset($changes['lazy'])) {
$def->setLazy($definition->isLazy());
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php
index fbd33ee..1de14fa 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php
@@ -26,15 +26,7 @@ class ServiceReferenceGraph
/**
* @var ServiceReferenceGraphNode[]
*/
- private $nodes;
-
- /**
- * Constructor.
- */
- public function __construct()
- {
- $this->nodes = array();
- }
+ private $nodes = array();
/**
* Checks if the graph has a specific node.
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php
index 3fd5077..283f6de 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php
@@ -24,8 +24,8 @@
class ServiceReferenceGraphNode
{
private $id;
- private $inEdges;
- private $outEdges;
+ private $inEdges = array();
+ private $outEdges = array();
private $value;
/**
@@ -38,8 +38,6 @@ public function __construct($id, $value)
{
$this->id = $id;
$this->value = $value;
- $this->inEdges = array();
- $this->outEdges = array();
}
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php
index ab0abf3..c4d8f16 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php
@@ -67,13 +67,13 @@ class Container implements IntrospectableContainerInterface
*/
protected $parameterBag;
- protected $services;
- protected $methodMap;
- protected $aliases;
- protected $scopes;
- protected $scopeChildren;
- protected $scopedServices;
- protected $scopeStacks;
+ protected $services = array();
+ protected $methodMap = array();
+ protected $aliases = array();
+ protected $scopes = array();
+ protected $scopeChildren = array();
+ protected $scopedServices = array();
+ protected $scopeStacks = array();
protected $loading = array();
/**
@@ -85,14 +85,7 @@ class Container implements IntrospectableContainerInterface
*/
public function __construct(ParameterBagInterface $parameterBag = null)
{
- $this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag;
-
- $this->services = array();
- $this->aliases = array();
- $this->scopes = array();
- $this->scopeChildren = array();
- $this->scopedServices = array();
- $this->scopeStacks = array();
+ $this->parameterBag = $parameterBag ?: new ParameterBag();
$this->set('service_container', $this);
}
@@ -214,7 +207,7 @@ public function set($id, $service, $scope = self::SCOPE_CONTAINER)
$this->services[$id] = $service;
- if (method_exists($this, $method = 'synchronize'.strtr($id, array('_' => '', '.' => '_')).'Service')) {
+ if (method_exists($this, $method = 'synchronize'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) {
$this->$method();
}
@@ -240,9 +233,10 @@ public function has($id)
{
$id = strtolower($id);
- return array_key_exists($id, $this->services)
- || array_key_exists($id, $this->aliases)
- || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')
+ return isset($this->services[$id])
+ || array_key_exists($id, $this->services)
+ || isset($this->aliases[$id])
+ || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')
;
}
@@ -267,16 +261,21 @@ public function has($id)
*/
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
{
- $id = strtolower($id);
-
- // resolve aliases
- if (isset($this->aliases[$id])) {
- $id = $this->aliases[$id];
- }
-
- // re-use shared service instance if it exists
- if (array_key_exists($id, $this->services)) {
- return $this->services[$id];
+ // Attempt to retrieve the service by checking first aliases then
+ // available services. Service IDs are case insensitive, however since
+ // this method can be called thousands of times during a request, avoid
+ // calling strtolower() unless necessary.
+ foreach (array(false, true) as $strtolower) {
+ if ($strtolower) {
+ $id = strtolower($id);
+ }
+ if (isset($this->aliases[$id])) {
+ $id = $this->aliases[$id];
+ }
+ // Re-use shared service instance if it exists.
+ if (isset($this->services[$id]) || array_key_exists($id, $this->services)) {
+ return $this->services[$id];
+ }
}
if (isset($this->loading[$id])) {
@@ -285,7 +284,7 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
if (isset($this->methodMap[$id])) {
$method = $this->methodMap[$id];
- } elseif (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')) {
+ } elseif (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) {
// $method is set to the right value, proceed
} else {
if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
@@ -339,7 +338,9 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
*/
public function initialized($id)
{
- return array_key_exists(strtolower($id), $this->services);
+ $id = strtolower($id);
+
+ return isset($this->services[$id]) || array_key_exists($id, $this->services);
}
/**
@@ -524,7 +525,7 @@ public function isScopeActive($name)
*/
public static function camelize($id)
{
- return strtr(ucwords(strtr($id, array('_' => ' ', '.' => '_ '))), array(' ' => ''));
+ return strtr(ucwords(strtr($id, array('_' => ' ', '.' => '_ ', '\\' => '_ '))), array(' ' => ''));
}
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareTrait.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareTrait.php
new file mode 100644
index 0000000..57280aa
--- /dev/null
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareTrait.php
@@ -0,0 +1,35 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\DependencyInjection;
+
+/**
+ * ContainerAware trait.
+ *
+ * @author Fabien Potencier
+ */
+trait ContainerAwareTrait
+{
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * Sets the Container associated with this Controller.
+ *
+ * @param ContainerInterface $container A ContainerInterface instance
+ */
+ public function setContainer(ContainerInterface $container = null)
+ {
+ $this->container = $container;
+ }
+}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
index 733d016..0e07ec6 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
@@ -24,6 +24,7 @@
use Symfony\Component\Config\Resource\ResourceInterface;
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface;
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator;
+use Symfony\Component\ExpressionLanguage\Expression;
/**
* ContainerBuilder is a DI container that provides an API to easily describe services.
@@ -79,6 +80,11 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
private $proxyInstantiator;
/**
+ * @var ExpressionLanguage|null
+ */
+ private $expressionLanguage;
+
+ /**
* Sets the track resources flag.
*
* If you are not using the loaders and therefore don't want
@@ -305,11 +311,7 @@ public function loadFromExtension($extension, array $values = array())
*/
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)
{
- if (null === $this->compiler) {
- $this->compiler = new Compiler();
- }
-
- $this->compiler->addPass($pass, $type);
+ $this->getCompiler()->addPass($pass, $type);
$this->addObjectResource($pass);
@@ -325,11 +327,7 @@ public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig:
*/
public function getCompilerPassConfig()
{
- if (null === $this->compiler) {
- $this->compiler = new Compiler();
- }
-
- return $this->compiler->getPassConfig();
+ return $this->getCompiler()->getPassConfig();
}
/**
@@ -610,15 +608,17 @@ public function prependExtensionConfig($name, array $config)
*/
public function compile()
{
- if (null === $this->compiler) {
- $this->compiler = new Compiler();
- }
+ $compiler = $this->getCompiler();
if ($this->trackResources) {
- foreach ($this->compiler->getPassConfig()->getPasses() as $pass) {
+ foreach ($compiler->getPassConfig()->getPasses() as $pass) {
$this->addObjectResource($pass);
}
+ }
+ $compiler->compile($this);
+
+ if ($this->trackResources) {
foreach ($this->definitions as $definition) {
if ($definition->isLazy() && ($class = $definition->getClass()) && class_exists($class)) {
$this->addClassResource(new \ReflectionClass($class));
@@ -626,8 +626,6 @@ public function compile()
}
}
- $this->compiler->compile($this);
-
$this->extensionConfigs = array();
parent::compile();
@@ -993,11 +991,12 @@ public function createService(Definition $definition, $id, $tryProxy = true)
}
/**
- * Replaces service references by the real service instance.
+ * Replaces service references by the real service instance and evaluates expressions.
*
* @param mixed $value A value
*
- * @return mixed The same value with all service references replaced by the real service instances
+ * @return mixed The same value with all service references replaced by
+ * the real service instances and all expressions evaluated
*/
public function resolveServices($value)
{
@@ -1009,6 +1008,8 @@ public function resolveServices($value)
$value = $this->get((string) $value, $value->getInvalidBehavior());
} elseif ($value instanceof Definition) {
$value = $this->createService($value, null);
+ } elseif ($value instanceof Expression) {
+ $value = $this->getExpressionLanguage()->evaluate($value, array('container' => $this));
}
return $value;
@@ -1159,4 +1160,16 @@ private function shareService(Definition $definition, $service, $id)
}
}
}
+
+ private function getExpressionLanguage()
+ {
+ if (null === $this->expressionLanguage) {
+ if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
+ throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
+ }
+ $this->expressionLanguage = new ExpressionLanguage();
+ }
+
+ return $this->expressionLanguage;
+ }
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php
index 1168444..428fee2 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php
@@ -28,24 +28,24 @@ class Definition
private $factoryClass;
private $factoryMethod;
private $factoryService;
- private $scope;
- private $properties;
- private $calls;
+ private $scope = ContainerInterface::SCOPE_CONTAINER;
+ private $properties = array();
+ private $calls = array();
private $configurator;
- private $tags;
- private $public;
- private $synthetic;
- private $abstract;
- private $synchronized;
- private $lazy;
+ private $tags = array();
+ private $public = true;
+ private $synthetic = false;
+ private $abstract = false;
+ private $synchronized = false;
+ private $lazy = false;
protected $arguments;
/**
* Constructor.
*
- * @param string $class The service class
- * @param array $arguments An array of arguments to pass to the service constructor
+ * @param string|null $class The service class
+ * @param array $arguments An array of arguments to pass to the service constructor
*
* @api
*/
@@ -53,15 +53,6 @@ public function __construct($class = null, array $arguments = array())
{
$this->class = $class;
$this->arguments = $arguments;
- $this->calls = array();
- $this->scope = ContainerInterface::SCOPE_CONTAINER;
- $this->tags = array();
- $this->public = true;
- $this->synthetic = false;
- $this->synchronized = false;
- $this->lazy = false;
- $this->abstract = false;
- $this->properties = array();
}
/**
@@ -84,7 +75,7 @@ public function setFactoryClass($factoryClass)
/**
* Gets the factory class.
*
- * @return string The factory class name
+ * @return string|null The factory class name
*
* @api
*/
@@ -112,7 +103,7 @@ public function setFactoryMethod($factoryMethod)
/**
* Gets the factory method.
*
- * @return string The factory method name
+ * @return string|null The factory method name
*
* @api
*/
@@ -140,7 +131,7 @@ public function setFactoryService($factoryService)
/**
* Gets the factory service id.
*
- * @return string The factory service id
+ * @return string|null The factory service id
*
* @api
*/
@@ -168,7 +159,7 @@ public function setClass($class)
/**
* Gets the service class.
*
- * @return string The service class
+ * @return string|null The service class
*
* @api
*/
@@ -508,7 +499,7 @@ public function setFile($file)
/**
* Gets the file to require before creating the service.
*
- * @return string The full pathname to include
+ * @return string|null The full pathname to include
*
* @api
*/
@@ -704,7 +695,7 @@ public function setConfigurator($callable)
/**
* Gets the configurator to call after the service is fully initialized.
*
- * @return callable The PHP callable to call
+ * @return callable|null The PHP callable to call
*
* @api
*/
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php
index 1f72b8f..b7eed8c 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php
@@ -24,7 +24,7 @@
class DefinitionDecorator extends Definition
{
private $parent;
- private $changes;
+ private $changes = array();
/**
* Constructor.
@@ -38,7 +38,6 @@ public function __construct($parent)
parent::__construct();
$this->parent = $parent;
- $this->changes = array();
}
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
index 8888d3f..7be1fe2 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
@@ -23,6 +23,8 @@
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface as ProxyDumper;
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper;
+use Symfony\Component\DependencyInjection\ExpressionLanguage;
+use Symfony\Component\ExpressionLanguage\Expression;
/**
* PhpDumper dumps a service container as a PHP class.
@@ -51,6 +53,7 @@ class PhpDumper extends Dumper
private $referenceVariables;
private $variableCount;
private $reservedVariables = array('instance', 'class');
+ private $expressionLanguage;
/**
* @var \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface
@@ -86,6 +89,7 @@ public function setProxyDumper(ProxyDumper $proxyDumper)
*
* * class: The class name
* * base_class: The base class name
+ * * namespace: The class namespace
*
* @param array $options An array of options
*
@@ -98,9 +102,10 @@ public function dump(array $options = array())
$options = array_merge(array(
'class' => 'ProjectServiceContainer',
'base_class' => 'Container',
+ 'namespace' => '',
), $options);
- $code = $this->startClass($options['class'], $options['base_class']);
+ $code = $this->startClass($options['class'], $options['base_class'], $options['namespace']);
if ($this->container->isFrozen()) {
$code .= $this->addFrozenConstructor();
@@ -188,7 +193,7 @@ private function addServiceLocalTempVariables($cId, $definition)
*/
private function addProxyClasses()
{
- /* @var $proxyDefinitions Definition[] */
+ /* @var $definitions Definition[] */
$definitions = array_filter(
$this->container->getDefinitions(),
array($this->getProxyDumper(), 'isProxyCandidate')
@@ -441,6 +446,12 @@ private function addServiceInlinedDefinitionsSetup($id, $definition)
continue;
}
+ // if the instance is simple, the return statement has already been generated
+ // so, the only possible way to get there is because of a circular reference
+ if ($this->isSimpleInstance($id, $definition)) {
+ throw new ServiceCircularReferenceException($id, array($id));
+ }
+
$name = (string) $this->definitionVariables->offsetGet($iDefinition);
$code .= $this->addServiceMethodCalls(null, $iDefinition, $name);
$code .= $this->addServiceProperties(null, $iDefinition, $name);
@@ -700,24 +711,24 @@ private function addNewInstance($id, Definition $definition, $return, $instantia
*
* @param string $class Class name
* @param string $baseClass The name of the base class
+ * @param string $namespace The class namespace
*
* @return string
*/
- private function startClass($class, $baseClass)
+ private function startClass($class, $baseClass, $namespace)
{
$bagClass = $this->container->isFrozen() ? 'use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;' : 'use Symfony\Component\DependencyInjection\ParameterBag\\ParameterBag;';
+ $namespaceLine = $namespace ? "namespace $namespace;\n" : '';
return <<getClass(), $path.'/'.$key));
} elseif ($value instanceof Reference) {
throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain references to other services (reference to service "%s" found in "%s").', $value, $path.'/'.$key));
+ } elseif ($value instanceof Expression) {
+ throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key));
} else {
$value = var_export($value, true);
}
@@ -1105,7 +1118,7 @@ private function getDefinitionsFromArguments(array $arguments)
*
* @return Boolean
*/
- private function hasReference($id, array $arguments, $deep = false, $visited = array())
+ private function hasReference($id, array $arguments, $deep = false, array $visited = array())
{
foreach ($arguments as $argument) {
if (is_array($argument)) {
@@ -1113,14 +1126,15 @@ private function hasReference($id, array $arguments, $deep = false, $visited = a
return true;
}
} elseif ($argument instanceof Reference) {
- if ($id === (string) $argument) {
+ $argumentId = (string) $argument;
+ if ($id === $argumentId) {
return true;
}
- if ($deep && !isset($visited[(string) $argument])) {
- $visited[(string) $argument] = true;
+ if ($deep && !isset($visited[$argumentId])) {
+ $visited[$argumentId] = true;
- $service = $this->container->getDefinition((string) $argument);
+ $service = $this->container->getDefinition($argumentId);
$arguments = array_merge($service->getMethodCalls(), $service->getArguments(), $service->getProperties());
if ($this->hasReference($id, $arguments, $deep, $visited)) {
@@ -1192,6 +1206,8 @@ private function dumpValue($value, $interpolate = true)
}
return $this->getServiceCall((string) $value, $value);
+ } elseif ($value instanceof Expression) {
+ return $this->getExpressionLanguage()->compile((string) $value, array('container'));
} elseif ($value instanceof Parameter) {
return $this->dumpParameter($value);
} elseif (true === $interpolate && is_string($value)) {
@@ -1314,4 +1330,16 @@ private function getNextVariableName()
return $name;
}
}
+
+ private function getExpressionLanguage()
+ {
+ if (null === $this->expressionLanguage) {
+ if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
+ throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
+ }
+ $this->expressionLanguage = new ExpressionLanguage();
+ }
+
+ return $this->expressionLanguage;
+ }
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php
index a311af3..31bec31 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php
@@ -17,6 +17,7 @@
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\ExpressionLanguage\Expression;
/**
* XmlDumper dumps a service container as an XML string.
@@ -259,6 +260,10 @@ private function convertParameters($parameters, $type, \DOMElement $parent, $key
} elseif ($value instanceof Definition) {
$element->setAttribute('type', 'service');
$this->addService($value, null, $element);
+ } elseif ($value instanceof Expression) {
+ $element->setAttribute('type', 'expression');
+ $text = $this->document->createTextNode(self::phpToXml((string) $value));
+ $element->appendChild($text);
} else {
if (in_array($value, array('null', 'true', 'false'), true)) {
$element->setAttribute('type', 'string');
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
index 807e656..b474854 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
@@ -19,6 +19,7 @@
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\ExpressionLanguage\Expression;
/**
* YamlDumper dumps a service container as a YAML string.
@@ -74,6 +75,10 @@ private function addService($id, $definition)
$code .= sprintf(" class: %s\n", $definition->getClass());
}
+ if (!$definition->isPublic()) {
+ $code .= " public: false\n";
+ }
+
$tagsCode = '';
foreach ($definition->getTags() as $name => $tags) {
foreach ($tags as $attributes) {
@@ -231,6 +236,8 @@ private function dumpValue($value)
return $this->getServiceCall((string) $value, $value);
} elseif ($value instanceof Parameter) {
return $this->getParameterCall((string) $value);
+ } elseif ($value instanceof Expression) {
+ return $this->getExpressionCall((string) $value);
} elseif (is_object($value) || is_resource($value)) {
throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
}
@@ -267,6 +274,11 @@ private function getParameterCall($id)
return sprintf('%%%s%%', $id);
}
+ private function getExpressionCall($expression)
+ {
+ return sprintf('@=%s', $expression);
+ }
+
/**
* Prepares parameters.
*
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ExpressionLanguage.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ExpressionLanguage.php
new file mode 100644
index 0000000..2e7edcd
--- /dev/null
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ExpressionLanguage.php
@@ -0,0 +1,42 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\DependencyInjection;
+
+use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
+
+/**
+ * Adds some function to the default ExpressionLanguage.
+ *
+ * To get a service, use service('request').
+ * To get a parameter, use parameter('kernel.debug').
+ *
+ * @author Fabien Potencier
+ */
+class ExpressionLanguage extends BaseExpressionLanguage
+{
+ protected function registerFunctions()
+ {
+ parent::registerFunctions();
+
+ $this->register('service', function ($arg) {
+ return sprintf('$this->get(%s)', $arg);
+ }, function (array $variables, $value) {
+ return $variables['container']->get($value);
+ });
+
+ $this->register('parameter', function ($arg) {
+ return sprintf('$this->getParameter(%s)', $arg);
+ }, function (array $variables, $value) {
+ return $variables['container']->getParameter($value);
+ });
+ }
+}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php
index fc015e1..424f020 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php
@@ -28,7 +28,7 @@
* @param array $config An array of configuration values
* @param ContainerBuilder $container A ContainerBuilder instance
*
- * @throws InvalidArgumentException When provided tag is not defined in this extension
+ * @throws \InvalidArgumentException When provided tag is not defined in this extension
*
* @api
*/
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php
index 475d26f..878d965 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php
@@ -14,7 +14,7 @@
use Symfony\Component\DependencyInjection\Definition;
/**
- * Lazy proxy dumper capable of generating the instantiation logic php code for proxied services.
+ * Lazy proxy dumper capable of generating the instantiation logic PHP code for proxied services.
*
* @author Marco Pivetta
*/
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php
index f2bf441..e866a29 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php
@@ -17,7 +17,7 @@
* PhpFileLoader loads service definitions from a PHP file.
*
* The PHP file is required and the $container variable can be
- * used form the file to change the container.
+ * used within the file to change the container.
*
* @author Fabien Potencier
*/
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
index 9f25ab7..9b2d46d 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
@@ -187,6 +187,10 @@ private function parseDefinition($id, $service, $file)
continue;
}
+ if (false !== strpos($name, '-') && false === strpos($name, '_') && !array_key_exists($normalizedName = str_replace('-', '_', $name), $parameters)) {
+ $parameters[$normalizedName] = SimpleXMLElement::phpize($value);
+ }
+ // keep not normalized key for BC too
$parameters[$name] = SimpleXMLElement::phpize($value);
}
@@ -233,10 +237,11 @@ private function processAnonymousServices(SimpleXMLElement $xml, $file)
if (false !== $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]|//container:property[@type="service"][not(@id)]')) {
foreach ($nodes as $node) {
// give it a unique name
- $node['id'] = sprintf('%s_%d', md5($file), ++$count);
+ $id = sprintf('%s_%d', hash('sha256', $file), ++$count);
+ $node['id'] = $id;
- $definitions[(string) $node['id']] = array($node->service, $file, false);
- $node->service['id'] = (string) $node['id'];
+ $definitions[$id] = array($node->service, $file, false);
+ $node->service['id'] = $id;
}
}
@@ -244,10 +249,11 @@ private function processAnonymousServices(SimpleXMLElement $xml, $file)
if (false !== $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) {
foreach ($nodes as $node) {
// give it a unique name
- $node['id'] = sprintf('%s_%d', md5($file), ++$count);
+ $id = sprintf('%s_%d', hash('sha256', $file), ++$count);
+ $node['id'] = $id;
- $definitions[(string) $node['id']] = array($node, $file, true);
- $node->service['id'] = (string) $node['id'];
+ $definitions[$id] = array($node, $file, true);
+ $node->service['id'] = $id;
}
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
index ce135fa..e081be5 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
@@ -19,6 +19,7 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Yaml\Parser as YamlParser;
+use Symfony\Component\ExpressionLanguage\Expression;
/**
* YamlFileLoader loads YAML files service definitions.
@@ -224,8 +225,8 @@ private function parseDefinition($id, $service, $file)
unset($tag['name']);
foreach ($tag as $attribute => $value) {
- if (!is_scalar($value)) {
- throw new InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s" in %s.', $id, $name, $file));
+ if (!is_scalar($value) && null !== $value) {
+ throw new InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s" in %s.', $id, $name, $attribute, $file));
}
}
@@ -311,6 +312,8 @@ private function resolveServices($value)
{
if (is_array($value)) {
$value = array_map(array($this, 'resolveServices'), $value);
+ } elseif (is_string($value) && 0 === strpos($value, '@=')) {
+ return new Expression(substr($value, 2));
} elseif (is_string($value) && 0 === strpos($value, '@')) {
if (0 === strpos($value, '@@')) {
$value = substr($value, 1);
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd
index f1c2003..f7b5787 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd
@@ -121,10 +121,12 @@
+
+
@@ -164,6 +166,7 @@
+
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
index 494d231..dabd1c6 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
@@ -24,8 +24,8 @@
*/
class ParameterBag implements ParameterBagInterface
{
- protected $parameters;
- protected $resolved;
+ protected $parameters = array();
+ protected $resolved = false;
/**
* Constructor.
@@ -36,9 +36,7 @@ class ParameterBag implements ParameterBagInterface
*/
public function __construct(array $parameters = array())
{
- $this->parameters = array();
$this->add($parameters);
- $this->resolved = false;
}
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md
index ab67595..29d1cd0 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md
@@ -69,5 +69,5 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/DependencyInjection/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php
index 1517da2..7257470 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php
@@ -47,7 +47,7 @@ public function __construct($id, $invalidBehavior = ContainerInterface::EXCEPTIO
*/
public function __toString()
{
- return (string) $this->id;
+ return $this->id;
}
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php
index cc5e311..db855f6 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection;
use Symfony\Component\Config\Util\XmlUtils;
+use Symfony\Component\ExpressionLanguage\Expression;
/**
* SimpleXMLElement class.
@@ -21,7 +22,7 @@
class SimpleXMLElement extends \SimpleXMLElement
{
/**
- * Converts an attribute as a php type.
+ * Converts an attribute as a PHP type.
*
* @param string $name
*
@@ -33,7 +34,7 @@ public function getAttributeAsPhp($name)
}
/**
- * Returns arguments as valid php types.
+ * Returns arguments as valid PHP types.
*
* @param string $name
* @param Boolean $lowercase
@@ -77,6 +78,9 @@ public function getArgumentsAsPhp($name, $lowercase = true)
$arguments[$key] = new Reference((string) $arg['id'], $invalidBehavior, $strict);
break;
+ case 'expression':
+ $arguments[$key] = new Expression((string) $arg);
+ break;
case 'collection':
$arguments[$key] = $arg->getArgumentsAsPhp($name, false);
break;
@@ -95,7 +99,7 @@ public function getArgumentsAsPhp($name, $lowercase = true)
}
/**
- * Converts an xml value to a php type.
+ * Converts an xml value to a PHP type.
*
* @param mixed $value
*
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php
index 06845a2..b5e4984 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php
@@ -18,7 +18,7 @@
class CheckDefinitionValidityPassTest extends \PHPUnit_Framework_TestCase
{
/**
- * @expectedException \RuntimeException
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
*/
public function testProcessDetectsSyntheticNonPublicDefinitions()
{
@@ -29,7 +29,7 @@ public function testProcessDetectsSyntheticNonPublicDefinitions()
}
/**
- * @expectedException \RuntimeException
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
*/
public function testProcessDetectsSyntheticPrototypeDefinitions()
{
@@ -40,7 +40,7 @@ public function testProcessDetectsSyntheticPrototypeDefinitions()
}
/**
- * @expectedException \RuntimeException
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
*/
public function testProcessDetectsNonSyntheticNonAbstractDefinitionWithoutClass()
{
@@ -61,6 +61,28 @@ public function testProcess()
$this->process($container);
}
+ public function testValidTags()
+ {
+ $container = new ContainerBuilder();
+ $container->register('a', 'class')->addTag('foo', array('bar' => 'baz'));
+ $container->register('b', 'class')->addTag('foo', array('bar' => null));
+ $container->register('c', 'class')->addTag('foo', array('bar' => 1));
+ $container->register('d', 'class')->addTag('foo', array('bar' => 1.1));
+
+ $this->process($container);
+ }
+
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ */
+ public function testInvalidTags()
+ {
+ $container = new ContainerBuilder();
+ $container->register('a', 'class')->addTag('foo', array('bar' => array('baz' => 'baz')));
+
+ $this->process($container);
+ }
+
protected function process(ContainerBuilder $container)
{
$pass = new CheckDefinitionValidityPass();
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php
index f22f0da..6458a33 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php
@@ -12,10 +12,8 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
use Symfony\Component\DependencyInjection\Scope;
-
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass;
-use Symfony\Component\DependencyInjection\Compiler\Compiler;
use Symfony\Component\DependencyInjection\Compiler\RepeatedPass;
use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass;
use Symfony\Component\DependencyInjection\Reference;
@@ -126,6 +124,41 @@ public function testProcessInlinesOnlyIfSameScope()
$this->assertTrue($container->hasDefinition('a'));
}
+ public function testProcessDoesNotInlineWhenServiceIsPrivateButLazy()
+ {
+ $container = new ContainerBuilder();
+ $container
+ ->register('foo')
+ ->setPublic(false)
+ ->setLazy(true)
+ ;
+
+ $container
+ ->register('service')
+ ->setArguments(array($ref = new Reference('foo')))
+ ;
+
+ $this->process($container);
+
+ $arguments = $container->getDefinition('service')->getArguments();
+ $this->assertSame($ref, $arguments[0]);
+ }
+
+ public function testProcessDoesNotInlineWhenServiceReferencesItself()
+ {
+ $container = new ContainerBuilder();
+ $container
+ ->register('foo')
+ ->setPublic(false)
+ ->addMethodCall('foo', array($ref = new Reference('foo')))
+ ;
+
+ $this->process($container);
+
+ $calls = $container->getDefinition('foo')->getMethodCalls();
+ $this->assertSame($ref, $calls[0][1][0]);
+ }
+
protected function process(ContainerBuilder $container)
{
$repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass()));
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
index a5e7531..dd08c97 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
@@ -21,10 +21,12 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Scope;
use Symfony\Component\Config\Resource\FileResource;
+use Symfony\Component\ExpressionLanguage\Expression;
class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
{
@@ -377,6 +379,15 @@ public function testCreateSyntheticService()
$builder->get('foo');
}
+ public function testCreateServiceWithExpression()
+ {
+ $builder = new ContainerBuilder();
+ $builder->setParameter('bar', 'bar');
+ $builder->register('bar', 'BarClass');
+ $builder->register('foo', 'FooClass')->addArgument(array('foo' => new Expression('service("bar").foo ~ parameter("bar")')));
+ $this->assertEquals('foobar', $builder->get('foo')->arguments['foo']);
+ }
+
/**
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::resolveServices
*/
@@ -386,6 +397,7 @@ public function testResolveServices()
$builder->register('foo', 'FooClass');
$this->assertEquals($builder->get('foo'), $builder->resolveServices(new Reference('foo')), '->resolveServices() resolves service references to service instances');
$this->assertEquals(array('foo' => array('foo', $builder->get('foo'))), $builder->resolveServices(array('foo' => array('foo', new Reference('foo')))), '->resolveServices() resolves service references to service instances in nested arrays');
+ $this->assertEquals($builder->get('foo'), $builder->resolveServices(new Expression('service("foo")')), '->resolveServices() resolves expressions');
}
/**
@@ -403,7 +415,6 @@ public function testMerge()
$container->setResourceTracking(false);
$config = new ContainerBuilder(new ParameterBag(array('foo' => '%bar%')));
$container->merge($config);
-////// FIXME
$container->compile();
$this->assertEquals(array('bar' => 'foo', 'foo' => 'foo'), $container->getParameterBag()->all(), '->merge() evaluates the values of the parameters towards already defined ones');
@@ -411,7 +422,6 @@ public function testMerge()
$container->setResourceTracking(false);
$config = new ContainerBuilder(new ParameterBag(array('foo' => '%bar%', 'baz' => '%foo%')));
$container->merge($config);
-////// FIXME
$container->compile();
$this->assertEquals(array('bar' => 'foo', 'foo' => 'foo', 'baz' => 'foo'), $container->getParameterBag()->all(), '->merge() evaluates the values of the parameters towards already defined ones');
@@ -439,7 +449,7 @@ public function testMerge()
/**
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge
- * @expectedException LogicException
+ * @expectedException \LogicException
*/
public function testMergeLogicException()
{
@@ -487,10 +497,6 @@ public function testFindDefinition()
*/
public function testAddObjectResource()
{
- if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$container = new ContainerBuilder();
$container->setResourceTracking(false);
@@ -517,10 +523,6 @@ public function testAddObjectResource()
*/
public function testAddClassResource()
{
- if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$container = new ContainerBuilder();
$container->setResourceTracking(false);
@@ -547,10 +549,6 @@ public function testAddClassResource()
*/
public function testCompilesClassDefinitionsOfLazyServices()
{
- if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$container = new ContainerBuilder();
$this->assertEmpty($container->getResources(), 'No resources get registered without resource tracking');
@@ -577,10 +575,6 @@ function (ResourceInterface $resource) use ($classesPath) {
*/
public function testResources()
{
- if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$container = new ContainerBuilder();
$container->addResource($a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml'));
$container->addResource($b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml'));
@@ -655,7 +649,7 @@ public function testPrivateServiceUser()
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
*/
public function testThrowsExceptionWhenSetServiceOnAFrozenContainer()
{
@@ -667,14 +661,10 @@ public function testThrowsExceptionWhenSetServiceOnAFrozenContainer()
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
*/
public function testThrowsExceptionWhenAddServiceOnAFrozenContainer()
{
- if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$container = new ContainerBuilder();
$container->compile();
$container->set('a', new \stdClass());
@@ -682,10 +672,6 @@ public function testThrowsExceptionWhenAddServiceOnAFrozenContainer()
public function testNoExceptionWhenSetSyntheticServiceOnAFrozenContainer()
{
- if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$container = new ContainerBuilder();
$def = new Definition('stdClass');
$def->setSynthetic(true);
@@ -742,7 +728,7 @@ public function testSynchronizedServiceWithScopes()
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
*/
public function testThrowsExceptionWhenSetDefinitionOnAFrozenContainer()
{
@@ -773,6 +759,39 @@ public function testExtensionConfig()
$configs = $container->getExtensionConfig('foo');
$this->assertEquals(array($second, $first), $configs);
}
+
+ public function testLazyLoadedService()
+ {
+ $loader = new ClosureLoader($container = new ContainerBuilder());
+ $loader->load(function (ContainerBuilder $container) {
+ $container->set('a', new \BazClass());
+ $definition = new Definition('BazClass');
+ $definition->setLazy(true);
+ $container->setDefinition('a', $definition);
+ }
+ );
+
+ $container->setResourceTracking(true);
+
+ $container->compile();
+
+ $class = new \BazClass();
+ $reflectionClass = new \ReflectionClass($class);
+
+ $r = new \ReflectionProperty($container, 'resources');
+ $r->setAccessible(true);
+ $resources = $r->getValue($container);
+
+ $classInList = false;
+ foreach ($resources as $resource) {
+ if ($resource->getResource() === $reflectionClass->getFileName()) {
+ $classInList = true;
+ break;
+ }
+ }
+
+ $this->assertEquals(true, $classInList);
+ }
}
class FooClass {}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php
index 6c49982..e145c7a 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php
@@ -51,6 +51,7 @@ public function dataForTestCamelize()
array('.foo', '_Foo'),
array('foo_', 'Foo'),
array('foo.', 'Foo_'),
+ array('foo\bar', 'Foo_Bar'),
);
}
@@ -187,6 +188,7 @@ public function testGet()
$this->assertEquals($sc->__bar, $sc->get('bar'), '->get() returns the service for the given id');
$this->assertEquals($sc->__foo_bar, $sc->get('foo_bar'), '->get() returns the service if a get*Method() is defined');
$this->assertEquals($sc->__foo_baz, $sc->get('foo.baz'), '->get() returns the service if a get*Method() is defined');
+ $this->assertEquals($sc->__foo_baz, $sc->get('foo\\baz'), '->get() returns the service if a get*Method() is defined');
$sc->set('bar', $bar = new \stdClass());
$this->assertEquals($bar, $sc->get('bar'), '->get() prefers to return a service defined with set() than one defined with a getXXXMethod()');
@@ -258,6 +260,7 @@ public function testHas()
$this->assertTrue($sc->has('bar'), '->has() returns true if a get*Method() is defined');
$this->assertTrue($sc->has('foo_bar'), '->has() returns true if a get*Method() is defined');
$this->assertTrue($sc->has('foo.baz'), '->has() returns true if a get*Method() is defined');
+ $this->assertTrue($sc->has('foo\\baz'), '->has() returns true if a get*Method() is defined');
}
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php
index 3464a6a..692d73d 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php
@@ -18,13 +18,6 @@ class CrossCheckTest extends \PHPUnit_Framework_TestCase
{
protected static $fixturesPath;
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
- }
-
public static function setUpBeforeClass()
{
self::$fixturesPath = __DIR__.'/Fixtures/';
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php
index 8be8b64..a266e9b 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php
@@ -81,7 +81,7 @@ public function testSetArgument()
}
/**
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
*/
public function testReplaceArgumentShouldRequireIntegerIndex()
{
@@ -106,7 +106,7 @@ public function testReplaceArgument()
}
/**
- * @expectedException OutOfBoundsException
+ * @expectedException \OutOfBoundsException
*/
public function testGetArgumentShouldCheckBounds()
{
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php
index d41c6a8..4ffd7c0 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php
@@ -275,7 +275,7 @@ public function testSetArgument()
}
/**
- * @expectedException OutOfBoundsException
+ * @expectedException \OutOfBoundsException
*/
public function testGetArgumentShouldCheckBounds()
{
@@ -286,7 +286,7 @@ public function testGetArgumentShouldCheckBounds()
}
/**
- * @expectedException OutOfBoundsException
+ * @expectedException \OutOfBoundsException
*/
public function testReplaceArgumentShouldCheckBounds()
{
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php
index 8bd31b0..98b05d2 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php
@@ -31,7 +31,7 @@ public function testDump()
$dumper = new PhpDumper($container = new ContainerBuilder());
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services1.php', $dumper->dump(), '->dump() dumps an empty container as an empty PHP class');
- $this->assertStringEqualsFile(self::$fixturesPath.'/php/services1-1.php', $dumper->dump(array('class' => 'Container', 'base_class' => 'AbstractContainer')), '->dump() takes a class and a base_class options');
+ $this->assertStringEqualsFile(self::$fixturesPath.'/php/services1-1.php', $dumper->dump(array('class' => 'Container', 'base_class' => 'AbstractContainer', 'namespace' => 'Symfony\Component\DependencyInjection\Dump')), '->dump() takes a class and a base_class options');
$container = new ContainerBuilder();
new PhpDumper($container);
@@ -81,7 +81,7 @@ public function testDumpOptimizationString()
}
/**
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
*/
public function testExportParameters()
{
@@ -121,7 +121,7 @@ public function testAddService()
}
/**
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
* @expectedExceptionMessage Service id "bar$" cannot be converted to a valid PHP method name.
*/
public function testAddServiceInvalidServiceId()
@@ -181,4 +181,19 @@ public function testOverrideServiceWhenUsingADumpedContainerAndServiceIsUsedFrom
$this->assertSame($bar, $container->get('foo')->bar, '->set() overrides an already defined service');
}
+
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
+ */
+ public function testCircularReference()
+ {
+ $container = new ContainerBuilder();
+ $container->register('foo', 'stdClass')->addArgument(new Reference('bar'));
+ $container->register('bar', 'stdClass')->setPublic(false)->addMethodCall('setA', array(new Reference('baz')));
+ $container->register('baz', 'stdClass')->addMethodCall('setA', array(new Reference('foo')));
+ $container->compile();
+
+ $dumper = new PhpDumper($container);
+ $dumper->dump();
+ }
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php
index ca7aec0..f9747a7 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php
@@ -18,13 +18,6 @@ class YamlDumperTest extends \PHPUnit_Framework_TestCase
{
protected static $fixturesPath;
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Yaml\Yaml')) {
- $this->markTestSkipped('The "Yaml" component is not available');
- }
- }
-
public static function setUpBeforeClass()
{
self::$fixturesPath = realpath(__DIR__.'/../Fixtures/');
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php
index 6abe5e2..19882c0 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php
@@ -6,6 +6,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Parameter;
+use Symfony\Component\ExpressionLanguage\Expression;
$container = new ContainerBuilder();
$container->
@@ -15,7 +16,7 @@
setFactoryClass('FooClass')->
setFactoryMethod('getInstance')->
setArguments(array('foo', new Reference('foo.baz'), array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%'), true, new Reference('service_container')))->
- setProperties(array('foo' => 'bar', 'moo' => new Reference('foo.baz')))->
+ setProperties(array('foo' => 'bar', 'moo' => new Reference('foo.baz'), 'qux' => array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%')))->
addMethodCall('setBar', array(new Reference('bar')))->
addMethodCall('initialize')->
setConfigurator('sc_configure')
@@ -50,7 +51,8 @@
addMethodCall('setBar', array(new Reference('foo')))->
addMethodCall('setBar', array(new Reference('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE)))->
addMethodCall('setBar', array(new Reference('foo3', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))->
- addMethodCall('setBar', array(new Reference('foobaz', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))
+ addMethodCall('setBar', array(new Reference('foobaz', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))->
+ addMethodCall('setBar', array(new Expression('service("foo").foo() ~ parameter("foo")')))
;
$container->
register('factory_service', 'Bar')->
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php
index 48e1c2c..70c3d27 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php
@@ -8,6 +8,7 @@ function sc_configure($instance)
class BarClass
{
protected $baz;
+ public $foo = 'foo';
public function setBaz(BazClass $baz)
{
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php
index bc093ef..084e789 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php
@@ -6,8 +6,6 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
-use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php
index 8796df8..d1f9c0d 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php
@@ -6,8 +6,6 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
-use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php
index 77712e8..f922d20 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php
@@ -6,8 +6,6 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
-use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/**
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
index 9361a0e..3fafcf1 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
@@ -6,8 +6,6 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
-use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/**
@@ -125,6 +123,7 @@ protected function getFooService()
$instance->initialize();
$instance->foo = 'bar';
$instance->moo = $a;
+ $instance->qux = array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'foobar' => $this->getParameter('foo'));
sc_configure($instance);
return $instance;
@@ -198,6 +197,7 @@ protected function getMethodCall1Service()
if ($this->has('foobaz')) {
$instance->setBar($this->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE));
}
+ $instance->setBar(($this->get("foo")->foo() . $this->getParameter("foo")));
return $instance;
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
index b60cbff..c4b8e47 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
@@ -6,8 +6,6 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
-use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
/**
@@ -133,6 +131,7 @@ protected function getFooService()
$instance->initialize();
$instance->foo = 'bar';
$instance->moo = $a;
+ $instance->qux = array('bar' => 'foo is bar', 'foobar' => 'bar');
sc_configure($instance);
return $instance;
@@ -203,6 +202,7 @@ protected function getMethodCall1Service()
$instance->setBar($this->get('foo'));
$instance->setBar(NULL);
+ $instance->setBar(($this->get("foo")->foo() . $this->getParameter("foo")));
return $instance;
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services10.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services10.xml
new file mode 100644
index 0000000..a4da1bf
--- /dev/null
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services10.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml
index 6e8a6ce..43cf86c 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml
@@ -27,5 +27,6 @@
value
+ PHP_EOL
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml
index abd9fbc..ffc0382 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml
@@ -32,6 +32,9 @@
+
+ service("foo").foo() ~ parameter("foo")
+
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml
index cb3a1f6..e53b03e 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml
@@ -19,6 +19,10 @@
bar
+
+ foo is %foo%
+ %foo%
+
@@ -49,6 +53,9 @@
+
+ service("foo").foo() ~ parameter("foo")
+
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml
index 8137fab..72ec4e8 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml
@@ -3,4 +3,4 @@ services:
class: FooClass
tags:
# tag-attribute is not a scalar
- - { name: foo, foo: { foo: foo, bar: bar } }
+ - { name: foo, bar: { foo: foo, bar: bar } }
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml
index 7ba9453..d3c793f 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml
@@ -15,6 +15,7 @@ services:
calls:
- [ setBar, [] ]
- [ setBar ]
+ - [ setBar, ['@=service("foo").foo() ~ parameter("foo")'] ]
method_call2:
class: FooClass
calls:
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml
index 6a4c3d5..6de64ee 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml
@@ -12,7 +12,7 @@ services:
factory_class: FooClass
factory_method: getInstance
arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', foobar: '%foo%' }, true, '@service_container']
- properties: { foo: bar, moo: '@foo.baz' }
+ properties: { foo: bar, moo: '@foo.baz', qux: { '%foo%': 'foo is %foo%', foobar: '%foo%' } }
calls:
- [setBar, ['@bar']]
- [initialize, { }]
@@ -38,6 +38,7 @@ services:
- [setBar, ['@?foo2']]
- [setBar, ['@?foo3']]
- [setBar, ['@?foobaz']]
+ - [setBar, ['@=service("foo").foo() ~ parameter("foo")']]
factory_service:
class: Bar
@@ -50,6 +51,7 @@ services:
inlined:
class: Bar
+ public: false
properties: { pub: pub }
calls:
- [setBaz, ['@baz']]
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php
index 33594d6..483e30b 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php
@@ -16,13 +16,6 @@
class ClosureLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
- }
-
/**
* @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::supports
*/
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php
index 220ad7f..b9f402b 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php
@@ -29,10 +29,6 @@ public static function setUpBeforeClass()
protected function setUp()
{
- if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$this->container = new ContainerBuilder();
$this->loader = new IniFileLoader($this->container, new FileLocator(self::$fixturesPath.'/ini'));
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php
index 3a97dc2..505f710 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php
@@ -18,13 +18,6 @@
class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
- }
-
/**
* @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::supports
*/
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php
index d8138f9..74db3c8 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php
@@ -22,18 +22,12 @@
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\Config\FileLocator;
+use Symfony\Component\ExpressionLanguage\Expression;
class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
protected static $fixturesPath;
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
- }
-
public static function setUpBeforeClass()
{
self::$fixturesPath = realpath(__DIR__.'/../Fixtures/');
@@ -99,17 +93,33 @@ public function testLoadParameters()
$loader->load('services2.xml');
$actual = $container->getParameterBag()->all();
- $expected = array('a string', 'foo' => 'bar', 'values' => array(0, 'integer' => 4, 100 => null, 'true', true, false, 'on', 'off', 'float' => 1.3, 1000.3, 'a string', array('foo', 'bar')), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'));
+ $expected = array(
+ 'a string',
+ 'foo' => 'bar',
+ 'values' => array(
+ 0,
+ 'integer' => 4,
+ 100 => null,
+ 'true',
+ true,
+ false,
+ 'on',
+ 'off',
+ 'float' => 1.3,
+ 1000.3,
+ 'a string',
+ array('foo', 'bar'),
+ ),
+ 'foo_bar' => new Reference('foo_bar'),
+ 'mixedcase' => array('MixedCaseKey' => 'value'),
+ 'constant' => PHP_EOL,
+ );
$this->assertEquals($expected, $actual, '->load() converts XML values to PHP ones');
}
public function testLoadImports()
{
- if (!class_exists('Symfony\Component\Yaml\Yaml')) {
- $this->markTestSkipped('The "Yaml" component is not available');
- }
-
$container = new ContainerBuilder();
$resolver = new LoaderResolver(array(
new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')),
@@ -120,7 +130,30 @@ public function testLoadImports()
$loader->load('services4.xml');
$actual = $container->getParameterBag()->all();
- $expected = array('a string', 'foo' => 'bar', 'values' => array(true, false), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'bar' => '%foo%', 'imported_from_ini' => true, 'imported_from_yaml' => true);
+ $expected = array(
+ 'a string',
+ 'foo' => 'bar',
+ 'values' => array(
+ 0,
+ 'integer' => 4,
+ 100 => null,
+ 'true',
+ true,
+ false,
+ 'on',
+ 'off',
+ 'float' => 1.3,
+ 1000.3,
+ 'a string',
+ array('foo', 'bar'),
+ ),
+ 'foo_bar' => new Reference('foo_bar'),
+ 'mixedcase' => array('MixedCaseKey' => 'value'),
+ 'constant' => PHP_EOL,
+ 'bar' => '%foo%',
+ 'imported_from_ini' => true,
+ 'imported_from_yaml' => true
+ );
$this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files');
@@ -179,7 +212,7 @@ public function testLoadServices()
$this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array(new Reference('baz', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag');
- $this->assertEquals(array(array('setBar', array())), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag');
+ $this->assertEquals(array(array('setBar', array()), array('setBar', array(new Expression('service("foo").foo() ~ parameter("foo")')))), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertNull($services['factory_service']->getClass());
$this->assertEquals('getInstance', $services['factory_service']->getFactoryMethod());
@@ -198,6 +231,29 @@ public function testLoadServices()
$this->assertFalse($aliases['another_alias_for_foo']->isPublic());
}
+ public function testParsesTags()
+ {
+ $container = new ContainerBuilder();
+ $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
+ $loader->load('services10.xml');
+
+ $services = $container->findTaggedServiceIds('foo_tag');
+ $this->assertCount(1, $services);
+
+ foreach ($services as $id => $tagAttributes) {
+ foreach ($tagAttributes as $attributes) {
+ $this->assertArrayHasKey('other_option', $attributes);
+ $this->assertEquals('lorem', $attributes['other_option']);
+ $this->assertArrayHasKey('other-option', $attributes, 'unnormalized tag attributes should not be removed');
+
+ $this->assertEquals('ciz', $attributes['some_option'], 'no overriding should be done when normalizing');
+ $this->assertEquals('cat', $attributes['some-option']);
+
+ $this->assertArrayNotHasKey('an_other_option', $attributes, 'normalization should not be done when an underscore is already found');
+ }
+ }
+ }
+
public function testConvertDomElementToArray()
{
$doc = new \DOMDocument("1.0");
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
index e452e5d..c7cb0cd 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
@@ -20,22 +20,12 @@
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\Config\FileLocator;
+use Symfony\Component\ExpressionLanguage\Expression;
class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
protected static $fixturesPath;
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\Loader\Loader')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
- if (!class_exists('Symfony\Component\Yaml\Yaml')) {
- $this->markTestSkipped('The "Yaml" component is not available');
- }
- }
-
public static function setUpBeforeClass()
{
self::$fixturesPath = realpath(__DIR__.'/../Fixtures/');
@@ -124,7 +114,7 @@ public function testLoadServices()
$this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array(new Reference('baz'), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag');
$this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag');
- $this->assertEquals(array(array('setBar', array()), array('setBar', array())), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag');
+ $this->assertEquals(array(array('setBar', array()), array('setBar', array()), array('setBar', array(new Expression('service("foo").foo() ~ parameter("foo")')))), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag');
$this->assertEquals('baz_factory', $services['factory_service']->getFactoryService());
@@ -209,7 +199,7 @@ public function testTagWithAttributeArrayThrowsException()
$this->fail('->load() should throw an exception when a tag-attribute is not a scalar');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar');
- $this->assertStringStartsWith('A "tags" attribute must be of a scalar-type for service ', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar');
+ $this->assertStringStartsWith('A "tags" attribute must be of a scalar-type for service "foo_service", tag "foo", attribute "bar"', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar');
}
}
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json
index 2631da9..1a29489 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json
@@ -20,7 +20,8 @@
},
"require-dev": {
"symfony/yaml": "~2.0",
- "symfony/config": "~2.2"
+ "symfony/config": "~2.2",
+ "symfony/expression-language": "~2.4"
},
"suggest": {
"symfony/yaml": "",
@@ -34,7 +35,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/services10.xml b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/services10.xml
new file mode 100644
index 0000000..824d8b5
--- /dev/null
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/services10.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php
index 42f09ea..e25e7f1 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php
@@ -76,6 +76,8 @@ public function stopPropagation()
*
* @param EventDispatcherInterface $dispatcher
*
+ * @deprecated Deprecated in 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call.
+ *
* @api
*/
public function setDispatcher(EventDispatcherInterface $dispatcher)
@@ -88,6 +90,8 @@ public function setDispatcher(EventDispatcherInterface $dispatcher)
*
* @return EventDispatcherInterface
*
+ * @deprecated Deprecated in 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call.
+ *
* @api
*/
public function getDispatcher()
@@ -100,6 +104,8 @@ public function getDispatcher()
*
* @return string
*
+ * @deprecated Deprecated in 2.4, to be removed in 3.0. The event name is passed to the listener call.
+ *
* @api
*/
public function getName()
@@ -112,6 +118,8 @@ public function getName()
*
* @param string $name The event name.
*
+ * @deprecated Deprecated in 2.4, to be removed in 3.0. The event name is passed to the listener call.
+ *
* @api
*/
public function setName($name)
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
index eb1fb59..ad48d43 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php
@@ -154,14 +154,14 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
* This method can be overridden to add functionality that is executed
* for each listener.
*
- * @param array[callback] $listeners The event listeners.
- * @param string $eventName The name of the event to dispatch.
- * @param Event $event The event object to pass to the event handlers/listeners.
+ * @param callable[] $listeners The event listeners.
+ * @param string $eventName The name of the event to dispatch.
+ * @param Event $event The event object to pass to the event handlers/listeners.
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
foreach ($listeners as $listener) {
- call_user_func($listener, $event);
+ call_user_func($listener, $event, $eventName, $this);
if ($event->isPropagationStopped()) {
break;
}
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php
index 3a5efcf..c226fdf 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php
@@ -21,7 +21,7 @@
class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
{
/**
- * Observer pattern subject.
+ * Event subject.
*
* @var mixed usually object or callable
*/
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md
index 11f6b18..22bf74f 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md
@@ -1,8 +1,8 @@
EventDispatcher Component
=========================
-EventDispatcher implements a lightweight version of the Observer design
-pattern.
+The Symfony2 EventDispatcher component implements the Mediator pattern in a
+simple and effective way to make your projects truly extensible.
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\Event;
@@ -21,5 +21,5 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/EventDispatcher/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php
index 71f3ad0..965a0c6 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php
@@ -19,13 +19,6 @@
class ContainerAwareEventDispatcherTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
- $this->markTestSkipped('The "DependencyInjection" component is not available');
- }
- }
-
public function testAddAListenerService()
{
$event = new Event();
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php
index ad7e448..50af445 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php
@@ -23,6 +23,9 @@ class EventDispatcherTest extends \PHPUnit_Framework_TestCase
const preBar = 'pre.bar';
const postBar = 'post.bar';
+ /**
+ * @var EventDispatcher
+ */
private $dispatcher;
private $listener;
@@ -237,7 +240,6 @@ public function testRemoveSubscriberWithMultipleListeners()
public function testEventReceivesTheDispatcherInstance()
{
- $test = $this;
$this->dispatcher->addListener('test', function ($event) use (&$dispatcher) {
$dispatcher = $event->getDispatcher();
});
@@ -245,6 +247,17 @@ public function testEventReceivesTheDispatcherInstance()
$this->assertSame($this->dispatcher, $dispatcher);
}
+ public function testEventReceivesTheDispatcherInstanceAsArgument()
+ {
+ $listener = new TestWithDispatcher();
+ $this->dispatcher->addListener('test', array($listener, 'foo'));
+ $this->assertNull($listener->name);
+ $this->assertNull($listener->dispatcher);
+ $this->dispatcher->dispatch('test');
+ $this->assertEquals('test', $listener->name);
+ $this->assertSame($this->dispatcher, $listener->dispatcher);
+ }
+
/**
* @see https://bugs.php.net/bug.php?id=62976
*
@@ -257,7 +270,7 @@ public function testWorkaroundForPhpBug62976()
{
$dispatcher = new EventDispatcher();
$dispatcher->addListener('bug.62976', new CallableClass());
- $dispatcher->removeListener('bug.62976', function() {});
+ $dispatcher->removeListener('bug.62976', function () {});
$this->assertTrue($dispatcher->hasListeners('bug.62976'));
}
}
@@ -289,6 +302,18 @@ public function postFoo(Event $e)
}
}
+class TestWithDispatcher
+{
+ public $name;
+ public $dispatcher;
+
+ public function foo(Event $e, $name, $dispatcher)
+ {
+ $this->name = $name;
+ $this->dispatcher = $dispatcher;
+ }
+}
+
class TestEventSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php
index 52aa9ad..7a20fe6 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/EventTest.php
@@ -35,7 +35,7 @@ class EventTest extends \PHPUnit_Framework_TestCase
*/
protected function setUp()
{
- $this->event = new Event;
+ $this->event = new Event();
$this->dispatcher = new EventDispatcher();
}
@@ -46,7 +46,7 @@ protected function setUp()
protected function tearDown()
{
$this->event = null;
- $this->eventDispatcher = null;
+ $this->dispatcher = null;
}
public function testIsPropagationStopped()
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php
index 8dd6f5b..c1e22f4 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php
@@ -33,7 +33,7 @@ protected function setUp()
{
parent::setUp();
- $this->subject = new \StdClass();
+ $this->subject = new \stdClass();
$this->event = new GenericEvent($this->subject, array('name' => 'Event'), 'foo');
}
diff --git a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json
index 1db2ecf..e748c50 100644
--- a/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json
+++ b/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json
@@ -32,7 +32,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php
index 9d4c313..0cec4ed 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeaderItem.php
@@ -90,7 +90,7 @@ public function __toString()
{
$string = $this->value.($this->quality < 1 ? ';q='.$this->quality : '');
if (count($this->attributes) > 0) {
- $string .= ';'.implode(';', array_map(function($name, $value) {
+ $string .= ';'.implode(';', array_map(function ($name, $value) {
return sprintf(preg_match('/[,;=]/', $value) ? '%s="%s"' : '%s=%s', $name, $value);
}, array_keys($this->attributes), $this->attributes));
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php
index 06d530d..4d27435 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/BinaryFileResponse.php
@@ -34,13 +34,13 @@ class BinaryFileResponse extends Response
/**
* Constructor.
*
- * @param SplFileInfo|string $file The file to stream
- * @param integer $status The response status code
- * @param array $headers An array of response headers
- * @param boolean $public Files are public by default
- * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename
- * @param boolean $autoEtag Whether the ETag header should be automatically set
- * @param boolean $autoLastModified Whether the Last-Modified header should be automatically set
+ * @param \SplFileInfo|string $file The file to stream
+ * @param integer $status The response status code
+ * @param array $headers An array of response headers
+ * @param boolean $public Files are public by default
+ * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename
+ * @param boolean $autoEtag Whether the ETag header should be automatically set
+ * @param boolean $autoLastModified Whether the Last-Modified header should be automatically set
*/
public function __construct($file, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
{
@@ -54,7 +54,13 @@ public function __construct($file, $status = 200, $headers = array(), $public =
}
/**
- * {@inheritdoc}
+ * @param \SplFileInfo|string $file The file to stream
+ * @param integer $status The response status code
+ * @param array $headers An array of response headers
+ * @param boolean $public Files are public by default
+ * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename
+ * @param boolean $autoEtag Whether the ETag header should be automatically set
+ * @param boolean $autoLastModified Whether the Last-Modified header should be automatically set
*/
public static function create($file = null, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
{
@@ -64,10 +70,10 @@ public static function create($file = null, $status = 200, $headers = array(), $
/**
* Sets the file to stream.
*
- * @param SplFileInfo|string $file The file to stream
- * @param string $contentDisposition
- * @param Boolean $autoEtag
- * @param Boolean $autoLastModified
+ * @param \SplFileInfo|string $file The file to stream
+ * @param string $contentDisposition
+ * @param Boolean $autoEtag
+ * @param Boolean $autoLastModified
*
* @return BinaryFileResponse
*
@@ -177,7 +183,7 @@ public function prepare(Request $request)
$path = $this->file->getRealPath();
if (strtolower($type) == 'x-accel-redirect') {
// Do X-Accel-Mapping substitutions.
- foreach (explode(',', $request->headers->get('X-Accel-Mapping', '')) as $mapping) {
+ foreach (explode(',', $request->headers->get('X-Accel-Mapping', '')) as $mapping) {
$mapping = explode('=', $mapping, 2);
if (2 == count($mapping)) {
@@ -210,14 +216,18 @@ public function prepare(Request $request)
$start = (int) $start;
}
- $start = max($start, 0);
- $end = min($end, $fileSize - 1);
-
- $this->maxlen = $end < $fileSize ? $end - $start + 1 : -1;
- $this->offset = $start;
+ if ($start <= $end) {
+ if ($start < 0 || $end > $fileSize - 1) {
+ $this->setStatusCode(416);
+ } elseif ($start !== 0 || $end !== $fileSize - 1) {
+ $this->maxlen = $end < $fileSize ? $end - $start + 1 : -1;
+ $this->offset = $start;
- $this->setStatusCode(206);
- $this->headers->set('Content-Range', sprintf('bytes %s-%s/%s', $start, $end, $fileSize));
+ $this->setStatusCode(206);
+ $this->headers->set('Content-Range', sprintf('bytes %s-%s/%s', $start, $end, $fileSize));
+ $this->headers->set('Content-Length', $end - $start + 1);
+ }
+ }
}
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md
index 41e8eb2..061d47e 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md
@@ -1,6 +1,13 @@
CHANGELOG
=========
+2.4.0
+-----
+
+ * added RequestStack
+ * added Request::getEncodings()
+ * added accessors methods to session handlers
+
2.3.0
-----
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ExpressionRequestMatcher.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ExpressionRequestMatcher.php
new file mode 100644
index 0000000..e9c8441
--- /dev/null
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ExpressionRequestMatcher.php
@@ -0,0 +1,47 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpFoundation;
+
+use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
+
+/**
+ * ExpressionRequestMatcher uses an expression to match a Request.
+ *
+ * @author Fabien Potencier
+ */
+class ExpressionRequestMatcher extends RequestMatcher
+{
+ private $language;
+ private $expression;
+
+ public function setExpression(ExpressionLanguage $language, $expression)
+ {
+ $this->language = $language;
+ $this->expression = $expression;
+ }
+
+ public function matches(Request $request)
+ {
+ if (!$this->language) {
+ throw new \LogicException('Unable to match the request as the expression language is not available.');
+ }
+
+ return $this->language->evaluate($this->expression, array(
+ 'request' => $request,
+ 'method' => $request->getMethod(),
+ 'path' => rawurldecode($request->getPathInfo()),
+ 'host' => $request->getHost(),
+ 'ip' => $request->getClientIp(),
+ 'attributes' => $request->attributes->all(),
+ )) && parent::matches($request);
+ }
+}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php
index 9002b51..4fabfb9 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php
@@ -137,7 +137,7 @@ protected function getTargetFile($directory, $name = null)
throw new FileException(sprintf('Unable to write in the "%s" directory', $directory));
}
- $target = $directory.DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));
+ $target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name));
return new File($target, false);
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php
index 1f23c35..16c4cdb 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php
@@ -252,7 +252,7 @@ public function move($directory, $name = null)
return $target;
}
- throw new FileException($this->getErrorMessage($this->getError()));
+ throw new FileException($this->getErrorMessage());
}
/**
@@ -262,30 +262,37 @@ public function move($directory, $name = null)
*/
public static function getMaxFilesize()
{
- $max = strtolower(ini_get('upload_max_filesize'));
+ $iniMax = strtolower(ini_get('upload_max_filesize'));
- if ('' === $max) {
+ if ('' === $iniMax) {
return PHP_INT_MAX;
}
- if (preg_match('#^\+?(0x?)?(.*?)([kmg]?)$#', $max, $match)) {
- $shifts = array('' => 0, 'k' => 10, 'm' => 20, 'g' => 30);
- $bases = array('' => 10, '0' => 8, '0x' => 16);
+ $max = ltrim($iniMax, '+');
+ if (0 === strpos($max, '0x')) {
+ $max = intval($max, 16);
+ } elseif (0 === strpos($max, '0')) {
+ $max = intval($max, 8);
+ } else {
+ $max = intval($max);
+ }
- return intval($match[2], $bases[$match[1]]) << $shifts[$match[3]];
+ switch (substr($iniMax, -1)) {
+ case 't': $max *= 1024;
+ case 'g': $max *= 1024;
+ case 'm': $max *= 1024;
+ case 'k': $max *= 1024;
}
- return 0;
+ return $max;
}
/**
* Returns an informative upload error message.
*
- * @param int $code The error code returned by an upload attempt
- *
* @return string The error message regarding the specified error code
*/
- private function getErrorMessage($errorCode)
+ public function getErrorMessage()
{
static $errors = array(
UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d kb).',
@@ -294,12 +301,13 @@ private function getErrorMessage($errorCode)
UPLOAD_ERR_NO_FILE => 'No file was uploaded.',
UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.',
UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',
- UPLOAD_ERR_EXTENSION => 'File upload was stopped by a php extension.',
+ UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',
);
+ $errorCode = $this->error;
$maxFilesize = $errorCode === UPLOAD_ERR_INI_SIZE ? self::getMaxFilesize() / 1024 : 0;
$message = isset($errors[$errorCode]) ? $errors[$errorCode] : 'The file "%s" was not uploaded due to an unknown error.';
- return sprintf($message, $this->getClientOriginalName(), $maxFilesize);
+ return sprintf($message, $this->getClientOriginalName(), $maxFilesize);
}
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php
index b579eb9..2b9ef0e 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php
@@ -20,8 +20,8 @@
*/
class HeaderBag implements \IteratorAggregate, \Countable
{
- protected $headers;
- protected $cacheControl;
+ protected $headers = array();
+ protected $cacheControl = array();
/**
* Constructor.
@@ -32,8 +32,6 @@ class HeaderBag implements \IteratorAggregate, \Countable
*/
public function __construct(array $headers = array())
{
- $this->cacheControl = array();
- $this->headers = array();
foreach ($headers as $key => $values) {
$this->set($key, $values);
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php
index 7c3742e..98b8481 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/IpUtils.php
@@ -24,10 +24,10 @@ class IpUtils
private function __construct() {}
/**
- * Validates an IPv4 or IPv6 address.
+ * Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets
*
- * @param string $requestIp
- * @param string|array $ips
+ * @param string $requestIp IP to check
+ * @param string|array $ips List of IPs or subnets (can be a string if only a single one)
*
* @return boolean Whether the IP is valid
*/
@@ -49,10 +49,11 @@ public static function checkIp($requestIp, $ips)
}
/**
- * Validates an IPv4 address.
+ * Compares two IPv4 addresses.
+ * In case a subnet is given, it checks if it contains the request IP.
*
- * @param string $requestIp
- * @param string $ip
+ * @param string $requestIp IPv4 address to check
+ * @param string $ip IPv4 address or subnet in CIDR notation
*
* @return boolean Whether the IP is valid
*/
@@ -73,13 +74,14 @@ public static function checkIp4($requestIp, $ip)
}
/**
- * Validates an IPv6 address.
+ * Compares two IPv6 addresses.
+ * In case a subnet is given, it checks if it contains the request IP.
*
* @author David Soria Parra
* @see https://github.com/dsp/v6tools
*
- * @param string $requestIp
- * @param string $ip
+ * @param string $requestIp IPv6 address to check
+ * @param string $ip IPv6 address or subnet in CIDR notation
*
* @return boolean Whether the IP is valid
*
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php
index eafccaa..6dfa75c 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php
@@ -55,11 +55,11 @@ public static function create($data = null, $status = 200, $headers = array())
/**
* Sets the JSONP callback.
*
- * @param string $callback
+ * @param string|null $callback The JSONP callback or null to use none
*
* @return JsonResponse
*
- * @throws \InvalidArgumentException
+ * @throws \InvalidArgumentException When the callback name is not valid
*/
public function setCallback($callback = null)
{
@@ -85,12 +85,18 @@ public function setCallback($callback = null)
* @param mixed $data
*
* @return JsonResponse
+ *
+ * @throws \InvalidArgumentException
*/
public function setData($data = array())
{
// Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML.
$this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
+ if (JSON_ERROR_NONE !== json_last_error()) {
+ throw new \InvalidArgumentException($this->transformJsonError());
+ }
+
return $this->update();
}
@@ -116,4 +122,31 @@ protected function update()
return $this->setContent($this->data);
}
+
+ private function transformJsonError()
+ {
+ if (function_exists('json_last_error_msg')) {
+ return json_last_error_msg();
+ }
+
+ switch (json_last_error()) {
+ case JSON_ERROR_DEPTH:
+ return 'Maximum stack depth exceeded.';
+
+ case JSON_ERROR_STATE_MISMATCH:
+ return 'Underflow or the modes mismatch.';
+
+ case JSON_ERROR_CTRL_CHAR:
+ return 'Unexpected control character found.';
+
+ case JSON_ERROR_SYNTAX:
+ return 'Syntax error, malformed JSON.';
+
+ case JSON_ERROR_UTF8:
+ return 'Malformed UTF-8 characters, possibly incorrectly encoded.';
+
+ default:
+ return 'Unknown error.';
+ }
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php
index c8720cd..a4ac98c 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php
@@ -266,7 +266,7 @@ public function getInt($key, $default = 0, $deep = false)
*
* @return mixed
*/
- public function filter($key, $default = null, $deep = false, $filter=FILTER_DEFAULT, $options=array())
+ public function filter($key, $default = null, $deep = false, $filter = FILTER_DEFAULT, $options = array())
{
$value = $this->get($key, $default, $deep);
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md
index ed49b4e..ea6a790 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md
@@ -44,5 +44,5 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/HttpFoundation/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php
index 54f5721..fbf377b 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php
@@ -27,7 +27,7 @@ class RedirectResponse extends Response
*
* @param string $url The URL to redirect to
* @param integer $status The status code (302 by default)
- * @param array $headers The headers (Location is always set to the given url)
+ * @param array $headers The headers (Location is always set to the given URL)
*
* @throws \InvalidArgumentException
*
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
index 4641ead..88a61b6 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
@@ -64,6 +64,8 @@ class Request
protected static $httpMethodParameterOverride = false;
/**
+ * Custom parameters
+ *
* @var \Symfony\Component\HttpFoundation\ParameterBag
*
* @api
@@ -71,6 +73,8 @@ class Request
public $attributes;
/**
+ * Request body parameters ($_POST)
+ *
* @var \Symfony\Component\HttpFoundation\ParameterBag
*
* @api
@@ -78,6 +82,8 @@ class Request
public $request;
/**
+ * Query string parameters ($_GET)
+ *
* @var \Symfony\Component\HttpFoundation\ParameterBag
*
* @api
@@ -85,6 +91,8 @@ class Request
public $query;
/**
+ * Server and execution environment parameters ($_SERVER)
+ *
* @var \Symfony\Component\HttpFoundation\ServerBag
*
* @api
@@ -92,6 +100,8 @@ class Request
public $server;
/**
+ * Uploaded files ($_FILES)
+ *
* @var \Symfony\Component\HttpFoundation\FileBag
*
* @api
@@ -99,6 +109,8 @@ class Request
public $files;
/**
+ * Cookies ($_COOKIE)
+ *
* @var \Symfony\Component\HttpFoundation\ParameterBag
*
* @api
@@ -106,6 +118,8 @@ class Request
public $cookies;
/**
+ * Headers (taken from the $_SERVER)
+ *
* @var \Symfony\Component\HttpFoundation\HeaderBag
*
* @api
@@ -130,6 +144,11 @@ class Request
/**
* @var array
*/
+ protected $encodings;
+
+ /**
+ * @var array
+ */
protected $acceptableContentTypes;
/**
@@ -182,6 +201,8 @@ class Request
*/
protected static $formats;
+ protected static $requestFactory;
+
/**
* Constructor.
*
@@ -228,6 +249,7 @@ public function initialize(array $query = array(), array $request = array(), arr
$this->content = $content;
$this->languages = null;
$this->charsets = null;
+ $this->encodings = null;
$this->acceptableContentTypes = null;
$this->pathInfo = null;
$this->requestUri = null;
@@ -246,7 +268,7 @@ public function initialize(array $query = array(), array $request = array(), arr
*/
public static function createFromGlobals()
{
- $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
+ $request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
if (0 === strpos($request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
&& in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH'))
@@ -346,16 +368,39 @@ public static function create($uri, $method = 'GET', $parameters = array(), $coo
break;
}
+ $queryString = '';
if (isset($components['query'])) {
parse_str(html_entity_decode($components['query']), $qs);
- $query = array_replace($qs, $query);
+
+ if ($query) {
+ $query = array_replace($qs, $query);
+ $queryString = http_build_query($query, '', '&');
+ } else {
+ $query = $qs;
+ $queryString = $components['query'];
+ }
+ } elseif ($query) {
+ $queryString = http_build_query($query, '', '&');
}
- $queryString = http_build_query($query, '', '&');
$server['REQUEST_URI'] = $components['path'].('' !== $queryString ? '?'.$queryString : '');
$server['QUERY_STRING'] = $queryString;
- return new static($query, $request, array(), $cookies, $files, $server, $content);
+ return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content);
+ }
+
+ /**
+ * Sets a callable able to create a Request instance.
+ *
+ * This is mainly useful when you need to override the Request class
+ * to keep BC with an existing system. It should not be used for any
+ * other purpose.
+ *
+ * @param callable|null $callable A PHP callable
+ */
+ public static function setFactory($callable)
+ {
+ self::$requestFactory = $callable;
}
/**
@@ -396,6 +441,7 @@ public function duplicate(array $query = null, array $request = null, array $att
}
$dup->languages = null;
$dup->charsets = null;
+ $dup->encodings = null;
$dup->acceptableContentTypes = null;
$dup->pathInfo = null;
$dup->requestUri = null;
@@ -404,8 +450,12 @@ public function duplicate(array $query = null, array $request = null, array $att
$dup->method = null;
$dup->format = null;
- if (!$dup->get('_format')) {
- $dup->setRequestFormat($this->getRequestFormat());
+ if (!$dup->get('_format') && $this->get('_format')) {
+ $dup->attributes->set('_format', $this->get('_format'));
+ }
+
+ if (!$dup->getRequestFormat(null)) {
+ $dup->setRequestFormat($format = $this->getRequestFormat(null));
}
return $dup;
@@ -467,7 +517,7 @@ public function overrideGlobals()
$request = array('g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE);
- $requestOrder = ini_get('request_order') ?: ini_get('variable_order');
+ $requestOrder = ini_get('request_order') ?: ini_get('variables_order');
$requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp';
$_REQUEST = array();
@@ -719,9 +769,9 @@ public function setSession(SessionInterface $session)
/**
* Returns the client IP addresses.
*
- * The most trusted IP address is first, and the less trusted one last.
- * The "real" client IP address is the last one, but this is also the
- * less trusted one.
+ * In the returned array the most trusted IP address is first, and the
+ * least trusted one last. The "real" client IP address is the last one,
+ * but this is also the least trusted one. Trusted proxies are stripped.
*
* Use this method carefully; you should use getClientIp() instead.
*
@@ -742,19 +792,18 @@ public function getClientIps()
}
$clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP])));
- $clientIps[] = $ip;
+ $clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from
- $trustedProxies = !self::$trustedProxies ? array($ip) : self::$trustedProxies;
- $ip = $clientIps[0];
+ $ip = $clientIps[0]; // Fallback to this when the client IP falls into the range of trusted proxies
+ // Eliminate all IPs from the forwarded IP chain which are trusted proxies
foreach ($clientIps as $key => $clientIp) {
- if (IpUtils::checkIp($clientIp, $trustedProxies)) {
+ if (IpUtils::checkIp($clientIp, self::$trustedProxies)) {
unset($clientIps[$key]);
-
- continue;
}
}
+ // Now the IP chain contains only untrusted proxies and the client IP
return $clientIps ? array_reverse($clientIps) : array($ip);
}
@@ -846,14 +895,14 @@ public function getBasePath()
}
/**
- * Returns the root url from which this request is executed.
+ * Returns the root URL from which this request is executed.
*
* The base URL never ends with a /.
*
* This is similar to getBasePath(), except that it also includes the
* script filename (e.g. index.php) if one exists.
*
- * @return string The raw url (i.e. not urldecoded)
+ * @return string The raw URL (i.e. not urldecoded)
*
* @api
*/
@@ -905,6 +954,14 @@ public function getPort()
}
}
+ if ($host = $this->headers->get('HOST')) {
+ if (false !== $pos = strrpos($host, ':')) {
+ return intval(substr($host, $pos + 1));
+ }
+
+ return 'https' === $this->getScheme() ? 443 : 80;
+ }
+
return $this->server->get('SERVER_PORT');
}
@@ -939,7 +996,7 @@ public function getUserInfo()
$pass = $this->getPassword();
if ('' != $pass) {
- $userinfo .= ":$pass";
+ $userinfo .= ":$pass";
}
return $userinfo;
@@ -1063,7 +1120,7 @@ public function getQueryString()
public function isSecure()
{
if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) {
- return in_array(strtolower($proto), array('https', 'on', '1'));
+ return in_array(strtolower(current(explode(',', $proto))), array('https', 'on', 'ssl', '1'));
}
return 'on' == strtolower($this->server->get('HTTPS')) || 1 == $this->server->get('HTTPS');
@@ -1105,7 +1162,7 @@ public function getHost()
// as the host can come from the user (HTTP_HOST and depending on the configuration, SERVER_NAME too can come from the user)
// check that it does not contain forbidden characters (see RFC 952 and RFC 2181)
if ($host && !preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host)) {
- throw new \UnexpectedValueException('Invalid Host "'.$host.'"');
+ throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host));
}
if (count(self::$trustedHostPatterns) > 0) {
@@ -1123,7 +1180,7 @@ public function getHost()
}
}
- throw new \UnexpectedValueException('Untrusted Host "'.$host.'"');
+ throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host));
}
return $host;
@@ -1503,6 +1560,20 @@ public function getCharsets()
}
/**
+ * Gets a list of encodings acceptable by the client browser.
+ *
+ * @return array List of encodings in preferable order
+ */
+ public function getEncodings()
+ {
+ if (null !== $this->encodings) {
+ return $this->encodings;
+ }
+
+ return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
+ }
+
+ /**
* Gets a list of content types acceptable by the client browser
*
* @return array List of content types in preferable order
@@ -1558,13 +1629,13 @@ protected function prepareRequestUri()
$requestUri = $this->headers->get('X_REWRITE_URL');
$this->headers->remove('X_REWRITE_URL');
} elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $this->server->get('UNENCODED_URL') != '') {
- // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)
+ // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem)
$requestUri = $this->server->get('UNENCODED_URL');
$this->server->remove('UNENCODED_URL');
$this->server->remove('IIS_WasUrlRewritten');
} elseif ($this->server->has('REQUEST_URI')) {
$requestUri = $this->server->get('REQUEST_URI');
- // HTTP proxy reqs setup request uri with scheme and host [and port] + the url path, only use url path
+ // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, only use URL path
$schemeAndHttpHost = $this->getSchemeAndHttpHost();
if (strpos($requestUri, $schemeAndHttpHost) === 0) {
$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
@@ -1613,7 +1684,7 @@ protected function prepareBaseUrl()
$seg = $segs[$index];
$baseUrl = '/'.$seg.$baseUrl;
++$index;
- } while (($last > $index) && (false !== ($pos = strpos($path, $baseUrl))) && (0 != $pos));
+ } while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos);
}
// Does the baseUrl have anything in common with the request_uri?
@@ -1630,7 +1701,7 @@ protected function prepareBaseUrl()
}
$truncatedRequestUri = $requestUri;
- if (($pos = strpos($requestUri, '?')) !== false) {
+ if (false !== $pos = strpos($requestUri, '?')) {
$truncatedRequestUri = substr($requestUri, 0, $pos);
}
@@ -1643,7 +1714,7 @@ protected function prepareBaseUrl()
// If using mod_rewrite or ISAPI_Rewrite strip the script filename
// out of baseUrl. $pos !== 0 makes sure it is not matching a value
// from PATH_INFO or QUERY_STRING
- if ((strlen($requestUri) >= strlen($baseUrl)) && ((false !== ($pos = strpos($requestUri, $baseUrl))) && ($pos !== 0))) {
+ if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && $pos !== 0) {
$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl));
}
@@ -1696,7 +1767,7 @@ protected function preparePathInfo()
$requestUri = substr($requestUri, 0, $pos);
}
- if ((null !== $baseUrl) && (false === ($pathInfo = substr($requestUri, strlen($baseUrl))))) {
+ if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) {
// If substr() returns false then PATH_INFO is set to an empty string
return '/';
} elseif (null === $baseUrl) {
@@ -1765,4 +1836,19 @@ private function getUrlencodedPrefix($string, $prefix)
return false;
}
+
+ private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+ {
+ if (self::$requestFactory) {
+ $request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content);
+
+ if (!$request instanceof Request) {
+ throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.');
+ }
+
+ return $request;
+ }
+
+ return new static($query, $request, $attributes, $cookies, $files, $server, $content);
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestStack.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestStack.php
new file mode 100644
index 0000000..4b0ef28
--- /dev/null
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestStack.php
@@ -0,0 +1,103 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpFoundation;
+
+/**
+ * Request stack that controls the lifecycle of requests.
+ *
+ * @author Benjamin Eberlei
+ */
+class RequestStack
+{
+ /**
+ * @var Request[]
+ */
+ private $requests = array();
+
+ /**
+ * Pushes a Request on the stack.
+ *
+ * This method should generally not be called directly as the stack
+ * management should be taken care of by the application itself.
+ */
+ public function push(Request $request)
+ {
+ $this->requests[] = $request;
+ }
+
+ /**
+ * Pops the current request from the stack.
+ *
+ * This operation lets the current request go out of scope.
+ *
+ * This method should generally not be called directly as the stack
+ * management should be taken care of by the application itself.
+ *
+ * @return Request|null
+ */
+ public function pop()
+ {
+ if (!$this->requests) {
+ return null;
+ }
+
+ return array_pop($this->requests);
+ }
+
+ /**
+ * @return Request|null
+ */
+ public function getCurrentRequest()
+ {
+ return end($this->requests) ?: null;
+ }
+
+ /**
+ * Gets the master Request.
+ *
+ * Be warned that making your code aware of the master request
+ * might make it un-compatible with other features of your framework
+ * like ESI support.
+ *
+ * @return Request|null
+ */
+ public function getMasterRequest()
+ {
+ if (!$this->requests) {
+ return null;
+ }
+
+ return $this->requests[0];
+ }
+
+ /**
+ * Returns the parent request of the current.
+ *
+ * Be warned that making your code aware of the parent request
+ * might make it un-compatible with other features of your framework
+ * like ESI support.
+ *
+ * If current Request is the master request, it returns null.
+ *
+ * @return Request|null
+ */
+ public function getParentRequest()
+ {
+ $pos = count($this->requests) - 2;
+
+ if (!isset($this->requests[$pos])) {
+ return null;
+ }
+
+ return $this->requests[$pos];
+ }
+}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
index 25c49c9..bc9a193 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
@@ -20,6 +20,67 @@
*/
class Response
{
+ const HTTP_CONTINUE = 100;
+ const HTTP_SWITCHING_PROTOCOLS = 101;
+ const HTTP_PROCESSING = 102; // RFC2518
+ const HTTP_OK = 200;
+ const HTTP_CREATED = 201;
+ const HTTP_ACCEPTED = 202;
+ const HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
+ const HTTP_NO_CONTENT = 204;
+ const HTTP_RESET_CONTENT = 205;
+ const HTTP_PARTIAL_CONTENT = 206;
+ const HTTP_MULTI_STATUS = 207; // RFC4918
+ const HTTP_ALREADY_REPORTED = 208; // RFC5842
+ const HTTP_IM_USED = 226; // RFC3229
+ const HTTP_MULTIPLE_CHOICES = 300;
+ const HTTP_MOVED_PERMANENTLY = 301;
+ const HTTP_FOUND = 302;
+ const HTTP_SEE_OTHER = 303;
+ const HTTP_NOT_MODIFIED = 304;
+ const HTTP_USE_PROXY = 305;
+ const HTTP_RESERVED = 306;
+ const HTTP_TEMPORARY_REDIRECT = 307;
+ const HTTP_PERMANENTLY_REDIRECT = 308; // RFC-reschke-http-status-308-07
+ const HTTP_BAD_REQUEST = 400;
+ const HTTP_UNAUTHORIZED = 401;
+ const HTTP_PAYMENT_REQUIRED = 402;
+ const HTTP_FORBIDDEN = 403;
+ const HTTP_NOT_FOUND = 404;
+ const HTTP_METHOD_NOT_ALLOWED = 405;
+ const HTTP_NOT_ACCEPTABLE = 406;
+ const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
+ const HTTP_REQUEST_TIMEOUT = 408;
+ const HTTP_CONFLICT = 409;
+ const HTTP_GONE = 410;
+ const HTTP_LENGTH_REQUIRED = 411;
+ const HTTP_PRECONDITION_FAILED = 412;
+ const HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
+ const HTTP_REQUEST_URI_TOO_LONG = 414;
+ const HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
+ const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+ const HTTP_EXPECTATION_FAILED = 417;
+ const HTTP_I_AM_A_TEAPOT = 418; // RFC2324
+ const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918
+ const HTTP_LOCKED = 423; // RFC4918
+ const HTTP_FAILED_DEPENDENCY = 424; // RFC4918
+ const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; // RFC2817
+ const HTTP_UPGRADE_REQUIRED = 426; // RFC2817
+ const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585
+ const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585
+ const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585
+ const HTTP_INTERNAL_SERVER_ERROR = 500;
+ const HTTP_NOT_IMPLEMENTED = 501;
+ const HTTP_BAD_GATEWAY = 502;
+ const HTTP_SERVICE_UNAVAILABLE = 503;
+ const HTTP_GATEWAY_TIMEOUT = 504;
+ const HTTP_VERSION_NOT_SUPPORTED = 505;
+ const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; // RFC2295
+ const HTTP_INSUFFICIENT_STORAGE = 507; // RFC4918
+ const HTTP_LOOP_DETECTED = 508; // RFC5842
+ const HTTP_NOT_EXTENDED = 510; // RFC2774
+ const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585
+
/**
* @var \Symfony\Component\HttpFoundation\ResponseHeaderBag
*/
@@ -127,7 +188,7 @@ class Response
/**
* Constructor.
*
- * @param string $content The response content
+ * @param mixed $content The response content, see setContent()
* @param integer $status The response status code
* @param array $headers An array of response headers
*
@@ -154,7 +215,7 @@ public function __construct($content = '', $status = 200, $headers = array())
* return Response::create($body, 200)
* ->setSharedMaxAge(300);
*
- * @param string $content The response content
+ * @param mixed $content The response content, see setContent()
* @param integer $status The response status code
* @param array $headers An array of response headers
*
@@ -223,7 +284,7 @@ public function prepare(Request $request)
$charset = $this->charset ?: 'UTF-8';
if (!$headers->has('Content-Type')) {
$headers->set('Content-Type', 'text/html; charset='.$charset);
- } elseif (0 === strpos($headers->get('Content-Type'), 'text/') && false === strpos($headers->get('Content-Type'), 'charset')) {
+ } elseif (0 === stripos($headers->get('Content-Type'), 'text/') && false === stripos($headers->get('Content-Type'), 'charset')) {
// add the charset
$headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset);
}
@@ -271,12 +332,12 @@ public function sendHeaders()
}
// status
- header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText));
+ header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
// headers
foreach ($this->headers->allPreserveCase() as $name => $values) {
foreach ($values as $value) {
- header($name.': '.$value, false);
+ header($name.': '.$value, false, $this->statusCode);
}
}
@@ -342,9 +403,9 @@ public function send()
/**
* Sets the response content.
*
- * Valid types are strings, numbers, and objects that implement a __toString() method.
+ * Valid types are strings, numbers, null, and objects that implement a __toString() method.
*
- * @param mixed $content
+ * @param mixed $content Content that can be cast to string
*
* @return Response
*
@@ -1181,7 +1242,7 @@ public function isEmpty()
}
/**
- * Check if we need to remove Cache-Control for ssl encrypted downloads when using IE < 9
+ * Check if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9
*
* @link http://support.microsoft.com/kb/323308
*/
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php
index d7aadc6..de6dbc9 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php
@@ -64,11 +64,17 @@ public function getHeaders()
$authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION'];
}
- // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic
- if ((null !== $authorizationHeader) && (0 === stripos($authorizationHeader, 'basic'))) {
- $exploded = explode(':', base64_decode(substr($authorizationHeader, 6)));
- if (count($exploded) == 2) {
- list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded;
+ if (null !== $authorizationHeader) {
+ if (0 === stripos($authorizationHeader, 'basic')) {
+ // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic
+ $exploded = explode(':', base64_decode(substr($authorizationHeader, 6)));
+ if (count($exploded) == 2) {
+ list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded;
+ }
+ } elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader, 'digest'))) {
+ // In some circumstances PHP_AUTH_DIGEST needs to be set
+ $headers['PHP_AUTH_DIGEST'] = $authorizationHeader;
+ $this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader;
}
}
}
@@ -76,6 +82,8 @@ public function getHeaders()
// PHP_AUTH_USER/PHP_AUTH_PW
if (isset($headers['PHP_AUTH_USER'])) {
$headers['AUTHORIZATION'] = 'Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']);
+ } elseif (isset($headers['PHP_AUTH_DIGEST'])) {
+ $headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST'];
}
return $headers;
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php
index e9d0257..af416d6 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php
@@ -31,7 +31,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
/**
* Constructor.
*
- * @param string $storageKey The key used to store attributes in the session.
+ * @param string $storageKey The key used to store attributes in the session
*/
public function __construct($storageKey = '_sf2_attributes')
{
@@ -148,7 +148,7 @@ public function getIterator()
/**
* Returns the number of attributes.
*
- * @return int The number of attributes
+ * @return integer The number of attributes
*/
public function count()
{
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php
index 5f1f37b..6356056 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php
@@ -33,7 +33,7 @@ public function has($name);
* Returns an attribute.
*
* @param string $name The attribute name
- * @param mixed $default The default value if not found.
+ * @param mixed $default The default value if not found
*
* @return mixed
*/
@@ -66,7 +66,7 @@ public function replace(array $attributes);
*
* @param string $name
*
- * @return mixed The removed value
+ * @return mixed The removed value or null when it does not exist
*/
public function remove($name);
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php
index c0dd358..7cafb22 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php
@@ -149,8 +149,8 @@ protected function &resolveAttributePath($name, $writeContext = false)
*/
protected function resolveKey($name)
{
- if (strpos($name, $this->namespaceCharacter) !== false) {
- $name = substr($name, strrpos($name, $this->namespaceCharacter)+1, strlen($name));
+ if (false !== $pos = strrpos($name, $this->namespaceCharacter)) {
+ $name = substr($name, $pos+1);
}
return $name;
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php
index c6e41de..25a6260 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php
@@ -25,7 +25,7 @@ class AutoExpireFlashBag implements FlashBagInterface
*
* @var array
*/
- private $flashes = array();
+ private $flashes = array('display' => array(), 'new' => array());
/**
* The storage key for flashes in the session
@@ -42,7 +42,6 @@ class AutoExpireFlashBag implements FlashBagInterface
public function __construct($storageKey = '_sf2_flashes')
{
$this->storageKey = $storageKey;
- $this->flashes = array('display' => array(), 'new' => array());
}
/**
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php
index d62e383..2bd7786 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php
@@ -14,6 +14,8 @@
/**
* FlashBag flash message container.
*
+ * \IteratorAggregate implementation is deprecated and will be removed in 3.0.
+ *
* @author Drak
*/
class FlashBag implements FlashBagInterface, \IteratorAggregate
@@ -76,7 +78,7 @@ public function add($type, $message)
/**
* {@inheritdoc}
*/
- public function peek($type, array $default =array())
+ public function peek($type, array $default = array())
{
return $this->has($type) ? $this->flashes[$type] : $default;
}
@@ -167,6 +169,8 @@ public function clear()
/**
* Returns an iterator for flashes.
*
+ * @deprecated Will be removed in 3.0.
+ *
* @return \ArrayIterator An \ArrayIterator instance
*/
public function getIterator()
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php
index 15df097..ac626fd 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php
@@ -16,7 +16,6 @@
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
-use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
/**
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php
index a94fad0..dc2f7bc 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php
@@ -163,7 +163,7 @@ public function replace(array $attributes);
*
* @param string $name
*
- * @return mixed The removed value
+ * @return mixed The removed value or null when it does not exist
*
* @api
*/
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php
index 4a5e639..b238450 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php
@@ -106,4 +106,14 @@ public function gc($lifetime)
// not required here because memcache will auto expire the records anyhow.
return true;
}
+
+ /**
+ * Return a Memcache instance
+ *
+ * @return \Memcache
+ */
+ protected function getMemcache()
+ {
+ return $this->memcache;
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php
index b3ca0bd..ed7d6ed 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php
@@ -112,4 +112,14 @@ public function gc($lifetime)
// not required here because memcached will auto expire the records anyhow.
return true;
}
+
+ /**
+ * Return a Memcached instance
+ *
+ * @return \Memcached
+ */
+ protected function getMemcached()
+ {
+ return $this->memcached;
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php
index 69ebae9..4d819fe 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php
@@ -160,4 +160,14 @@ private function getCollection()
return $this->collection;
}
+
+ /**
+ * Return a Mongo instance
+ *
+ * @return \Mongo
+ */
+ protected function getMongo()
+ {
+ return $this->mongo;
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php
index 347cbee..baf8eea 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php
@@ -240,4 +240,14 @@ private function createNewSession($id, $data = '')
return true;
}
+
+ /**
+ * Return a PDO instance
+ *
+ * @return \PDO
+ */
+ protected function getConnection()
+ {
+ return $this->pdo;
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php
new file mode 100644
index 0000000..c43c9d0
--- /dev/null
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php
@@ -0,0 +1,91 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
+
+/**
+ * Wraps another SessionHandlerInterface to only write the session when it has been modified.
+ *
+ * @author Adrien Brault
+ */
+class WriteCheckSessionHandler implements \SessionHandlerInterface
+{
+ /**
+ * @var \SessionHandlerInterface
+ */
+ private $wrappedSessionHandler;
+
+ /**
+ * @var array sessionId => session
+ */
+ private $readSessions;
+
+ public function __construct(\SessionHandlerInterface $wrappedSessionHandler)
+ {
+ $this->wrappedSessionHandler = $wrappedSessionHandler;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function close()
+ {
+ return $this->wrappedSessionHandler->close();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy($sessionId)
+ {
+ return $this->wrappedSessionHandler->destroy($sessionId);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function gc($maxLifetime)
+ {
+ return $this->wrappedSessionHandler->gc($maxLifetime);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function open($savePath, $sessionId)
+ {
+ return $this->wrappedSessionHandler->open($savePath, $sessionId);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function read($sessionId)
+ {
+ $session = $this->wrappedSessionHandler->read($sessionId);
+
+ $this->readSessions[$sessionId] = $session;
+
+ return $session;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($sessionId, $sessionData)
+ {
+ if (isset($this->readSessions[$sessionId]) && $sessionData === $this->readSessions[$sessionId]) {
+ return true;
+ }
+
+ return $this->wrappedSessionHandler->write($sessionId, $sessionData);
+ }
+}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php
index 892d004..4421297 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php
@@ -39,7 +39,7 @@ class MetadataBag implements SessionBagInterface
/**
* @var array
*/
- protected $meta = array();
+ protected $meta = array(self::CREATED => 0, self::UPDATED => 0, self::LIFETIME => 0);
/**
* Unix timestamp.
@@ -49,14 +49,20 @@ class MetadataBag implements SessionBagInterface
private $lastUsed;
/**
+ * @var integer
+ */
+ private $updateThreshold;
+
+ /**
* Constructor.
*
- * @param string $storageKey The key used to store bag in the session.
+ * @param string $storageKey The key used to store bag in the session.
+ * @param integer $updateThreshold The time to wait between two UPDATED updates
*/
- public function __construct($storageKey = '_sf2_meta')
+ public function __construct($storageKey = '_sf2_meta', $updateThreshold = 0)
{
$this->storageKey = $storageKey;
- $this->meta = array(self::CREATED => 0, self::UPDATED => 0, self::LIFETIME => 0);
+ $this->updateThreshold = $updateThreshold;
}
/**
@@ -68,7 +74,11 @@ public function initialize(array &$array)
if (isset($array[self::CREATED])) {
$this->lastUsed = $this->meta[self::UPDATED];
- $this->meta[self::UPDATED] = time();
+
+ $timeStamp = time();
+ if ($timeStamp - $array[self::UPDATED] >= $this->updateThreshold) {
+ $this->meta[self::UPDATED] = $timeStamp;
+ }
} else {
$this->stampCreated();
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php
index a1fcf53..8b1c213 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
-use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
/**
* MockArraySessionStorage mocks the session for unit tests.
@@ -164,6 +163,7 @@ public function save()
}
// nothing to do since we don't persist the session data
$this->closed = false;
+ $this->started = false;
}
/**
@@ -249,7 +249,7 @@ public function getMetadataBag()
*/
protected function generateId()
{
- return sha1(uniqid(mt_rand()));
+ return hash('sha256', uniqid(mt_rand()));
}
protected function loadSession()
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
index d86ff33..083df9d 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
@@ -13,7 +13,6 @@
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
-use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
@@ -163,7 +162,7 @@ public function start()
*/
public function getId()
{
- if (!$this->started) {
+ if (!$this->started && !$this->closed) {
return ''; // returning empty is consistent with session_id() behaviour
}
@@ -219,6 +218,8 @@ public function regenerate($destroy = false, $lifetime = null)
} else {
session_start();
}
+
+ $this->loadSession();
}
return $ret;
@@ -237,6 +238,7 @@ public function save()
}
$this->closed = true;
+ $this->started = false;
}
/**
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php
index 0f00203..f70b5e6 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php
index 711eaa2..74f19c5 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
-use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
/**
* StorageInterface.
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php
index ae579be..d9fece6 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php
@@ -34,9 +34,9 @@ class StreamedResponse extends Response
/**
* Constructor.
*
- * @param mixed $callback A valid PHP callback
- * @param integer $status The response status code
- * @param array $headers An array of response headers
+ * @param callable|null $callback A valid PHP callback or null to set it later
+ * @param integer $status The response status code
+ * @param array $headers An array of response headers
*
* @api
*/
@@ -51,7 +51,13 @@ public function __construct($callback = null, $status = 200, $headers = array())
}
/**
- * {@inheritDoc}
+ * Factory method for chainability
+ *
+ * @param callable|null $callback A valid PHP callback or null to set it later
+ * @param integer $status The response status code
+ * @param array $headers An array of response headers
+ *
+ * @return StreamedResponse
*/
public static function create($callback = null, $status = 200, $headers = array())
{
@@ -61,7 +67,7 @@ public static function create($callback = null, $status = 200, $headers = array(
/**
* Sets the PHP callback associated with this Response.
*
- * @param mixed $callback A valid PHP callback
+ * @param callable $callback A valid PHP callback
*
* @throws \LogicException
*/
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
index c3d324f..7586316 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
@@ -84,12 +84,73 @@ public function provideRanges()
return array(
array('bytes=1-4', 1, 4, 'bytes 1-4/35'),
array('bytes=-5', 30, 5, 'bytes 30-34/35'),
- array('bytes=-35', 0, 35, 'bytes 0-34/35'),
- array('bytes=-40', 0, 35, 'bytes 0-34/35'),
array('bytes=30-', 30, 5, 'bytes 30-34/35'),
array('bytes=30-30', 30, 1, 'bytes 30-30/35'),
array('bytes=30-34', 30, 5, 'bytes 30-34/35'),
- array('bytes=30-40', 30, 5, 'bytes 30-34/35')
+ );
+ }
+
+ /**
+ * @dataProvider provideFullFileRanges
+ */
+ public function testFullFileRequests($requestRange)
+ {
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif')->setAutoEtag();
+
+ // prepare a request for a range of the testing file
+ $request = Request::create('/');
+ $request->headers->set('Range', $requestRange);
+
+ $file = fopen(__DIR__.'/File/Fixtures/test.gif', 'r');
+ $data = fread($file, 35);
+ fclose($file);
+
+ $this->expectOutputString($data);
+ $response = clone $response;
+ $response->prepare($request);
+ $response->sendContent();
+
+ $this->assertEquals(200, $response->getStatusCode());
+ $this->assertEquals('binary', $response->headers->get('Content-Transfer-Encoding'));
+ }
+
+ public function provideFullFileRanges()
+ {
+ return array(
+ array('bytes=0-'),
+ array('bytes=0-34'),
+ array('bytes=-35'),
+ // Syntactical invalid range-request should also return the full resource
+ array('bytes=20-10'),
+ array('bytes=50-40'),
+ );
+ }
+
+ /**
+ * @dataProvider provideInvalidRanges
+ */
+ public function testInvalidRequests($requestRange)
+ {
+ $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif')->setAutoEtag();
+
+ // prepare a request for a range of the testing file
+ $request = Request::create('/');
+ $request->headers->set('Range', $requestRange);
+
+ $response = clone $response;
+ $response->prepare($request);
+ $response->sendContent();
+
+ $this->assertEquals(416, $response->getStatusCode());
+ $this->assertEquals('binary', $response->headers->get('Content-Transfer-Encoding'));
+ #$this->assertEquals('', $response->headers->get('Content-Range'));
+ }
+
+ public function provideInvalidRanges()
+ {
+ return array(
+ array('bytes=-40'),
+ array('bytes=30-40')
);
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php
index f4c9ec1..def1c7a 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php
@@ -38,7 +38,7 @@ public function invalidNames()
/**
* @dataProvider invalidNames
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
* @covers Symfony\Component\HttpFoundation\Cookie::__construct
*/
public function testInstantiationThrowsExceptionIfCookieNameContainsInvalidCharacters($name)
@@ -47,11 +47,11 @@ public function testInstantiationThrowsExceptionIfCookieNameContainsInvalidChara
}
/**
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
*/
public function testInvalidExpiration()
{
- $cookie = new Cookie('MyCookie', 'foo','bar');
+ $cookie = new Cookie('MyCookie', 'foo', 'bar');
}
/**
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php
index 7bf10a2..1078fc2 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpFoundation\Tests\File;
+namespace Symfony\Component\HttpFoundation\Tests\File\MimeType;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
index f6ea340..5b48970 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
@@ -224,7 +224,7 @@ public function testIsValid()
null,
filesize(__DIR__.'/Fixtures/test.gif'),
UPLOAD_ERR_OK,
- true
+ true
);
$this->assertTrue($file->isValid());
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php
index 8f1383f..ef392ca 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php
@@ -159,18 +159,27 @@ public function testSetCallback()
$this->assertEquals('text/javascript', $response->headers->get('Content-Type'));
}
+ public function testJsonEncodeFlags()
+ {
+ $response = new JsonResponse('<>\'&"');
+
+ $this->assertEquals('"\u003C\u003E\u0027\u0026\u0022"', $response->getContent());
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
public function testSetCallbackInvalidIdentifier()
{
$response = new JsonResponse('foo');
-
- $this->setExpectedException('InvalidArgumentException');
$response->setCallback('+invalid');
}
- public function testJsonEncodeFlags()
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSetContent()
{
- $response = new JsonResponse('<>\'&"');
-
- $this->assertEquals('"\u003C\u003E\u0027\u0026\u0022"', $response->getContent());
+ JsonResponse::create("\xB1\x31");
}
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php
index 6cd42bf..7f4f243 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php
@@ -205,10 +205,10 @@ public function testFilter()
$this->assertEquals('example@example.com', $bag->filter('email', '', false, FILTER_VALIDATE_EMAIL), '->filter() gets a value of parameter as email');
- $this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, array('flags' => FILTER_FLAG_PATH_REQUIRED)), '->filter() gets a value of parameter as url with a path');
+ $this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, array('flags' => FILTER_FLAG_PATH_REQUIRED)), '->filter() gets a value of parameter as URL with a path');
// This test is repeated for code-coverage
- $this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED), '->filter() gets a value of parameter as url with a path');
+ $this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED), '->filter() gets a value of parameter as URL with a path');
$this->assertFalse($bag->filter('dec', '', false, FILTER_VALIDATE_INT, array(
'flags' => FILTER_FLAG_ALLOW_HEX,
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
index 330d9fe..2a097d6 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
@@ -11,7 +11,7 @@
namespace Symfony\Component\HttpFoundation\Tests;
-use \Symfony\Component\HttpFoundation\RedirectResponse;
+use Symfony\Component\HttpFoundation\RedirectResponse;
class RedirectResponseTest extends \PHPUnit_Framework_TestCase
{
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php
index ba95c4a..db331f2 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php
@@ -211,6 +211,10 @@ public function testCreate()
$this->assertEquals('testnopass', $request->getUser());
$this->assertNull($request->getPassword());
$this->assertFalse($request->isSecure());
+
+ $request = Request::create('http://test.com/?foo');
+ $this->assertEquals('/?foo', $request->getRequestUri());
+ $this->assertEquals(array('foo' => ''), $request->query->all());
}
/**
@@ -250,9 +254,6 @@ public function testCreateCheckPrecedence()
$this->assertEquals('foo=bar', $request->getQueryString());
}
- /**
- * @covers Symfony\Component\HttpFoundation\Request::duplicate
- */
public function testDuplicate()
{
$request = new Request(array('foo' => 'bar'), array('foo' => 'bar'), array('foo' => 'bar'), array(), array(), array('HTTP_FOO' => 'bar'));
@@ -271,6 +272,21 @@ public function testDuplicate()
$this->assertEquals(array('foo' => array('foobar')), $dup->headers->all(), '->duplicate() overrides the HTTP header if provided');
}
+ public function testDuplicateWithFormat()
+ {
+ $request = new Request(array(), array(), array('_format' => 'json'));
+ $dup = $request->duplicate();
+
+ $this->assertEquals('json', $dup->getRequestFormat());
+ $this->assertEquals('json', $dup->attributes->get('_format'));
+
+ $request = new Request();
+ $request->setRequestFormat('xml');
+ $dup = $request->duplicate();
+
+ $this->assertEquals('xml', $dup->getRequestFormat());
+ }
+
/**
* @covers Symfony\Component\HttpFoundation\Request::getFormat
* @covers Symfony\Component\HttpFoundation\Request::setFormat
@@ -653,18 +669,18 @@ public function testGetHost()
$request->initialize(array('foo' => 'bar'));
$this->assertEquals('', $request->getHost(), '->getHost() return empty string if not initialized');
- $request->initialize(array(), array(), array(), array(), array(), array('HTTP_HOST' => 'www.exemple.com'));
- $this->assertEquals('www.exemple.com', $request->getHost(), '->getHost() from Host Header');
+ $request->initialize(array(), array(), array(), array(), array(), array('HTTP_HOST' => 'www.example.com'));
+ $this->assertEquals('www.example.com', $request->getHost(), '->getHost() from Host Header');
// Host header with port number
- $request->initialize(array(), array(), array(), array(), array(), array('HTTP_HOST' => 'www.exemple.com:8080'));
- $this->assertEquals('www.exemple.com', $request->getHost(), '->getHost() from Host Header with port number');
+ $request->initialize(array(), array(), array(), array(), array(), array('HTTP_HOST' => 'www.example.com:8080'));
+ $this->assertEquals('www.example.com', $request->getHost(), '->getHost() from Host Header with port number');
// Server values
- $request->initialize(array(), array(), array(), array(), array(), array('SERVER_NAME' => 'www.exemple.com'));
- $this->assertEquals('www.exemple.com', $request->getHost(), '->getHost() from server name');
+ $request->initialize(array(), array(), array(), array(), array(), array('SERVER_NAME' => 'www.example.com'));
+ $this->assertEquals('www.example.com', $request->getHost(), '->getHost() from server name');
- $request->initialize(array(), array(), array(), array(), array(), array('SERVER_NAME' => 'www.exemple.com', 'HTTP_HOST' => 'www.host.com'));
+ $request->initialize(array(), array(), array(), array(), array(), array('SERVER_NAME' => 'www.example.com', 'HTTP_HOST' => 'www.host.com'));
$this->assertEquals('www.host.com', $request->getHost(), '->getHost() value from Host header has priority over SERVER_NAME ');
}
@@ -699,12 +715,31 @@ public function testGetPort()
));
$port = $request->getPort();
- $this->assertEquals(80, $port, 'If X_FORWARDED_PROTO is set to http return 80.');
+ $this->assertEquals(80, $port, 'If X_FORWARDED_PROTO is set to HTTP return 80.');
+
+ $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ 'HTTP_X_FORWARDED_PROTO' => 'On'
+ ));
+ $port = $request->getPort();
+ $this->assertEquals(443, $port, 'With only PROTO set and value is On, getPort() defaults to 443.');
+
+ $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ 'HTTP_X_FORWARDED_PROTO' => '1'
+ ));
+ $port = $request->getPort();
+ $this->assertEquals(443, $port, 'With only PROTO set and value is 1, getPort() defaults to 443.');
+
+ $request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
+ 'HTTP_X_FORWARDED_PROTO' => 'something-else'
+ ));
+ $port = $request->getPort();
+ $this->assertEquals(80, $port, 'With only PROTO set and value is not recognized, getPort() defaults to 80.');
+
Request::setTrustedProxies(array());
}
/**
- * @expectedException RuntimeException
+ * @expectedException \RuntimeException
*/
public function testGetHostWithFakeHttpHostValue()
{
@@ -846,14 +881,14 @@ public function testGetClientIpsProvider()
public function testGetContentWorksTwiceInDefaultMode()
{
- $req = new Request;
+ $req = new Request();
$this->assertEquals('', $req->getContent());
$this->assertEquals('', $req->getContent());
}
public function testGetContentReturnsResource()
{
- $req = new Request;
+ $req = new Request();
$retval = $req->getContent(true);
$this->assertInternalType('resource', $retval);
$this->assertEquals("", fread($retval, 1));
@@ -861,12 +896,12 @@ public function testGetContentReturnsResource()
}
/**
- * @expectedException LogicException
+ * @expectedException \LogicException
* @dataProvider getContentCantBeCalledTwiceWithResourcesProvider
*/
public function testGetContentCantBeCalledTwiceWithResources($first, $second)
{
- $req = new Request;
+ $req = new Request();
$req->getContent($first);
$req->getContent($second);
}
@@ -966,6 +1001,12 @@ public function testOverrideGlobals()
$this->assertArrayHasKey('HTTP_X_FORWARDED_PROTO', $_SERVER);
+ $request->headers->set('CONTENT_TYPE', 'multipart/form-data');
+ $request->headers->set('CONTENT_LENGTH', 12345);
+ $request->overrideGlobals();
+ $this->assertArrayHasKey('CONTENT_TYPE', $_SERVER);
+ $this->assertArrayHasKey('CONTENT_LENGTH', $_SERVER);
+
// restore initial $_SERVER array
$_SERVER = $server;
}
@@ -1122,6 +1163,22 @@ public function testGetCharsets()
$this->assertEquals(array('ISO-8859-1', 'utf-8', '*'), $request->getCharsets());
}
+ public function testGetEncodings()
+ {
+ $request = new Request();
+ $this->assertEquals(array(), $request->getEncodings());
+ $request->headers->set('Accept-Encoding', 'gzip,deflate,sdch');
+ $this->assertEquals(array(), $request->getEncodings()); // testing caching
+
+ $request = new Request();
+ $request->headers->set('Accept-Encoding', 'gzip,deflate,sdch');
+ $this->assertEquals(array('gzip', 'deflate', 'sdch'), $request->getEncodings());
+
+ $request = new Request();
+ $request->headers->set('Accept-Encoding', 'gzip;q=0.4,deflate;q=0.9,compress;q=0.7');
+ $this->assertEquals(array('deflate', 'compress', 'gzip'), $request->getEncodings());
+ }
+
public function testGetAcceptableContentTypes()
{
$request = new Request();
@@ -1304,7 +1361,7 @@ public function getBaseUrlData()
*/
public function testUrlencodedStringPrefix($string, $prefix, $expect)
{
- $request = new Request;
+ $request = new Request();
$me = new \ReflectionMethod($request, 'getUrlencodedPrefix');
$me->setAccessible(true);
@@ -1385,6 +1442,13 @@ public function testTrustedProxies()
$this->assertEquals(443, $request->getPort());
$this->assertTrue($request->isSecure());
+ // check various X_FORWARDED_PROTO header values
+ $request->headers->set('X_FORWARDED_PROTO', 'ssl');
+ $this->assertTrue($request->isSecure());
+
+ $request->headers->set('X_FORWARDED_PROTO', 'https, http');
+ $this->assertTrue($request->isSecure());
+
// custom header names
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, 'X_MY_FOR');
Request::setTrustedHeaderName(Request::HEADER_CLIENT_HOST, 'X_MY_HOST');
@@ -1414,6 +1478,24 @@ public function testTrustedProxies()
}
/**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSetTrustedProxiesInvalidHeaderName()
+ {
+ Request::create('http://example.com/');
+ Request::setTrustedHeaderName('bogus name', 'X_MY_FOR');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testGetTrustedProxiesInvalidHeaderName()
+ {
+ Request::create('http://example.com/');
+ Request::getTrustedHeaderName('bogus name');
+ }
+
+ /**
* @dataProvider iisRequestUriProvider
*/
public function testIISRequestUri($headers, $server, $expectedRequestUri)
@@ -1425,7 +1507,7 @@ public function testIISRequestUri($headers, $server, $expectedRequestUri)
$this->assertEquals($expectedRequestUri, $request->getRequestUri(), '->getRequestUri() is correct');
$subRequestUri = '/bar/foo';
- $subRequest = $request::create($subRequestUri, 'get', array(), array(), array(), $request->server->all());
+ $subRequest = Request::create($subRequestUri, 'get', array(), array(), array(), $request->server->all());
$this->assertEquals($subRequestUri, $subRequest->getRequestUri(), '->getRequestUri() is correct in sub request');
}
@@ -1526,12 +1608,35 @@ public function testTrustedHosts()
// trusted hosts
$request->headers->set('host', 'trusted.com');
$this->assertEquals('trusted.com', $request->getHost());
+ $this->assertEquals(80, $request->getPort());
+
+ $request->server->set('HTTPS', true);
+ $request->headers->set('host', 'trusted.com');
+ $this->assertEquals('trusted.com', $request->getHost());
+ $this->assertEquals(443, $request->getPort());
+ $request->server->set('HTTPS', false);
+
+ $request->headers->set('host', 'trusted.com:8000');
+ $this->assertEquals('trusted.com', $request->getHost());
+ $this->assertEquals(8000, $request->getPort());
+
$request->headers->set('host', 'subdomain.trusted.com');
$this->assertEquals('subdomain.trusted.com', $request->getHost());
// reset request for following tests
Request::setTrustedHosts(array());
}
+
+ public function testFactory()
+ {
+ Request::setFactory(function (array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) {
+ return new NewRequest();
+ });
+
+ $this->assertEquals('foo', Request::create('/')->getFoo());
+
+ Request::setFactory(null);
+ }
}
class RequestContentProxy extends Request
@@ -1541,3 +1646,11 @@ public function getContent($asResource = false)
return http_build_query(array('_method' => 'PUT', 'content' => 'mycontent'));
}
}
+
+class NewRequest extends Request
+{
+ public function getFoo()
+ {
+ return 'foo';
+ }
+}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
index 3a08495..11eb38c 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
@@ -79,6 +79,19 @@ public function testIsCacheable()
$this->assertFalse($response->isCacheable());
}
+ public function testIsCacheableWithErrorCode()
+ {
+ $response = new Response('', 500);
+ $this->assertFalse($response->isCacheable());
+ }
+
+ public function testIsCacheableWithNoStoreDirective()
+ {
+ $response = new Response();
+ $response->headers->set('cache-control', 'private');
+ $this->assertFalse($response->isCacheable());
+ }
+
public function testIsCacheableWithSetTtl()
{
$response = new Response();
@@ -118,6 +131,50 @@ public function testIsNotModified()
$this->assertFalse($modified);
}
+ public function testIsNotModifiedNotSafe()
+ {
+ $request = Request::create('/homepage', 'POST');
+
+ $response = new Response();
+ $this->assertFalse($response->isNotModified($request));
+ }
+
+ public function testIsNotModifiedLastModified()
+ {
+ $modified = 'Sun, 25 Aug 2013 18:33:31 GMT';
+
+ $request = new Request();
+ $request->headers->set('If-Modified-Since', $modified);
+
+ $response = new Response();
+ $response->headers->set('Last-Modified', $modified);
+
+ $this->assertTrue($response->isNotModified($request));
+
+ $response->headers->set('Last-Modified', '');
+ $this->assertFalse($response->isNotModified($request));
+ }
+
+ public function testIsNotModifiedEtag()
+ {
+ $etagOne = 'randomly_generated_etag';
+ $etagTwo = 'randomly_generated_etag_2';
+
+ $request = new Request();
+ $request->headers->set('if_none_match', sprintf('%s, %s, %s', $etagOne, $etagTwo, 'etagThree'));
+
+ $response = new Response();
+
+ $response->headers->set('ETag', $etagOne);
+ $this->assertTrue($response->isNotModified($request));
+
+ $response->headers->set('ETag', $etagTwo);
+ $this->assertTrue($response->isNotModified($request));
+
+ $response->headers->set('ETag', '');
+ $this->assertFalse($response->isNotModified($request));
+ }
+
public function testIsValidateable()
{
$response = new Response('', 200, array('Last-Modified' => $this->createDateTimeOneHourAgo()->format(DATE_RFC2822)));
@@ -361,11 +418,44 @@ public function testPrepareRemovesContentForHeadRequests()
$response = new Response('foo');
$request = Request::create('/', 'HEAD');
+ $length = 12345;
+ $response->headers->set('Content-Length', $length);
+ $response->prepare($request);
+
+ $this->assertEquals('', $response->getContent());
+ $this->assertEquals($length, $response->headers->get('Content-Length'), 'Content-Length should be as if it was GET; see RFC2616 14.13');
+ }
+
+ public function testPrepareRemovesContentForInformationalResponse()
+ {
+ $response = new Response('foo');
+ $request = Request::create('/');
+
+ $response->setContent('content');
+ $response->setStatusCode(101);
$response->prepare($request);
+ $this->assertEquals('', $response->getContent());
+ $response->setContent('content');
+ $response->setStatusCode(304);
+ $response->prepare($request);
$this->assertEquals('', $response->getContent());
}
+ public function testPrepareRemovesContentLength()
+ {
+ $response = new Response('foo');
+ $request = Request::create('/');
+
+ $response->headers->set('Content-Length', 12345);
+ $response->prepare($request);
+ $this->assertEquals(12345, $response->headers->get('Content-Length'));
+
+ $response->headers->set('Transfer-Encoding', 'chunked');
+ $response->prepare($request);
+ $this->assertFalse($response->headers->has('Content-Length'));
+ }
+
public function testPrepareSetsPragmaOnHttp10Only()
{
$request = Request::create('/', 'GET');
@@ -634,7 +724,7 @@ public function testSetContent($content)
}
/**
- * @expectedException UnexpectedValueException
+ * @expectedException \UnexpectedValueException
* @dataProvider invalidContentProvider
*/
public function testSetContentInvalid($content)
@@ -668,7 +758,7 @@ public function testSettersAreChainable()
public function validContentProvider()
{
return array(
- 'obj' => array(new StringableObject),
+ 'obj' => array(new StringableObject()),
'string' => array('Foo'),
'int' => array(2),
);
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php
index f8e487d..89920f1 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php
@@ -89,6 +89,28 @@ public function testHttpBasicAuthWithPhpCgiEmptyPassword()
), $bag->getHeaders());
}
+ public function testHttpDigestAuthWithPhpCgi()
+ {
+ $digest = 'Digest username="foo", realm="acme", nonce="'.md5('secret').'", uri="/protected, qop="auth"';
+ $bag = new ServerBag(array('HTTP_AUTHORIZATION' => $digest));
+
+ $this->assertEquals(array(
+ 'AUTHORIZATION' => $digest,
+ 'PHP_AUTH_DIGEST' => $digest,
+ ), $bag->getHeaders());
+ }
+
+ public function testHttpDigestAuthWithPhpCgiRedirect()
+ {
+ $digest = 'Digest username="foo", realm="acme", nonce="'.md5('secret').'", uri="/protected, qop="auth"';
+ $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => $digest));
+
+ $this->assertEquals(array(
+ 'AUTHORIZATION' => $digest,
+ 'PHP_AUTH_DIGEST' => $digest,
+ ), $bag->getHeaders());
+ }
+
public function testOAuthBearerAuth()
{
$headerContent = 'Bearer L-yLEOr9zhmUYRkzN1jwwxwQ-PBNiKDc8dgfB4hTfvo';
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php
index da0440d..8d38ab3 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php
@@ -121,4 +121,12 @@ public function getOptionFixtures()
array(array('expiretime' => 100, 'foo' => 'bar'), false),
);
}
+
+ public function testGetConnection()
+ {
+ $method = new \ReflectionMethod($this->storage, 'getMemcache');
+ $method->setAccessible(true);
+
+ $this->assertInstanceOf('\Memcache', $method->invoke($this->storage));
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php
index 985fae4..72be327 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php
@@ -116,4 +116,12 @@ public function getOptionFixtures()
array(array('expiretime' => 100, 'foo' => 'bar'), false),
);
}
+
+ public function testGetConnection()
+ {
+ $method = new \ReflectionMethod($this->storage, 'getMemcached');
+ $method->setAccessible(true);
+
+ $this->assertInstanceOf('\Memcached', $method->invoke($this->storage));
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
index 1cfd117..d907ce4 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
@@ -31,7 +31,7 @@ protected function setUp()
$this->markTestSkipped('MongoDbSessionHandler requires the PHP "mongo" extension.');
}
- $mongoClass = (version_compare(phpversion('mongo'), '1.3.0', '<')) ? 'Mongo' : 'MongoClient';
+ $mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient';
$this->mongo = $this->getMockBuilder($mongoClass)
->disableOriginalConstructor()
@@ -49,7 +49,7 @@ protected function setUp()
}
/**
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
*/
public function testConstructorShouldThrowExceptionForInvalidMongo()
{
@@ -57,7 +57,7 @@ public function testConstructorShouldThrowExceptionForInvalidMongo()
}
/**
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
*/
public function testConstructorShouldThrowExceptionForMissingOptions()
{
@@ -90,7 +90,7 @@ public function testWrite()
$collection->expects($this->once())
->method('update')
- ->will($this->returnCallback(function($criteria, $updateData, $options) use ($that, &$data) {
+ ->will($this->returnCallback(function ($criteria, $updateData, $options) use ($that, &$data) {
$that->assertEquals(array($that->options['id_field'] => 'foo'), $criteria);
$that->assertEquals(array('upsert' => true, 'multiple' => false), $options);
@@ -118,7 +118,7 @@ public function testReplaceSessionData()
$collection->expects($this->exactly(2))
->method('update')
- ->will($this->returnCallback(function($criteria, $updateData, $options) use (&$data) {
+ ->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) {
$data = $updateData;
}));
@@ -161,11 +161,21 @@ public function testGc()
$collection->expects($this->once())
->method('remove')
- ->will($this->returnCallback(function($criteria) use ($that) {
+ ->will($this->returnCallback(function ($criteria) use ($that) {
$that->assertInstanceOf('MongoDate', $criteria[$that->options['time_field']]['$lt']);
$that->assertGreaterThanOrEqual(time() - -1, $criteria[$that->options['time_field']]['$lt']->sec);
}));
$this->assertTrue($this->storage->gc(-1));
}
+
+ public function testGetConnection()
+ {
+ $method = new \ReflectionMethod($this->storage, 'getMongo');
+ $method->setAccessible(true);
+
+ $mongoClass = (version_compare(phpversion('mongo'), '1.3.0', '<')) ? '\Mongo' : '\MongoClient';
+
+ $this->assertInstanceOf($mongoClass, $method->invoke($this->storage));
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php
index 45a47ce..371ab6f 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php
@@ -22,7 +22,7 @@
*
* @runTestsInSeparateProcesses
*/
-class NullSessionStorageTest extends \PHPUnit_Framework_TestCase
+class NullSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
index 1abf384..06da009 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
@@ -98,4 +98,14 @@ public function testSessionGC()
$storage->gc(-1);
$this->assertEquals(0, count($this->pdo->query('SELECT * FROM sessions')->fetchAll()));
}
+
+ public function testGetConnection()
+ {
+ $storage = new PdoSessionHandler($this->pdo, array('db_table' => 'sessions'), array());
+
+ $method = new \ReflectionMethod($storage, 'getConnection');
+ $method->setAccessible(true);
+
+ $this->assertInstanceOf('\PDO', $method->invoke($storage));
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php
new file mode 100644
index 0000000..dcfd94b
--- /dev/null
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php
@@ -0,0 +1,94 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
+
+use Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler;
+
+/**
+ * @author Adrien Brault
+ */
+class WriteCheckSessionHandlerTest extends \PHPUnit_Framework_TestCase
+{
+ public function test()
+ {
+ $wrappedSessionHandlerMock = $this->getMock('SessionHandlerInterface');
+ $writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock);
+
+ $wrappedSessionHandlerMock
+ ->expects($this->once())
+ ->method('close')
+ ->with()
+ ->will($this->returnValue(true))
+ ;
+
+ $this->assertEquals(true, $writeCheckSessionHandler->close());
+ }
+
+ public function testWrite()
+ {
+ $wrappedSessionHandlerMock = $this->getMock('SessionHandlerInterface');
+ $writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock);
+
+ $wrappedSessionHandlerMock
+ ->expects($this->once())
+ ->method('write')
+ ->with('foo', 'bar')
+ ->will($this->returnValue(true))
+ ;
+
+ $this->assertEquals(true, $writeCheckSessionHandler->write('foo', 'bar'));
+ }
+
+ public function testSkippedWrite()
+ {
+ $wrappedSessionHandlerMock = $this->getMock('SessionHandlerInterface');
+ $writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock);
+
+ $wrappedSessionHandlerMock
+ ->expects($this->once())
+ ->method('read')
+ ->with('foo')
+ ->will($this->returnValue('bar'))
+ ;
+
+ $wrappedSessionHandlerMock
+ ->expects($this->never())
+ ->method('write')
+ ;
+
+ $this->assertEquals('bar', $writeCheckSessionHandler->read('foo'));
+ $this->assertEquals(true, $writeCheckSessionHandler->write('foo', 'bar'));
+ }
+
+ public function testNonSkippedWrite()
+ {
+ $wrappedSessionHandlerMock = $this->getMock('SessionHandlerInterface');
+ $writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock);
+
+ $wrappedSessionHandlerMock
+ ->expects($this->once())
+ ->method('read')
+ ->with('foo')
+ ->will($this->returnValue('bar'))
+ ;
+
+ $wrappedSessionHandlerMock
+ ->expects($this->once())
+ ->method('write')
+ ->with('foo', 'baZZZ')
+ ->will($this->returnValue(true))
+ ;
+
+ $this->assertEquals('bar', $writeCheckSessionHandler->read('foo'));
+ $this->assertEquals(true, $writeCheckSessionHandler->write('foo', 'baZZZ'));
+ }
+}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php
index ef70281..c502c38 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php
@@ -43,27 +43,23 @@ protected function tearDown()
public function testInitialize()
{
- $p = new \ReflectionProperty('Symfony\Component\HttpFoundation\Session\Storage\MetadataBag', 'meta');
- $p->setAccessible(true);
+ $sessionMetadata = array();
$bag1 = new MetadataBag();
- $array = array();
- $bag1->initialize($array);
+ $bag1->initialize($sessionMetadata);
$this->assertGreaterThanOrEqual(time(), $bag1->getCreated());
$this->assertEquals($bag1->getCreated(), $bag1->getLastUsed());
sleep(1);
$bag2 = new MetadataBag();
- $array2 = $p->getValue($bag1);
- $bag2->initialize($array2);
+ $bag2->initialize($sessionMetadata);
$this->assertEquals($bag1->getCreated(), $bag2->getCreated());
$this->assertEquals($bag1->getLastUsed(), $bag2->getLastUsed());
$this->assertEquals($bag2->getCreated(), $bag2->getLastUsed());
sleep(1);
$bag3 = new MetadataBag();
- $array3 = $p->getValue($bag2);
- $bag3->initialize($array3);
+ $bag3->initialize($sessionMetadata);
$this->assertEquals($bag1->getCreated(), $bag3->getCreated());
$this->assertGreaterThan($bag2->getLastUsed(), $bag3->getLastUsed());
$this->assertNotEquals($bag3->getCreated(), $bag3->getLastUsed());
@@ -104,4 +100,36 @@ public function testClear()
{
$this->bag->clear();
}
+
+ public function testSkipLastUsedUpdate()
+ {
+ $bag = new MetadataBag('', 30);
+ $timeStamp = time();
+
+ $created = $timeStamp - 15;
+ $sessionMetadata = array(
+ MetadataBag::CREATED => $created,
+ MetadataBag::UPDATED => $created,
+ MetadataBag::LIFETIME => 1000
+ );
+ $bag->initialize($sessionMetadata);
+
+ $this->assertEquals($created, $sessionMetadata[MetadataBag::UPDATED]);
+ }
+
+ public function testDoesNotSkipLastUsedUpdate()
+ {
+ $bag = new MetadataBag('', 30);
+ $timeStamp = time();
+
+ $created = $timeStamp - 45;
+ $sessionMetadata = array(
+ MetadataBag::CREATED => $created,
+ MetadataBag::UPDATED => $created,
+ MetadataBag::LIFETIME => 1000
+ );
+ $bag->initialize($sessionMetadata);
+
+ $this->assertEquals($timeStamp, $sessionMetadata[MetadataBag::UPDATED]);
+ }
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php
index 2a6f6bb..c56ea4a 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php
@@ -97,7 +97,7 @@ public function testGetId()
}
/**
- * @expectedException RuntimeException
+ * @expectedException \RuntimeException
*/
public function testUnstartedSave()
{
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php
index d42c62a..329c090 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php
@@ -107,7 +107,7 @@ public function testMultipleInstances()
}
/**
- * @expectedException RuntimeException
+ * @expectedException \RuntimeException
*/
public function testSaveWithoutStart()
{
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php
index 14ae52f..691ee14 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php
@@ -59,7 +59,7 @@ protected function tearDown()
protected function getStorage(array $options = array())
{
$storage = new NativeSessionStorage($options);
- $storage->registerBag(new AttributeBag);
+ $storage->registerBag(new AttributeBag());
return $storage;
}
@@ -85,8 +85,12 @@ public function testGetId()
{
$storage = $this->getStorage();
$this->assertEquals('', $storage->getId());
+
$storage->start();
$this->assertNotEquals('', $storage->getId());
+
+ $storage->save();
+ $this->assertNotEquals('', $storage->getId());
}
public function testRegenerate()
@@ -154,7 +158,7 @@ public function testCookieOptions()
public function testSetSaveHandlerException()
{
$storage = $this->getStorage();
- $storage->setSaveHandler(new \StdClass);
+ $storage->setSaveHandler(new \stdClass);
}
public function testSetSaveHandler53()
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
index d5a66d6..0510f3f 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
@@ -23,7 +23,7 @@
*
* @runTestsInSeparateProcesses
*/
-class PhpSessionStorageTest extends \PHPUnit_Framework_TestCase
+class PhpBridgeSessionStorageTest extends \PHPUnit_Framework_TestCase
{
private $savePath;
@@ -53,7 +53,7 @@ protected function tearDown()
protected function getStorage()
{
$storage = new PhpBridgeSessionStorage();
- $storage->registerBag(new AttributeBag);
+ $storage->registerBag(new AttributeBag());
return $storage;
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php
index 6b8bba0..58b632a 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php
@@ -22,7 +22,7 @@ class ConcreteProxy extends AbstractProxy
class ConcreteSessionHandlerInterfaceProxy extends AbstractProxy implements \SessionHandlerInterface
{
- public function open($savePath, $sessionName)
+ public function open($savePath, $sessionName)
{
}
diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json
index f77e08e..09f5b24 100644
--- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json
+++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json
@@ -26,7 +26,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php
index 215d1e1..2fdbe1c 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php
@@ -29,8 +29,8 @@
abstract class Bundle extends ContainerAware implements BundleInterface
{
protected $name;
- protected $reflected;
protected $extension;
+ protected $path;
/**
* Boots the Bundle.
@@ -109,11 +109,9 @@ public function getContainerExtension()
*/
public function getNamespace()
{
- if (null === $this->reflected) {
- $this->reflected = new \ReflectionObject($this);
- }
+ $class = get_class($this);
- return $this->reflected->getNamespaceName();
+ return substr($class, 0, strrpos($class, '\\'));
}
/**
@@ -125,11 +123,12 @@ public function getNamespace()
*/
public function getPath()
{
- if (null === $this->reflected) {
- $this->reflected = new \ReflectionObject($this);
+ if (null === $this->path) {
+ $reflected = new \ReflectionObject($this);
+ $this->path = dirname($reflected->getFileName());
}
- return dirname($this->reflected->getFileName());
+ return $this->path;
}
/**
@@ -160,7 +159,7 @@ public function getParent()
$name = get_class($this);
$pos = strrpos($name, '\\');
- return $this->name = false === $pos ? $name : substr($name, $pos + 1);
+ return $this->name = false === $pos ? $name : substr($name, $pos + 1);
}
/**
@@ -188,7 +187,14 @@ public function registerCommands(Application $application)
if ($relativePath = $file->getRelativePath()) {
$ns .= '\\'.strtr($relativePath, '/', '\\');
}
- $r = new \ReflectionClass($ns.'\\'.$file->getBasename('.php'));
+ $class = $ns.'\\'.$file->getBasename('.php');
+ if ($this->container) {
+ $alias = 'console.command.'.strtolower(str_replace('\\', '_', $class));
+ if ($this->container->has($alias)) {
+ continue;
+ }
+ }
+ $r = new \ReflectionClass($class);
if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
$application->add($r->newInstance());
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md
index c06dd3f..66219ae 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md
@@ -1,6 +1,12 @@
CHANGELOG
=========
+2.4.0
+-----
+
+ * added event listeners for the session
+ * added the KernelEvents::FINISH_REQUEST event
+
2.3.0
-----
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php
index eb26ac5..bd96057 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php
@@ -18,13 +18,14 @@
*/
class CacheWarmerAggregate implements CacheWarmerInterface
{
- protected $warmers;
- protected $optionalsEnabled;
+ protected $warmers = array();
+ protected $optionalsEnabled = false;
public function __construct(array $warmers = array())
{
- $this->setWarmers($warmers);
- $this->optionalsEnabled = false;
+ foreach ($warmers as $warmer) {
+ $this->add($warmer);
+ }
}
public function enableOptionalWarmers()
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php
index bb427b3..b40d700 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php
@@ -11,16 +11,15 @@
namespace Symfony\Component\HttpKernel;
-use Symfony\Component\HttpFoundation\File\UploadedFile;
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\BrowserKit\Client as BaseClient;
use Symfony\Component\BrowserKit\Request as DomRequest;
use Symfony\Component\BrowserKit\Response as DomResponse;
use Symfony\Component\BrowserKit\Cookie as DomCookie;
use Symfony\Component\BrowserKit\History;
use Symfony\Component\BrowserKit\CookieJar;
-use Symfony\Component\HttpKernel\TerminableInterface;
+use Symfony\Component\HttpFoundation\File\UploadedFile;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
/**
* Client simulates a browser and makes requests to a Kernel object.
@@ -43,11 +42,11 @@ class Client extends BaseClient
*/
public function __construct(HttpKernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null)
{
+ // These class properties must be set before calling the parent constructor, as it may depend on it.
$this->kernel = $kernel;
+ $this->followRedirects = false;
parent::__construct($server, $history, $cookieJar);
-
- $this->followRedirects = false;
}
/**
@@ -104,7 +103,7 @@ protected function getScript($request)
$requirePath = str_replace("'", "\\'", $r->getFileName());
$symfonyPath = str_replace("'", "\\'", realpath(__DIR__.'/../../..'));
- return <<register();
\$kernel = unserialize('$kernel');
-echo serialize(\$kernel->handle(unserialize('$request')));
+\$request = unserialize('$request');
+EOF;
+
+ return $code.$this->getHandleScript();
+ }
+
+ protected function getHandleScript()
+ {
+ return <<<'EOF'
+$response = $kernel->handle($request);
+
+if ($kernel instanceof Symfony\Component\HttpKernel\TerminableInterface) {
+ $kernel->terminate($request, $response);
+}
+
+echo serialize($response);
EOF;
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php
index 047ade1..4648449 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php
@@ -40,18 +40,11 @@ public function __construct(LoggerInterface $logger = null)
}
/**
- * Returns the Controller instance associated with a Request.
+ * {@inheritdoc}
*
* This method looks for a '_controller' request attribute that represents
* the controller name (a string like ClassName::MethodName).
*
- * @param Request $request A Request instance
- *
- * @return mixed|Boolean A PHP callable representing the Controller,
- * or false if this resolver is not able to determine the controller
- *
- * @throws \InvalidArgumentException|\LogicException If the controller can't be found
- *
* @api
*/
public function getController(Request $request)
@@ -86,14 +79,7 @@ public function getController(Request $request)
}
/**
- * Returns the arguments to pass to the controller.
- *
- * @param Request $request A Request instance
- * @param mixed $controller A PHP callable
- *
- * @return array
- *
- * @throws \RuntimeException When value for argument given is not provided
+ * {@inheritdoc}
*
* @api
*/
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php
index f58f50d..6f805ed 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php
@@ -38,10 +38,10 @@
*
* @param Request $request A Request instance
*
- * @return mixed|Boolean A PHP callable representing the Controller,
- * or false if this resolver is not able to determine the controller
+ * @return callable|false A PHP callable representing the Controller,
+ * or false if this resolver is not able to determine the controller
*
- * @throws \InvalidArgumentException|\LogicException If the controller can't be found
+ * @throws \LogicException If the controller can't be found
*
* @api
*/
@@ -50,8 +50,8 @@ public function getController(Request $request);
/**
* Returns the arguments to pass to the controller.
*
- * @param Request $request A Request instance
- * @param mixed $controller A PHP callable
+ * @param Request $request A Request instance
+ * @param callable $controller A PHP callable
*
* @return array An array of arguments to pass to the controller
*
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
index 47529fd..51b6d7a 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
@@ -13,7 +13,6 @@
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\Kernel;
-use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
index 7d9c289..1835938 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
@@ -11,17 +11,25 @@
namespace Symfony\Component\HttpKernel\DataCollector;
+use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
+
/**
* DataCollector.
*
* Children of this class must store the collected data in the data property.
*
* @author Fabien Potencier
+ * @author Bernhard Schussek
*/
abstract class DataCollector implements DataCollectorInterface, \Serializable
{
protected $data;
+ /**
+ * @var ValueExporter
+ */
+ private $valueExporter;
+
public function serialize()
{
return serialize($this->data);
@@ -41,35 +49,10 @@ public function unserialize($data)
*/
protected function varToString($var)
{
- if (is_object($var)) {
- return sprintf('Object(%s)', get_class($var));
- }
-
- if (is_array($var)) {
- $a = array();
- foreach ($var as $k => $v) {
- $a[] = sprintf('%s => %s', $k, $this->varToString($v));
- }
-
- return sprintf("Array(%s)", implode(', ', $a));
- }
-
- if (is_resource($var)) {
- return sprintf('Resource(%s)', get_resource_type($var));
- }
-
- if (null === $var) {
- return 'null';
- }
-
- if (false === $var) {
- return 'false';
- }
-
- if (true === $var) {
- return 'true';
+ if (null === $this->valueExporter) {
+ $this->valueExporter = new ValueExporter();
}
- return (string) $var;
+ return $this->valueExporter->exportValue($var);
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php
index cd7f787..418ed68 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php
@@ -13,6 +13,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface;
/**
@@ -20,8 +21,15 @@
*
* @author Fabien Potencier
*/
-class EventDataCollector extends DataCollector
+class EventDataCollector extends DataCollector implements LateDataCollectorInterface
{
+ protected $dispatcher;
+
+ public function __construct(EventDispatcherInterface $dispatcher = null)
+ {
+ $this->dispatcher = $dispatcher;
+ }
+
/**
* {@inheritdoc}
*/
@@ -33,6 +41,14 @@ public function collect(Request $request, Response $response, \Exception $except
);
}
+ public function lateCollect()
+ {
+ if ($this->dispatcher instanceof TraceableEventDispatcherInterface) {
+ $this->setCalledListeners($this->dispatcher->getCalledListeners());
+ $this->setNotCalledListeners($this->dispatcher->getNotCalledListeners());
+ }
+ }
+
/**
* Sets the called listeners.
*
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LateDataCollectorInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LateDataCollectorInterface.php
new file mode 100644
index 0000000..012332d
--- /dev/null
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LateDataCollectorInterface.php
@@ -0,0 +1,25 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\DataCollector;
+
+/**
+ * LateDataCollectorInterface.
+ *
+ * @author Fabien Potencier
+ */
+interface LateDataCollectorInterface
+{
+ /**
+ * Collects data as late as possible.
+ */
+ public function lateCollect();
+}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
index f08720e..ba2ea44 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
@@ -21,7 +21,7 @@
*
* @author Fabien Potencier
*/
-class LoggerDataCollector extends DataCollector
+class LoggerDataCollector extends DataCollector implements LateDataCollectorInterface
{
private $logger;
@@ -37,6 +37,14 @@ public function __construct($logger = null)
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
{
+ // everything is done as late as possible
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function lateCollect()
+ {
if (null !== $this->logger) {
$this->data = array(
'error_count' => $this->logger->countErrors(),
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php
index 5540a1b..e36f1f4 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php
@@ -19,13 +19,13 @@
*
* @author Fabien Potencier
*/
-class MemoryDataCollector extends DataCollector
+class MemoryDataCollector extends DataCollector implements LateDataCollectorInterface
{
public function __construct()
{
$this->data = array(
'memory' => 0,
- 'memory_limit' => $this->convertToBytes(strtolower(ini_get('memory_limit'))),
+ 'memory_limit' => $this->convertToBytes(ini_get('memory_limit')),
);
}
@@ -38,6 +38,14 @@ public function collect(Request $request, Response $response, \Exception $except
}
/**
+ * {@inheritdoc}
+ */
+ public function lateCollect()
+ {
+ $this->updateMemoryUsage();
+ }
+
+ /**
* Gets the memory.
*
* @return integer The memory
@@ -79,13 +87,23 @@ private function convertToBytes($memoryLimit)
return -1;
}
- if (preg_match('#^\+?(0x?)?(.*?)([kmg]?)$#', $memoryLimit, $match)) {
- $shifts = array('' => 0, 'k' => 10, 'm' => 20, 'g' => 30);
- $bases = array('' => 10, '0' => 8, '0x' => 16);
+ $memoryLimit = strtolower($memoryLimit);
+ $max = strtolower(ltrim($memoryLimit, '+'));
+ if (0 === strpos($max, '0x')) {
+ $max = intval($max, 16);
+ } elseif (0 === strpos($max, '0')) {
+ $max = intval($max, 8);
+ } else {
+ $max = intval($max);
+ }
- return intval($match[2], $bases[$match[1]]) << $shifts[$match[3]];
+ switch (substr($memoryLimit, -1)) {
+ case 't': $max *= 1024;
+ case 'g': $max *= 1024;
+ case 'm': $max *= 1024;
+ case 'k': $max *= 1024;
}
- return 0;
+ return $max;
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
index 934c847..4473605 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
@@ -50,11 +50,15 @@ public function collect(Request $request, Response $response, \Exception $except
$attributes = array();
foreach ($request->attributes->all() as $key => $value) {
- if ('_route' == $key && is_object($value)) {
- $value = $value->getPath();
+ if ('_route' === $key && is_object($value)) {
+ $attributes['_route'] = $this->varToString($value->getPath());
+ } elseif ('_route_params' === $key) {
+ foreach ($value as $key => $v) {
+ $attributes['_route_params'][$key] = $this->varToString($v);
+ }
+ } else {
+ $attributes[$key] = $this->varToString($value);
}
-
- $attributes[$key] = $this->varToString($value);
}
$content = null;
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php
index 80e250a..8757412 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php
@@ -14,7 +14,6 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
-use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
/**
@@ -50,6 +49,8 @@ public function collect(Request $request, Response $response, \Exception $except
$this->data['route'] = $this->guessRoute($request, $this->controllers[$request]);
}
}
+
+ unset($this->controllers[$request]);
}
protected function guessRoute(Request $request, $controller)
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php
index 74d7616..4b5b00f 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php
@@ -11,23 +11,24 @@
namespace Symfony\Component\HttpKernel\DataCollector;
-use Symfony\Component\HttpKernel\DataCollector\DataCollector;
-use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\KernelInterface;
/**
* TimeDataCollector.
*
* @author Fabien Potencier
*/
-class TimeDataCollector extends DataCollector
+class TimeDataCollector extends DataCollector implements LateDataCollectorInterface
{
protected $kernel;
+ protected $stopwatch;
- public function __construct(KernelInterface $kernel = null)
+ public function __construct(KernelInterface $kernel = null, $stopwatch = null)
{
$this->kernel = $kernel;
+ $this->stopwatch = $stopwatch;
}
/**
@@ -42,12 +43,24 @@ public function collect(Request $request, Response $response, \Exception $except
}
$this->data = array(
+ 'token' => $response->headers->get('X-Debug-Token'),
'start_time' => $startTime * 1000,
'events' => array(),
);
}
/**
+ * {@inheritdoc}
+ */
+ public function lateCollect()
+ {
+ if (null !== $this->stopwatch && isset($this->data['token'])) {
+ $this->setEvents($this->stopwatch->getSectionEvents($this->data['token']));
+ }
+ unset($this->data['token']);
+ }
+
+ /**
* Sets the request events.
*
* @param array $events The request events
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php
new file mode 100644
index 0000000..f3aeb80
--- /dev/null
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php
@@ -0,0 +1,59 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\DataCollector\Util;
+
+/**
+ * @author Bernhard Schussek
+ */
+class ValueExporter
+{
+ /**
+ * Converts a PHP value to a string.
+ *
+ * @param mixed $value The PHP value
+ *
+ * @return string The string representation of the given value
+ */
+ public function exportValue($value)
+ {
+ if (is_object($value)) {
+ return sprintf('Object(%s)', get_class($value));
+ }
+
+ if (is_array($value)) {
+ $a = array();
+ foreach ($value as $k => $v) {
+ $a[] = sprintf('%s => %s', $k, $this->exportValue($v));
+ }
+
+ return sprintf("Array(%s)", implode(', ', $a));
+ }
+
+ if (is_resource($value)) {
+ return sprintf('Resource(%s)', get_resource_type($value));
+ }
+
+ if (null === $value) {
+ return 'null';
+ }
+
+ if (false === $value) {
+ return 'false';
+ }
+
+ if (true === $value) {
+ return 'true';
+ }
+
+ return (string) $value;
+ }
+}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
index 6bfd7a0..c8905fe 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
@@ -13,10 +13,8 @@
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\HttpKernel\KernelEvents;
-use Psr\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Profiler\Profile;
use Symfony\Component\HttpKernel\Profiler\Profiler;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -32,13 +30,13 @@
class TraceableEventDispatcher implements EventDispatcherInterface, TraceableEventDispatcherInterface
{
private $logger;
- private $called;
+ private $called = array();
private $stopwatch;
- private $profiler;
private $dispatcher;
- private $wrappedListeners;
- private $firstCalledEvent;
+ private $wrappedListeners = array();
+ private $firstCalledEvent = array();
private $id;
+ private $lastEventId = 0;
/**
* Constructor.
@@ -52,19 +50,21 @@ public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $sto
$this->dispatcher = $dispatcher;
$this->stopwatch = $stopwatch;
$this->logger = $logger;
- $this->called = array();
- $this->wrappedListeners = array();
- $this->firstCalledEvent = array();
}
/**
* Sets the profiler.
*
+ * The traceable event dispatcher does not use the profiler anymore.
+ * The job is now done directly by the Profiler listener and the
+ * data collectors themselves.
+ *
* @param Profiler|null $profiler A Profiler instance
+ *
+ * @deprecated Deprecated since version 2.4, to be removed in 3.0.
*/
public function setProfiler(Profiler $profiler = null)
{
- $this->profiler = $profiler;
}
/**
@@ -124,7 +124,7 @@ public function dispatch($eventName, Event $event = null)
$event = new Event();
}
- $this->id = spl_object_hash($event);
+ $this->id = $eventId = ++$this->lastEventId;
$this->preDispatch($eventName, $event);
@@ -139,11 +139,13 @@ public function dispatch($eventName, Event $event = null)
$this->dispatcher->dispatch($eventName, $event);
// reset the id as another event might have been dispatched during the dispatching of this event
- $this->id = spl_object_hash($event);
+ $this->id = $eventId;
unset($this->firstCalledEvent[$eventName]);
- $e->stop();
+ if ($e->isStarted()) {
+ $e->stop();
+ }
$this->postDispatch($eventName, $event);
@@ -257,7 +259,7 @@ public function preListenerCall($eventName, $listener)
* @param object $listener The listener
* @param string $eventName The event name
*
- * @return array Informations about the listener
+ * @return array Information about the listener
*/
private function getListenerInfo($listener, $eventName)
{
@@ -313,57 +315,6 @@ private function getListenerInfo($listener, $eventName)
return $info;
}
- /**
- * Updates the stopwatch data in the profile hierarchy.
- *
- * @param string $token Profile token
- * @param Boolean $updateChildren Whether to update the children altogether
- */
- private function updateProfiles($token, $updateChildren)
- {
- if (!$this->profiler || !$profile = $this->profiler->loadProfile($token)) {
- return;
- }
-
- $this->saveInfoInProfile($profile, $updateChildren);
- }
-
- /**
- * Update the profiles with the timing and events information and saves them.
- *
- * @param Profile $profile The root profile
- * @param Boolean $updateChildren Whether to update the children altogether
- */
- private function saveInfoInProfile(Profile $profile, $updateChildren)
- {
- try {
- $collector = $profile->getCollector('memory');
- $collector->updateMemoryUsage();
- } catch (\InvalidArgumentException $e) {
- }
-
- try {
- $collector = $profile->getCollector('time');
- $collector->setEvents($this->stopwatch->getSectionEvents($profile->getToken()));
- } catch (\InvalidArgumentException $e) {
- }
-
- try {
- $collector = $profile->getCollector('events');
- $collector->setCalledListeners($this->getCalledListeners());
- $collector->setNotCalledListeners($this->getNotCalledListeners());
- } catch (\InvalidArgumentException $e) {
- }
-
- $this->profiler->saveProfile($profile);
-
- if ($updateChildren) {
- foreach ($profile->getChildren() as $child) {
- $this->saveInfoInProfile($child, true);
- }
- }
- }
-
private function preDispatch($eventName, Event $event)
{
// wrap all listeners before they are called
@@ -412,23 +363,14 @@ private function postDispatch($eventName, Event $event)
case KernelEvents::RESPONSE:
$token = $event->getResponse()->headers->get('X-Debug-Token');
$this->stopwatch->stopSection($token);
- if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) {
- // The profiles can only be updated once they have been created
- // that is after the 'kernel.response' event of the main request
- $this->updateProfiles($token, true);
- }
break;
case KernelEvents::TERMINATE:
- $token = $event->getResponse()->headers->get('X-Debug-Token');
// In the special case described in the `preDispatch` method above, the `$token` section
// does not exist, then closing it throws an exception which must be caught.
+ $token = $event->getResponse()->headers->get('X-Debug-Token');
try {
$this->stopwatch->stopSection($token);
} catch (\LogicException $e) {}
- // The children profiles have been updated by the previous 'kernel.response'
- // event. Only the root profile need to be updated with the 'kernel.terminate'
- // timing informations.
- $this->updateProfiles($token, false);
break;
}
@@ -447,9 +389,11 @@ private function wrapListener($eventName, $listener)
return function (Event $event) use ($self, $eventName, $listener) {
$e = $self->preListenerCall($eventName, $listener);
- call_user_func($listener, $event);
+ call_user_func($listener, $event, $eventName, $self);
- $e->stop();
+ if ($e->isStarted()) {
+ $e->stop();
+ }
if ($event->isPropagationStopped()) {
$self->logSkippedListeners($eventName, $event, $listener);
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php
index 7e694eb..b1f3415 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php
@@ -13,7 +13,6 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
-use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\Kernel;
/**
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php
index c9b8a21..69e7937 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\HttpKernel\DependencyInjection;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
@@ -35,10 +36,11 @@ class ContainerAwareHttpKernel extends HttpKernel
* @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
* @param ContainerInterface $container A ContainerInterface instance
* @param ControllerResolverInterface $controllerResolver A ControllerResolverInterface instance
+ * @param RequestStack $requestStack A stack for master/sub requests
*/
- public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver)
+ public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null)
{
- parent::__construct($dispatcher, $controllerResolver);
+ parent::__construct($dispatcher, $controllerResolver, $requestStack);
$this->container = $container;
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php
index ee00fbb..e48c409 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php
@@ -50,18 +50,27 @@ public function __construct($dispatcherService = 'event_dispatcher', $listenerTa
public function process(ContainerBuilder $container)
{
- if (!$container->hasDefinition($this->dispatcherService)) {
+ if (!$container->hasDefinition($this->dispatcherService) && !$container->hasAlias($this->dispatcherService)) {
return;
}
- $definition = $container->getDefinition($this->dispatcherService);
+ $definition = $container->findDefinition($this->dispatcherService);
foreach ($container->findTaggedServiceIds($this->listenerTag) as $id => $events) {
+ $def = $container->getDefinition($id);
+ if (!$def->isPublic()) {
+ throw new \InvalidArgumentException(sprintf('The service "%s" must be public as event listeners are lazy-loaded.', $id));
+ }
+
+ if ($def->isAbstract()) {
+ throw new \InvalidArgumentException(sprintf('The service "%s" must not be abstract as event listeners are lazy-loaded.', $id));
+ }
+
foreach ($events as $event) {
$priority = isset($event['priority']) ? $event['priority'] : 0;
if (!isset($event['event'])) {
- throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id));
+ throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag));
}
if (!isset($event['method'])) {
@@ -77,8 +86,13 @@ public function process(ContainerBuilder $container)
}
foreach ($container->findTaggedServiceIds($this->subscriberTag) as $id => $attributes) {
+ $def = $container->getDefinition($id);
+ if (!$def->isPublic()) {
+ throw new \InvalidArgumentException(sprintf('The service "%s" must be public as event subscribers are lazy-loaded.', $id));
+ }
+
// We must assume that the class value has been correctly filled, even if the service is created by a factory
- $class = $container->getDefinition($id)->getClass();
+ $class = $def->getClass();
$refClass = new \ReflectionClass($class);
$interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface';
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FinishRequestEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FinishRequestEvent.php
new file mode 100644
index 0000000..ee72484
--- /dev/null
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FinishRequestEvent.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\Event;
+
+/**
+ * Triggered whenever a request is fully processed.
+ *
+ * @author Benjamin Eberlei
+ */
+class FinishRequestEvent extends KernelEvent
+{
+}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php
index 1bc0f98..fcb38da 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php
@@ -56,7 +56,7 @@ public function getControllerResult()
/**
* Assigns the return value of the controller.
*
- * @param mixed The controller return value
+ * @param mixed $controllerResult The controller return value
*
* @api
*/
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php
index e57eed4..9876325 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php
@@ -86,4 +86,16 @@ public function getRequestType()
{
return $this->requestType;
}
+
+ /**
+ * Checks if this is a master request.
+ *
+ * @return Boolean True if the request is a master request
+ *
+ * @api
+ */
+ public function isMasterRequest()
+ {
+ return HttpKernelInterface::MASTER_REQUEST === $this->requestType;
+ }
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php
index b90562b..686778a 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\HttpKernel\EventListener;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\HttpCache\Esi;
@@ -43,7 +42,7 @@ public function __construct(Esi $esi = null)
*/
public function onKernelResponse(FilterResponseEvent $event)
{
- if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType() || null === $this->esi) {
+ if (!$event->isMasterRequest() || null === $this->esi) {
return;
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
index 55950b2..33ce993 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\HttpKernel\EventListener;
use Psr\Log\LoggerInterface;
+use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\KernelEvents;
@@ -51,18 +52,7 @@ public function onKernelException(GetResponseForExceptionEvent $event)
$this->logException($exception, sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', get_class($exception), $exception->getMessage(), $exception->getFile(), $exception->getLine()));
- $attributes = array(
- '_controller' => $this->controller,
- 'exception' => FlattenException::create($exception),
- 'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
- // keep for BC -- as $format can be an argument of the controller callable
- // see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
- // @deprecated in 2.4, to be removed in 3.0
- 'format' => $request->getRequestFormat(),
- );
-
- $request = $request->duplicate(null, null, $attributes);
- $request->setMethod('GET');
+ $request = $this->duplicateRequest($exception, $request);
try {
$response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, true);
@@ -109,4 +99,29 @@ protected function logException(\Exception $exception, $message, $original = tru
error_log($message);
}
}
+
+ /**
+ * Clones the request for the exception.
+ *
+ * @param \Exception $exception The thrown exception.
+ * @param Request $request The original request.
+ *
+ * @return Request $request The cloned request.
+ */
+ protected function duplicateRequest(\Exception $exception, Request $request)
+ {
+ $attributes = array(
+ '_controller' => $this->controller,
+ 'exception' => FlattenException::create($exception),
+ 'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
+ // keep for BC -- as $format can be an argument of the controller callable
+ // see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
+ // @deprecated in 2.4, to be removed in 3.0
+ 'format' => $request->getRequestFormat(),
+ );
+ $request = $request->duplicate(null, null, $attributes);
+ $request->setMethod('GET');
+
+ return $request;
+ }
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php
index 0b864c0..bdcf4c7 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php
@@ -12,7 +12,9 @@
namespace Symfony\Component\HttpKernel\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RequestContextAwareInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -20,32 +22,48 @@
/**
* Initializes the locale based on the current request.
*
+ * This listener works in 2 modes:
+ *
+ * * 2.3 compatibility mode where you must call setRequest whenever the Request changes.
+ * * 2.4+ mode where you must pass a RequestStack instance in the constructor.
+ *
* @author Fabien Potencier
*/
class LocaleListener implements EventSubscriberInterface
{
private $router;
private $defaultLocale;
+ private $requestStack;
- public function __construct($defaultLocale = 'en', RequestContextAwareInterface $router = null)
+ /**
+ * RequestStack will become required in 3.0.
+ */
+ public function __construct($defaultLocale = 'en', RequestContextAwareInterface $router = null, RequestStack $requestStack = null)
{
$this->defaultLocale = $defaultLocale;
+ $this->requestStack = $requestStack;
$this->router = $router;
}
+ /**
+ * Sets the current Request.
+ *
+ * This method was used to synchronize the Request, but as the HttpKernel
+ * is doing that automatically now, you should never call it directly.
+ * It is kept public for BC with the 2.3 version.
+ *
+ * @param Request|null $request A Request instance
+ *
+ * @deprecated Deprecated since version 2.4, to be removed in 3.0.
+ */
public function setRequest(Request $request = null)
{
if (null === $request) {
return;
}
- if ($locale = $request->attributes->get('_locale')) {
- $request->setLocale($locale);
- }
-
- if (null !== $this->router) {
- $this->router->getContext()->setParameter('_locale', $request->getLocale());
- }
+ $this->setLocale($request);
+ $this->setRouterContext($request);
}
public function onKernelRequest(GetResponseEvent $event)
@@ -53,7 +71,33 @@ public function onKernelRequest(GetResponseEvent $event)
$request = $event->getRequest();
$request->setDefaultLocale($this->defaultLocale);
- $this->setRequest($request);
+ $this->setLocale($request);
+ $this->setRouterContext($request);
+ }
+
+ public function onKernelFinishRequest(FinishRequestEvent $event)
+ {
+ if (null === $this->requestStack) {
+ return; // removed when requestStack is required
+ }
+
+ if (null !== $parentRequest = $this->requestStack->getParentRequest()) {
+ $this->setRouterContext($parentRequest);
+ }
+ }
+
+ private function setLocale(Request $request)
+ {
+ if ($locale = $request->attributes->get('_locale')) {
+ $request->setLocale($locale);
+ }
+ }
+
+ private function setRouterContext(Request $request)
+ {
+ if (null !== $this->router) {
+ $this->router->getContext()->setParameter('_locale', $request->getLocale());
+ }
}
public static function getSubscribedEvents()
@@ -61,6 +105,7 @@ public static function getSubscribedEvents()
return array(
// must be registered after the Router to have access to the _locale
KernelEvents::REQUEST => array(array('onKernelRequest', 16)),
+ KernelEvents::FINISH_REQUEST => array(array('onKernelFinishRequest', 0)),
);
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php
index 5b2228b..995c998 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php
@@ -11,14 +11,14 @@
namespace Symfony\Component\HttpKernel\EventListener;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\PostResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
-use Symfony\Component\HttpKernel\Profiler\Profile;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
@@ -33,9 +33,10 @@ class ProfilerListener implements EventSubscriberInterface
protected $onlyException;
protected $onlyMasterRequests;
protected $exception;
- protected $children;
- protected $requests;
+ protected $requests = array();
protected $profiles;
+ protected $requestStack;
+ protected $parents;
/**
* Constructor.
@@ -45,14 +46,15 @@ class ProfilerListener implements EventSubscriberInterface
* @param Boolean $onlyException true if the profiler only collects data when an exception occurs, false otherwise
* @param Boolean $onlyMasterRequests true if the profiler only collects data when the request is a master request, false otherwise
*/
- public function __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false)
+ public function __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false, RequestStack $requestStack = null)
{
$this->profiler = $profiler;
$this->matcher = $matcher;
$this->onlyException = (Boolean) $onlyException;
$this->onlyMasterRequests = (Boolean) $onlyMasterRequests;
- $this->children = new \SplObjectStorage();
- $this->profiles = array();
+ $this->profiles = new \SplObjectStorage();
+ $this->parents = new \SplObjectStorage();
+ $this->requestStack = $requestStack;
}
/**
@@ -62,16 +64,21 @@ public function __construct(Profiler $profiler, RequestMatcherInterface $matcher
*/
public function onKernelException(GetResponseForExceptionEvent $event)
{
- if ($this->onlyMasterRequests && HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
+ if ($this->onlyMasterRequests && !$event->isMasterRequest()) {
return;
}
$this->exception = $event->getException();
}
+ /**
+ * @deprecated Deprecated since version 2.4, to be removed in 3.0.
+ */
public function onKernelRequest(GetResponseEvent $event)
{
- $this->requests[] = $event->getRequest();
+ if (null === $this->requestStack) {
+ $this->requests[] = $event->getRequest();
+ }
}
/**
@@ -81,7 +88,7 @@ public function onKernelRequest(GetResponseEvent $event)
*/
public function onKernelResponse(FilterResponseEvent $event)
{
- $master = HttpKernelInterface::MASTER_REQUEST === $event->getRequestType();
+ $master = $event->isMasterRequest();
if ($this->onlyMasterRequests && !$master) {
return;
}
@@ -102,40 +109,36 @@ public function onKernelResponse(FilterResponseEvent $event)
return;
}
- $this->profiles[] = $profile;
-
- if (null !== $exception) {
- foreach ($this->profiles as $profile) {
- $this->profiler->saveProfile($profile);
- }
-
- return;
- }
+ $this->profiles[$request] = $profile;
- // keep the profile as the child of its parent
- if (!$master) {
+ if (null !== $this->requestStack) {
+ $this->parents[$request] = $this->requestStack->getParentRequest();
+ } elseif (!$master) {
+ // to be removed when requestStack is required
array_pop($this->requests);
- $parent = end($this->requests);
-
- // when simulating requests, we might not have the parent
- if ($parent) {
- $profiles = isset($this->children[$parent]) ? $this->children[$parent] : array();
- $profiles[] = $profile;
- $this->children[$parent] = $profiles;
- }
+ $this->parents[$request] = end($this->requests);
}
+ }
- if (isset($this->children[$request])) {
- foreach ($this->children[$request] as $child) {
- $profile->addChild($child);
+ public function onKernelTerminate(PostResponseEvent $event)
+ {
+ // attach children to parents
+ foreach ($this->profiles as $request) {
+ // isset call should be removed when requestStack is required
+ if (isset($this->parents[$request]) && null !== $parentRequest = $this->parents[$request]) {
+ $this->profiles[$parentRequest]->addChild($this->profiles[$request]);
}
- $this->children[$request] = array();
}
- if ($master) {
- $this->saveProfiles($profile);
+ // save profiles
+ foreach ($this->profiles as $request) {
+ $this->profiler->saveProfile($this->profiles[$request]);
}
+
+ $this->profiles = new \SplObjectStorage();
+ $this->parents = new \SplObjectStorage();
+ $this->requests = array();
}
public static function getSubscribedEvents()
@@ -146,19 +149,7 @@ public static function getSubscribedEvents()
KernelEvents::REQUEST => array('onKernelRequest', 1024),
KernelEvents::RESPONSE => array('onKernelResponse', -100),
KernelEvents::EXCEPTION => 'onKernelException',
+ KernelEvents::TERMINATE => array('onKernelTerminate', -1024),
);
}
-
- /**
- * Saves the profile hierarchy.
- *
- * @param Profile $profile The root profile
- */
- private function saveProfiles(Profile $profile)
- {
- $this->profiler->saveProfile($profile);
- foreach ($profile->getChildren() as $profile) {
- $this->saveProfiles($profile);
- }
- }
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php
index 669980c..eeb2b0f 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\EventListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -37,7 +36,7 @@ public function __construct($charset)
*/
public function onKernelResponse(FilterResponseEvent $event)
{
- if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
+ if (!$event->isMasterRequest()) {
return;
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php
index f68716c..27ac632 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php
@@ -13,9 +13,11 @@
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
@@ -28,6 +30,11 @@
/**
* Initializes the context from the request and sets request attributes based on a matching route.
*
+ * This listener works in 2 modes:
+ *
+ * * 2.3 compatibility mode where you must call setRequest whenever the Request changes.
+ * * 2.4+ mode where you must pass a RequestStack instance in the constructor.
+ *
* @author Fabien Potencier
*/
class RouterListener implements EventSubscriberInterface
@@ -36,17 +43,20 @@ class RouterListener implements EventSubscriberInterface
private $context;
private $logger;
private $request;
+ private $requestStack;
/**
* Constructor.
*
+ * RequestStack will become required in 3.0.
+ *
* @param UrlMatcherInterface|RequestMatcherInterface $matcher The Url or Request matcher
* @param RequestContext|null $context The RequestContext (can be null when $matcher implements RequestContextAwareInterface)
* @param LoggerInterface|null $logger The logger
*
* @throws \InvalidArgumentException
*/
- public function __construct($matcher, RequestContext $context = null, LoggerInterface $logger = null)
+ public function __construct($matcher, RequestContext $context = null, LoggerInterface $logger = null, RequestStack $requestStack = null)
{
if (!$matcher instanceof UrlMatcherInterface && !$matcher instanceof RequestMatcherInterface) {
throw new \InvalidArgumentException('Matcher must either implement UrlMatcherInterface or RequestMatcherInterface.');
@@ -58,18 +68,20 @@ public function __construct($matcher, RequestContext $context = null, LoggerInte
$this->matcher = $matcher;
$this->context = $context ?: $matcher->getContext();
+ $this->requestStack = $requestStack;
$this->logger = $logger;
}
/**
* Sets the current Request.
*
- * The application should call this method whenever the Request
- * object changes (entering a Request scope for instance, but
- * also when leaving a Request scope -- especially when they are
- * nested).
+ * This method was used to synchronize the Request, but as the HttpKernel
+ * is doing that automatically now, you should never call it directly.
+ * It is kept public for BC with the 2.3 version.
*
* @param Request|null $request A Request instance
+ *
+ * @deprecated Deprecated since version 2.4, to be moved to a private function in 3.0.
*/
public function setRequest(Request $request = null)
{
@@ -79,6 +91,15 @@ public function setRequest(Request $request = null)
$this->request = $request;
}
+ public function onKernelFinishRequest(FinishRequestEvent $event)
+ {
+ if (null === $this->requestStack) {
+ return; // removed when requestStack is required
+ }
+
+ $this->setRequest($this->requestStack->getParentRequest());
+ }
+
public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
@@ -86,7 +107,10 @@ public function onKernelRequest(GetResponseEvent $event)
// initialize the context that is also used by the generator (assuming matcher and generator share the same context instance)
// we call setRequest even if most of the time, it has already been done to keep compatibility
// with frameworks which do not use the Symfony service container
- $this->setRequest($request);
+ // when we have a RequestStack, no need to do it
+ if (null !== $this->requestStack) {
+ $this->setRequest($request);
+ }
if ($request->attributes->has('_controller')) {
// routing is already done
@@ -113,9 +137,13 @@ public function onKernelRequest(GetResponseEvent $event)
} catch (ResourceNotFoundException $e) {
$message = sprintf('No route found for "%s %s"', $request->getMethod(), $request->getPathInfo());
+ if ($referer = $request->headers->get('referer')) {
+ $message .= sprintf(' (from "%s")', $referer);
+ }
+
throw new NotFoundHttpException($message, $e);
} catch (MethodNotAllowedException $e) {
- $message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getPathInfo(), strtoupper(implode(', ', $e->getAllowedMethods())));
+ $message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getPathInfo(), implode(', ', $e->getAllowedMethods()));
throw new MethodNotAllowedHttpException($e->getAllowedMethods(), $message, $e);
}
@@ -135,6 +163,7 @@ public static function getSubscribedEvents()
{
return array(
KernelEvents::REQUEST => array(array('onKernelRequest', 32)),
+ KernelEvents::FINISH_REQUEST => array(array('onKernelFinishRequest', 0)),
);
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/SessionListener.php
similarity index 50%
copy from core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php
copy to core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/SessionListener.php
index 88505fa..d1023b2 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/SessionListener.php
@@ -11,42 +11,44 @@
namespace Symfony\Component\HttpKernel\EventListener;
-use Symfony\Component\HttpFoundation\StreamedResponse;
-use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
- * StreamedResponseListener is responsible for sending the Response
- * to the client.
+ * Sets the session in the request.
*
- * @author Fabien Potencier
+ * @author Johannes M. Schmitt
*/
-class StreamedResponseListener implements EventSubscriberInterface
+abstract class SessionListener implements EventSubscriberInterface
{
- /**
- * Filters the Response.
- *
- * @param FilterResponseEvent $event A FilterResponseEvent instance
- */
- public function onKernelResponse(FilterResponseEvent $event)
+ public function onKernelRequest(GetResponseEvent $event)
{
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return;
}
- $response = $event->getResponse();
-
- if ($response instanceof StreamedResponse) {
- $response->send();
+ $request = $event->getRequest();
+ $session = $this->getSession();
+ if (null === $session || $request->hasSession()) {
+ return;
}
+
+ $request->setSession($session);
}
public static function getSubscribedEvents()
{
return array(
- KernelEvents::RESPONSE => array('onKernelResponse', -1024),
+ KernelEvents::REQUEST => array('onKernelRequest', 128),
);
}
+
+ /**
+ * Gets the session object.
+ *
+ * @return SessionInterface|null A SessionInterface instance of null if no session is available
+ */
+ abstract protected function getSession();
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php
index 88505fa..571cd74 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php
@@ -13,7 +13,6 @@
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -32,7 +31,7 @@ class StreamedResponseListener implements EventSubscriberInterface
*/
public function onKernelResponse(FilterResponseEvent $event)
{
- if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
+ if (!$event->isMasterRequest()) {
return;
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/TestSessionListener.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/TestSessionListener.php
new file mode 100644
index 0000000..ee047a6
--- /dev/null
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/TestSessionListener.php
@@ -0,0 +1,84 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\EventListener;
+
+use Symfony\Component\HttpFoundation\Cookie;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * TestSessionListener.
+ *
+ * Saves session in test environment.
+ *
+ * @author Bulat Shakirzyanov
+ * @author Fabien Potencier
+ */
+abstract class TestSessionListener implements EventSubscriberInterface
+{
+ public function onKernelRequest(GetResponseEvent $event)
+ {
+ if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
+ return;
+ }
+
+ // bootstrap the session
+ $session = $this->getSession();
+ if (!$session) {
+ return;
+ }
+
+ $cookies = $event->getRequest()->cookies;
+
+ if ($cookies->has($session->getName())) {
+ $session->setId($cookies->get($session->getName()));
+ }
+ }
+
+ /**
+ * Checks if session was initialized and saves if current request is master
+ * Runs on 'kernel.response' in test environment
+ *
+ * @param FilterResponseEvent $event
+ */
+ public function onKernelResponse(FilterResponseEvent $event)
+ {
+ if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
+ return;
+ }
+
+ $session = $event->getRequest()->getSession();
+ if ($session && $session->isStarted()) {
+ $session->save();
+ $params = session_get_cookie_params();
+ $event->getResponse()->headers->setCookie(new Cookie($session->getName(), $session->getId(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly']));
+ }
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ KernelEvents::REQUEST => array('onKernelRequest', 192),
+ KernelEvents::RESPONSE => array('onKernelResponse', -128),
+ );
+ }
+
+ /**
+ * Gets the session object.
+ *
+ * @return SessionInterface|null A SessionInterface instance of null if no session is available
+ */
+ abstract protected function getSession();
+}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php
index 68b1a87..a491a85 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php
@@ -35,7 +35,7 @@ class EsiFragmentRenderer extends RoutableFragmentRenderer
* @param Esi $esi An Esi instance
* @param InlineFragmentRenderer $inlineStrategy The inline strategy to use when ESI is not supported
*/
- public function __construct(Esi $esi, InlineFragmentRenderer $inlineStrategy)
+ public function __construct(Esi $esi = null, InlineFragmentRenderer $inlineStrategy)
{
$this->esi = $esi;
$this->inlineStrategy = $inlineStrategy;
@@ -56,7 +56,7 @@ public function __construct(Esi $esi, InlineFragmentRenderer $inlineStrategy)
*/
public function render($uri, Request $request, array $options = array())
{
- if (!$this->esi->hasSurrogateEsiCapability($request)) {
+ if (!$this->esi || !$this->esi->hasSurrogateEsiCapability($request)) {
return $this->inlineStrategy->render($uri, $request, $options);
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php
index af9b9ba..0297304 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php
@@ -14,6 +14,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
/**
@@ -22,6 +23,11 @@
* This class handles the rendering of resource fragments that are included into
* a main resource. The handling of the rendering is managed by specialized renderers.
*
+ * This listener works in 2 modes:
+ *
+ * * 2.3 compatibility mode where you must call setRequest whenever the Request changes.
+ * * 2.4+ mode where you must pass a RequestStack instance in the constructor.
+ *
* @author Fabien Potencier
*
* @see FragmentRendererInterface
@@ -29,18 +35,22 @@
class FragmentHandler
{
private $debug;
- private $renderers;
+ private $renderers = array();
private $request;
+ private $requestStack;
/**
* Constructor.
*
- * @param FragmentRendererInterface[] $renderers An array of FragmentRendererInterface instances
- * @param Boolean $debug Whether the debug mode is enabled or not
+ * RequestStack will become required in 3.0.
+ *
+ * @param FragmentRendererInterface[] $renderers An array of FragmentRendererInterface instances
+ * @param Boolean $debug Whether the debug mode is enabled or not
+ * @param RequestStack|null $requestStack The Request stack that controls the lifecycle of requests
*/
- public function __construct(array $renderers = array(), $debug = false)
+ public function __construct(array $renderers = array(), $debug = false, RequestStack $requestStack = null)
{
- $this->renderers = array();
+ $this->requestStack = $requestStack;
foreach ($renderers as $renderer) {
$this->addRenderer($renderer);
}
@@ -60,7 +70,13 @@ public function addRenderer(FragmentRendererInterface $renderer)
/**
* Sets the current Request.
*
- * @param Request $request The current Request
+ * This method was used to synchronize the Request, but as the HttpKernel
+ * is doing that automatically now, you should never call it directly.
+ * It is kept public for BC with the 2.3 version.
+ *
+ * @param Request|null $request A Request instance
+ *
+ * @deprecated Deprecated since version 2.4, to be removed in 3.0.
*/
public function setRequest(Request $request = null)
{
@@ -81,7 +97,7 @@ public function setRequest(Request $request = null)
* @return string|null The Response content or null when the Response is streamed
*
* @throws \InvalidArgumentException when the renderer does not exist
- * @throws \RuntimeException when the Response is not successful
+ * @throws \LogicException when the Request is not successful
*/
public function render($uri, $renderer = 'inline', array $options = array())
{
@@ -93,11 +109,11 @@ public function render($uri, $renderer = 'inline', array $options = array())
throw new \InvalidArgumentException(sprintf('The "%s" renderer does not exist.', $renderer));
}
- if (null === $this->request) {
- throw new \LogicException('Rendering a fragment can only be done when handling a master Request.');
+ if (!$request = $this->getRequest()) {
+ throw new \LogicException('Rendering a fragment can only be done when handling a Request.');
}
- return $this->deliver($this->renderers[$renderer]->render($uri, $this->request, $options));
+ return $this->deliver($this->renderers[$renderer]->render($uri, $request, $options));
}
/**
@@ -115,7 +131,7 @@ public function render($uri, $renderer = 'inline', array $options = array())
protected function deliver(Response $response)
{
if (!$response->isSuccessful()) {
- throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->request->getUri(), $response->getStatusCode()));
+ throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this->getRequest()->getUri(), $response->getStatusCode()));
}
if (!$response instanceof StreamedResponse) {
@@ -124,4 +140,9 @@ protected function deliver(Response $response)
$response->sendContent();
}
+
+ private function getRequest()
+ {
+ return $this->requestStack ? $this->requestStack->getCurrentRequest() : $this->request;
+ }
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php
index a758d2c..ae172df 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php
@@ -13,6 +13,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
+use Symfony\Component\HttpFoundation\Response;
/**
* Interface implemented by all rendering strategies.
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php
index 882bc2b..8fc4572 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php
@@ -91,7 +91,8 @@ public function render($uri, Request $request, array $options = array())
throw new \LogicException('You must use a proper URI when using the Hinclude rendering strategy or set a URL signer.');
}
- $uri = $this->signer->sign($this->generateFragmentUri($uri, $request));
+ // we need to sign the absolute URI, but want to return the path only.
+ $uri = substr($this->signer->sign($this->generateFragmentUri($uri, $request, true)), strlen($request->getSchemeAndHttpHost()));
}
// We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content.
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php
index a3f37c3..c6ca3d4 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php
@@ -32,7 +32,8 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
/**
* Constructor.
*
- * @param HttpKernelInterface $kernel A HttpKernelInterface instance
+ * @param HttpKernelInterface $kernel A HttpKernelInterface instance
+ * @param EventDispatcherInterface $dispatcher A EventDispatcherInterface instance
*/
public function __construct(HttpKernelInterface $kernel, EventDispatcherInterface $dispatcher = null)
{
@@ -60,14 +61,15 @@ public function render($uri, Request $request, array $options = array())
$attributes = $reference->attributes;
$reference->attributes = array();
- // The request format and locale might have been overriden by the user
+ // The request format and locale might have been overridden by the user
foreach (array('_format', '_locale') as $key) {
if (isset($attributes[$key])) {
$reference->attributes[$key] = $attributes[$key];
}
}
- $uri = $this->generateFragmentUri($uri, $request);
+ $uri = $this->generateFragmentUri($uri, $request, false, false);
+
$reference->attributes = array_merge($attributes, $reference->attributes);
}
@@ -130,7 +132,7 @@ protected function createSubRequest($uri, Request $request)
$server['REMOTE_ADDR'] = '127.0.0.1';
- $subRequest = $request::create($uri, 'get', array(), $cookies, array(), $server);
+ $subRequest = Request::create($uri, 'get', array(), $cookies, array(), $server);
if ($request->headers->has('Surrogate-Capability')) {
$subRequest->headers->set('Surrogate-Capability', $request->headers->get('Surrogate-Capability'));
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php
index 1f3b84f..bdf710b 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php
@@ -40,12 +40,18 @@ public function setFragmentPath($path)
* Generates a fragment URI for a given controller.
*
* @param ControllerReference $reference A ControllerReference instance
- * @param Request $request A Request instance
+ * @param Request $request A Request instance
+ * @param Boolean $absolute Whether to generate an absolute URL or not
+ * @param Boolean $strict Whether to allow non-scalar attributes or not
*
* @return string A fragment URI
*/
- protected function generateFragmentUri(ControllerReference $reference, Request $request)
+ protected function generateFragmentUri(ControllerReference $reference, Request $request, $absolute = false, $strict = true)
{
+ if ($strict) {
+ $this->checkNonScalar($reference->attributes);
+ }
+
// We need to forward the current _format and _locale values as we don't have
// a proper routing pattern to do the job for us.
// This makes things inconsistent if you switch from rendering a controller
@@ -62,6 +68,23 @@ protected function generateFragmentUri(ControllerReference $reference, Request $
$reference->query['_path'] = http_build_query($reference->attributes, '', '&');
- return $request->getUriForPath($this->fragmentPath.'?'.http_build_query($reference->query, '', '&'));
+ $path = $this->fragmentPath.'?'.http_build_query($reference->query, '', '&');
+
+ if ($absolute) {
+ return $request->getUriForPath($path);
+ }
+
+ return $request->getBaseUrl().$path;
+ }
+
+ private function checkNonScalar($values)
+ {
+ foreach ($values as $key => $value) {
+ if (is_array($value)) {
+ $this->checkNonScalar($value);
+ } elseif (!is_scalar($value)) {
+ throw new \LogicException(sprintf('Controller attributes cannot contain non-scalar values (value for key "%s" is not a scalar).', $key));
+ }
+ }
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
index 63cde7e..f80d6f0 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
@@ -19,7 +19,6 @@
use Symfony\Component\HttpKernel\TerminableInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\HttpCache\Esi;
/**
* Cache provides HTTP caching.
@@ -35,7 +34,8 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
private $request;
private $esi;
private $esiCacheStrategy;
- private $traces;
+ private $options = array();
+ private $traces = array();
/**
* Constructor.
@@ -81,6 +81,7 @@ public function __construct(HttpKernelInterface $kernel, StoreInterface $store,
{
$this->store = $store;
$this->kernel = $kernel;
+ $this->esi = $esi;
// needed in case there is a fatal error because the backend is too slow to respond
register_shutdown_function(array($this->store, 'cleanup'));
@@ -94,8 +95,6 @@ public function __construct(HttpKernelInterface $kernel, StoreInterface $store,
'stale_while_revalidate' => 2,
'stale_if_error' => 60,
), $options);
- $this->esi = $esi;
- $this->traces = array();
}
/**
@@ -268,7 +267,7 @@ protected function invalidate(Request $request, $catch = false)
// As per the RFC, invalidate Location and Content-Location URLs if present
foreach (array('Location', 'Content-Location') as $header) {
if ($uri = $response->headers->get($header)) {
- $subRequest = $request::create($uri, 'get', array(), array(), array(), $request->server->all());
+ $subRequest = Request::create($uri, 'get', array(), array(), array(), $request->server->all());
$this->store->invalidate($subRequest);
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php
index a1cda1f..1d55ab4 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php
@@ -50,7 +50,9 @@ public function cleanup()
{
// unlock everything
foreach ($this->locks as $lock) {
- @unlink($lock);
+ if (file_exists($lock)) {
+ @unlink($lock);
+ }
}
$error = error_get_last();
@@ -214,7 +216,7 @@ public function write(Request $request, Response $response)
*/
protected function generateContentDigest(Response $response)
{
- return 'en'.sha1($response->getContent());
+ return 'en'.hash('sha256', $response->getContent());
}
/**
@@ -365,6 +367,25 @@ public function getPath($key)
}
/**
+ * Generates a cache key for the given Request.
+ *
+ * This method should return a key that must only depend on a
+ * normalized version of the request URI.
+ *
+ * If the same URI can have more than one representation, based on some
+ * headers, use a Vary header to indicate them, and each representation will
+ * be stored independently under the same cache key.
+ *
+ * @param Request $request A Request instance
+ *
+ * @return string A key for the given Request
+ */
+ protected function generateCacheKey(Request $request)
+ {
+ return 'md'.hash('sha256', $request->getUri());
+ }
+
+ /**
* Returns a cache key for the given Request.
*
* @param Request $request A Request instance
@@ -377,7 +398,7 @@ private function getCacheKey(Request $request)
return $this->keyCache[$request];
}
- return $this->keyCache[$request] = 'md'.sha1($request->getUri());
+ return $this->keyCache[$request] = $this->generateCacheKey($request);
}
/**
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php
index 837a16f..0be8e1b 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php
@@ -16,11 +16,13 @@
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -35,19 +37,22 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
{
protected $dispatcher;
protected $resolver;
+ protected $requestStack;
/**
* Constructor
*
- * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
- * @param ControllerResolverInterface $resolver A ControllerResolverInterface instance
+ * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
+ * @param ControllerResolverInterface $resolver A ControllerResolverInterface instance
+ * @param RequestStack $requestStack A stack for master/sub requests
*
* @api
*/
- public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver)
+ public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null)
{
$this->dispatcher = $dispatcher;
$this->resolver = $resolver;
+ $this->requestStack = $requestStack ?: new RequestStack();
}
/**
@@ -61,6 +66,8 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if (false === $catch) {
+ $this->finishRequest($request, $type);
+
throw $e;
}
@@ -93,6 +100,8 @@ public function terminate(Request $request, Response $response)
*/
private function handleRaw(Request $request, $type = self::MASTER_REQUEST)
{
+ $this->requestStack->push($request);
+
// request
$event = new GetResponseEvent($this, $request, $type);
$this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
@@ -156,10 +165,28 @@ private function filterResponse(Response $response, Request $request, $type)
$this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
+ $this->finishRequest($request, $type);
+
return $event->getResponse();
}
/**
+ * Publishes the finish request event, then pop the request from the stack.
+ *
+ * Note that the order of the operations is important here, otherwise
+ * operations such as {@link RequestStack::getParentRequest()} can lead to
+ * weird results.
+ *
+ * @param Request $request
+ * @param int $type
+ */
+ private function finishRequest(Request $request, $type)
+ {
+ $this->dispatcher->dispatch(KernelEvents::FINISH_REQUEST, new FinishRequestEvent($this, $request, $type));
+ $this->requestStack->pop();
+ }
+
+ /**
* Handles an exception by trying to convert it to a Response.
*
* @param \Exception $e An \Exception instance
@@ -179,6 +206,8 @@ private function handleException(\Exception $e, $request, $type)
$e = $event->getException();
if (!$event->hasResponse()) {
+ $this->finishRequest($request, $type);
+
throw $e;
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php
index 96a746e..94353c0 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php
@@ -24,7 +24,6 @@
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
@@ -48,24 +47,23 @@
/**
* @var BundleInterface[]
*/
- protected $bundles;
+ protected $bundles = array();
protected $bundleMap;
protected $container;
protected $rootDir;
protected $environment;
protected $debug;
- protected $booted;
+ protected $booted = false;
protected $name;
protected $startTime;
protected $loadClassCache;
- protected $errorReportingLevel;
- const VERSION = '2.3.4';
- const VERSION_ID = '20304';
+ const VERSION = '2.4.1';
+ const VERSION_ID = '20401';
const MAJOR_VERSION = '2';
- const MINOR_VERSION = '3';
- const RELEASE_VERSION = '4';
+ const MINOR_VERSION = '4';
+ const RELEASE_VERSION = '1';
const EXTRA_VERSION = '';
/**
@@ -80,10 +78,8 @@ public function __construct($environment, $debug)
{
$this->environment = $environment;
$this->debug = (Boolean) $debug;
- $this->booted = false;
$this->rootDir = $this->getRootDir();
$this->name = $this->getName();
- $this->bundles = array();
if ($this->debug) {
$this->startTime = microtime(true);
@@ -190,7 +186,7 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
}
/**
- * Gets a http kernel from the container
+ * Gets a HTTP kernel from the container
*
* @return HttpKernel
*/
@@ -498,7 +494,9 @@ protected function initializeBundles()
}
// look for orphans
- if (count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {
+ if (!empty($directChildren) && count($diff = array_diff_key($directChildren, $this->bundles))) {
+ $diff = array_keys($diff);
+
throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
}
@@ -713,7 +711,7 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container
$content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass));
if (!$this->debug) {
- $content = self::stripComments($content);
+ $content = static::stripComments($content);
}
$cache->write($content, $container->getResources());
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php
index fce48ac..5e6ebcb 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php
@@ -102,4 +102,14 @@
* @var string
*/
const TERMINATE = 'kernel.terminate';
+
+ /**
+ * The REQUEST_FINISHED event occurs when a response was generated for a request.
+ *
+ * This event allows you to reset the global and environmental state of
+ * the application, when it was changed during the request.
+ *
+ * @var string
+ */
+ const FINISH_REQUEST = 'kernel.finish_request';
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php
index dd37b60..6905a12 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel;
use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\Config\Loader\LoaderInterface;
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php
index 69ff973..fd6bd96 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php
@@ -89,7 +89,7 @@ public function find($ip, $url, $limit, $method, $start = null, $end = null)
--$limit;
}
- usort($result, function($a, $b) {
+ usort($result, function ($a, $b) {
if ($a['time'] === $b['time']) {
return 0;
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
index 9265fc1..e225b0d 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
@@ -70,7 +70,7 @@ public function find($ip, $url, $limit, $method, $start = null, $end = null)
}
if (!empty($start) && $csvTime < $start) {
- continue;
+ continue;
}
if (!empty($end) && $csvTime > $end) {
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php
index a78cec0..2034a19 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php
@@ -42,7 +42,7 @@ protected function getMemcache()
$host = $matches[1] ?: $matches[2];
$port = $matches[3];
- $memcache = new Memcache;
+ $memcache = new Memcache();
$memcache->addServer($host, $port);
$this->memcache = $memcache;
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php
index f7f6842..31f3136 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php
@@ -42,7 +42,7 @@ protected function getMemcached()
$host = $matches[1] ?: $matches[2];
$port = $matches[3];
- $memcached = new Memcached;
+ $memcached = new Memcached();
//disable compression to allow appending
$memcached->setOption(Memcached::OPT_COMPRESSION, false);
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php
index 49f3137..b545b4a 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php
@@ -13,8 +13,8 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface;
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
+use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
use Psr\Log\LoggerInterface;
/**
@@ -109,6 +109,13 @@ public function loadProfile($token)
*/
public function saveProfile(Profile $profile)
{
+ // late collect
+ foreach ($profile->getCollectors() as $collector) {
+ if ($collector instanceof LateDataCollectorInterface) {
+ $collector->lateCollect();
+ }
+ }
+
if (!($ret = $this->storage->write($profile)) && null !== $this->logger) {
$this->logger->warning('Unable to store the profiler information.');
}
@@ -204,7 +211,7 @@ public function collect(Request $request, Response $response, \Exception $except
return;
}
- $profile = new Profile(substr(sha1(uniqid(mt_rand(), true)), 0, 6));
+ $profile = new Profile(substr(hash('sha256', uniqid(mt_rand(), true)), 0, 6));
$profile->setTime(time());
$profile->setUrl($request->getUri());
$profile->setIp($request->getClientIp());
@@ -215,8 +222,8 @@ public function collect(Request $request, Response $response, \Exception $except
foreach ($this->collectors as $collector) {
$collector->collect($request, $response, $exception);
- // forces collectors to become "read/only" (they loose their object dependencies)
- $profile->addCollector(unserialize(serialize($collector)));
+ // we need to clone for sub-requests
+ $profile->addCollector(clone $collector);
}
return $profile;
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
index d62d6c7..de2decf 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
@@ -11,8 +11,6 @@
namespace Symfony\Component\HttpKernel\Profiler;
-use Redis;
-
/**
* RedisProfilerStorage stores profiling information in Redis.
*
@@ -32,7 +30,7 @@ class RedisProfilerStorage implements ProfilerStorageInterface
protected $lifetime;
/**
- * @var Redis
+ * @var \Redis
*/
private $redis;
@@ -199,7 +197,7 @@ public function write(Profile $profile)
/**
* Internal convenience method that returns the instance of Redis.
*
- * @return Redis
+ * @return \Redis
*
* @throws \RuntimeException
*/
@@ -216,7 +214,7 @@ protected function getRedis()
throw new \RuntimeException('RedisProfilerStorage requires that the redis extension is loaded.');
}
- $redis = new Redis;
+ $redis = new \Redis;
$redis->connect($data['host'], $data['port']);
if (isset($data['path'])) {
@@ -238,7 +236,7 @@ protected function getRedis()
/**
* Set instance of the Redis
*
- * @param Redis $redis
+ * @param \Redis $redis
*/
public function setRedis($redis)
{
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md
index e0f3c98..7aa0656 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md
@@ -85,5 +85,5 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/HttpKernel/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php
index 8affb5f..a451b7a 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php
@@ -11,28 +11,18 @@
namespace Symfony\Component\HttpKernel\Tests\Bundle;
+use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\HttpKernel\Bundle\Bundle;
-
-use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\ExtensionPresentBundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionAbsentBundle\ExtensionAbsentBundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command\FooCommand;
+use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\ExtensionPresentBundle;
class BundleTest extends \PHPUnit_Framework_TestCase
{
public function testRegisterCommands()
{
- if (!class_exists('Symfony\Component\Console\Application')) {
- $this->markTestSkipped('The "Console" component is not available');
- }
-
- if (!interface_exists('Symfony\Component\DependencyInjection\ContainerAwareInterface')) {
- $this->markTestSkipped('The "DependencyInjection" component is not available');
- }
-
- if (!class_exists('Symfony\Component\Finder\Finder')) {
- $this->markTestSkipped('The "Finder" component is not available');
- }
-
$cmd = new FooCommand();
$app = $this->getMock('Symfony\Component\Console\Application');
$app->expects($this->once())->method('add')->with($this->equalTo($cmd));
@@ -43,6 +33,25 @@ public function testRegisterCommands()
$bundle2 = new ExtensionAbsentBundle();
$this->assertNull($bundle2->registerCommands($app));
+ }
+ public function testRegisterCommandsIngoreCommandAsAService()
+ {
+ $container = new ContainerBuilder();
+ $container->addCompilerPass(new AddConsoleCommandPass());
+ $definition = new Definition('Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command\FooCommand');
+ $definition->addTag('console.command');
+ $container->setDefinition('my-command', $definition);
+ $container->compile();
+
+ $application = $this->getMock('Symfony\Component\Console\Application');
+ // Never called, because it's the
+ // Symfony\Bundle\FrameworkBundle\Console\Application that register
+ // commands as a service
+ $application->expects($this->never())->method('add');
+
+ $bundle = new ExtensionPresentBundle();
+ $bundle->setContainer($container);
+ $bundle->registerCommands($application);
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php
index 755d7f6..c58c958 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php
@@ -22,13 +22,6 @@
class ClientTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\BrowserKit\Client')) {
- $this->markTestSkipped('The "BrowserKit" component is not available');
- }
- }
-
public function testDoRequest()
{
$client = new Client(new TestHttpKernel());
@@ -50,14 +43,6 @@ public function testDoRequest()
public function testGetScript()
{
- if (!class_exists('Symfony\Component\Process\Process')) {
- $this->markTestSkipped('The "Process" component is not available');
- }
-
- if (!class_exists('Symfony\Component\ClassLoader\ClassLoader')) {
- $this->markTestSkipped('The "ClassLoader" component is not available');
- }
-
$client = new TestClient(new TestHttpKernel());
$client->insulate();
$client->request('GET', '/');
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php
index aa401f4..dd14186 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php
@@ -9,20 +9,14 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests;
+namespace Symfony\Component\HttpKernel\Tests\Controller;
use Symfony\Component\HttpKernel\Controller\ControllerResolver;
+use Symfony\Component\HttpKernel\Tests\Logger;
use Symfony\Component\HttpFoundation\Request;
class ControllerResolverTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testGetController()
{
$logger = new Logger();
@@ -32,9 +26,9 @@ public function testGetController()
$this->assertFalse($resolver->getController($request), '->getController() returns false when the request has no _controller attribute');
$this->assertEquals(array('Unable to look for the controller as the "_controller" parameter is missing'), $logger->getLogs('warning'));
- $request->attributes->set('_controller', 'Symfony\Component\HttpKernel\Tests\ControllerResolverTest::testGetController');
+ $request->attributes->set('_controller', 'Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest::testGetController');
$controller = $resolver->getController($request);
- $this->assertInstanceOf('Symfony\Component\HttpKernel\Tests\ControllerResolverTest', $controller[0], '->getController() returns a PHP callable');
+ $this->assertInstanceOf('Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest', $controller[0], '->getController() returns a PHP callable');
$request->attributes->set('_controller', $lambda = function () {});
$controller = $resolver->getController($request);
@@ -44,21 +38,21 @@ public function testGetController()
$controller = $resolver->getController($request);
$this->assertSame($this, $controller);
- $request->attributes->set('_controller', 'Symfony\Component\HttpKernel\Tests\ControllerResolverTest');
+ $request->attributes->set('_controller', 'Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest');
$controller = $resolver->getController($request);
- $this->assertInstanceOf('Symfony\Component\HttpKernel\Tests\ControllerResolverTest', $controller);
+ $this->assertInstanceOf('Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest', $controller);
$request->attributes->set('_controller', array($this, 'controllerMethod1'));
$controller = $resolver->getController($request);
$this->assertSame(array($this, 'controllerMethod1'), $controller);
- $request->attributes->set('_controller', array('Symfony\Component\HttpKernel\Tests\ControllerResolverTest', 'controllerMethod4'));
+ $request->attributes->set('_controller', array('Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest', 'controllerMethod4'));
$controller = $resolver->getController($request);
- $this->assertSame(array('Symfony\Component\HttpKernel\Tests\ControllerResolverTest', 'controllerMethod4'), $controller);
+ $this->assertSame(array('Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest', 'controllerMethod4'), $controller);
- $request->attributes->set('_controller', 'Symfony\Component\HttpKernel\Tests\some_controller_function');
+ $request->attributes->set('_controller', 'Symfony\Component\HttpKernel\Tests\Controller\some_controller_function');
$controller = $resolver->getController($request);
- $this->assertSame('Symfony\Component\HttpKernel\Tests\some_controller_function', $controller);
+ $this->assertSame('Symfony\Component\HttpKernel\Tests\Controller\some_controller_function', $controller);
$request->attributes->set('_controller', 'foo');
try {
@@ -76,7 +70,7 @@ public function testGetController()
$this->assertInstanceOf('\InvalidArgumentException', $e, '->getController() throws an \InvalidArgumentException if the _controller attribute contains a non-existent class');
}
- $request->attributes->set('_controller', 'Symfony\Component\HttpKernel\Tests\ControllerResolverTest::bar');
+ $request->attributes->set('_controller', 'Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest::bar');
try {
$resolver->getController($request);
$this->fail('->getController() throws an \InvalidArgumentException if the _controller attribute contains a non-existent method');
@@ -126,7 +120,7 @@ public function testGetArguments()
$request = Request::create('/');
$request->attributes->set('foo', 'foo');
$request->attributes->set('foobar', 'foobar');
- $controller = 'Symfony\Component\HttpKernel\Tests\some_controller_function';
+ $controller = 'Symfony\Component\HttpKernel\Tests\Controller\some_controller_function';
$this->assertEquals(array('foo', 'foobar'), $resolver->getArguments($request, $controller));
$request = Request::create('/');
@@ -153,7 +147,7 @@ public function testGetArguments()
public function testCreateControllerCanReturnAnyCallable()
{
$mock = $this->getMock('Symfony\Component\HttpKernel\Controller\ControllerResolver', array('createController'));
- $mock->expects($this->once())->method('createController')->will($this->returnValue('Symfony\Component\HttpKernel\Tests\some_controller_function'));
+ $mock->expects($this->once())->method('createController')->will($this->returnValue('Symfony\Component\HttpKernel\Tests\Controller\some_controller_function'));
$request = Request::create('/');
$request->attributes->set('_controller', 'foobar');
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
index 192c808..0c73961 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
@@ -19,13 +19,6 @@
class ConfigDataCollectorTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testCollect()
{
$kernel = new KernelForTest('test', true);
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php
index 54a8aab..ebea3ea 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php
@@ -18,13 +18,6 @@
class ExceptionDataCollectorTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testCollect()
{
$e = new \Exception('foo',500);
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
index ea82d9d..7cd4d06 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
@@ -13,18 +13,9 @@
use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector;
use Symfony\Component\HttpKernel\Debug\ErrorHandler;
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpFoundation\Response;
class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
/**
* @dataProvider getCollectTestData
*/
@@ -35,7 +26,7 @@ public function testCollect($nb, $logs, $expectedLogs, $expectedDeprecationCount
$logger->expects($this->exactly(2))->method('getLogs')->will($this->returnValue($logs));
$c = new LoggerDataCollector($logger);
- $c->collect(new Request(), new Response());
+ $c->lateCollect();
$this->assertSame('logger', $c->getName());
$this->assertSame($nb, $c->countErrors());
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php
index 607a580..340b428 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php
@@ -17,13 +17,6 @@
class MemoryDataCollectorTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testCollect()
{
$collector = new MemoryDataCollector();
@@ -56,6 +49,7 @@ public function getBytesConversionTestData()
array('010', 8),
array('+0x10 k', 16 * 1024),
array('1g', 1024 * 1024 * 1024),
+ array('1G', 1024 * 1024 * 1024),
array('-1', -1),
array('0', 0),
array('2mk', 2048), // the unit must be the last char, so in this case 'k', not 'm'
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
index 8c14604..bb80781 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
@@ -22,13 +22,6 @@
class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
/**
* @dataProvider provider
*/
@@ -38,21 +31,23 @@ public function testCollect(Request $request, Response $response)
$c->collect($request, $response);
- $this->assertSame('request',$c->getName());
- $this->assertInstanceOf('Symfony\Component\HttpFoundation\HeaderBag',$c->getRequestHeaders());
- $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag',$c->getRequestServer());
- $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag',$c->getRequestCookies());
- $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag',$c->getRequestAttributes());
- $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag',$c->getRequestRequest());
- $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag',$c->getRequestQuery());
- $this->assertEquals('html',$c->getFormat());
- $this->assertEquals(array(),$c->getSessionAttributes());
- $this->assertEquals('en',$c->getLocale());
-
- $this->assertInstanceOf('Symfony\Component\HttpFoundation\HeaderBag',$c->getResponseHeaders());
- $this->assertEquals('OK',$c->getStatusText());
- $this->assertEquals(200,$c->getStatusCode());
- $this->assertEquals('application/json',$c->getContentType());
+ $this->assertSame('request', $c->getName());
+ $this->assertInstanceOf('Symfony\Component\HttpFoundation\HeaderBag', $c->getRequestHeaders());
+ $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag', $c->getRequestServer());
+ $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag', $c->getRequestCookies());
+ $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag', $c->getRequestAttributes());
+ $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag', $c->getRequestRequest());
+ $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag', $c->getRequestQuery());
+ $this->assertSame('html', $c->getFormat());
+ $this->assertSame('foobar', $c->getRoute());
+ $this->assertSame(array('name' => 'foo'), $c->getRouteParams());
+ $this->assertSame(array(), $c->getSessionAttributes());
+ $this->assertSame('en', $c->getLocale());
+
+ $this->assertInstanceOf('Symfony\Component\HttpFoundation\HeaderBag', $c->getResponseHeaders());
+ $this->assertSame('OK', $c->getStatusText());
+ $this->assertSame(200, $c->getStatusCode());
+ $this->assertSame('application/json', $c->getContentType());
}
/**
@@ -80,7 +75,7 @@ public function testControllerInspection(Request $request, Response $response)
array(
'Closure',
- function() { return 'foo'; },
+ function () { return 'foo'; },
array(
'class' => __NAMESPACE__.'\{closure}',
'method' => null,
@@ -145,7 +140,7 @@ function() { return 'foo'; },
foreach ($controllerTests as $controllerTest) {
$this->injectController($c, $controllerTest[1], $request);
$c->collect($request, $response);
- $this->assertEquals($controllerTest[2], $c->getController(), sprintf('Testing: %s', $controllerTest[0]));
+ $this->assertSame($controllerTest[2], $c->getController(), sprintf('Testing: %s', $controllerTest[0]));
}
}
@@ -157,6 +152,8 @@ public function provider()
$request = Request::create('http://test.com/foo?bar=baz');
$request->attributes->set('foo', 'bar');
+ $request->attributes->set('_route', 'foobar');
+ $request->attributes->set('_route_params', array('name' => 'foo'));
$response = new Response();
$response->setStatusCode(200);
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php
index 13abb67..b5d64bf 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php
@@ -17,16 +17,9 @@
class TimeDataCollectorTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testCollect()
{
- $c = new TimeDataCollector;
+ $c = new TimeDataCollector();
$request = new Request();
$request->server->set('REQUEST_TIME', 1);
@@ -42,7 +35,7 @@ public function testCollect()
$this->assertEquals(2000, $c->getStartTime());
$request = new Request();
- $c->collect($request, new Response);
+ $c->collect($request, new Response());
$this->assertEquals(0, $c->getStartTime());
$kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php
index a5f507c..d30837d 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php
@@ -22,17 +22,6 @@
class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
-
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testAddRemoveListener()
{
$dispatcher = new EventDispatcher();
@@ -159,6 +148,22 @@ public function testDispatchNested()
$dispatcher->dispatch('foo');
}
+ public function testDispatchReusedEventNested()
+ {
+ $nestedCall = false;
+ $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
+ $dispatcher->addListener('foo', function (Event $e) use ($dispatcher) {
+ $dispatcher->dispatch('bar', $e);
+ });
+ $dispatcher->addListener('bar', function (Event $e) use (&$nestedCall) {
+ $nestedCall = true;
+ });
+
+ $this->assertFalse($nestedCall);
+ $dispatcher->dispatch('foo');
+ $this->assertTrue($nestedCall);
+ }
+
public function testStopwatchSections()
{
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), $stopwatch = new Stopwatch());
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php
index 61372cd..83182e6 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php
@@ -13,27 +13,13 @@
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\EventDispatcher\EventDispatcher;
class ContainerAwareHttpKernelTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
- $this->markTestSkipped('The "DependencyInjection" component is not available');
- }
-
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
-
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
/**
* @dataProvider getProviderTypes
*/
@@ -41,59 +27,49 @@ public function testHandle($type)
{
$request = new Request();
$expected = new Response();
+ $controller = function () use ($expected) {
+ return $expected;
+ };
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
- $container
- ->expects($this->once())
- ->method('enterScope')
- ->with($this->equalTo('request'))
- ;
- $container
- ->expects($this->once())
- ->method('leaveScope')
- ->with($this->equalTo('request'))
- ;
- $container
- ->expects($this->at(0))
- ->method('hasScope')
- ->with($this->equalTo('request'))
- ->will($this->returnValue(false));
- $container
- ->expects($this->at(1))
- ->method('addScope')
- ->with($this->isInstanceOf('Symfony\Component\DependencyInjection\Scope'));
- // enterScope()
- $container
- ->expects($this->at(3))
- ->method('set')
- ->with($this->equalTo('request'), $this->equalTo($request), $this->equalTo('request'))
- ;
- $container
- ->expects($this->at(4))
- ->method('set')
- ->with($this->equalTo('request'), $this->equalTo(null), $this->equalTo('request'))
+ $this
+ ->expectsEnterScopeOnce($container)
+ ->expectsLeaveScopeOnce($container)
+ ->expectsSetRequestWithAt($container, $request, 3)
+ ->expectsSetRequestWithAt($container, null, 4)
;
$dispatcher = new EventDispatcher();
- $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
- $kernel = new ContainerAwareHttpKernel($dispatcher, $container, $resolver);
+ $resolver = $this->getResolverMockFor($controller, $request);
+ $stack = new RequestStack();
+ $kernel = new ContainerAwareHttpKernel($dispatcher, $container, $resolver, $stack);
+
+ $actual = $kernel->handle($request, $type);
- $controller = function() use ($expected) {
+ $this->assertSame($expected, $actual, '->handle() returns the response');
+ }
+
+ /**
+ * @dataProvider getProviderTypes
+ */
+ public function testVerifyRequestStackPushPopDuringHandle($type)
+ {
+ $request = new Request();
+ $expected = new Response();
+ $controller = function () use ($expected) {
return $expected;
};
- $resolver->expects($this->once())
- ->method('getController')
- ->with($request)
- ->will($this->returnValue($controller));
- $resolver->expects($this->once())
- ->method('getArguments')
- ->with($request, $controller)
- ->will($this->returnValue(array()));
+ $stack = $this->getMock('Symfony\Component\HttpFoundation\RequestStack', array('push', 'pop'));
+ $stack->expects($this->at(0))->method('push')->with($this->equalTo($request));
+ $stack->expects($this->at(1))->method('pop');
- $actual = $kernel->handle($request, $type);
+ $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $dispatcher = new EventDispatcher();
+ $resolver = $this->getResolverMockFor($controller, $request);
+ $kernel = new ContainerAwareHttpKernel($dispatcher, $container, $resolver, $stack);
- $this->assertSame($expected, $actual, '->handle() returns the response');
+ $kernel->handle($request, $type);
}
/**
@@ -103,51 +79,23 @@ public function testHandleRestoresThePreviousRequestOnException($type)
{
$request = new Request();
$expected = new \Exception();
+ $controller = function () use ($expected) {
+ throw $expected;
+ };
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
- $container
- ->expects($this->once())
- ->method('enterScope')
- ->with($this->equalTo('request'))
- ;
- $container
- ->expects($this->once())
- ->method('leaveScope')
- ->with($this->equalTo('request'))
- ;
- $container
- ->expects($this->at(0))
- ->method('hasScope')
- ->with($this->equalTo('request'))
- ->will($this->returnValue(true));
- // enterScope()
- $container
- ->expects($this->at(2))
- ->method('set')
- ->with($this->equalTo('request'), $this->equalTo($request), $this->equalTo('request'))
- ;
- $container
- ->expects($this->at(3))
- ->method('set')
- ->with($this->equalTo('request'), $this->equalTo(null), $this->equalTo('request'))
+ $this
+ ->expectsEnterScopeOnce($container)
+ ->expectsLeaveScopeOnce($container)
+ ->expectsSetRequestWithAt($container, $request, 3)
+ ->expectsSetRequestWithAt($container, null, 4)
;
$dispatcher = new EventDispatcher();
$resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
- $kernel = new ContainerAwareHttpKernel($dispatcher, $container, $resolver);
-
- $controller = function() use ($expected) {
- throw $expected;
- };
-
- $resolver->expects($this->once())
- ->method('getController')
- ->with($request)
- ->will($this->returnValue($controller));
- $resolver->expects($this->once())
- ->method('getArguments')
- ->with($request, $controller)
- ->will($this->returnValue(array()));
+ $resolver = $this->getResolverMockFor($controller, $request);
+ $stack = new RequestStack();
+ $kernel = new ContainerAwareHttpKernel($dispatcher, $container, $resolver, $stack);
try {
$kernel->handle($request, $type);
@@ -166,4 +114,52 @@ public function getProviderTypes()
array(HttpKernelInterface::SUB_REQUEST),
);
}
+
+ private function getResolverMockFor($controller, $request)
+ {
+ $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
+ $resolver->expects($this->once())
+ ->method('getController')
+ ->with($request)
+ ->will($this->returnValue($controller));
+ $resolver->expects($this->once())
+ ->method('getArguments')
+ ->with($request, $controller)
+ ->will($this->returnValue(array()));
+
+ return $resolver;
+ }
+
+ private function expectsSetRequestWithAt($container, $with, $at)
+ {
+ $container
+ ->expects($this->at($at))
+ ->method('set')
+ ->with($this->equalTo('request'), $this->equalTo($with), $this->equalTo('request'))
+ ;
+
+ return $this;
+ }
+
+ private function expectsEnterScopeOnce($container)
+ {
+ $container
+ ->expects($this->once())
+ ->method('enterScope')
+ ->with($this->equalTo('request'))
+ ;
+
+ return $this;
+ }
+
+ private function expectsLeaveScopeOnce($container)
+ {
+ $container
+ ->expects($this->once())
+ ->method('leaveScope')
+ ->with($this->equalTo('request'))
+ ;
+
+ return $this;
+ }
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php
index 0800758..0df6a45 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php
@@ -9,23 +9,12 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests;
+namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
- $this->markTestSkipped('The "DependencyInjection" component is not available');
- }
-
- if (!class_exists('Symfony\Component\Config\FileLocator')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
- }
-
public function testAutoloadMainExtension()
{
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerBuilder');
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterListenersPassTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterListenersPassTest.php
index d1e825a..b82053e 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterListenersPassTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterListenersPassTest.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass;
class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase
@@ -32,6 +31,9 @@ public function testEventSubscriberWithoutInterface()
$definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
$definition->expects($this->atLeastOnce())
+ ->method('isPublic')
+ ->will($this->returnValue(true));
+ $definition->expects($this->atLeastOnce())
->method('getClass')
->will($this->returnValue('stdClass'));
@@ -61,6 +63,9 @@ public function testValidEventSubscriber()
$definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
$definition->expects($this->atLeastOnce())
+ ->method('isPublic')
+ ->will($this->returnValue(true));
+ $definition->expects($this->atLeastOnce())
->method('getClass')
->will($this->returnValue('Symfony\Component\HttpKernel\Tests\DependencyInjection\SubscriberService'));
@@ -78,9 +83,55 @@ public function testValidEventSubscriber()
->method('getDefinition')
->will($this->returnValue($definition));
+ $builder->expects($this->atLeastOnce())
+ ->method('findDefinition')
+ ->will($this->returnValue($definition));
+
$registerListenersPass = new RegisterListenersPass();
$registerListenersPass->process($builder);
}
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The service "foo" must be public as event listeners are lazy-loaded.
+ */
+ public function testPrivateEventListener()
+ {
+ $container = new ContainerBuilder();
+ $container->register('foo', 'stdClass')->setPublic(false)->addTag('kernel.event_listener', array());
+ $container->register('event_dispatcher', 'stdClass');
+
+ $registerListenersPass = new RegisterListenersPass();
+ $registerListenersPass->process($container);
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The service "foo" must be public as event subscribers are lazy-loaded.
+ */
+ public function testPrivateEventSubscriber()
+ {
+ $container = new ContainerBuilder();
+ $container->register('foo', 'stdClass')->setPublic(false)->addTag('kernel.event_subscriber', array());
+ $container->register('event_dispatcher', 'stdClass');
+
+ $registerListenersPass = new RegisterListenersPass();
+ $registerListenersPass->process($container);
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The service "foo" must not be abstract as event listeners are lazy-loaded.
+ */
+ public function testAbstractEventListener()
+ {
+ $container = new ContainerBuilder();
+ $container->register('foo', 'stdClass')->setAbstract(true)->addTag('kernel.event_listener', array());
+ $container->register('event_dispatcher', 'stdClass');
+
+ $registerListenersPass = new RegisterListenersPass();
+ $registerListenersPass->process($container);
+ }
}
class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php
index 2eddc57..56f6853 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php
@@ -22,13 +22,6 @@
class EsiListenerTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
- }
-
public function testFilterDoesNothingForSubRequests()
{
$dispatcher = new EventDispatcher();
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php
index c6a0128..30e8c74 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php
@@ -26,17 +26,6 @@
*/
class ExceptionListenerTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
-
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testConstruct()
{
$logger = new TestLogger();
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/FragmentListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/FragmentListenerTest.php
index 153d8a4..ec9360a 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/FragmentListenerTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/FragmentListenerTest.php
@@ -19,13 +19,6 @@
class FragmentListenerTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
- }
-
public function testOnlyTriggeredOnFragmentRoute()
{
$request = Request::create('http://example.com/foo?_path=foo%3Dbar%26_controller%3Dfoo');
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php
index e5e4e3a..d128753 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php
@@ -11,23 +11,24 @@
namespace Symfony\Component\HttpKernel\Tests\EventListener;
-use Symfony\Component\HttpKernel\EventListener\LocaleListener;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\EventListener\LocaleListener;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
class LocaleListenerTest extends \PHPUnit_Framework_TestCase
{
+ private $requestStack;
+
protected function setUp()
{
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
+ $this->requestStack = $this->getMock('Symfony\Component\HttpFoundation\RequestStack', array(), array(), '', false);
}
public function testDefaultLocaleWithoutSession()
{
- $listener = new LocaleListener('fr');
+ $listener = new LocaleListener('fr', null, $this->requestStack);
$event = $this->getEvent($request = Request::create('/'));
$listener->onKernelRequest($event);
@@ -41,7 +42,7 @@ public function testLocaleFromRequestAttribute()
$request->cookies->set('foo', 'value');
$request->attributes->set('_locale', 'es');
- $listener = new LocaleListener('fr');
+ $listener = new LocaleListener('fr', null, $this->requestStack);
$event = $this->getEvent($request);
$listener->onKernelRequest($event);
@@ -50,6 +51,22 @@ public function testLocaleFromRequestAttribute()
public function testLocaleSetForRoutingContext()
{
+ // the request context is updated
+ $context = $this->getMock('Symfony\Component\Routing\RequestContext');
+ $context->expects($this->once())->method('setParameter')->with('_locale', 'es');
+
+ $router = $this->getMock('Symfony\Component\Routing\Router', array('getContext'), array(), '', false);
+ $router->expects($this->once())->method('getContext')->will($this->returnValue($context));
+
+ $request = Request::create('/');
+
+ $request->attributes->set('_locale', 'es');
+ $listener = new LocaleListener('fr', $router, $this->requestStack);
+ $listener->onKernelRequest($this->getEvent($request));
+ }
+
+ public function testRouterResetWithParentRequestOnKernelFinishRequest()
+ {
if (!class_exists('Symfony\Component\Routing\Router')) {
$this->markTestSkipped('The "Routing" component is not available');
}
@@ -61,18 +78,22 @@ public function testLocaleSetForRoutingContext()
$router = $this->getMock('Symfony\Component\Routing\Router', array('getContext'), array(), '', false);
$router->expects($this->once())->method('getContext')->will($this->returnValue($context));
- $request = Request::create('/');
+ $parentRequest = Request::create('/');
+ $parentRequest->setLocale('es');
- $request->attributes->set('_locale', 'es');
- $listener = new LocaleListener('fr', $router);
- $listener->onKernelRequest($this->getEvent($request));
+ $this->requestStack->expects($this->once())->method('getParentRequest')->will($this->returnValue($parentRequest));
+
+ $event = $this->getMock('Symfony\Component\HttpKernel\Event\FinishRequestEvent', array(), array(), '', false);
+
+ $listener = new LocaleListener('fr', $router, $this->requestStack);
+ $listener->onKernelFinishRequest($event);
}
public function testRequestLocaleIsNotOverridden()
{
$request = Request::create('/');
$request->setLocale('de');
- $listener = new LocaleListener('fr');
+ $listener = new LocaleListener('fr', null, $this->requestStack);
$event = $this->getEvent($request);
$listener->onKernelRequest($event);
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ProfilerListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ProfilerListenerTest.php
new file mode 100644
index 0000000..772dfd0
--- /dev/null
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ProfilerListenerTest.php
@@ -0,0 +1,55 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\Tests\EventListener;
+
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\PostResponseEvent;
+use Symfony\Component\HttpKernel\EventListener\ProfilerListener;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Kernel;
+
+class ProfilerListenerTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test to ensure BC without RequestStack
+ *
+ * @deprecated Deprecated since version 2.4, to be removed in 3.0.
+ */
+ public function testEventsWithoutRequestStack()
+ {
+ $profile = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profile')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $profiler = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profiler')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $profiler->expects($this->once())
+ ->method('collect')
+ ->will($this->returnValue($profile));
+
+ $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
+
+ $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $response = $this->getMockBuilder('Symfony\Component\HttpFoundation\Response')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $listener = new ProfilerListener($profiler);
+ $listener->onKernelRequest(new GetResponseEvent($kernel, $request, Kernel::MASTER_REQUEST));
+ $listener->onKernelResponse(new FilterResponseEvent($kernel, $request, Kernel::MASTER_REQUEST, $response));
+ $listener->onKernelTerminate(new PostResponseEvent($kernel, $request, $response));
+ }
+}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php
index 3f8e852..2698f8e 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php
@@ -27,10 +27,6 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
-
$this->dispatcher = new EventDispatcher();
$listener = new ResponseListener('UTF-8');
$this->dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'));
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
index 3ba56a8..ac742b3 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
@@ -11,23 +11,20 @@
namespace Symfony\Component\HttpKernel\Tests\EventListener;
-use Symfony\Component\HttpKernel\EventListener\RouterListener;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\EventListener\RouterListener;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Routing\RequestContext;
class RouterListenerTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
+ private $requestStack;
- if (!class_exists('Symfony\Component\Routing\Router')) {
- $this->markTestSkipped('The "Routing" component is not available');
- }
+ public function setUp()
+ {
+ $this->requestStack = $this->getMock('Symfony\Component\HttpFoundation\RequestStack', array(), array(), '', false);
}
/**
@@ -45,7 +42,7 @@ public function testPort($defaultHttpPort, $defaultHttpsPort, $uri, $expectedHtt
->method('getContext')
->will($this->returnValue($context));
- $listener = new RouterListener($urlMatcher);
+ $listener = new RouterListener($urlMatcher, null, null, $this->requestStack);
$event = $this->createGetResponseEventForUri($uri);
$listener->onKernelRequest($event);
@@ -83,7 +80,7 @@ private function createGetResponseEventForUri($uri)
*/
public function testInvalidMatcher()
{
- new RouterListener(new \stdClass());
+ new RouterListener(new \stdClass(), null, null, $this->requestStack);
}
public function testRequestMatcher()
@@ -98,7 +95,7 @@ public function testRequestMatcher()
->with($this->isInstanceOf('Symfony\Component\HttpFoundation\Request'))
->will($this->returnValue(array()));
- $listener = new RouterListener($requestMatcher, new RequestContext());
+ $listener = new RouterListener($requestMatcher, new RequestContext(), null, $this->requestStack);
$listener->onKernelRequest($event);
}
@@ -119,7 +116,7 @@ public function testSubRequestWithDifferentMethod()
->method('getContext')
->will($this->returnValue($context));
- $listener = new RouterListener($requestMatcher, new RequestContext());
+ $listener = new RouterListener($requestMatcher, new RequestContext(), null, $this->requestStack);
$listener->onKernelRequest($event);
// sub-request with another HTTP method
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php
new file mode 100644
index 0000000..907c203
--- /dev/null
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php
@@ -0,0 +1,132 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\Tests\EventListener;
+
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
+
+/**
+ * SessionListenerTest.
+ *
+ * Tests SessionListener.
+ *
+ * @author Bulat Shakirzyanov
+ */
+class TestSessionListenerTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var TestSessionListener
+ */
+ private $listener;
+
+ /**
+ * @var SessionInterface
+ */
+ private $session;
+
+ protected function setUp()
+ {
+ $this->listener = $this->getMockForAbstractClass('Symfony\Component\HttpKernel\EventListener\TestSessionListener');
+ $this->session = $this->getSession();
+ }
+
+ public function testShouldSaveMasterRequestSession()
+ {
+ $this->sessionHasBeenStarted();
+ $this->sessionMustBeSaved();
+
+ $this->filterResponse(new Request());
+ }
+
+ public function testShouldNotSaveSubRequestSession()
+ {
+ $this->sessionMustNotBeSaved();
+
+ $this->filterResponse(new Request(), HttpKernelInterface::SUB_REQUEST);
+ }
+
+ public function testDoesNotDeleteCookieIfUsingSessionLifetime()
+ {
+ $this->sessionHasBeenStarted();
+
+ $params = session_get_cookie_params();
+ session_set_cookie_params(0, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
+
+ $response = $this->filterResponse(new Request(), HttpKernelInterface::MASTER_REQUEST);
+ $cookies = $response->headers->getCookies();
+
+ $this->assertEquals(0, reset($cookies)->getExpiresTime());
+ }
+
+ public function testUnstartedSessionIsNotSave()
+ {
+ $this->sessionHasNotBeenStarted();
+ $this->sessionMustNotBeSaved();
+
+ $this->filterResponse(new Request());
+ }
+
+ private function filterResponse(Request $request, $type = HttpKernelInterface::MASTER_REQUEST)
+ {
+ $request->setSession($this->session);
+ $response = new Response();
+ $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
+ $event = new FilterResponseEvent($kernel, $request, $type, $response);
+
+ $this->listener->onKernelResponse($event);
+
+ $this->assertSame($response, $event->getResponse());
+
+ return $response;
+ }
+
+ private function sessionMustNotBeSaved()
+ {
+ $this->session->expects($this->never())
+ ->method('save');
+ }
+
+ private function sessionMustBeSaved()
+ {
+ $this->session->expects($this->once())
+ ->method('save');
+ }
+
+ private function sessionHasBeenStarted()
+ {
+ $this->session->expects($this->once())
+ ->method('isStarted')
+ ->will($this->returnValue(true));
+ }
+
+ private function sessionHasNotBeenStarted()
+ {
+ $this->session->expects($this->once())
+ ->method('isStarted')
+ ->will($this->returnValue(false));
+ }
+
+ private function getSession()
+ {
+ $mock = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Session')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ // set return value for getName()
+ $mock->expects($this->any())->method('getName')->will($this->returnValue('MOCKSESSID'));
+
+ return $mock;
+ }
+}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php
index e24daef..5fd61bb 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php
@@ -23,32 +23,15 @@ public function getBundleMap()
public function registerBundles()
{
- }
-
- public function init()
- {
- }
-
- public function registerBundleDirs()
- {
+ return array();
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
}
- public function initializeBundles()
- {
- parent::initializeBundles();
- }
-
public function isBooted()
{
return $this->booted;
}
-
- public function setIsBooted($value)
- {
- $this->booted = (Boolean) $value;
- }
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php
index 5bbfdac..8acf45d 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Tests\Fragment\FragmentRenderer;
+namespace Symfony\Component\HttpKernel\Tests\Fragment;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
use Symfony\Component\HttpKernel\Fragment\EsiFragmentRenderer;
@@ -18,13 +18,6 @@
class EsiFragmentRendererTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testRenderFallbackToInlineStrategyIfNoRequest()
{
$strategy = new EsiFragmentRenderer(new Esi(), $this->getInlineStrategy(true));
@@ -48,7 +41,7 @@ public function testRender()
$this->assertEquals('', $strategy->render('/', $request)->getContent());
$this->assertEquals("\n", $strategy->render('/', $request, array('comment' => 'This is a comment'))->getContent());
$this->assertEquals('', $strategy->render('/', $request, array('alt' => 'foo'))->getContent());
- $this->assertEquals('', $strategy->render(new ControllerReference('main_controller', array(), array()), $request, array('alt' => new ControllerReference('alt_controller', array(), array())))->getContent());
+ $this->assertEquals('', $strategy->render(new ControllerReference('main_controller', array(), array()), $request, array('alt' => new ControllerReference('alt_controller', array(), array())))->getContent());
}
private function getInlineStrategy($called = false)
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php
index cec8ae9..1893d85 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php
@@ -17,17 +17,32 @@
class FragmentHandlerTest extends \PHPUnit_Framework_TestCase
{
+ private $requestStack;
+
+ public function setUp()
+ {
+ $this->requestStack = $this->getMockBuilder('Symfony\\Component\\HttpFoundation\\RequestStack')
+ ->disableOriginalConstructor()
+ ->getMock()
+ ;
+ $this->requestStack
+ ->expects($this->any())
+ ->method('getCurrentRequest')
+ ->will($this->returnValue(Request::create('/')))
+ ;
+ }
+
/**
* @expectedException \InvalidArgumentException
*/
public function testRenderWhenRendererDoesNotExist()
{
- $handler = new FragmentHandler();
+ $handler = new FragmentHandler(array(), null, $this->requestStack);
$handler->render('/', 'foo');
}
/**
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
*/
public function testRenderWithUnknownRenderer()
{
@@ -37,7 +52,7 @@ public function testRenderWithUnknownRenderer()
}
/**
- * @expectedException RuntimeException
+ * @expectedException \RuntimeException
* @expectedExceptionMessage Error when rendering "http://localhost/" (Status code is 404).
*/
public function testDeliverWithUnsuccessfulResponse()
@@ -72,9 +87,8 @@ protected function getHandler($returnValue, $arguments = array())
call_user_func_array(array($e, 'with'), $arguments);
}
- $handler = new FragmentHandler();
+ $handler = new FragmentHandler(array(), null, $this->requestStack);
$handler->addRenderer($renderer);
- $handler->setRequest(Request::create('/'));
return $handler;
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php
index 20840f3..2f266db 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Fragment\Tests\FragmentRenderer;
+namespace Symfony\Component\HttpKernel\Tests\Fragment;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
use Symfony\Component\HttpKernel\Fragment\HIncludeFragmentRenderer;
@@ -18,13 +18,6 @@
class HIncludeFragmentRendererTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
/**
* @expectedException \LogicException
*/
@@ -38,7 +31,7 @@ public function testRenderWithControllerAndSigner()
{
$strategy = new HIncludeFragmentRenderer(null, new UriSigner('foo'));
- $this->assertEquals('', $strategy->render(new ControllerReference('main_controller', array(), array()), Request::create('/'))->getContent());
+ $this->assertEquals('', $strategy->render(new ControllerReference('main_controller', array(), array()), Request::create('/'))->getContent());
}
public function testRenderWithUri()
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
index ffc0c0a..c7252c9 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Fragment\Tests\FragmentRenderer;
+namespace Symfony\Component\HttpKernel\Tests\Fragment;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
use Symfony\Component\HttpKernel\HttpKernel;
@@ -21,17 +21,6 @@
class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
-
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testRender()
{
$strategy = new InlineFragmentRenderer($this->getKernel($this->returnValue(new Response('foo'))));
@@ -67,6 +56,24 @@ public function testRenderWithObjectsAsAttributes()
$strategy->render(new ControllerReference('main_controller', array('object' => $object), array()), Request::create('/'));
}
+ public function testRenderWithObjectsAsAttributesPassedAsObjectsInTheController()
+ {
+ $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', array('getController'));
+ $resolver
+ ->expects($this->once())
+ ->method('getController')
+ ->will($this->returnValue(function (\stdClass $object, Bar $object1) {
+ return new Response($object1->getBar());
+ }))
+ ;
+
+ $kernel = new HttpKernel(new EventDispatcher(), $resolver);
+ $renderer = new InlineFragmentRenderer($kernel);
+
+ $response = $renderer->render(new ControllerReference('main_controller', array('object' => new \stdClass(), 'object1' => new Bar()), array()), Request::create('/'));
+ $this->assertEquals('bar', $response->getContent());
+ }
+
public function testRenderWithTrustedHeaderDisabled()
{
$trustedHeaderName = Request::getTrustedHeaderName(Request::HEADER_CLIENT_IP);
@@ -83,7 +90,7 @@ public function testRenderWithTrustedHeaderDisabled()
$strategy = new InlineFragmentRenderer($kernel);
$strategy->render('/', Request::create('/'));
-
+
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, $trustedHeaderName);
}
@@ -197,3 +204,13 @@ public function testESIHeaderIsKeptInSubrequestWithTrustedHeaderDisabled()
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, $trustedHeaderName);
}
}
+
+class Bar
+{
+ public $bar = 'bar';
+
+ public function getBar()
+ {
+ return $this->bar;
+ }
+}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php
index 69385dc..4af3601 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php
@@ -9,11 +9,10 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpKernel\Fragment\Tests\FragmentRenderer;
+namespace Symfony\Component\HttpKernel\Tests\Fragment;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
-use Symfony\Component\HttpKernel\Fragment\RoutableFragmentRenderer;
class RoutableFragmentRendererTest extends \PHPUnit_Framework_TestCase
{
@@ -22,17 +21,26 @@ class RoutableFragmentRendererTest extends \PHPUnit_Framework_TestCase
*/
public function testGenerateFragmentUri($uri, $controller)
{
- $this->assertEquals($uri, $this->getRenderer()->doGenerateFragmentUri($controller, Request::create('/')));
+ $this->assertEquals($uri, $this->callGenerateFragmentUriMethod($controller, Request::create('/')));
+ }
+
+ /**
+ * @dataProvider getGenerateFragmentUriData
+ */
+ public function testGenerateAbsoluteFragmentUri($uri, $controller)
+ {
+ $this->assertEquals('http://localhost'.$uri, $this->callGenerateFragmentUriMethod($controller, Request::create('/'), true));
}
public function getGenerateFragmentUriData()
{
return array(
- array('http://localhost/_fragment?_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array(), array())),
- array('http://localhost/_fragment?_path=_format%3Dxml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array('_format' => 'xml'), array())),
- array('http://localhost/_fragment?_path=foo%3Dfoo%26_format%3Djson%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array('foo' => 'foo', '_format' => 'json'), array())),
- array('http://localhost/_fragment?bar=bar&_path=foo%3Dfoo%26_format%3Dhtml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array('foo' => 'foo'), array('bar' => 'bar'))),
- array('http://localhost/_fragment?foo=foo&_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array(), array('foo' => 'foo'))),
+ array('/_fragment?_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array(), array())),
+ array('/_fragment?_path=_format%3Dxml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array('_format' => 'xml'), array())),
+ array('/_fragment?_path=foo%3Dfoo%26_format%3Djson%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array('foo' => 'foo', '_format' => 'json'), array())),
+ array('/_fragment?bar=bar&_path=foo%3Dfoo%26_format%3Dhtml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array('foo' => 'foo'), array('bar' => 'bar'))),
+ array('/_fragment?foo=foo&_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array(), array('foo' => 'foo'))),
+ array('/_fragment?_path=foo%255B0%255D%3Dfoo%26foo%255B1%255D%3Dbar%26_format%3Dhtml%26_locale%3Den%26_controller%3Dcontroller', new ControllerReference('controller', array('foo' => array('foo', 'bar')), array())),
);
}
@@ -43,22 +51,48 @@ public function testGenerateFragmentUriWithARequest()
$request->setLocale('fr');
$controller = new ControllerReference('controller', array(), array());
- $this->assertEquals('http://localhost/_fragment?_path=_format%3Djson%26_locale%3Dfr%26_controller%3Dcontroller', $this->getRenderer()->doGenerateFragmentUri($controller, $request));
+ $this->assertEquals('/_fragment?_path=_format%3Djson%26_locale%3Dfr%26_controller%3Dcontroller', $this->callGenerateFragmentUriMethod($controller, $request));
+ }
+
+ /**
+ * @expectedException LogicException
+ * @dataProvider getGenerateFragmentUriDataWithNonScalar
+ */
+ public function testGenerateFragmentUriWithNonScalar($controller)
+ {
+ $this->callGenerateFragmentUriMethod($controller, Request::create('/'));
+ }
+
+ public function getGenerateFragmentUriDataWithNonScalar()
+ {
+ return array(
+ array(new ControllerReference('controller', array('foo' => new Foo(), 'bar' => 'bar'), array())),
+ array(new ControllerReference('controller', array('foo' => array('foo' => 'foo'), 'bar' => array('bar' => new Foo())), array())),
+ );
}
- private function getRenderer()
+ private function callGenerateFragmentUriMethod(ControllerReference $reference, Request $request, $absolute = false)
{
- return new Renderer();
+ $renderer = $this->getMockForAbstractClass('Symfony\Component\HttpKernel\Fragment\RoutableFragmentRenderer');
+ $r = new \ReflectionObject($renderer);
+ $m = $r->getMethod('generateFragmentUri');
+ $m->setAccessible(true);
+
+ return $m->invoke($renderer, $reference, $request, $absolute);
}
}
-class Renderer extends RoutableFragmentRenderer
+class Foo
{
- public function render($uri, Request $request, array $options = array()) {}
- public function getName() {}
+ public $foo;
+
+ public function getFoo()
+ {
+ return $this->foo;
+ }
- public function doGenerateFragmentUri(ControllerReference $reference, Request $request)
+ public function doGenerateFragmentUri(ControllerReference $reference, Request $request, $absolute = false, $strict = true)
{
- return parent::generateFragmentUri($reference, $request);
+ return parent::generateFragmentUri($reference, $request, $absolute, $strict);
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php
index 7180da1..c509706 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php
@@ -17,13 +17,6 @@
class EsiTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testHasSurrogateEsiCapability()
{
$esi = new Esi();
@@ -133,7 +126,7 @@ public function testProcessEscapesPhpTags()
}
/**
- * @expectedException RuntimeException
+ * @expectedException \RuntimeException
*/
public function testProcessWhenNoSrcInAnEsi()
{
@@ -173,7 +166,7 @@ public function testHandle()
}
/**
- * @expectedException RuntimeException
+ * @expectedException \RuntimeException
*/
public function testHandleWhenResponseIsNot200()
{
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
index a8064b8..a2b38bd 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
@@ -19,19 +19,8 @@
class HttpCacheTest extends HttpCacheTestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testTerminateDelegatesTerminationOnlyForTerminableInterface()
{
- if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
- $this->markTestSkipped('The "DependencyInjection" component is not available');
- }
-
$storeMock = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpCache\\StoreInterface')
->disableOriginalConstructor()
->getMock();
@@ -634,7 +623,7 @@ public function testFetchesFullResponseWhenCacheStaleAndNoValidatorsPresent()
$r = new \ReflectionObject($this->store);
$m = $r->getMethod('save');
$m->setAccessible(true);
- $m->invoke($this->store, 'md'.sha1('http://localhost/'), serialize($tmp));
+ $m->invoke($this->store, 'md'.hash('sha256', 'http://localhost/'), serialize($tmp));
// build subsequent request; should be found but miss due to freshness
$this->request('GET', '/');
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php
index 4377f61..9a1c7d7 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php
@@ -31,10 +31,6 @@ class HttpCacheTestCase extends \PHPUnit_Framework_TestCase
protected function setUp()
{
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$this->kernel = null;
$this->cache = null;
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php
index 6a3e565..d8cf75f 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php
@@ -23,10 +23,6 @@ class StoreTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$this->request = Request::create('/');
$this->response = new Response('hello world', 200, array());
@@ -93,7 +89,7 @@ public function testSetsTheXContentDigestResponseHeaderBeforeStoring()
$entries = $this->getStoreMetadata($cacheKey);
list ($req, $res) = $entries[0];
- $this->assertEquals('ena94a8fe5ccb19ba61c4c0873d391e987982fbbd3', $res['x-content-digest'][0]);
+ $this->assertEquals('en9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', $res['x-content-digest'][0]);
}
public function testFindsAStoredEntryWithLookup()
@@ -143,7 +139,7 @@ public function testRestoresResponseContentFromEntityStoreWithLookup()
{
$this->storeSimpleEntry();
$response = $this->store->lookup($this->request);
- $this->assertEquals($this->getStorePath('en'.sha1('test')), $response->getContent());
+ $this->assertEquals($this->getStorePath('en'.hash('sha256', 'test')), $response->getContent());
}
public function testInvalidatesMetaAndEntityStoreEntriesWithInvalidate()
@@ -186,9 +182,9 @@ public function testStoresMultipleResponsesForEachVaryCombination()
$res3 = new Response('test 3', 200, array('Vary' => 'Foo Bar'));
$this->store->write($req3, $res3);
- $this->assertEquals($this->getStorePath('en'.sha1('test 3')), $this->store->lookup($req3)->getContent());
- $this->assertEquals($this->getStorePath('en'.sha1('test 2')), $this->store->lookup($req2)->getContent());
- $this->assertEquals($this->getStorePath('en'.sha1('test 1')), $this->store->lookup($req1)->getContent());
+ $this->assertEquals($this->getStorePath('en'.hash('sha256', 'test 3')), $this->store->lookup($req3)->getContent());
+ $this->assertEquals($this->getStorePath('en'.hash('sha256', 'test 2')), $this->store->lookup($req2)->getContent());
+ $this->assertEquals($this->getStorePath('en'.hash('sha256', 'test 1')), $this->store->lookup($req1)->getContent());
$this->assertCount(3, $this->getStoreMetadata($key));
}
@@ -198,17 +194,17 @@ public function testOverwritesNonVaryingResponseWithStore()
$req1 = Request::create('/test', 'get', array(), array(), array(), array('HTTP_FOO' => 'Foo', 'HTTP_BAR' => 'Bar'));
$res1 = new Response('test 1', 200, array('Vary' => 'Foo Bar'));
$key = $this->store->write($req1, $res1);
- $this->assertEquals($this->getStorePath('en'.sha1('test 1')), $this->store->lookup($req1)->getContent());
+ $this->assertEquals($this->getStorePath('en'.hash('sha256', 'test 1')), $this->store->lookup($req1)->getContent());
$req2 = Request::create('/test', 'get', array(), array(), array(), array('HTTP_FOO' => 'Bling', 'HTTP_BAR' => 'Bam'));
$res2 = new Response('test 2', 200, array('Vary' => 'Foo Bar'));
$this->store->write($req2, $res2);
- $this->assertEquals($this->getStorePath('en'.sha1('test 2')), $this->store->lookup($req2)->getContent());
+ $this->assertEquals($this->getStorePath('en'.hash('sha256', 'test 2')), $this->store->lookup($req2)->getContent());
$req3 = Request::create('/test', 'get', array(), array(), array(), array('HTTP_FOO' => 'Foo', 'HTTP_BAR' => 'Bar'));
$res3 = new Response('test 3', 200, array('Vary' => 'Foo Bar'));
$key = $this->store->write($req3, $res3);
- $this->assertEquals($this->getStorePath('en'.sha1('test 3')), $this->store->lookup($req3)->getContent());
+ $this->assertEquals($this->getStorePath('en'.hash('sha256', 'test 3')), $this->store->lookup($req3)->getContent());
$this->assertCount(2, $this->getStoreMetadata($key));
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php
index cf23d7b..da8c34c 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php
@@ -23,9 +23,9 @@ class TestHttpKernel extends HttpKernel implements ControllerResolverInterface
protected $body;
protected $status;
protected $headers;
- protected $called;
+ protected $called = false;
protected $customizer;
- protected $catch;
+ protected $catch = false;
protected $backendRequest;
public function __construct($body, $status, $headers, \Closure $customizer = null)
@@ -34,8 +34,6 @@ public function __construct($body, $status, $headers, \Closure $customizer = nul
$this->status = $status;
$this->headers = $headers;
$this->customizer = $customizer;
- $this->called = false;
- $this->catch = false;
parent::__construct(new EventDispatcher(), $this);
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php
index 6dd3d9e..89ef406 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php
@@ -20,20 +20,14 @@
class TestMultipleHttpKernel extends HttpKernel implements ControllerResolverInterface
{
- protected $bodies;
- protected $statuses;
- protected $headers;
- protected $catch;
- protected $call;
+ protected $bodies = array();
+ protected $statuses = array();
+ protected $headers = array();
+ protected $call = false;
protected $backendRequest;
public function __construct($responses)
{
- $this->bodies = array();
- $this->statuses = array();
- $this->headers = array();
- $this->call = false;
-
foreach ($responses as $response) {
$this->bodies[] = $response['body'];
$this->statuses[] = $response['status'];
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php
index 367e3e2..700b111 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php
@@ -23,19 +23,8 @@
class HttpKernelTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
- $this->markTestSkipped('The "EventDispatcher" component is not available');
- }
-
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
/**
- * @expectedException RuntimeException
+ * @expectedException \RuntimeException
*/
public function testHandleWhenControllerThrowsAnExceptionAndRawIsTrue()
{
@@ -45,7 +34,7 @@ public function testHandleWhenControllerThrowsAnExceptionAndRawIsTrue()
}
/**
- * @expectedException RuntimeException
+ * @expectedException \RuntimeException
*/
public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalseAndNoListenerIsRegistered()
{
@@ -147,7 +136,7 @@ public function testHandleWhenNoControllerIsFound()
}
/**
- * @expectedException LogicException
+ * @expectedException \LogicException
*/
public function testHandleWhenTheControllerIsNotACallable()
{
@@ -199,7 +188,7 @@ public function testHandleWhenTheControllerIsAStaticArray()
}
/**
- * @expectedException LogicException
+ * @expectedException \LogicException
*/
public function testHandleWhenTheControllerDoesNotReturnAResponse()
{
@@ -249,10 +238,24 @@ public function testTerminate()
$this->assertEquals($response, $capturedResponse);
}
+ public function testVerifyRequestStackPushPopDuringHandle()
+ {
+ $request = new Request();
+
+ $stack = $this->getMock('Symfony\Component\HttpFoundation\RequestStack', array('push', 'pop'));
+ $stack->expects($this->at(0))->method('push')->with($this->equalTo($request));
+ $stack->expects($this->at(1))->method('pop');
+
+ $dispatcher = new EventDispatcher();
+ $kernel = new HttpKernel($dispatcher, $this->getResolver(), $stack);
+
+ $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST);
+ }
+
protected function getResolver($controller = null)
{
if (null === $controller) {
- $controller = function() { return new Response('Hello'); };
+ $controller = function () { return new Response('Hello'); };
}
$resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php
index b36f909..f4aba74 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\Tests;
use Symfony\Component\HttpKernel\Kernel;
-use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -22,13 +21,6 @@
class KernelTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\DependencyInjection\Container')) {
- $this->markTestSkipped('The "DependencyInjection" component is not available');
- }
- }
-
public function testConstructor()
{
$env = 'test_env';
@@ -59,33 +51,22 @@ public function testClone()
public function testBootInitializesBundlesAndContainer()
{
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('initializeBundles', 'initializeContainer', 'getBundles'))
- ->getMock();
+ $kernel = $this->getKernel(array('initializeBundles', 'initializeContainer'));
$kernel->expects($this->once())
->method('initializeBundles');
$kernel->expects($this->once())
->method('initializeContainer');
- $kernel->expects($this->once())
- ->method('getBundles')
- ->will($this->returnValue(array()));
$kernel->boot();
}
public function testBootSetsTheContainerToTheBundles()
{
- $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\Bundle')
- ->disableOriginalConstructor()
- ->getMock();
+ $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\Bundle');
$bundle->expects($this->once())
->method('setContainer');
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('initializeBundles', 'initializeContainer', 'getBundles'))
- ->getMock();
+ $kernel = $this->getKernel(array('initializeBundles', 'initializeContainer', 'getBundles'));
$kernel->expects($this->once())
->method('getBundles')
->will($this->returnValue(array($bundle)));
@@ -95,13 +76,11 @@ public function testBootSetsTheContainerToTheBundles()
public function testBootSetsTheBootedFlagToTrue()
{
+ // use test kernel to access isBooted()
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('initializeBundles', 'initializeContainer', 'getBundles'))
+ ->setConstructorArgs(array('test', false))
+ ->setMethods(array('initializeBundles', 'initializeContainer'))
->getMock();
- $kernel->expects($this->once())
- ->method('getBundles')
- ->will($this->returnValue(array()));
$kernel->boot();
@@ -110,14 +89,8 @@ public function testBootSetsTheBootedFlagToTrue()
public function testClassCacheIsLoaded()
{
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('initializeBundles', 'initializeContainer', 'getBundles', 'doLoadClassCache'))
- ->getMock();
+ $kernel = $this->getKernel(array('initializeBundles', 'initializeContainer', 'doLoadClassCache'));
$kernel->loadClassCache('name', '.extension');
- $kernel->expects($this->any())
- ->method('getBundles')
- ->will($this->returnValue(array()));
$kernel->expects($this->once())
->method('doLoadClassCache')
->with('name', '.extension');
@@ -127,13 +100,7 @@ public function testClassCacheIsLoaded()
public function testClassCacheIsNotLoadedByDefault()
{
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('initializeBundles', 'initializeContainer', 'getBundles', 'doLoadClassCache'))
- ->getMock();
- $kernel->expects($this->any())
- ->method('getBundles')
- ->will($this->returnValue(array()));
+ $kernel = $this->getKernel(array('initializeBundles', 'initializeContainer'));
$kernel->expects($this->never())
->method('doLoadClassCache');
@@ -142,27 +109,17 @@ public function testClassCacheIsNotLoadedByDefault()
public function testClassCacheIsNotLoadedWhenKernelIsNotBooted()
{
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('initializeBundles', 'initializeContainer', 'getBundles', 'doLoadClassCache'))
- ->getMock();
+ $kernel = $this->getKernel(array('initializeBundles', 'initializeContainer', 'doLoadClassCache'));
$kernel->loadClassCache();
- $kernel->expects($this->any())
- ->method('getBundles')
- ->will($this->returnValue(array()));
$kernel->expects($this->never())
->method('doLoadClassCache');
}
public function testBootKernelSeveralTimesOnlyInitializesBundlesOnce()
{
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('initializeBundles', 'initializeContainer', 'getBundles'))
- ->getMock();
+ $kernel = $this->getKernel(array('initializeBundles', 'initializeContainer'));
$kernel->expects($this->once())
- ->method('getBundles')
- ->will($this->returnValue(array()));
+ ->method('initializeBundles');
$kernel->boot();
$kernel->boot();
@@ -170,40 +127,29 @@ public function testBootKernelSeveralTimesOnlyInitializesBundlesOnce()
public function testShutdownCallsShutdownOnAllBundles()
{
- $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\Bundle')
- ->disableOriginalConstructor()
- ->getMock();
+ $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\Bundle');
$bundle->expects($this->once())
->method('shutdown');
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('getBundles'))
- ->getMock();
- $kernel->expects($this->once())
- ->method('getBundles')
- ->will($this->returnValue(array($bundle)));
+ $kernel = $this->getKernel(array(), array($bundle));
+ $kernel->boot();
$kernel->shutdown();
}
public function testShutdownGivesNullContainerToAllBundles()
{
- $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\Bundle')
- ->disableOriginalConstructor()
- ->getMock();
- $bundle->expects($this->once())
+ $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\Bundle');
+ $bundle->expects($this->at(3))
->method('setContainer')
->with(null);
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('getBundles'))
- ->getMock();
- $kernel->expects($this->once())
+ $kernel = $this->getKernel(array('getBundles'));
+ $kernel->expects($this->any())
->method('getBundles')
->will($this->returnValue(array($bundle)));
+ $kernel->boot();
$kernel->shutdown();
}
@@ -221,11 +167,7 @@ public function testHandleCallsHandleOnHttpKernel()
->method('handle')
->with($request, $type, $catch);
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('getHttpKernel'))
- ->getMock();
-
+ $kernel = $this->getKernel(array('getHttpKernel'));
$kernel->expects($this->once())
->method('getHttpKernel')
->will($this->returnValue($httpKernelMock));
@@ -243,11 +185,7 @@ public function testHandleBootsTheKernel()
->disableOriginalConstructor()
->getMock();
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('getHttpKernel', 'boot'))
- ->getMock();
-
+ $kernel = $this->getKernel(array('getHttpKernel', 'boot'));
$kernel->expects($this->once())
->method('getHttpKernel')
->will($this->returnValue($httpKernelMock));
@@ -255,10 +193,6 @@ public function testHandleBootsTheKernel()
$kernel->expects($this->once())
->method('boot');
- // required as this value is initialized
- // in the kernel constructor, which we don't call
- $kernel->setIsBooted(false);
-
$kernel->handle($request, $type, $catch);
}
@@ -334,8 +268,8 @@ public function doStuff()
$output = Kernel::stripComments($source);
- // Heredocs are preserved, making the output mixing unix and windows line
- // endings, switching to "\n" everywhere on windows to avoid failure.
+ // Heredocs are preserved, making the output mixing Unix and Windows line
+ // endings, switching to "\n" everywhere on Windows to avoid failure.
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
$expected = str_replace("\r\n", "\n", $expected);
$output = str_replace("\r\n", "\n", $output);
@@ -369,10 +303,7 @@ protected function getKernelMockForIsClassInActiveBundleTest()
{
$bundle = new FooBarBundle();
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('getBundles'))
- ->getMock();
+ $kernel = $this->getKernel(array('getBundles'));
$kernel->expects($this->once())
->method('getBundles')
->will($this->returnValue(array($bundle)));
@@ -416,7 +347,7 @@ public function testSerialize()
*/
public function testLocateResourceThrowsExceptionWhenNameIsNotValid()
{
- $this->getKernelForInvalidLocateResource()->locateResource('Foo');
+ $this->getKernel()->locateResource('Foo');
}
/**
@@ -424,7 +355,7 @@ public function testLocateResourceThrowsExceptionWhenNameIsNotValid()
*/
public function testLocateResourceThrowsExceptionWhenNameIsUnsafe()
{
- $this->getKernelForInvalidLocateResource()->locateResource('@FooBundle/../bar');
+ $this->getKernel()->locateResource('@FooBundle/../bar');
}
/**
@@ -432,7 +363,7 @@ public function testLocateResourceThrowsExceptionWhenNameIsUnsafe()
*/
public function testLocateResourceThrowsExceptionWhenBundleDoesNotExist()
{
- $this->getKernelForInvalidLocateResource()->locateResource('@FooBundle/config/routing.xml');
+ $this->getKernel()->locateResource('@FooBundle/config/routing.xml');
}
/**
@@ -440,7 +371,7 @@ public function testLocateResourceThrowsExceptionWhenBundleDoesNotExist()
*/
public function testLocateResourceThrowsExceptionWhenResourceDoesNotExist()
{
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->once())
->method('getBundle')
@@ -452,7 +383,7 @@ public function testLocateResourceThrowsExceptionWhenResourceDoesNotExist()
public function testLocateResourceReturnsTheFirstThatMatches()
{
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->once())
->method('getBundle')
@@ -467,7 +398,7 @@ public function testLocateResourceReturnsTheFirstThatMatchesWithParent()
$parent = $this->getBundle(__DIR__.'/Fixtures/Bundle1Bundle');
$child = $this->getBundle(__DIR__.'/Fixtures/Bundle2Bundle');
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->exactly(2))
->method('getBundle')
@@ -483,7 +414,7 @@ public function testLocateResourceReturnsAllMatches()
$parent = $this->getBundle(__DIR__.'/Fixtures/Bundle1Bundle');
$child = $this->getBundle(__DIR__.'/Fixtures/Bundle2Bundle');
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->once())
->method('getBundle')
@@ -498,7 +429,7 @@ public function testLocateResourceReturnsAllMatches()
public function testLocateResourceReturnsAllMatchesBis()
{
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->once())
->method('getBundle')
@@ -516,7 +447,7 @@ public function testLocateResourceReturnsAllMatchesBis()
public function testLocateResourceIgnoresDirOnNonResource()
{
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->once())
->method('getBundle')
@@ -531,7 +462,7 @@ public function testLocateResourceIgnoresDirOnNonResource()
public function testLocateResourceReturnsTheDirOneForResources()
{
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->once())
->method('getBundle')
@@ -546,7 +477,7 @@ public function testLocateResourceReturnsTheDirOneForResources()
public function testLocateResourceReturnsTheDirOneForResourcesAndBundleOnes()
{
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->once())
->method('getBundle')
@@ -565,7 +496,7 @@ public function testLocateResourceOverrideBundleAndResourcesFolders()
$parent = $this->getBundle(__DIR__.'/Fixtures/BaseBundle', null, 'BaseBundle', 'BaseBundle');
$child = $this->getBundle(__DIR__.'/Fixtures/ChildBundle', 'ParentBundle', 'ChildBundle', 'ChildBundle');
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->exactly(4))
->method('getBundle')
@@ -600,7 +531,7 @@ public function testLocateResourceOverrideBundleAndResourcesFolders()
public function testLocateResourceOnDirectories()
{
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->exactly(2))
->method('getBundle')
@@ -616,7 +547,7 @@ public function testLocateResourceOnDirectories()
$kernel->locateResource('@FooBundle/Resources', __DIR__.'/Fixtures/Resources')
);
- $kernel = $this->getKernel();
+ $kernel = $this->getKernel(array('getBundle'));
$kernel
->expects($this->exactly(2))
->method('getBundle')
@@ -638,13 +569,19 @@ public function testInitializeBundles()
$parent = $this->getBundle(null, null, 'ParentABundle');
$child = $this->getBundle(null, 'ParentABundle', 'ChildABundle');
- $kernel = $this->getKernel();
+ // use test kernel so we can access getBundleMap()
+ $kernel = $this
+ ->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
+ ->setMethods(array('registerBundles'))
+ ->setConstructorArgs(array('test', false))
+ ->getMock()
+ ;
$kernel
->expects($this->once())
->method('registerBundles')
->will($this->returnValue(array($parent, $child)))
;
- $kernel->initializeBundles();
+ $kernel->boot();
$map = $kernel->getBundleMap();
$this->assertEquals(array($child, $parent), $map['ParentABundle']);
@@ -656,14 +593,20 @@ public function testInitializeBundlesSupportInheritanceCascade()
$parent = $this->getBundle(null, 'GrandParentBBundle', 'ParentBBundle');
$child = $this->getBundle(null, 'ParentBBundle', 'ChildBBundle');
- $kernel = $this->getKernel();
+ // use test kernel so we can access getBundleMap()
+ $kernel = $this
+ ->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
+ ->setMethods(array('registerBundles'))
+ ->setConstructorArgs(array('test', false))
+ ->getMock()
+ ;
$kernel
->expects($this->once())
->method('registerBundles')
->will($this->returnValue(array($grandparent, $parent, $child)))
;
- $kernel->initializeBundles();
+ $kernel->boot();
$map = $kernel->getBundleMap();
$this->assertEquals(array($child, $parent, $grandparent), $map['GrandParentBBundle']);
@@ -673,43 +616,45 @@ public function testInitializeBundlesSupportInheritanceCascade()
/**
* @expectedException \LogicException
+ * @expectedExceptionMessage Bundle "ChildCBundle" extends bundle "FooBar", which is not registered.
*/
public function testInitializeBundlesThrowsExceptionWhenAParentDoesNotExists()
{
$child = $this->getBundle(null, 'FooBar', 'ChildCBundle');
-
- $kernel = $this->getKernel();
- $kernel
- ->expects($this->once())
- ->method('registerBundles')
- ->will($this->returnValue(array($child)))
- ;
- $kernel->initializeBundles();
+ $kernel = $this->getKernel(array(), array($child));
+ $kernel->boot();
}
public function testInitializeBundlesSupportsArbitraryBundleRegistrationOrder()
{
- $grandparent = $this->getBundle(null, null, 'GrandParentCCundle');
- $parent = $this->getBundle(null, 'GrandParentCCundle', 'ParentCCundle');
- $child = $this->getBundle(null, 'ParentCCundle', 'ChildCCundle');
+ $grandparent = $this->getBundle(null, null, 'GrandParentCBundle');
+ $parent = $this->getBundle(null, 'GrandParentCBundle', 'ParentCBundle');
+ $child = $this->getBundle(null, 'ParentCBundle', 'ChildCBundle');
- $kernel = $this->getKernel();
+ // use test kernel so we can access getBundleMap()
+ $kernel = $this
+ ->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
+ ->setMethods(array('registerBundles'))
+ ->setConstructorArgs(array('test', false))
+ ->getMock()
+ ;
$kernel
->expects($this->once())
->method('registerBundles')
->will($this->returnValue(array($parent, $grandparent, $child)))
;
- $kernel->initializeBundles();
+ $kernel->boot();
$map = $kernel->getBundleMap();
- $this->assertEquals(array($child, $parent, $grandparent), $map['GrandParentCCundle']);
- $this->assertEquals(array($child, $parent), $map['ParentCCundle']);
- $this->assertEquals(array($child), $map['ChildCCundle']);
+ $this->assertEquals(array($child, $parent, $grandparent), $map['GrandParentCBundle']);
+ $this->assertEquals(array($child, $parent), $map['ParentCBundle']);
+ $this->assertEquals(array($child), $map['ChildCBundle']);
}
/**
* @expectedException \LogicException
+ * @expectedExceptionMessage Bundle "ParentCBundle" is directly extended by two bundles "ChildC2Bundle" and "ChildC1Bundle".
*/
public function testInitializeBundlesThrowsExceptionWhenABundleIsDirectlyExtendedByTwoBundles()
{
@@ -717,59 +662,41 @@ public function testInitializeBundlesThrowsExceptionWhenABundleIsDirectlyExtende
$child1 = $this->getBundle(null, 'ParentCBundle', 'ChildC1Bundle');
$child2 = $this->getBundle(null, 'ParentCBundle', 'ChildC2Bundle');
- $kernel = $this->getKernel();
- $kernel
- ->expects($this->once())
- ->method('registerBundles')
- ->will($this->returnValue(array($parent, $child1, $child2)))
- ;
- $kernel->initializeBundles();
+ $kernel = $this->getKernel(array(), array($parent, $child1, $child2));
+ $kernel->boot();
}
/**
* @expectedException \LogicException
+ * @expectedExceptionMessage Trying to register two bundles with the same name "DuplicateName"
*/
public function testInitializeBundleThrowsExceptionWhenRegisteringTwoBundlesWithTheSameName()
{
$fooBundle = $this->getBundle(null, null, 'FooBundle', 'DuplicateName');
$barBundle = $this->getBundle(null, null, 'BarBundle', 'DuplicateName');
- $kernel = $this->getKernel();
- $kernel
- ->expects($this->once())
- ->method('registerBundles')
- ->will($this->returnValue(array($fooBundle, $barBundle)))
- ;
- $kernel->initializeBundles();
+ $kernel = $this->getKernel(array(), array($fooBundle, $barBundle));
+ $kernel->boot();
}
/**
* @expectedException \LogicException
+ * @expectedExceptionMessage Bundle "CircularRefBundle" can not extend itself.
*/
public function testInitializeBundleThrowsExceptionWhenABundleExtendsItself()
{
$circularRef = $this->getBundle(null, 'CircularRefBundle', 'CircularRefBundle');
- $kernel = $this->getKernel();
- $kernel
- ->expects($this->once())
- ->method('registerBundles')
- ->will($this->returnValue(array($circularRef)))
- ;
- $kernel->initializeBundles();
+ $kernel = $this->getKernel(array(), array($circularRef));
+ $kernel->boot();
}
public function testTerminateReturnsSilentlyIfKernelIsNotBooted()
{
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('getHttpKernel'))
- ->getMock();
-
+ $kernel = $this->getKernel(array('getHttpKernel'));
$kernel->expects($this->never())
->method('getHttpKernel');
- $kernel->setIsBooted(false);
$kernel->terminate(Request::create('/'), new Response());
}
@@ -784,16 +711,12 @@ public function testTerminateDelegatesTerminationOnlyForTerminableInterface()
->expects($this->never())
->method('terminate');
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('getHttpKernel'))
- ->getMock();
-
+ $kernel = $this->getKernel(array('getHttpKernel'));
$kernel->expects($this->once())
->method('getHttpKernel')
->will($this->returnValue($httpKernelMock));
- $kernel->setIsBooted(true);
+ $kernel->boot();
$kernel->terminate(Request::create('/'), new Response());
// implements TerminableInterface
@@ -806,19 +729,20 @@ public function testTerminateDelegatesTerminationOnlyForTerminableInterface()
->expects($this->once())
->method('terminate');
- $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->disableOriginalConstructor()
- ->setMethods(array('getHttpKernel'))
- ->getMock();
-
+ $kernel = $this->getKernel(array('getHttpKernel'));
$kernel->expects($this->exactly(2))
->method('getHttpKernel')
->will($this->returnValue($httpKernelMock));
- $kernel->setIsBooted(true);
+ $kernel->boot();
$kernel->terminate(Request::create('/'), new Response());
}
+ /**
+ * Returns a mock for the BundleInterface
+ *
+ * @return BundleInterface
+ */
protected function getBundle($dir = null, $parent = null, $className = null, $bundleName = null)
{
$bundle = $this
@@ -854,22 +778,28 @@ protected function getBundle($dir = null, $parent = null, $className = null, $bu
return $bundle;
}
- protected function getKernel()
- {
- return $this
- ->getMockBuilder('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest')
- ->setMethods(array('getBundle', 'registerBundles'))
- ->disableOriginalConstructor()
- ->getMock()
- ;
- }
-
- protected function getKernelForInvalidLocateResource()
+ /**
+ * Returns a mock for the abstract kernel.
+ *
+ * @param array $methods Additional methods to mock (besides the abstract ones)
+ * @param array $bundles Bundles to register
+ *
+ * @return Kernel
+ */
+ protected function getKernel(array $methods = array(), array $bundles = array())
{
- return $this
+ $kernel = $this
->getMockBuilder('Symfony\Component\HttpKernel\Kernel')
- ->disableOriginalConstructor()
+ ->setMethods($methods)
+ ->setConstructorArgs(array('test', false))
->getMockForAbstractClass()
;
+
+ $kernel->expects($this->any())
+ ->method('registerBundles')
+ ->will($this->returnValue($bundles))
+ ;
+
+ return $kernel;
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php
index 014f549..9ff962c 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php
@@ -18,14 +18,8 @@
*/
class MemcacheMock
{
- private $connected;
- private $storage;
-
- public function __construct()
- {
- $this->connected = false;
- $this->storage = array();
- }
+ private $connected = false;
+ private $storage = array();
/**
* Open memcached server connection
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php
index 2b17d70..d28d542 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcachedMock.php
@@ -18,14 +18,8 @@
*/
class MemcachedMock
{
- private $connected;
- private $storage;
-
- public function __construct()
- {
- $this->connected = false;
- $this->storage = array();
- }
+ private $connected = false;
+ private $storage = array();
/**
* Set a Memcached option
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php
index ca2980e..4a89e2d 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php
@@ -18,15 +18,8 @@
*/
class RedisMock
{
-
- private $connected;
- private $storage;
-
- public function __construct()
- {
- $this->connected = false;
- $this->storage = array();
- }
+ private $connected = false;
+ private $storage = array();
/**
* Add a server to connection pool
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php
index 2a41531..ede7c3f 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php
@@ -19,13 +19,6 @@
class ProfilerTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
- }
-
public function testCollect()
{
if (!class_exists('SQLite3') && (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers()))) {
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php
index 665e99e..7ede0c3 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/UriSigner.php
@@ -67,6 +67,6 @@ public function check($uri)
private function computeHash($uri)
{
- return urlencode(base64_encode(hash_hmac('sha1', $uri, $this->secret, true)));
+ return urlencode(base64_encode(hash_hmac('sha256', $uri, $this->secret, true)));
}
}
diff --git a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json
index af659da..a09b001 100644
--- a/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json
+++ b/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json
@@ -18,7 +18,7 @@
"require": {
"php": ">=5.3.3",
"symfony/event-dispatcher": "~2.1",
- "symfony/http-foundation": "~2.2",
+ "symfony/http-foundation": "~2.4",
"symfony/debug": "~2.3",
"psr/log": "~1.0"
},
@@ -49,7 +49,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/.gitattributes b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/.gitattributes
new file mode 100644
index 0000000..8048151
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/.gitattributes
@@ -0,0 +1,2 @@
+/Tests export-ignore
+phpunit.xml.dist export-ignore
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/CHANGELOG.md b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/CHANGELOG.md
new file mode 100644
index 0000000..071ef3b
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/CHANGELOG.md
@@ -0,0 +1,14 @@
+CHANGELOG
+=========
+
+2.3.0
+------
+
+ * added PropertyAccessorBuilder, to enable or disable the support of "__call"
+ * added support for "__call" in the PropertyAccessor (disabled by default)
+ * [BC BREAK] changed PropertyAccessor to continue its search for a property or
+ method even if a non-public match was found. Before, a PropertyAccessDeniedException
+ was thrown in this case. Class PropertyAccessDeniedException was removed
+ now.
+ * deprecated PropertyAccess::getPropertyAccessor
+ * added PropertyAccess::createPropertyAccessor and PropertyAccess::createPropertyAccessorBuilder
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/AccessException.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/AccessException.php
new file mode 100644
index 0000000..b3a8546
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/AccessException.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess\Exception;
+
+/**
+ * Thrown when a property path is not available.
+ *
+ * @author Stéphane Escandell
+ */
+class AccessException extends RuntimeException
+{
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/ExceptionInterface.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/ExceptionInterface.php
new file mode 100644
index 0000000..d1fcdac
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/ExceptionInterface.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess\Exception;
+
+/**
+ * Marker interface for the PropertyAccess component.
+ *
+ * @author Bernhard Schussek
+ */
+interface ExceptionInterface
+{
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/InvalidPropertyPathException.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/InvalidPropertyPathException.php
new file mode 100644
index 0000000..69de31c
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/InvalidPropertyPathException.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess\Exception;
+
+/**
+ * Thrown when a property path is malformed.
+ *
+ * @author Bernhard Schussek
+ */
+class InvalidPropertyPathException extends RuntimeException
+{
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchIndexException.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchIndexException.php
new file mode 100644
index 0000000..597b990
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchIndexException.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess\Exception;
+
+/**
+ * Thrown when an index cannot be found.
+ *
+ * @author Stéphane Escandell
+ */
+class NoSuchIndexException extends AccessException
+{
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchPropertyException.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchPropertyException.php
new file mode 100644
index 0000000..1c7eda5
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchPropertyException.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess\Exception;
+
+/**
+ * Thrown when a property cannot be found.
+ *
+ * @author Bernhard Schussek
+ */
+class NoSuchPropertyException extends AccessException
+{
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/OutOfBoundsException.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/OutOfBoundsException.php
new file mode 100644
index 0000000..a3c4559
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/OutOfBoundsException.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess\Exception;
+
+/**
+ * Base OutOfBoundsException for the PropertyAccess component.
+ *
+ * @author Bernhard Schussek
+ */
+class OutOfBoundsException extends \OutOfBoundsException implements ExceptionInterface
+{
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/RuntimeException.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/RuntimeException.php
new file mode 100644
index 0000000..9fe843e
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/RuntimeException.php
@@ -0,0 +1,21 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess\Exception;
+
+/**
+ * Base RuntimeException for the PropertyAccess component.
+ *
+ * @author Bernhard Schussek
+ */
+class RuntimeException extends \RuntimeException implements ExceptionInterface
+{
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php
new file mode 100644
index 0000000..029d48c
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php
@@ -0,0 +1,25 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess\Exception;
+
+/**
+ * Thrown when a value does not match an expected type.
+ *
+ * @author Bernhard Schussek
+ */
+class UnexpectedTypeException extends RuntimeException
+{
+ public function __construct($value, $expectedType)
+ {
+ parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, is_object($value) ? get_class($value) : gettype($value)));
+ }
+}
diff --git a/core/vendor/doctrine/common/LICENSE b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/LICENSE
similarity index 59%
rename from core/vendor/doctrine/common/LICENSE
rename to core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/LICENSE
index 4a91f0b..88a57f8 100644
--- a/core/vendor/doctrine/common/LICENSE
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/LICENSE
@@ -1,11 +1,11 @@
-Copyright (c) 2006-2012 Doctrine Project
+Copyright (c) 2004-2013 Fabien Potencier
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal 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:
+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.
@@ -15,5 +15,5 @@ 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.
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccess.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccess.php
new file mode 100644
index 0000000..3b234df
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccess.php
@@ -0,0 +1,60 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+/**
+ * Entry point of the PropertyAccess component.
+ *
+ * @author Bernhard Schussek
+ */
+final class PropertyAccess
+{
+ /**
+ * Creates a property accessor with the default configuration.
+ *
+ * @return PropertyAccessor The new property accessor
+ */
+ public static function createPropertyAccessor()
+ {
+ return self::createPropertyAccessorBuilder()->getPropertyAccessor();
+ }
+
+ /**
+ * Creates a property accessor builder.
+ *
+ * @return PropertyAccessorBuilder The new property accessor builder
+ */
+ public static function createPropertyAccessorBuilder()
+ {
+ return new PropertyAccessorBuilder();
+ }
+
+ /**
+ * Alias of {@link getPropertyAccessor}.
+ *
+ * @return PropertyAccessor The new property accessor
+ *
+ * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use
+ * {@link createPropertyAccessor()} instead.
+ */
+ public static function getPropertyAccessor()
+ {
+ return self::createPropertyAccessor();
+ }
+
+ /**
+ * This class cannot be instantiated.
+ */
+ private function __construct()
+ {
+ }
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessor.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessor.php
new file mode 100644
index 0000000..d48891e
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessor.php
@@ -0,0 +1,457 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
+use Symfony\Component\PropertyAccess\Exception\NoSuchIndexException;
+use Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException;
+
+/**
+ * Default implementation of {@link PropertyAccessorInterface}.
+ *
+ * @author Bernhard Schussek
+ */
+class PropertyAccessor implements PropertyAccessorInterface
+{
+ const VALUE = 0;
+ const IS_REF = 1;
+
+ /**
+ * @var Boolean
+ */
+ private $magicCall;
+
+ /**
+ * @var Boolean
+ */
+ private $throwExceptionOnInvalidIndex;
+
+ /**
+ * Should not be used by application code. Use
+ * {@link PropertyAccess::createPropertyAccessor()} instead.
+ */
+ public function __construct($magicCall = false, $throwExceptionOnInvalidIndex = false)
+ {
+ $this->magicCall = $magicCall;
+ $this->throwExceptionOnInvalidIndex = $throwExceptionOnInvalidIndex;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getValue($objectOrArray, $propertyPath)
+ {
+ if (is_string($propertyPath)) {
+ $propertyPath = new PropertyPath($propertyPath);
+ } elseif (!$propertyPath instanceof PropertyPathInterface) {
+ throw new UnexpectedTypeException($propertyPath, 'string or Symfony\Component\PropertyAccess\PropertyPathInterface');
+ }
+
+ $propertyValues =& $this->readPropertiesUntil($objectOrArray, $propertyPath, $propertyPath->getLength(), $this->throwExceptionOnInvalidIndex);
+
+ return $propertyValues[count($propertyValues) - 1][self::VALUE];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setValue(&$objectOrArray, $propertyPath, $value)
+ {
+ if (is_string($propertyPath)) {
+ $propertyPath = new PropertyPath($propertyPath);
+ } elseif (!$propertyPath instanceof PropertyPathInterface) {
+ throw new UnexpectedTypeException($propertyPath, 'string or Symfony\Component\PropertyAccess\PropertyPathInterface');
+ }
+
+ $propertyValues =& $this->readPropertiesUntil($objectOrArray, $propertyPath, $propertyPath->getLength() - 1);
+ $overwrite = true;
+
+ // Add the root object to the list
+ array_unshift($propertyValues, array(
+ self::VALUE => &$objectOrArray,
+ self::IS_REF => true,
+ ));
+
+ for ($i = count($propertyValues) - 1; $i >= 0; --$i) {
+ $objectOrArray =& $propertyValues[$i][self::VALUE];
+
+ if ($overwrite) {
+ if (!is_object($objectOrArray) && !is_array($objectOrArray)) {
+ throw new UnexpectedTypeException($objectOrArray, 'object or array');
+ }
+
+ $property = $propertyPath->getElement($i);
+ //$singular = $propertyPath->singulars[$i];
+ $singular = null;
+
+ if ($propertyPath->isIndex($i)) {
+ $this->writeIndex($objectOrArray, $property, $value);
+ } else {
+ $this->writeProperty($objectOrArray, $property, $singular, $value);
+ }
+ }
+
+ $value =& $objectOrArray;
+ $overwrite = !$propertyValues[$i][self::IS_REF];
+ }
+ }
+
+ /**
+ * Reads the path from an object up to a given path index.
+ *
+ * @param object|array $objectOrArray The object or array to read from
+ * @param PropertyPathInterface $propertyPath The property path to read
+ * @param integer $lastIndex The index up to which should be read
+ *
+ * @return array The values read in the path.
+ *
+ * @throws UnexpectedTypeException If a value within the path is neither object nor array.
+ */
+ private function &readPropertiesUntil(&$objectOrArray, PropertyPathInterface $propertyPath, $lastIndex, $throwExceptionOnNonexistantIndex = false)
+ {
+ $propertyValues = array();
+
+ for ($i = 0; $i < $lastIndex; ++$i) {
+ if (!is_object($objectOrArray) && !is_array($objectOrArray)) {
+ throw new UnexpectedTypeException($objectOrArray, 'object or array');
+ }
+
+ $property = $propertyPath->getElement($i);
+ $isIndex = $propertyPath->isIndex($i);
+ $isArrayAccess = is_array($objectOrArray) || $objectOrArray instanceof \ArrayAccess;
+
+ // Create missing nested arrays on demand
+ if ($isIndex && $isArrayAccess && !isset($objectOrArray[$property])) {
+ if ($throwExceptionOnNonexistantIndex) {
+ throw new NoSuchIndexException(sprintf('Cannot read property "%s". Available properties are "%s"', $property, print_r(array_keys($objectOrArray), true)));
+ }
+ $objectOrArray[$property] = $i + 1 < $propertyPath->getLength() ? array() : null;
+ }
+
+ if ($isIndex) {
+ $propertyValue =& $this->readIndex($objectOrArray, $property);
+ } else {
+ $propertyValue =& $this->readProperty($objectOrArray, $property);
+ }
+
+ $objectOrArray =& $propertyValue[self::VALUE];
+
+ $propertyValues[] =& $propertyValue;
+ }
+
+ return $propertyValues;
+ }
+
+ /**
+ * Reads a key from an array-like structure.
+ *
+ * @param \ArrayAccess|array $array The array or \ArrayAccess object to read from
+ * @param string|integer $index The key to read
+ *
+ * @return mixed The value of the key
+ *
+ * @throws NoSuchPropertyException If the array does not implement \ArrayAccess or it is not an array
+ */
+ private function &readIndex(&$array, $index)
+ {
+ if (!$array instanceof \ArrayAccess && !is_array($array)) {
+ throw new NoSuchPropertyException(sprintf('Index "%s" cannot be read from object of type "%s" because it doesn\'t implement \ArrayAccess', $index, get_class($array)));
+ }
+
+ // Use an array instead of an object since performance is very crucial here
+ $result = array(
+ self::VALUE => null,
+ self::IS_REF => false
+ );
+
+ if (isset($array[$index])) {
+ if (is_array($array)) {
+ $result[self::VALUE] =& $array[$index];
+ $result[self::IS_REF] = true;
+ } else {
+ $result[self::VALUE] = $array[$index];
+ // Objects are always passed around by reference
+ $result[self::IS_REF] = is_object($array[$index]) ? true : false;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Reads the a property from an object or array.
+ *
+ * @param object $object The object to read from.
+ * @param string $property The property to read.
+ *
+ * @return mixed The value of the read property
+ *
+ * @throws NoSuchPropertyException If the property does not exist or is not
+ * public.
+ */
+ private function &readProperty(&$object, $property)
+ {
+ // Use an array instead of an object since performance is
+ // very crucial here
+ $result = array(
+ self::VALUE => null,
+ self::IS_REF => false
+ );
+
+ if (!is_object($object)) {
+ throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you should write the property path as "[%s]" instead?', $property, $property));
+ }
+
+ $camelProp = $this->camelize($property);
+ $reflClass = new \ReflectionClass($object);
+ $getter = 'get'.$camelProp;
+ $isser = 'is'.$camelProp;
+ $hasser = 'has'.$camelProp;
+ $classHasProperty = $reflClass->hasProperty($property);
+
+ if ($reflClass->hasMethod($getter) && $reflClass->getMethod($getter)->isPublic()) {
+ $result[self::VALUE] = $object->$getter();
+ } elseif ($reflClass->hasMethod($isser) && $reflClass->getMethod($isser)->isPublic()) {
+ $result[self::VALUE] = $object->$isser();
+ } elseif ($reflClass->hasMethod($hasser) && $reflClass->getMethod($hasser)->isPublic()) {
+ $result[self::VALUE] = $object->$hasser();
+ } elseif ($reflClass->hasMethod('__get') && $reflClass->getMethod('__get')->isPublic()) {
+ $result[self::VALUE] = $object->$property;
+ } elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) {
+ $result[self::VALUE] =& $object->$property;
+ $result[self::IS_REF] = true;
+ } elseif (!$classHasProperty && property_exists($object, $property)) {
+ // Needed to support \stdClass instances. We need to explicitly
+ // exclude $classHasProperty, otherwise if in the previous clause
+ // a *protected* property was found on the class, property_exists()
+ // returns true, consequently the following line will result in a
+ // fatal error.
+ $result[self::VALUE] =& $object->$property;
+ $result[self::IS_REF] = true;
+ } elseif ($this->magicCall && $reflClass->hasMethod('__call') && $reflClass->getMethod('__call')->isPublic()) {
+ // we call the getter and hope the __call do the job
+ $result[self::VALUE] = $object->$getter();
+ } else {
+ $methods = array($getter, $isser, $hasser, '__get');
+ if ($this->magicCall) {
+ $methods[] = '__call';
+ }
+
+ throw new NoSuchPropertyException(sprintf(
+ 'Neither the property "%s" nor one of the methods "%s()" '.
+ 'exist and have public access in class "%s".',
+ $property,
+ implode('()", "', $methods),
+ $reflClass->name
+ ));
+ }
+
+ // Objects are always passed around by reference
+ if (is_object($result[self::VALUE])) {
+ $result[self::IS_REF] = true;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets the value of the property at the given index in the path
+ *
+ * @param \ArrayAccess|array $array An array or \ArrayAccess object to write to
+ * @param string|integer $index The index to write at
+ * @param mixed $value The value to write
+ *
+ * @throws NoSuchPropertyException If the array does not implement \ArrayAccess or it is not an array
+ */
+ private function writeIndex(&$array, $index, $value)
+ {
+ if (!$array instanceof \ArrayAccess && !is_array($array)) {
+ throw new NoSuchPropertyException(sprintf('Index "%s" cannot be modified in object of type "%s" because it doesn\'t implement \ArrayAccess', $index, get_class($array)));
+ }
+
+ $array[$index] = $value;
+ }
+
+ /**
+ * Sets the value of the property at the given index in the path
+ *
+ * @param object|array $object The object or array to write to
+ * @param string $property The property to write
+ * @param string|null $singular The singular form of the property name or null
+ * @param mixed $value The value to write
+ *
+ * @throws NoSuchPropertyException If the property does not exist or is not
+ * public.
+ */
+ private function writeProperty(&$object, $property, $singular, $value)
+ {
+ $guessedAdders = '';
+
+ if (!is_object($object)) {
+ throw new NoSuchPropertyException(sprintf('Cannot write property "%s" to an array. Maybe you should write the property path as "[%s]" instead?', $property, $property));
+ }
+
+ $reflClass = new \ReflectionClass($object);
+ $plural = $this->camelize($property);
+
+ // Any of the two methods is required, but not yet known
+ $singulars = null !== $singular ? array($singular) : (array) StringUtil::singularify($plural);
+
+ if (is_array($value) || $value instanceof \Traversable) {
+ $methods = $this->findAdderAndRemover($reflClass, $singulars);
+
+ if (null !== $methods) {
+ // At this point the add and remove methods have been found
+ // Use iterator_to_array() instead of clone in order to prevent side effects
+ // see https://github.com/symfony/symfony/issues/4670
+ $itemsToAdd = is_object($value) ? iterator_to_array($value) : $value;
+ $itemToRemove = array();
+ $propertyValue = $this->readProperty($object, $property);
+ $previousValue = $propertyValue[self::VALUE];
+
+ if (is_array($previousValue) || $previousValue instanceof \Traversable) {
+ foreach ($previousValue as $previousItem) {
+ foreach ($value as $key => $item) {
+ if ($item === $previousItem) {
+ // Item found, don't add
+ unset($itemsToAdd[$key]);
+
+ // Next $previousItem
+ continue 2;
+ }
+ }
+
+ // Item not found, add to remove list
+ $itemToRemove[] = $previousItem;
+ }
+ }
+
+ foreach ($itemToRemove as $item) {
+ call_user_func(array($object, $methods[1]), $item);
+ }
+
+ foreach ($itemsToAdd as $item) {
+ call_user_func(array($object, $methods[0]), $item);
+ }
+
+ return;
+ } else {
+ // It is sufficient to include only the adders in the error
+ // message. If the user implements the adder but not the remover,
+ // an exception will be thrown in findAdderAndRemover() that
+ // the remover has to be implemented as well.
+ $guessedAdders = '"add'.implode('()", "add', $singulars).'()", ';
+ }
+ }
+
+ $setter = 'set'.$this->camelize($property);
+ $classHasProperty = $reflClass->hasProperty($property);
+
+ if ($reflClass->hasMethod($setter) && $reflClass->getMethod($setter)->isPublic()) {
+ $object->$setter($value);
+ } elseif ($reflClass->hasMethod('__set') && $reflClass->getMethod('__set')->isPublic()) {
+ $object->$property = $value;
+ } elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) {
+ $object->$property = $value;
+ } elseif (!$classHasProperty && property_exists($object, $property)) {
+ // Needed to support \stdClass instances. We need to explicitly
+ // exclude $classHasProperty, otherwise if in the previous clause
+ // a *protected* property was found on the class, property_exists()
+ // returns true, consequently the following line will result in a
+ // fatal error.
+ $object->$property = $value;
+ } elseif ($this->magicCall && $reflClass->hasMethod('__call') && $reflClass->getMethod('__call')->isPublic()) {
+ // we call the getter and hope the __call do the job
+ $object->$setter($value);
+ } else {
+ throw new NoSuchPropertyException(sprintf(
+ 'Neither the property "%s" nor one of the methods %s"%s()", '.
+ '"__set()" or "__call()" exist and have public access in class "%s".',
+ $property,
+ $guessedAdders,
+ $setter,
+ $reflClass->name
+ ));
+ }
+ }
+
+ /**
+ * Camelizes a given string.
+ *
+ * @param string $string Some string
+ *
+ * @return string The camelized version of the string
+ */
+ private function camelize($string)
+ {
+ return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $string);
+ }
+
+ /**
+ * Searches for add and remove methods.
+ *
+ * @param \ReflectionClass $reflClass The reflection class for the given object
+ * @param array $singulars The singular form of the property name or null
+ *
+ * @return array|null An array containing the adder and remover when found, null otherwise
+ *
+ * @throws NoSuchPropertyException If the property does not exist
+ */
+ private function findAdderAndRemover(\ReflectionClass $reflClass, array $singulars)
+ {
+ foreach ($singulars as $singular) {
+ $addMethod = 'add'.$singular;
+ $removeMethod = 'remove'.$singular;
+
+ $addMethodFound = $this->isAccessible($reflClass, $addMethod, 1);
+ $removeMethodFound = $this->isAccessible($reflClass, $removeMethod, 1);
+
+ if ($addMethodFound && $removeMethodFound) {
+ return array($addMethod, $removeMethod);
+ }
+
+ if ($addMethodFound xor $removeMethodFound) {
+ throw new NoSuchPropertyException(sprintf(
+ 'Found the public method "%s()", but did not find a public "%s()" on class %s',
+ $addMethodFound ? $addMethod : $removeMethod,
+ $addMethodFound ? $removeMethod : $addMethod,
+ $reflClass->name
+ ));
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns whether a method is public and has a specific number of required parameters.
+ *
+ * @param \ReflectionClass $class The class of the method
+ * @param string $methodName The method name
+ * @param integer $parameters The number of parameters
+ *
+ * @return Boolean Whether the method is public and has $parameters
+ * required parameters
+ */
+ private function isAccessible(\ReflectionClass $class, $methodName, $parameters)
+ {
+ if ($class->hasMethod($methodName)) {
+ $method = $class->getMethod($methodName);
+
+ if ($method->isPublic() && $method->getNumberOfRequiredParameters() === $parameters) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php
new file mode 100644
index 0000000..50b872f
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php
@@ -0,0 +1,104 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+/**
+ * A configurable builder for PropertyAccessorInterface objects.
+ *
+ * @author Jérémie Augustin
+ */
+class PropertyAccessorBuilder
+{
+ /**
+ * @var Boolean
+ */
+ private $magicCall = false;
+
+ /**
+ * @var Boolean
+ */
+ private $throwExceptionOnInvalidIndex = false;
+
+ /**
+ * Enables the use of "__call" by the PropertyAccessor.
+ *
+ * @return PropertyAccessorBuilder The builder object
+ */
+ public function enableMagicCall()
+ {
+ $this->magicCall = true;
+
+ return $this;
+ }
+
+ /**
+ * Disables the use of "__call" by the PropertyAccessor.
+ *
+ * @return PropertyAccessorBuilder The builder object
+ */
+ public function disableMagicCall()
+ {
+ $this->magicCall = false;
+
+ return $this;
+ }
+
+ /**
+ * @return Boolean true if the use of "__call" by the PropertyAccessor is enabled
+ */
+ public function isMagicCallEnabled()
+ {
+ return $this->magicCall;
+ }
+
+ /**
+ * Enables exceptions in read context for array by PropertyAccessor
+ *
+ * @return PropertyAccessorBuilder The builder object
+ */
+ public function enableExceptionOnInvalidIndex()
+ {
+ $this->throwExceptionOnInvalidIndex = true;
+
+ return $this;
+ }
+
+ /**
+ * Disables exceptions in read context for array by PropertyAccessor
+ *
+ * @return PropertyAccessorBuilder The builder object
+ */
+ public function disableExceptionOnInvalidIndex()
+ {
+ $this->throwExceptionOnInvalidIndex = false;
+
+ return $this;
+ }
+
+ /**
+ * @return Boolean true is exceptions in read context for array is enabled
+ */
+ public function isExceptionOnInvalidIndexEnabled()
+ {
+ return $this->throwExceptionOnInvalidIndex;
+ }
+
+ /**
+ * Builds and returns a new propertyAccessor object.
+ *
+ * @return PropertyAccessorInterface The built propertyAccessor
+ */
+ public function getPropertyAccessor()
+ {
+ return new PropertyAccessor($this->magicCall, $this->throwExceptionOnInvalidIndex);
+ }
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php
new file mode 100644
index 0000000..1eed7c7
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php
@@ -0,0 +1,81 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+/**
+ * Writes and reads values to/from an object/array graph.
+ *
+ * @author Bernhard Schussek
+ */
+interface PropertyAccessorInterface
+{
+ /**
+ * Sets the value at the end of the property path of the object
+ *
+ * Example:
+ *
+ * use Symfony\Component\PropertyAccess\PropertyAccess;
+ *
+ * $propertyAccessor = PropertyAccess::getPropertyAccessor();
+ *
+ * echo $propertyAccessor->setValue($object, 'child.name', 'Fabien');
+ * // equals echo $object->getChild()->setName('Fabien');
+ *
+ * This method first tries to find a public setter for each property in the
+ * path. The name of the setter must be the camel-cased property name
+ * prefixed with "set".
+ *
+ * If the setter does not exist, this method tries to find a public
+ * property. The value of the property is then changed.
+ *
+ * If neither is found, an exception is thrown.
+ *
+ * @param object|array $objectOrArray The object or array to modify
+ * @param string|PropertyPathInterface $propertyPath The property path to modify
+ * @param mixed $value The value to set at the end of the property path
+ *
+ * @throws Exception\NoSuchPropertyException If a property does not exist or is not public.
+ * @throws Exception\UnexpectedTypeException If a value within the path is neither object
+ * nor array
+ */
+ public function setValue(&$objectOrArray, $propertyPath, $value);
+
+ /**
+ * Returns the value at the end of the property path of the object
+ *
+ * Example:
+ *
+ * use Symfony\Component\PropertyAccess\PropertyAccess;
+ *
+ * $propertyAccessor = PropertyAccess::getPropertyAccessor();
+ *
+ * echo $propertyAccessor->getValue($object, 'child.name);
+ * // equals echo $object->getChild()->getName();
+ *
+ * This method first tries to find a public getter for each property in the
+ * path. The name of the getter must be the camel-cased property name
+ * prefixed with "get", "is", or "has".
+ *
+ * If the getter does not exist, this method tries to find a public
+ * property. The value of the property is then returned.
+ *
+ * If none of them are found, an exception is thrown.
+ *
+ * @param object|array $objectOrArray The object or array to traverse
+ * @param string|PropertyPathInterface $propertyPath The property path to read
+ *
+ * @return mixed The value at the end of the property path
+ *
+ * @throws Exception\NoSuchPropertyException If a property does not exist or is not public.
+ */
+ public function getValue($objectOrArray, $propertyPath);
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPath.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPath.php
new file mode 100644
index 0000000..840fc71
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPath.php
@@ -0,0 +1,225 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+use Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException;
+use Symfony\Component\PropertyAccess\Exception\OutOfBoundsException;
+use Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException;
+
+/**
+ * Default implementation of {@link PropertyPathInterface}.
+ *
+ * @author Bernhard Schussek
+ */
+class PropertyPath implements \IteratorAggregate, PropertyPathInterface
+{
+ /**
+ * Character used for separating between plural and singular of an element.
+ * @var string
+ */
+ const SINGULAR_SEPARATOR = '|';
+
+ /**
+ * The elements of the property path
+ * @var array
+ */
+ private $elements = array();
+
+ /**
+ * The singular forms of the elements in the property path.
+ * @var array
+ */
+ private $singulars = array();
+
+ /**
+ * The number of elements in the property path
+ * @var integer
+ */
+ private $length;
+
+ /**
+ * Contains a Boolean for each property in $elements denoting whether this
+ * element is an index. It is a property otherwise.
+ * @var array
+ */
+ private $isIndex = array();
+
+ /**
+ * String representation of the path
+ * @var string
+ */
+ private $pathAsString;
+
+ /**
+ * Constructs a property path from a string.
+ *
+ * @param PropertyPath|string $propertyPath The property path as string or instance
+ *
+ * @throws UnexpectedTypeException If the given path is not a string
+ * @throws InvalidPropertyPathException If the syntax of the property path is not valid
+ */
+ public function __construct($propertyPath)
+ {
+ // Can be used as copy constructor
+ if ($propertyPath instanceof PropertyPath) {
+ /* @var PropertyPath $propertyPath */
+ $this->elements = $propertyPath->elements;
+ $this->singulars = $propertyPath->singulars;
+ $this->length = $propertyPath->length;
+ $this->isIndex = $propertyPath->isIndex;
+ $this->pathAsString = $propertyPath->pathAsString;
+
+ return;
+ }
+ if (!is_string($propertyPath)) {
+ throw new UnexpectedTypeException($propertyPath, 'string or Symfony\Component\PropertyAccess\PropertyPath');
+ }
+
+ if ('' === $propertyPath) {
+ throw new InvalidPropertyPathException('The property path should not be empty.');
+ }
+
+ $this->pathAsString = $propertyPath;
+ $position = 0;
+ $remaining = $propertyPath;
+
+ // first element is evaluated differently - no leading dot for properties
+ $pattern = '/^(([^\.\[]+)|\[([^\]]+)\])(.*)/';
+
+ while (preg_match($pattern, $remaining, $matches)) {
+ if ('' !== $matches[2]) {
+ $element = $matches[2];
+ $this->isIndex[] = false;
+ } else {
+ $element = $matches[3];
+ $this->isIndex[] = true;
+ }
+ // Disabled this behaviour as the syntax is not yet final
+ //$pos = strpos($element, self::SINGULAR_SEPARATOR);
+ $pos = false;
+ $singular = null;
+
+ if (false !== $pos) {
+ $singular = substr($element, $pos + 1);
+ $element = substr($element, 0, $pos);
+ }
+
+ $this->elements[] = $element;
+ $this->singulars[] = $singular;
+
+ $position += strlen($matches[1]);
+ $remaining = $matches[4];
+ $pattern = '/^(\.(\w+)|\[([^\]]+)\])(.*)/';
+ }
+
+ if ('' !== $remaining) {
+ throw new InvalidPropertyPathException(sprintf(
+ 'Could not parse property path "%s". Unexpected token "%s" at position %d',
+ $propertyPath,
+ $remaining{0},
+ $position
+ ));
+ }
+
+ $this->length = count($this->elements);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function __toString()
+ {
+ return $this->pathAsString;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getLength()
+ {
+ return $this->length;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getParent()
+ {
+ if ($this->length <= 1) {
+ return null;
+ }
+
+ $parent = clone $this;
+
+ --$parent->length;
+ $parent->pathAsString = substr($parent->pathAsString, 0, max(strrpos($parent->pathAsString, '.'), strrpos($parent->pathAsString, '[')));
+ array_pop($parent->elements);
+ array_pop($parent->singulars);
+ array_pop($parent->isIndex);
+
+ return $parent;
+ }
+
+ /**
+ * Returns a new iterator for this path
+ *
+ * @return PropertyPathIteratorInterface
+ */
+ public function getIterator()
+ {
+ return new PropertyPathIterator($this);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getElements()
+ {
+ return $this->elements;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getElement($index)
+ {
+ if (!isset($this->elements[$index])) {
+ throw new OutOfBoundsException(sprintf('The index %s is not within the property path', $index));
+ }
+
+ return $this->elements[$index];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isProperty($index)
+ {
+ if (!isset($this->isIndex[$index])) {
+ throw new OutOfBoundsException(sprintf('The index %s is not within the property path', $index));
+ }
+
+ return !$this->isIndex[$index];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isIndex($index)
+ {
+ if (!isset($this->isIndex[$index])) {
+ throw new OutOfBoundsException(sprintf('The index %s is not within the property path', $index));
+ }
+
+ return $this->isIndex[$index];
+ }
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathBuilder.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathBuilder.php
new file mode 100644
index 0000000..f4eb0fb
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathBuilder.php
@@ -0,0 +1,306 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+use Symfony\Component\PropertyAccess\Exception\OutOfBoundsException;
+
+/**
+ * @author Bernhard Schussek
+ */
+class PropertyPathBuilder
+{
+ /**
+ * @var array
+ */
+ private $elements = array();
+
+ /**
+ * @var array
+ */
+ private $isIndex = array();
+
+ /**
+ * Creates a new property path builder.
+ *
+ * @param null|PropertyPathInterface|string $path The path to initially store
+ * in the builder. Optional.
+ */
+ public function __construct($path = null)
+ {
+ if (null !== $path) {
+ $this->append($path);
+ }
+ }
+
+ /**
+ * Appends a (sub-) path to the current path.
+ *
+ * @param PropertyPathInterface|string $path The path to append.
+ * @param integer $offset The offset where the appended
+ * piece starts in $path.
+ * @param integer $length The length of the appended piece.
+ * If 0, the full path is appended.
+ */
+ public function append($path, $offset = 0, $length = 0)
+ {
+ if (is_string($path)) {
+ $path = new PropertyPath($path);
+ }
+
+ if (0 === $length) {
+ $end = $path->getLength();
+ } else {
+ $end = $offset + $length;
+ }
+
+ for (; $offset < $end; ++$offset) {
+ $this->elements[] = $path->getElement($offset);
+ $this->isIndex[] = $path->isIndex($offset);
+ }
+ }
+
+ /**
+ * Appends an index element to the current path.
+ *
+ * @param string $name The name of the appended index
+ */
+ public function appendIndex($name)
+ {
+ $this->elements[] = $name;
+ $this->isIndex[] = true;
+ }
+
+ /**
+ * Appends a property element to the current path.
+ *
+ * @param string $name The name of the appended property
+ */
+ public function appendProperty($name)
+ {
+ $this->elements[] = $name;
+ $this->isIndex[] = false;
+ }
+
+ /**
+ * Removes elements from the current path.
+ *
+ * @param integer $offset The offset at which to remove
+ * @param integer $length The length of the removed piece
+ *
+ * @throws OutOfBoundsException if offset is invalid
+ */
+ public function remove($offset, $length = 1)
+ {
+ if (!isset($this->elements[$offset])) {
+ throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
+ }
+
+ $this->resize($offset, $length, 0);
+ }
+
+ /**
+ * Replaces a sub-path by a different (sub-) path.
+ *
+ * @param integer $offset The offset at which to replace.
+ * @param integer $length The length of the piece to replace.
+ * @param PropertyPathInterface|string $path The path to insert.
+ * @param integer $pathOffset The offset where the inserted piece
+ * starts in $path.
+ * @param integer $pathLength The length of the inserted piece.
+ * If 0, the full path is inserted.
+ *
+ * @throws OutOfBoundsException If the offset is invalid
+ */
+ public function replace($offset, $length, $path, $pathOffset = 0, $pathLength = 0)
+ {
+ if (is_string($path)) {
+ $path = new PropertyPath($path);
+ }
+
+ if ($offset < 0 && abs($offset) <= $this->getLength()) {
+ $offset = $this->getLength() + $offset;
+ } elseif (!isset($this->elements[$offset])) {
+ throw new OutOfBoundsException('The offset ' . $offset . ' is not within the property path');
+ }
+
+ if (0 === $pathLength) {
+ $pathLength = $path->getLength() - $pathOffset;
+ }
+
+ $this->resize($offset, $length, $pathLength);
+
+ for ($i = 0; $i < $pathLength; ++$i) {
+ $this->elements[$offset + $i] = $path->getElement($pathOffset + $i);
+ $this->isIndex[$offset + $i] = $path->isIndex($pathOffset + $i);
+ }
+ }
+
+ /**
+ * Replaces a property element by an index element.
+ *
+ * @param integer $offset The offset at which to replace
+ * @param string $name The new name of the element. Optional.
+ *
+ * @throws OutOfBoundsException If the offset is invalid
+ */
+ public function replaceByIndex($offset, $name = null)
+ {
+ if (!isset($this->elements[$offset])) {
+ throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
+ }
+
+ if (null !== $name) {
+ $this->elements[$offset] = $name;
+ }
+
+ $this->isIndex[$offset] = true;
+ }
+
+ /**
+ * Replaces an index element by a property element.
+ *
+ * @param integer $offset The offset at which to replace
+ * @param string $name The new name of the element. Optional.
+ *
+ * @throws OutOfBoundsException If the offset is invalid
+ */
+ public function replaceByProperty($offset, $name = null)
+ {
+ if (!isset($this->elements[$offset])) {
+ throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
+ }
+
+ if (null !== $name) {
+ $this->elements[$offset] = $name;
+ }
+
+ $this->isIndex[$offset] = false;
+ }
+
+ /**
+ * Returns the length of the current path.
+ *
+ * @return integer The path length
+ */
+ public function getLength()
+ {
+ return count($this->elements);
+ }
+
+ /**
+ * Returns the current property path.
+ *
+ * @return PropertyPathInterface The constructed property path
+ */
+ public function getPropertyPath()
+ {
+ $pathAsString = $this->__toString();
+
+ return '' !== $pathAsString ? new PropertyPath($pathAsString) : null;
+ }
+
+ /**
+ * Returns the current property path as string.
+ *
+ * @return string The property path as string
+ */
+ public function __toString()
+ {
+ $string = '';
+
+ foreach ($this->elements as $offset => $element) {
+ if ($this->isIndex[$offset]) {
+ $element = '['.$element.']';
+ } elseif ('' !== $string) {
+ $string .= '.';
+ }
+
+ $string .= $element;
+ }
+
+ return $string;
+ }
+
+ /**
+ * Resizes the path so that a chunk of length $cutLength is
+ * removed at $offset and another chunk of length $insertionLength
+ * can be inserted.
+ *
+ * @param integer $offset The offset where the removed chunk starts
+ * @param integer $cutLength The length of the removed chunk
+ * @param integer $insertionLength The length of the inserted chunk
+ */
+ private function resize($offset, $cutLength, $insertionLength)
+ {
+ // Nothing else to do in this case
+ if ($insertionLength === $cutLength) {
+ return;
+ }
+
+ $length = count($this->elements);
+
+ if ($cutLength > $insertionLength) {
+ // More elements should be removed than inserted
+ $diff = $cutLength - $insertionLength;
+ $newLength = $length - $diff;
+
+ // Shift elements to the left (left-to-right until the new end)
+ // Max allowed offset to be shifted is such that
+ // $offset + $diff < $length (otherwise invalid index access)
+ // i.e. $offset < $length - $diff = $newLength
+ for ($i = $offset; $i < $newLength; ++$i) {
+ $this->elements[$i] = $this->elements[$i + $diff];
+ $this->isIndex[$i] = $this->isIndex[$i + $diff];
+ }
+
+ // All remaining elements should be removed
+ for (; $i < $length; ++$i) {
+ unset($this->elements[$i]);
+ unset($this->isIndex[$i]);
+ }
+ } else {
+ $diff = $insertionLength - $cutLength;
+
+ $newLength = $length + $diff;
+ $indexAfterInsertion = $offset + $insertionLength;
+
+ // $diff <= $insertionLength
+ // $indexAfterInsertion >= $insertionLength
+ // => $diff <= $indexAfterInsertion
+
+ // In each of the following loops, $i >= $diff must hold,
+ // otherwise ($i - $diff) becomes negative.
+
+ // Shift old elements to the right to make up space for the
+ // inserted elements. This needs to be done left-to-right in
+ // order to preserve an ascending array index order
+ // Since $i = max($length, $indexAfterInsertion) and $indexAfterInsertion >= $diff,
+ // $i >= $diff is guaranteed.
+ for ($i = max($length, $indexAfterInsertion); $i < $newLength; ++$i) {
+ $this->elements[$i] = $this->elements[$i - $diff];
+ $this->isIndex[$i] = $this->isIndex[$i - $diff];
+ }
+
+ // Shift remaining elements to the right. Do this right-to-left
+ // so we don't overwrite elements before copying them
+ // The last written index is the immediate index after the inserted
+ // string, because the indices before that will be overwritten
+ // anyway.
+ // Since $i >= $indexAfterInsertion and $indexAfterInsertion >= $diff,
+ // $i >= $diff is guaranteed.
+ for ($i = $length - 1; $i >= $indexAfterInsertion; --$i) {
+ $this->elements[$i] = $this->elements[$i - $diff];
+ $this->isIndex[$i] = $this->isIndex[$i - $diff];
+ }
+ }
+ }
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathInterface.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathInterface.php
new file mode 100644
index 0000000..95f34ff
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathInterface.php
@@ -0,0 +1,86 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+/**
+ * A sequence of property names or array indices.
+ *
+ * @author Bernhard Schussek
+ */
+interface PropertyPathInterface extends \Traversable
+{
+ /**
+ * Returns the string representation of the property path
+ *
+ * @return string The path as string
+ */
+ public function __toString();
+
+ /**
+ * Returns the length of the property path, i.e. the number of elements.
+ *
+ * @return integer The path length
+ */
+ public function getLength();
+
+ /**
+ * Returns the parent property path.
+ *
+ * The parent property path is the one that contains the same items as
+ * this one except for the last one.
+ *
+ * If this property path only contains one item, null is returned.
+ *
+ * @return PropertyPath The parent path or null
+ */
+ public function getParent();
+
+ /**
+ * Returns the elements of the property path as array
+ *
+ * @return array An array of property/index names
+ */
+ public function getElements();
+
+ /**
+ * Returns the element at the given index in the property path
+ *
+ * @param integer $index The index key
+ *
+ * @return string A property or index name
+ *
+ * @throws Exception\OutOfBoundsException If the offset is invalid
+ */
+ public function getElement($index);
+
+ /**
+ * Returns whether the element at the given index is a property
+ *
+ * @param integer $index The index in the property path
+ *
+ * @return Boolean Whether the element at this index is a property
+ *
+ * @throws Exception\OutOfBoundsException If the offset is invalid
+ */
+ public function isProperty($index);
+
+ /**
+ * Returns whether the element at the given index is an array index
+ *
+ * @param integer $index The index in the property path
+ *
+ * @return Boolean Whether the element at this index is an array index
+ *
+ * @throws Exception\OutOfBoundsException If the offset is invalid
+ */
+ public function isIndex($index);
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathIterator.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathIterator.php
new file mode 100644
index 0000000..d6cd49c
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathIterator.php
@@ -0,0 +1,55 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+/**
+ * Traverses a property path and provides additional methods to find out
+ * information about the current element
+ *
+ * @author Bernhard Schussek
+ */
+class PropertyPathIterator extends \ArrayIterator implements PropertyPathIteratorInterface
+{
+ /**
+ * The traversed property path
+ * @var PropertyPathInterface
+ */
+ protected $path;
+
+ /**
+ * Constructor.
+ *
+ * @param PropertyPathInterface $path The property path to traverse
+ */
+ public function __construct(PropertyPathInterface $path)
+ {
+ parent::__construct($path->getElements());
+
+ $this->path = $path;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isIndex()
+ {
+ return $this->path->isIndex($this->key());
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isProperty()
+ {
+ return $this->path->isProperty($this->key());
+ }
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathIteratorInterface.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathIteratorInterface.php
new file mode 100644
index 0000000..cb43f8d
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPathIteratorInterface.php
@@ -0,0 +1,34 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+/**
+ * @author Bernhard Schussek
+ */
+interface PropertyPathIteratorInterface extends \Iterator, \SeekableIterator
+{
+ /**
+ * Returns whether the current element in the property path is an array
+ * index.
+ *
+ * @return Boolean
+ */
+ public function isIndex();
+
+ /**
+ * Returns whether the current element in the property path is a property
+ * name.
+ *
+ * @return Boolean
+ */
+ public function isProperty();
+}
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/README.md b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/README.md
new file mode 100644
index 0000000..79b6ebc
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/README.md
@@ -0,0 +1,14 @@
+PropertyAccess Component
+========================
+
+PropertyAccess reads/writes values from/to object/array graphs using a simple
+string notation.
+
+Resources
+---------
+
+You can run the unit tests with the following command:
+
+ $ cd path/to/Symfony/Component/PropertyAccess/
+ $ composer.phar install
+ $ phpunit
diff --git a/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/StringUtil.php b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/StringUtil.php
new file mode 100644
index 0000000..509bce4
--- /dev/null
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/StringUtil.php
@@ -0,0 +1,201 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\PropertyAccess;
+
+/**
+ * Creates singulars from plurals.
+ *
+ * @author Bernhard Schussek
+ */
+class StringUtil
+{
+ /**
+ * Map english plural to singular suffixes
+ *
+ * @var array
+ *
+ * @see http://english-zone.com/spelling/plurals.html
+ * @see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English
+ */
+ private static $pluralMap = array(
+ // First entry: plural suffix, reversed
+ // Second entry: length of plural suffix
+ // Third entry: Whether the suffix may succeed a vocal
+ // Fourth entry: Whether the suffix may succeed a consonant
+ // Fifth entry: singular suffix, normal
+
+ // bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
+ array('a', 1, true, true, array('on', 'um')),
+
+ // nebulae (nebula)
+ array('ea', 2, true, true, 'a'),
+
+ // mice (mouse), lice (louse)
+ array('eci', 3, false, true, 'ouse'),
+
+ // geese (goose)
+ array('esee', 4, false, true, 'oose'),
+
+ // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius)
+ array('i', 1, true, true, 'us'),
+
+ // men (man), women (woman)
+ array('nem', 3, true, true, 'man'),
+
+ // children (child)
+ array('nerdlihc', 8, true, true, 'child'),
+
+ // oxen (ox)
+ array('nexo', 4, false, false, 'ox'),
+
+ // indices (index), appendices (appendix), prices (price)
+ array('seci', 4, false, true, array('ex', 'ix', 'ice')),
+
+ // babies (baby)
+ array('sei', 3, false, true, 'y'),
+
+ // accesses (access), addresses (address), kisses (kiss)
+ array('sess', 4, true, false, 'ss'),
+
+ // analyses (analysis), ellipses (ellipsis), funguses (fungus),
+ // neuroses (neurosis), theses (thesis), emphases (emphasis),
+ // oases (oasis), crises (crisis), houses (house), bases (base),
+ // atlases (atlas)
+ array('ses', 3, true, true, array('s', 'se', 'sis')),
+
+ // objectives (objective), alternative (alternatives)
+ array('sevit', 5, true, true, 'tive'),
+
+ // lives (life), wives (wife)
+ array('sevi', 4, false, true, 'ife'),
+
+ // moves (move)
+ array('sevom', 5, true, true, 'move'),
+
+ // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf)
+ array('sev', 3, true, true, 'f'),
+
+ // axes (axis), axes (ax), axes (axe)
+ array('sexa', 4, false, false, array('ax', 'axe', 'axis')),
+
+ // indexes (index), matrixes (matrix)
+ array('sex', 3, true, false, 'x'),
+
+ // quizzes (quiz)
+ array('sezz', 4, true, false, 'z'),
+
+ // bureaus (bureau)
+ array('suae', 4, false, true, 'eau'),
+
+ // roses (rose), garages (garage), cassettes (cassette),
+ // waltzes (waltz), heroes (hero), bushes (bush), arches (arch),
+ // shoes (shoe)
+ array('se', 2, true, true, array('', 'e')),
+
+ // tags (tag)
+ array('s', 1, true, true, ''),
+
+ // chateaux (chateau)
+ array('xuae', 4, false, true, 'eau'),
+ );
+
+ /**
+ * This class should not be instantiated
+ */
+ private function __construct() {}
+
+ /**
+ * Returns the singular form of a word
+ *
+ * If the method can't determine the form with certainty, an array of the
+ * possible singulars is returned.
+ *
+ * @param string $plural A word in plural form
+ * @return string|array The singular form or an array of possible singular
+ * forms
+ */
+ public static function singularify($plural)
+ {
+ $pluralRev = strrev($plural);
+ $lowerPluralRev = strtolower($pluralRev);
+ $pluralLength = strlen($lowerPluralRev);
+
+ // The outer loop iterates over the entries of the plural table
+ // The inner loop $j iterates over the characters of the plural suffix
+ // in the plural table to compare them with the characters of the actual
+ // given plural suffix
+ foreach (self::$pluralMap as $map) {
+ $suffix = $map[0];
+ $suffixLength = $map[1];
+ $j = 0;
+
+ // Compare characters in the plural table and of the suffix of the
+ // given plural one by one
+ while ($suffix[$j] === $lowerPluralRev[$j]) {
+ // Let $j point to the next character
+ ++$j;
+
+ // Successfully compared the last character
+ // Add an entry with the singular suffix to the singular array
+ if ($j === $suffixLength) {
+ // Is there any character preceding the suffix in the plural string?
+ if ($j < $pluralLength) {
+ $nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]);
+
+ if (!$map[2] && $nextIsVocal) {
+ // suffix may not succeed a vocal but next char is one
+ break;
+ }
+
+ if (!$map[3] && !$nextIsVocal) {
+ // suffix may not succeed a consonant but next char is one
+ break;
+ }
+ }
+
+ $newBase = substr($plural, 0, $pluralLength - $suffixLength);
+ $newSuffix = $map[4];
+
+ // Check whether the first character in the plural suffix
+ // is uppercased. If yes, uppercase the first character in
+ // the singular suffix too
+ $firstUpper = ctype_upper($pluralRev[$j - 1]);
+
+ if (is_array($newSuffix)) {
+ $singulars = array();
+
+ foreach ($newSuffix as $newSuffixEntry) {
+ $singulars[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry);
+ }
+
+ return $singulars;
+ }
+
+ return $newBase.($firstUpper ? ucFirst($newSuffix) : $newSuffix);
+ }
+
+ // Suffix is longer than word
+ if ($j === $pluralLength) {
+ break;
+ }
+ }
+ }
+
+ // Convert teeth to tooth, feet to foot
+ if (false !== ($pos = strpos($plural, 'ee')) && strlen($plural) > 3) {
+ return substr_replace($plural, 'oo', $pos, 2);
+ }
+
+ // Assume that plural and singular is identical
+ return $plural;
+ }
+}
diff --git a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/composer.json
similarity index 57%
copy from core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json
copy to core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/composer.json
index 06a1c62..d79eba1 100644
--- a/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json
+++ b/core/vendor/symfony/property-access/Symfony/Component/PropertyAccess/composer.json
@@ -1,8 +1,8 @@
{
- "name": "symfony/class-loader",
+ "name": "symfony/property-access",
"type": "library",
- "description": "Symfony ClassLoader Component",
- "keywords": [],
+ "description": "Symfony PropertyAccess Component",
+ "keywords": ["property", "index", "access", "object", "array", "extraction", "injection", "reflection", "property path"],
"homepage": "http://symfony.com",
"license": "MIT",
"authors": [
@@ -15,20 +15,17 @@
"homepage": "http://symfony.com/contributors"
}
],
- "minimum-stability": "dev",
"require": {
"php": ">=5.3.3"
},
- "require-dev": {
- "symfony/finder": "~2.0"
- },
"autoload": {
- "psr-0": { "Symfony\\Component\\ClassLoader\\": "" }
+ "psr-0": { "Symfony\\Component\\PropertyAccess\\": "" }
},
- "target-dir": "Symfony/Component/ClassLoader",
+ "target-dir": "Symfony/Component/PropertyAccess",
+ "minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php
index abdbea2..ebda097 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php
@@ -22,12 +22,13 @@ class Route
{
private $path;
private $name;
- private $requirements;
- private $options;
- private $defaults;
+ private $requirements = array();
+ private $options = array();
+ private $defaults = array();
private $host;
- private $methods;
- private $schemes;
+ private $methods = array();
+ private $schemes = array();
+ private $condition;
/**
* Constructor.
@@ -38,12 +39,6 @@ class Route
*/
public function __construct(array $data)
{
- $this->requirements = array();
- $this->options = array();
- $this->defaults = array();
- $this->methods = array();
- $this->schemes = array();
-
if (isset($data['value'])) {
$data['path'] = $data['value'];
unset($data['value']);
@@ -153,4 +148,14 @@ public function getMethods()
{
return $this->methods;
}
+
+ public function setCondition($condition)
+ {
+ $this->condition = $condition;
+ }
+
+ public function getCondition()
+ {
+ return $this->condition;
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php
index 5925838..8c25f34 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php
@@ -25,7 +25,7 @@
* params because they come from third party libs but don't want to have a 404 in
* production environment. It should log the mismatch so one can review it.
* - setStrictRequirements(null): Return the URL with the given parameters without
- * checking the requirements at all. When generating an URL you should either trust
+ * checking the requirements at all. When generating a URL you should either trust
* your params or you validated them beforehand because otherwise it would break your
* link anyway. So in production environment you should know that params always pass
* the requirements. Thus this option allows to disable the check on URL generation for
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php
index 42cd910..4d19d2a 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php
@@ -92,6 +92,7 @@ private function generateDeclaredRoutes()
$properties[] = $route->getRequirements();
$properties[] = $compiledRoute->getTokens();
$properties[] = $compiledRoute->getHostTokens();
+ $properties[] = $route->getSchemes();
$routes .= sprintf(" '%s' => %s,\n", $name, str_replace("\n", '', var_export($properties, true)));
}
@@ -114,9 +115,9 @@ public function generate(\$name, \$parameters = array(), \$referenceType = self:
throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', \$name));
}
- list(\$variables, \$defaults, \$requirements, \$tokens, \$hostTokens) = self::\$declaredRoutes[\$name];
+ list(\$variables, \$defaults, \$requirements, \$tokens, \$hostTokens, \$requiredSchemes) = self::\$declaredRoutes[\$name];
- return \$this->doGenerate(\$variables, \$defaults, \$requirements, \$tokens, \$parameters, \$name, \$referenceType, \$hostTokens);
+ return \$this->doGenerate(\$variables, \$defaults, \$requirements, \$tokens, \$parameters, \$name, \$referenceType, \$hostTokens, \$requiredSchemes);
}
EOF;
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php
index f224cb3..4687084 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php
@@ -137,7 +137,7 @@ public function generate($name, $parameters = array(), $referenceType = self::AB
// the Route has a cache of its own and is not recompiled as long as it does not get modified
$compiledRoute = $route->compile();
- return $this->doGenerate($compiledRoute->getVariables(), $route->getDefaults(), $route->getRequirements(), $compiledRoute->getTokens(), $parameters, $name, $referenceType, $compiledRoute->getHostTokens());
+ return $this->doGenerate($compiledRoute->getVariables(), $route->getDefaults(), $route->getRequirements(), $compiledRoute->getTokens(), $parameters, $name, $referenceType, $compiledRoute->getHostTokens(), $route->getSchemes());
}
/**
@@ -145,7 +145,7 @@ public function generate($name, $parameters = array(), $referenceType = self::AB
* @throws InvalidParameterException When a parameter value for a placeholder is not correct because
* it does not match the requirement
*/
- protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens)
+ protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array())
{
$variables = array_flip($variables);
$mergedParams = array_replace($defaults, $this->context->getParameters(), $parameters);
@@ -188,7 +188,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
$url = '/';
}
- // the contexts base url is already encoded (see Symfony\Component\HttpFoundation\Request)
+ // the contexts base URL is already encoded (see Symfony\Component\HttpFoundation\Request)
$url = strtr(rawurlencode($url), $this->decodedChars);
// the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3
@@ -204,7 +204,24 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
$schemeAuthority = '';
if ($host = $this->context->getHost()) {
$scheme = $this->context->getScheme();
- if (isset($requirements['_scheme']) && ($req = strtolower($requirements['_scheme'])) && $scheme !== $req) {
+
+ if ($requiredSchemes) {
+ $schemeMatched = false;
+ foreach ($requiredSchemes as $requiredScheme) {
+ if ($scheme === $requiredScheme) {
+ $schemeMatched = true;
+
+ break;
+ }
+ }
+
+ if (!$schemeMatched) {
+ $referenceType = self::ABSOLUTE_URL;
+ $scheme = current($requiredSchemes);
+ }
+
+ } elseif (isset($requirements['_scheme']) && ($req = strtolower($requirements['_scheme'])) && $scheme !== $req) {
+ // We do this for BC; to be removed if _scheme is not supported anymore
$referenceType = self::ABSOLUTE_URL;
$scheme = $req;
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
index 9831d85..af70a88 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
@@ -116,6 +116,7 @@ public function load($class, $type = null)
'schemes' => array(),
'methods' => array(),
'host' => '',
+ 'condition' => '',
);
$class = new \ReflectionClass($class);
@@ -154,6 +155,10 @@ public function load($class, $type = null)
if (null !== $annot->getHost()) {
$globals['host'] = $annot->getHost();
}
+
+ if (null !== $annot->getCondition()) {
+ $globals['condition'] = $annot->getCondition();
+ }
}
$collection = new RouteCollection();
@@ -180,7 +185,7 @@ protected function addRoute(RouteCollection $collection, $annot, $globals, \Refl
$defaults = array_replace($globals['defaults'], $annot->getDefaults());
foreach ($method->getParameters() as $param) {
- if ($param->isOptional()) {
+ if (!isset($defaults[$param->getName()]) && $param->isOptional()) {
$defaults[$param->getName()] = $param->getDefaultValue();
}
}
@@ -194,7 +199,12 @@ protected function addRoute(RouteCollection $collection, $annot, $globals, \Refl
$host = $globals['host'];
}
- $route = new Route($globals['path'].$annot->getPath(), $defaults, $requirements, $options, $host, $schemes, $methods);
+ $condition = $annot->getCondition();
+ if (null === $condition) {
+ $condition = $globals['condition'];
+ }
+
+ $route = new Route($globals['path'].$annot->getPath(), $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
$this->configureRoute($route, $class, $method, $annot);
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php
index da7b33d..e854202 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/XmlFileLoader.php
@@ -129,9 +129,9 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $node, $p
$schemes = preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, PREG_SPLIT_NO_EMPTY);
$methods = preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, PREG_SPLIT_NO_EMPTY);
- list($defaults, $requirements, $options) = $this->parseConfigs($node, $path);
+ list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path);
- $route = new Route($node->getAttribute('path'), $defaults, $requirements, $options, $node->getAttribute('host'), $schemes, $methods);
+ $route = new Route($node->getAttribute('path'), $defaults, $requirements, $options, $node->getAttribute('host'), $schemes, $methods, $condition);
$collection->add($id, $route);
}
@@ -157,7 +157,7 @@ protected function parseImport(RouteCollection $collection, \DOMElement $node, $
$schemes = $node->hasAttribute('schemes') ? preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, PREG_SPLIT_NO_EMPTY) : null;
$methods = $node->hasAttribute('methods') ? preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, PREG_SPLIT_NO_EMPTY) : null;
- list($defaults, $requirements, $options) = $this->parseConfigs($node, $path);
+ list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path);
$this->setCurrentDir(dirname($path));
@@ -211,6 +211,7 @@ private function parseConfigs(\DOMElement $node, $path)
$defaults = array();
$requirements = array();
$options = array();
+ $condition = null;
foreach ($node->getElementsByTagNameNS(self::NAMESPACE_URI, '*') as $n) {
switch ($n->localName) {
@@ -228,11 +229,14 @@ private function parseConfigs(\DOMElement $node, $path)
case 'option':
$options[$n->getAttribute('key')] = trim($n->textContent);
break;
+ case 'condition':
+ $condition = trim($n->textContent);
+ break;
default:
throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "default", "requirement" or "option".', $n->localName, $path));
}
}
- return array($defaults, $requirements, $options);
+ return array($defaults, $requirements, $options, $condition);
}
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php
index 9deea7f..d3eaea4 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/YamlFileLoader.php
@@ -28,7 +28,7 @@
class YamlFileLoader extends FileLoader
{
private static $availableKeys = array(
- 'resource', 'type', 'prefix', 'pattern', 'path', 'host', 'schemes', 'methods', 'defaults', 'requirements', 'options',
+ 'resource', 'type', 'prefix', 'pattern', 'path', 'host', 'schemes', 'methods', 'defaults', 'requirements', 'options', 'condition'
);
private $yamlParser;
@@ -123,8 +123,9 @@ protected function parseRoute(RouteCollection $collection, $name, array $config,
$host = isset($config['host']) ? $config['host'] : '';
$schemes = isset($config['schemes']) ? $config['schemes'] : array();
$methods = isset($config['methods']) ? $config['methods'] : array();
+ $condition = isset($config['condition']) ? $config['condition'] : null;
- $route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods);
+ $route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
$collection->add($name, $route);
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd
index daea814..9ab969a 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd
@@ -29,6 +29,7 @@
+
@@ -61,4 +62,9 @@
+
+
+
+
+
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
index 01d8c03..5b32684 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
@@ -50,6 +50,9 @@ public function dump(array $options = array())
$prevHostRegex = '';
foreach ($this->getRoutes()->all() as $name => $route) {
+ if ($route->getCondition()) {
+ throw new \LogicException(sprintf('Unable to dump the routes for Apache as route "%s" has a condition.', $name));
+ }
$compiledRoute = $route->compile();
$hostRegex = $compiledRoute->getHostRegex();
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php
index f85e4ce..5e7c134 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/MatcherDumperInterface.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Routing\Matcher\Dumper;
+use Symfony\Component\Routing\RouteCollection;
+
/**
* MatcherDumperInterface is the interface that all matcher dumper classes must implement.
*
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
index dc17ffb..784f309 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
@@ -13,6 +13,7 @@
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
+use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
/**
* PhpMatcherDumper creates a PHP class able to match URLs for a given set of routes.
@@ -23,6 +24,8 @@
*/
class PhpMatcherDumper extends MatcherDumper
{
+ private $expressionLanguage;
+
/**
* Dumps a set of routes to a PHP class.
*
@@ -91,6 +94,8 @@ public function match(\$pathinfo)
{
\$allow = array();
\$pathinfo = rawurldecode(\$pathinfo);
+ \$context = \$this->context;
+ \$request = \$this->request;
$code
@@ -237,6 +242,10 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren
$hostMatches = true;
}
+ if ($route->getCondition()) {
+ $conditions[] = $this->getExpressionLanguage()->compile($route->getCondition(), array('context', 'request'));
+ }
+
$conditions = implode(' && ', $conditions);
$code .= <<context->getMethod() != '$methods[0]') {
@@ -280,14 +288,15 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren
EOF;
}
- if ($scheme = $route->getRequirement('_scheme')) {
+ if ($schemes = $route->getSchemes()) {
if (!$supportsRedirections) {
- throw new \LogicException('The "_scheme" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface.');
+ throw new \LogicException('The "schemes" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface.');
}
-
+ $schemes = str_replace("\n", '', var_export(array_flip($schemes), true));
$code .= <<context->getScheme() !== '$scheme') {
- return \$this->redirect(\$pathinfo, '$name', '$scheme');
+ \$requiredSchemes = $schemes;
+ if (!isset(\$requiredSchemes[\$this->context->getScheme()])) {
+ return \$this->redirect(\$pathinfo, '$name', key(\$requiredSchemes));
}
@@ -305,8 +314,11 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren
}
$vars[] = "array('_route' => '$name')";
- $code .= sprintf(" return \$this->mergeDefaults(array_replace(%s), %s);\n"
- , implode(', ', $vars), str_replace("\n", '', var_export($route->getDefaults(), true)));
+ $code .= sprintf(
+ " return \$this->mergeDefaults(array_replace(%s), %s);\n",
+ implode(', ', $vars),
+ str_replace("\n", '', var_export($route->getDefaults(), true))
+ );
} elseif ($route->getDefaults()) {
$code .= sprintf(" return %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), array('_route' => $name)), true)));
@@ -375,4 +387,16 @@ private function buildPrefixTree(DumperCollection $collection)
return $tree;
}
+
+ private function getExpressionLanguage()
+ {
+ if (null === $this->expressionLanguage) {
+ if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
+ throw new \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
+ }
+ $this->expressionLanguage = new ExpressionLanguage();
+ }
+
+ return $this->expressionLanguage;
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php
index 51e8005..3d13181 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcher.php
@@ -50,10 +50,16 @@ public function match($pathinfo)
*/
protected function handleRouteRequirements($pathinfo, $name, Route $route)
{
+ // expression condition
+ if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request))) {
+ return array(self::REQUIREMENT_MISMATCH, null);
+ }
+
// check HTTP scheme requirement
- $scheme = $route->getRequirement('_scheme');
- if ($scheme && $this->context->getScheme() !== $scheme) {
- return array(self::ROUTE_MATCH, $this->redirect($pathinfo, $name, $scheme));
+ $scheme = $this->context->getScheme();
+ $schemes = $route->getSchemes();
+ if ($schemes && !$route->hasScheme($scheme)) {
+ return array(self::ROUTE_MATCH, $this->redirect($pathinfo, $name, current($schemes)));
}
return array(self::REQUIREMENT_MATCH, null);
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php
index c09f83e..22af699 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/TraceableUrlMatcher.php
@@ -14,7 +14,6 @@
use Symfony\Component\Routing\Exception\ExceptionInterface;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
-use Symfony\Component\Routing\Matcher\UrlMatcher;
/**
* TraceableUrlMatcher helps debug path info matching by tracing the match.
@@ -75,7 +74,7 @@ protected function matchCollection($pathinfo, RouteCollection $routes)
if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) {
$this->addTrace(sprintf('Host "%s" does not match the requirement ("%s")', $this->context->getHost(), $route->getHost()), self::ROUTE_ALMOST_MATCHES, $name, $route);
- return true;
+ continue;
}
// check HTTP method requirement
@@ -94,10 +93,21 @@ protected function matchCollection($pathinfo, RouteCollection $routes)
}
}
+ // check condition
+ if ($condition = $route->getCondition()) {
+ if (!$this->getExpressionLanguage()->evaluate($condition, array('context' => $this->context, 'request' => $this->request))) {
+ $this->addTrace(sprintf('Condition "%s" does not evaluate to "true"', $condition), self::ROUTE_ALMOST_MATCHES, $name, $route);
+
+ continue;
+ }
+ }
+
// check HTTP scheme requirement
- if ($scheme = $route->getRequirement('_scheme')) {
- if ($this->context->getScheme() !== $scheme) {
- $this->addTrace(sprintf('Scheme "%s" does not match the requirement ("%s"); the user will be redirected', $this->context->getScheme(), $scheme), self::ROUTE_ALMOST_MATCHES, $name, $route);
+ if ($requiredSchemes = $route->getSchemes()) {
+ $scheme = $this->context->getScheme();
+
+ if (!$route->hasScheme($scheme)) {
+ $this->addTrace(sprintf('Scheme "%s" does not match any of the required schemes ("%s"); the user will be redirected to first required scheme', $scheme, implode(', ', $requiredSchemes)), self::ROUTE_ALMOST_MATCHES, $name, $route);
return true;
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php
index db18ec4..8d081a8 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php
@@ -16,6 +16,8 @@
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Route;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
/**
* UrlMatcher matches URL based on a set of routes.
@@ -24,7 +26,7 @@
*
* @api
*/
-class UrlMatcher implements UrlMatcherInterface
+class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
{
const REQUIREMENT_MATCH = 0;
const REQUIREMENT_MISMATCH = 1;
@@ -45,6 +47,9 @@ class UrlMatcher implements UrlMatcherInterface
*/
protected $routes;
+ protected $request;
+ protected $expressionLanguage;
+
/**
* Constructor.
*
@@ -92,6 +97,20 @@ public function match($pathinfo)
}
/**
+ * {@inheritdoc}
+ */
+ public function matchRequest(Request $request)
+ {
+ $this->request = $request;
+
+ $ret = $this->match($request->getPathInfo());
+
+ $this->request = null;
+
+ return $ret;
+ }
+
+ /**
* Tries to match a URL with a set of routes.
*
* @param string $pathinfo The path info to be parsed
@@ -180,9 +199,14 @@ protected function getAttributes(Route $route, $name, array $attributes)
*/
protected function handleRouteRequirements($pathinfo, $name, Route $route)
{
+ // expression condition
+ if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request))) {
+ return array(self::REQUIREMENT_MISMATCH, null);
+ }
+
// check HTTP scheme requirement
- $scheme = $route->getRequirement('_scheme');
- $status = $scheme && $scheme !== $this->context->getScheme() ? self::REQUIREMENT_MISMATCH : self::REQUIREMENT_MATCH;
+ $scheme = $this->context->getScheme();
+ $status = $route->getSchemes() && !$route->hasScheme($scheme) ? self::REQUIREMENT_MISMATCH : self::REQUIREMENT_MATCH;
return array($status, null);
}
@@ -205,4 +229,16 @@ protected function mergeDefaults($params, $defaults)
return $defaults;
}
+
+ protected function getExpressionLanguage()
+ {
+ if (null === $this->expressionLanguage) {
+ if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
+ throw new \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
+ }
+ $this->expressionLanguage = new ExpressionLanguage();
+ }
+
+ return $this->expressionLanguage;
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/README.md b/core/vendor/symfony/routing/Symfony/Component/Routing/README.md
index 663844a..83febc7 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/README.md
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/README.md
@@ -30,5 +30,5 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Routing/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php
index 5bc535c..0800554 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php
@@ -61,6 +61,8 @@ class Route implements \Serializable
*/
private $compiled;
+ private $condition;
+
/**
* Constructor.
*
@@ -75,10 +77,11 @@ class Route implements \Serializable
* @param string $host The host pattern to match
* @param string|array $schemes A required URI scheme or an array of restricted schemes
* @param string|array $methods A required HTTP method or an array of restricted methods
+ * @param string $condition A condition that should evaluate to true for the route to match
*
* @api
*/
- public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())
+ public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array(), $condition = null)
{
$this->setPath($path);
$this->setDefaults($defaults);
@@ -93,6 +96,7 @@ public function __construct($path, array $defaults = array(), array $requirement
if ($methods) {
$this->setMethods($methods);
}
+ $this->setCondition($condition);
}
public function serialize()
@@ -105,6 +109,7 @@ public function serialize()
'options' => $this->options,
'schemes' => $this->schemes,
'methods' => $this->methods,
+ 'condition' => $this->condition,
));
}
@@ -118,6 +123,7 @@ public function unserialize($data)
$this->options = $data['options'];
$this->schemes = $data['schemes'];
$this->methods = $data['methods'];
+ $this->condition = $data['condition'];
}
/**
@@ -242,6 +248,25 @@ public function setSchemes($schemes)
}
/**
+ * Checks if a scheme requirement has been set.
+ *
+ * @param string $scheme
+ *
+ * @return Boolean true if the scheme requirement exists, otherwise false
+ */
+ public function hasScheme($scheme)
+ {
+ $scheme = strtolower($scheme);
+ foreach ($this->schemes as $requiredScheme) {
+ if ($scheme === $requiredScheme) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
* Returns the uppercased HTTP methods this route is restricted to.
* So an empty array means that any method is allowed.
*
@@ -544,6 +569,33 @@ public function setRequirement($key, $regex)
}
/**
+ * Returns the condition.
+ *
+ * @return string The condition
+ */
+ public function getCondition()
+ {
+ return $this->condition;
+ }
+
+ /**
+ * Sets the condition.
+ *
+ * This method implements a fluent interface.
+ *
+ * @param string $condition The condition
+ *
+ * @return Route The current Route instance
+ */
+ public function setCondition($condition)
+ {
+ $this->condition = (string) $condition;
+ $this->compiled = null;
+
+ return $this;
+ }
+
+ /**
* Compiles the route.
*
* @return CompiledRoute A CompiledRoute instance
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php b/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php
index 499fe0f..f028324 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php
@@ -178,6 +178,20 @@ public function setHost($pattern, array $defaults = array(), array $requirements
}
/**
+ * Sets a condition on all routes.
+ *
+ * Existing conditions will be overridden.
+ *
+ * @param string $condition The condition
+ */
+ public function setCondition($condition)
+ {
+ foreach ($this->routes as $route) {
+ $route->setCondition($condition);
+ }
+ }
+
+ /**
* Adds defaults to all routes.
*
* An existing default value under the same name in a route will be overridden.
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php
index d1e2897..62abec3 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php
@@ -16,7 +16,11 @@
use Psr\Log\LoggerInterface;
use Symfony\Component\Routing\Generator\ConfigurableRequirementsInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+use Symfony\Component\Routing\Generator\Dumper\GeneratorDumperInterface;
+use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
+use Symfony\Component\Routing\Matcher\Dumper\MatcherDumperInterface;
+use Symfony\Component\HttpFoundation\Request;
/**
* The Router class is an example of the integration of all pieces of the
@@ -24,7 +28,7 @@
*
* @author Fabien Potencier
*/
-class Router implements RouterInterface
+class Router implements RouterInterface, RequestMatcherInterface
{
/**
* @var UrlMatcherInterface|null
@@ -80,7 +84,7 @@ public function __construct(LoaderInterface $loader, $resource, array $options =
$this->loader = $loader;
$this->resource = $resource;
$this->logger = $logger;
- $this->context = null === $context ? new RequestContext() : $context;
+ $this->context = $context ?: new RequestContext();
$this->setOptions($options);
}
@@ -216,6 +220,20 @@ public function match($pathinfo)
}
/**
+ * {@inheritdoc}
+ */
+ public function matchRequest(Request $request)
+ {
+ $matcher = $this->getMatcher();
+ if (!$matcher instanceof RequestMatcherInterface) {
+ // fallback to the default UrlMatcherInterface
+ return $matcher->match($request->getPathInfo());
+ }
+
+ return $matcher->matchRequest($request);
+ }
+
+ /**
* Gets the UrlMatcher instance associated with this Router.
*
* @return UrlMatcherInterface A UrlMatcherInterface instance
@@ -232,8 +250,8 @@ public function getMatcher()
$class = $this->options['matcher_cache_class'];
$cache = new ConfigCache($this->options['cache_dir'].'/'.$class.'.php', $this->options['debug']);
- if (!$cache->isFresh($class)) {
- $dumper = new $this->options['matcher_dumper_class']($this->getRouteCollection());
+ if (!$cache->isFresh()) {
+ $dumper = $this->getMatcherDumperInstance();
$options = array(
'class' => $class,
@@ -264,8 +282,8 @@ public function getGenerator()
} else {
$class = $this->options['generator_cache_class'];
$cache = new ConfigCache($this->options['cache_dir'].'/'.$class.'.php', $this->options['debug']);
- if (!$cache->isFresh($class)) {
- $dumper = new $this->options['generator_dumper_class']($this->getRouteCollection());
+ if (!$cache->isFresh()) {
+ $dumper = $this->getGeneratorDumperInstance();
$options = array(
'class' => $class,
@@ -286,4 +304,20 @@ public function getGenerator()
return $this->generator;
}
+
+ /**
+ * @return GeneratorDumperInterface
+ */
+ protected function getGeneratorDumperInstance()
+ {
+ return new $this->options['generator_dumper_class']($this->getRouteCollection());
+ }
+
+ /**
+ * @return MatcherDumperInterface
+ */
+ protected function getMatcherDumperInstance()
+ {
+ return new $this->options['matcher_dumper_class']($this->getRouteCollection());
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Annotation/RouteTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Annotation/RouteTest.php
index b58869f..bd01670 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Annotation/RouteTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Annotation/RouteTest.php
@@ -35,15 +35,16 @@ public function testRouteParameters($parameter, $value, $getter)
public function getValidParameters()
{
return array(
- array('value', '/Blog', 'getPattern'),
- array('value', '/Blog', 'getPath'),
- array('requirements', array('_method' => 'GET'), 'getRequirements'),
- array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
- array('name', 'blog_index', 'getName'),
- array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults'),
- array('schemes', array('https'), 'getSchemes'),
- array('methods', array('GET', 'POST'), 'getMethods'),
- array('host', array('{locale}.example.com'), 'getHost')
+ array('value', '/Blog', 'getPattern'),
+ array('value', '/Blog', 'getPath'),
+ array('requirements', array('_method' => 'GET'), 'getRequirements'),
+ array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
+ array('name', 'blog_index', 'getName'),
+ array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults'),
+ array('schemes', array('https'), 'getSchemes'),
+ array('methods', array('GET', 'POST'), 'getMethods'),
+ array('host', array('{locale}.example.com'), 'getHost'),
+ array('condition', array('context.getMethod() == "GET"'), 'getCondition'),
);
}
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php
index 12a5bed..2e9b028 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php
@@ -21,6 +21,6 @@ class CustomXmlFileLoader extends XmlFileLoader
{
protected function loadFile($file)
{
- return XmlUtils::loadFile($file, function() { return true; });
+ return XmlUtils::loadFile($file, function () { return true; });
}
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php
index e5f7665..248a4f1 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php
@@ -24,6 +24,8 @@ public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
+ $context = $this->context;
+ $request = $this->request;
// foo
if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?Pbaz|symfony)$#s', $pathinfo, $matches)) {
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php
index ad15790..acf1163 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php
@@ -24,6 +24,8 @@ public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
+ $context = $this->context;
+ $request = $this->request;
// foo
if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?Pbaz|symfony)$#s', $pathinfo, $matches)) {
@@ -319,8 +321,9 @@ public function match($pathinfo)
// secure
if ($pathinfo === '/secure') {
- if ($this->context->getScheme() !== 'https') {
- return $this->redirect($pathinfo, 'secure', 'https');
+ $requiredSchemes = array ( 'https' => 0,);
+ if (!isset($requiredSchemes[$this->context->getScheme()])) {
+ return $this->redirect($pathinfo, 'secure', key($requiredSchemes));
}
return array('_route' => 'secure');
@@ -328,8 +331,9 @@ public function match($pathinfo)
// nonsecure
if ($pathinfo === '/nonsecure') {
- if ($this->context->getScheme() !== 'http') {
- return $this->redirect($pathinfo, 'nonsecure', 'http');
+ $requiredSchemes = array ( 'http' => 0,);
+ if (!isset($requiredSchemes[$this->context->getScheme()])) {
+ return $this->redirect($pathinfo, 'nonsecure', key($requiredSchemes));
}
return array('_route' => 'nonsecure');
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php
index f2f642e..c3463fa 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php
@@ -24,6 +24,8 @@ public function match($pathinfo)
{
$allow = array();
$pathinfo = rawurldecode($pathinfo);
+ $context = $this->context;
+ $request = $this->request;
if (0 === strpos($pathinfo, '/rootprefix')) {
// static
@@ -38,6 +40,11 @@ public function match($pathinfo)
}
+ // with-condition
+ if ($pathinfo === '/with-condition' && ($context->getMethod() == "GET")) {
+ return array('_route' => 'with-condition');
+ }
+
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.php
index b8bbbb5..b652d94 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.php
@@ -10,14 +10,18 @@
array('compiler_class' => 'RouteCompiler'),
'{locale}.example.com',
array('https'),
- array('GET','POST','put','OpTiOnS')
+ array('GET','POST','put','OpTiOnS'),
+ 'context.getMethod() == "GET"'
));
$collection->add('blog_show_legacy', new Route(
'/blog/{slug}',
array('_controller' => 'MyBlogBundle:Blog:show'),
array('_method' => 'GET|POST|put|OpTiOnS', '_scheme' => 'https', 'locale' => '\w+',),
array('compiler_class' => 'RouteCompiler'),
- '{locale}.example.com'
+ '{locale}.example.com',
+ array(),
+ array(),
+ 'context.getMethod() == "GET"'
));
return $collection;
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml
index b9f2234..cfee9d6 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml
@@ -8,6 +8,7 @@
MyBundle:Blog:show\w+
+ context.getMethod() == "GET"
@@ -17,5 +18,6 @@
hTTps\w+
+ context.getMethod() == "GET"
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml
index 4ada883..48cf7f8 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/validpattern.yml
@@ -5,6 +5,7 @@ blog_show:
requirements: { 'locale': '\w+' }
methods: ['GET','POST','put','OpTiOnS']
schemes: ['https']
+ condition: 'context.getMethod() == "GET"'
options:
compiler_class: RouteCompiler
@@ -13,5 +14,6 @@ blog_show_legacy:
defaults: { _controller: "MyBundle:Blog:show" }
host: "{locale}.example.com"
requirements: { '_method': 'GET|POST|put|OpTiOnS', _scheme: https, 'locale': '\w+' }
+ condition: 'context.getMethod() == "GET"'
options:
compiler_class: RouteCompiler
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php
index ab5f4cd..78e3907 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php
@@ -114,4 +114,37 @@ public function testDumpForRouteWithDefaults()
$this->assertEquals($url, '/testing');
}
+
+ public function testDumpWithSchemeRequirement()
+ {
+ $this->routeCollection->add('Test1', new Route('/testing', array(), array(), array(), '', array('ftp', 'https')));
+ $this->routeCollection->add('Test2', new Route('/testing_bc', array(), array('_scheme' => 'https'))); // BC
+
+ file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'SchemeUrlGenerator')));
+ include ($this->testTmpFilepath);
+
+ $projectUrlGenerator = new \SchemeUrlGenerator(new RequestContext('/app.php'));
+
+ $absoluteUrl = $projectUrlGenerator->generate('Test1', array(), true);
+ $absoluteUrlBC = $projectUrlGenerator->generate('Test2', array(), true);
+ $relativeUrl = $projectUrlGenerator->generate('Test1', array(), false);
+ $relativeUrlBC = $projectUrlGenerator->generate('Test2', array(), false);
+
+ $this->assertEquals($absoluteUrl, 'ftp://localhost/app.php/testing');
+ $this->assertEquals($absoluteUrlBC, 'https://localhost/app.php/testing_bc');
+ $this->assertEquals($relativeUrl, 'ftp://localhost/app.php/testing');
+ $this->assertEquals($relativeUrlBC, 'https://localhost/app.php/testing_bc');
+
+ $projectUrlGenerator = new \SchemeUrlGenerator(new RequestContext('/app.php', 'GET', 'localhost', 'https'));
+
+ $absoluteUrl = $projectUrlGenerator->generate('Test1', array(), true);
+ $absoluteUrlBC = $projectUrlGenerator->generate('Test2', array(), true);
+ $relativeUrl = $projectUrlGenerator->generate('Test1', array(), false);
+ $relativeUrlBC = $projectUrlGenerator->generate('Test2', array(), false);
+
+ $this->assertEquals($absoluteUrl, 'https://localhost/app.php/testing');
+ $this->assertEquals($absoluteUrlBC, 'https://localhost/app.php/testing_bc');
+ $this->assertEquals($relativeUrl, '/app.php/testing');
+ $this->assertEquals($relativeUrlBC, '/app.php/testing_bc');
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
index 5f8ef49..143e344 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
@@ -207,10 +207,6 @@ public function testGenerateForRouteWithInvalidOptionalParameterNonStrict()
public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLogger()
{
- if (!interface_exists('Psr\Log\LoggerInterface')) {
- $this->markTestSkipped('The "psr/log" package is not available');
- }
-
$routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+')));
$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger->expects($this->once())
@@ -248,22 +244,40 @@ public function testRequiredParamAndEmptyPassed()
public function testSchemeRequirementDoesNothingIfSameCurrentScheme()
{
- $routes = $this->getRoutes('test', new Route('/', array(), array('_scheme' => 'http')));
+ $routes = $this->getRoutes('test', new Route('/', array(), array('_scheme' => 'http'))); // BC
+ $this->assertEquals('/app.php/', $this->getGenerator($routes)->generate('test'));
+
+ $routes = $this->getRoutes('test', new Route('/', array(), array('_scheme' => 'https'))); // BC
+ $this->assertEquals('/app.php/', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test'));
+
+ $routes = $this->getRoutes('test', new Route('/', array(), array(), array(), '', array('http')));
$this->assertEquals('/app.php/', $this->getGenerator($routes)->generate('test'));
- $routes = $this->getRoutes('test', new Route('/', array(), array('_scheme' => 'https')));
+ $routes = $this->getRoutes('test', new Route('/', array(), array(), array(), '', array('https')));
$this->assertEquals('/app.php/', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test'));
}
public function testSchemeRequirementForcesAbsoluteUrl()
{
- $routes = $this->getRoutes('test', new Route('/', array(), array('_scheme' => 'https')));
+ $routes = $this->getRoutes('test', new Route('/', array(), array('_scheme' => 'https'))); // BC
+ $this->assertEquals('https://localhost/app.php/', $this->getGenerator($routes)->generate('test'));
+
+ $routes = $this->getRoutes('test', new Route('/', array(), array('_scheme' => 'http'))); // BC
+ $this->assertEquals('http://localhost/app.php/', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test'));
+
+ $routes = $this->getRoutes('test', new Route('/', array(), array(), array(), '', array('https')));
$this->assertEquals('https://localhost/app.php/', $this->getGenerator($routes)->generate('test'));
- $routes = $this->getRoutes('test', new Route('/', array(), array('_scheme' => 'http')));
+ $routes = $this->getRoutes('test', new Route('/', array(), array(), array(), '', array('http')));
$this->assertEquals('http://localhost/app.php/', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test'));
}
+ public function testSchemeRequirementCreatesUrlForFirstRequiredScheme()
+ {
+ $routes = $this->getRoutes('test', new Route('/', array(), array(), array(), '', array('Ftp', 'https')));
+ $this->assertEquals('ftp://localhost/app.php/', $this->getGenerator($routes)->generate('test'));
+ }
+
public function testPathWithTwoStartingSlashes()
{
$routes = $this->getRoutes('test', new Route('//path-and-not-domain'));
@@ -447,7 +461,7 @@ public function testUrlWithInvalidParameterInHostInNonStrictMode()
$this->assertNull($generator->generate('test', array('foo' => 'baz'), false));
}
- public function testGenerateNetworkPath()
+ public function testGenerateNetworkPathBC()
{
$routes = $this->getRoutes('test', new Route('/{name}', array(), array('_scheme' => 'http'), array(), '{locale}.example.com'));
@@ -465,13 +479,32 @@ public function testGenerateNetworkPath()
);
}
+ public function testGenerateNetworkPath()
+ {
+ $routes = $this->getRoutes('test', new Route('/{name}', array(), array(), array(), '{locale}.example.com', array('http')));
+
+ $this->assertSame('//fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test',
+ array('name' =>'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::NETWORK_PATH), 'network path with different host'
+ );
+ $this->assertSame('//fr.example.com/app.php/Fabien?query=string', $this->getGenerator($routes, array('host' => 'fr.example.com'))->generate('test',
+ array('name' =>'Fabien', 'locale' => 'fr', 'query' => 'string'), UrlGeneratorInterface::NETWORK_PATH), 'network path although host same as context'
+ );
+ $this->assertSame('http://fr.example.com/app.php/Fabien', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test',
+ array('name' =>'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::NETWORK_PATH), 'absolute URL because scheme requirement does not match context'
+ );
+ $this->assertSame('http://fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test',
+ array('name' =>'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::ABSOLUTE_URL), 'absolute URL with same scheme because it is requested'
+ );
+ }
+
public function testGenerateRelativePath()
{
$routes = new RouteCollection();
$routes->add('article', new Route('/{author}/{article}/'));
$routes->add('comments', new Route('/{author}/{article}/comments'));
$routes->add('host', new Route('/{article}', array(), array(), array(), '{author}.example.com'));
- $routes->add('scheme', new Route('/{author}', array(), array('_scheme' => 'https')));
+ $routes->add('schemeBC', new Route('/{author}', array(), array('_scheme' => 'https'))); // BC
+ $routes->add('scheme', new Route('/{author}/blog', array(), array(), array(), '', array('https')));
$routes->add('unrelated', new Route('/about'));
$generator = $this->getGenerator($routes, array('host' => 'example.com', 'pathInfo' => '/fabien/symfony-is-great/'));
@@ -491,9 +524,12 @@ public function testGenerateRelativePath()
$this->assertSame('//bernhard.example.com/app.php/forms-are-great', $generator->generate('host',
array('author' =>'bernhard', 'article' => 'forms-are-great'), UrlGeneratorInterface::RELATIVE_PATH)
);
- $this->assertSame('https://example.com/app.php/bernhard', $generator->generate('scheme',
+ $this->assertSame('https://example.com/app.php/bernhard', $generator->generate('schemeBC',
array('author' =>'bernhard'), UrlGeneratorInterface::RELATIVE_PATH)
);
+ $this->assertSame('https://example.com/app.php/bernhard/blog', $generator->generate('scheme',
+ array('author' =>'bernhard'), UrlGeneratorInterface::RELATIVE_PATH)
+ );
$this->assertSame('../../about', $generator->generate('unrelated',
array(), UrlGeneratorInterface::RELATIVE_PATH)
);
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php
index c927ae4..288bf64 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php
@@ -13,13 +13,6 @@
abstract class AbstractAnnotationLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Doctrine\\Common\\Version')) {
- $this->markTestSkipped('Doctrine is not available.');
- }
- }
-
public function getReader()
{
return $this->getMockBuilder('Doctrine\Common\Annotations\Reader')
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php
index 31c43f5..c609979 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Routing\Tests\Loader;
+use Symfony\Component\Routing\Annotation\Route;
+
class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
{
protected $loader;
@@ -71,12 +73,22 @@ public function getLoadTests()
return array(
array(
'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass',
- array('name'=>'route1'),
+ array('name' => 'route1'),
+ array('arg2' => 'defaultValue2', 'arg3' => 'defaultValue3')
+ ),
+ array(
+ 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass',
+ array('name' => 'route1', 'defaults' => array('arg2' => 'foo')),
+ array('arg2' => 'defaultValue2', 'arg3' => 'defaultValue3')
+ ),
+ array(
+ 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass',
+ array('name' => 'route1', 'defaults' => array('arg2' => 'foobar')),
array('arg2' => 'defaultValue2', 'arg3' =>'defaultValue3')
),
array(
'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass',
- array('name'=>'route1', 'defaults' => array('arg2' => 'foo')),
+ array('name' => 'route1', 'defaults' => array('arg2' => 'foo'), 'condition' => 'context.getMethod() == "GET"'),
array('arg2' => 'defaultValue2', 'arg3' =>'defaultValue3')
),
);
@@ -95,6 +107,7 @@ public function testLoad($className, $routeDatas = array(), $methodArgs = array(
'defaults' => array(),
'schemes' => array(),
'methods' => array(),
+ 'condition' => null,
), $routeDatas);
$this->reader
@@ -108,12 +121,12 @@ public function testLoad($className, $routeDatas = array(), $methodArgs = array(
$this->assertSame($routeDatas['path'], $route->getPath(), '->load preserves path annotation');
$this->assertSame($routeDatas['requirements'],$route->getRequirements(), '->load preserves requirements annotation');
$this->assertCount(0, array_intersect($route->getOptions(), $routeDatas['options']), '->load preserves options annotation');
- $this->assertSame(array_replace($routeDatas['defaults'], $methodArgs), $route->getDefaults(), '->load preserves defaults annotation');
+ $this->assertSame(array_replace($methodArgs, $routeDatas['defaults']), $route->getDefaults(), '->load preserves defaults annotation');
+ $this->assertEquals($routeDatas['condition'], $route->getCondition(), '->load preserves condition annotation');
}
private function getAnnotatedRoute($datas)
{
- return new \Symfony\Component\Routing\Annotation\Route($datas);
+ return new Route($datas);
}
-
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php
index 64d1b08..d34fa87 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php
@@ -17,13 +17,6 @@
class ClosureLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\FileLocator')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
- }
-
public function testSupports()
{
$loader = new ClosureLoader();
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php
index 18b166f..bf76d34 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php
@@ -16,13 +16,6 @@
class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\FileLocator')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
- }
-
public function testSupports()
{
$loader = new PhpFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php
index 9f038c1..c38adbd 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php
@@ -17,13 +17,6 @@
class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\FileLocator')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
- }
-
public function testSupports()
{
$loader = new XmlFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));
@@ -52,6 +45,7 @@ public function testLoadWithRoute()
$this->assertSame('RouteCompiler', $route->getOption('compiler_class'));
$this->assertEquals(array('GET', 'POST', 'PUT', 'OPTIONS'), $route->getMethods());
$this->assertEquals(array('https'), $route->getSchemes());
+ $this->assertEquals('context.getMethod() == "GET"', $route->getCondition());
}
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php
index a3e934c..f030106 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php
@@ -17,17 +17,6 @@
class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Config\FileLocator')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
- if (!class_exists('Symfony\Component\Yaml\Yaml')) {
- $this->markTestSkipped('The "Yaml" component is not available');
- }
- }
-
public function testSupports()
{
$loader = new YamlFileLoader($this->getMock('Symfony\Component\Config\FileLocator'));
@@ -90,6 +79,7 @@ public function testLoadWithRoute()
$this->assertSame('RouteCompiler', $route->getOption('compiler_class'));
$this->assertEquals(array('GET', 'POST', 'PUT', 'OPTIONS'), $route->getMethods());
$this->assertEquals(array('https'), $route->getSchemes());
+ $this->assertEquals('context.getMethod() == "GET"', $route->getCondition());
}
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/DumperCollectionTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/DumperCollectionTest.php
index 54b3772..7b6001c 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/DumperCollectionTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/DumperCollectionTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Routing\Test\Matcher\Dumper;
+namespace Symfony\Component\Routing\Tests\Matcher\Dumper;
use Symfony\Component\Routing\Matcher\Dumper\DumperCollection;
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/DumperPrefixCollectionTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/DumperPrefixCollectionTest.php
index 7b4565c..de01a75 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/DumperPrefixCollectionTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/DumperPrefixCollectionTest.php
@@ -20,7 +20,7 @@ class DumperPrefixCollectionTest extends \PHPUnit_Framework_TestCase
{
public function testAddPrefixRoute()
{
- $coll = new DumperPrefixCollection;
+ $coll = new DumperPrefixCollection();
$coll->setPrefix('');
$route = new DumperRoute('bar', new Route('/foo/bar'));
@@ -66,7 +66,7 @@ public function testAddPrefixRoute()
public function testMergeSlashNodes()
{
- $coll = new DumperPrefixCollection;
+ $coll = new DumperPrefixCollection();
$coll->setPrefix('');
$route = new DumperRoute('bar', new Route('/foo/bar'));
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
index 542ede8..473af6a 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
@@ -251,6 +251,9 @@ public function getRouteCollections()
$rootprefixCollection->add('static', new Route('/test'));
$rootprefixCollection->add('dynamic', new Route('/{var}'));
$rootprefixCollection->addPrefix('rootprefix');
+ $route = new Route('/with-condition');
+ $route->setCondition('context.getMethod() == "GET"');
+ $rootprefixCollection->add('with-condition', $route);
return array(
array($collection, 'url_matcher1.php', array()),
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php
index 2ad4fc8..5cbb605 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php
@@ -41,7 +41,7 @@ public function testRedirectWhenNoSlashForNonSafeMethod()
$matcher->match('/foo');
}
- public function testSchemeRedirect()
+ public function testSchemeRedirectBC()
{
$coll = new RouteCollection();
$coll->add('foo', new Route('/foo', array(), array('_scheme' => 'https')));
@@ -55,4 +55,32 @@ public function testSchemeRedirect()
;
$matcher->match('/foo');
}
+
+ public function testSchemeRedirectRedirectsToFirstScheme()
+ {
+ $coll = new RouteCollection();
+ $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('FTP', 'HTTPS')));
+
+ $matcher = $this->getMockForAbstractClass('Symfony\Component\Routing\Matcher\RedirectableUrlMatcher', array($coll, new RequestContext()));
+ $matcher
+ ->expects($this->once())
+ ->method('redirect')
+ ->with('/foo', 'foo', 'ftp')
+ ->will($this->returnValue(array('_route' => 'foo')))
+ ;
+ $matcher->match('/foo');
+ }
+
+ public function testNoSchemaRedirectIfOnOfMultipleSchemesMatches()
+ {
+ $coll = new RouteCollection();
+ $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('https', 'http')));
+
+ $matcher = $this->getMockForAbstractClass('Symfony\Component\Routing\Matcher\RedirectableUrlMatcher', array($coll, new RequestContext()));
+ $matcher
+ ->expects($this->never())
+ ->method('redirect')
+ ;
+ $matcher->match('/foo');
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php
index 86d8d95..969ab0a 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php
@@ -26,13 +26,14 @@ public function test()
$coll->add('bar1', new Route('/bar/{name}', array(), array('id' => '\w+', '_method' => 'POST')));
$coll->add('bar2', new Route('/foo', array(), array(), array(), 'baz'));
$coll->add('bar3', new Route('/foo1', array(), array(), array(), 'baz'));
+ $coll->add('bar4', new Route('/foo2', array(), array(), array(), 'baz', array(), array(), 'context.getMethod() == "GET"'));
$context = new RequestContext();
$context->setHost('baz');
$matcher = new TraceableUrlMatcher($coll, $context);
$traces = $matcher->getTraces('/babar');
- $this->assertEquals(array(0, 0, 0, 0, 0), $this->getLevels($traces));
+ $this->assertEquals(array(0, 0, 0, 0, 0, 0), $this->getLevels($traces));
$traces = $matcher->getTraces('/foo');
$this->assertEquals(array(1, 0, 0, 2), $this->getLevels($traces));
@@ -41,7 +42,7 @@ public function test()
$this->assertEquals(array(0, 2), $this->getLevels($traces));
$traces = $matcher->getTraces('/bar/dd');
- $this->assertEquals(array(0, 1, 1, 0, 0), $this->getLevels($traces));
+ $this->assertEquals(array(0, 1, 1, 0, 0, 0), $this->getLevels($traces));
$traces = $matcher->getTraces('/foo1');
$this->assertEquals(array(0, 0, 0, 0, 2), $this->getLevels($traces));
@@ -52,6 +53,40 @@ public function test()
$traces = $matcher->getTraces('/bar/dd');
$this->assertEquals(array(0, 1, 2), $this->getLevels($traces));
+
+ $traces = $matcher->getTraces('/foo2');
+ $this->assertEquals(array(0, 0, 0, 0, 0, 1), $this->getLevels($traces));
+ }
+
+ public function testMatchRouteOnMultipleHosts()
+ {
+ $routes = new RouteCollection();
+ $routes->add('first', new Route(
+ '/mypath/',
+ array('_controller' => 'MainBundle:Info:first'),
+ array(),
+ array(),
+ 'some.example.com'
+ ));
+
+ $routes->add('second', new Route(
+ '/mypath/',
+ array('_controller' => 'MainBundle:Info:second'),
+ array(),
+ array(),
+ 'another.example.com'
+ ));
+
+ $context = new RequestContext();
+ $context->setHost('baz');
+
+ $matcher = new TraceableUrlMatcher($routes, $context);
+
+ $traces = $matcher->getTraces('/mypath/');
+ $this->assertEquals(
+ array(TraceableUrlMatcher::ROUTE_ALMOST_MATCHES, TraceableUrlMatcher::ROUTE_ALMOST_MATCHES),
+ $this->getLevels($traces)
+ );
}
public function getLevels($traces)
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
index 8a1428f..b03b0c3 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
@@ -313,13 +313,36 @@ public function testDefaultRequirementOfVariableDisallowsNextSeparator()
/**
* @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException
*/
- public function testSchemeRequirement()
+ public function testSchemeRequirementBC()
{
$coll = new RouteCollection();
$coll->add('foo', new Route('/foo', array(), array('_scheme' => 'https')));
$matcher = new UrlMatcher($coll, new RequestContext());
$matcher->match('/foo');
}
+ /**
+ * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException
+ */
+ public function testSchemeRequirement()
+ {
+ $coll = new RouteCollection();
+ $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('https')));
+ $matcher = new UrlMatcher($coll, new RequestContext());
+ $matcher->match('/foo');
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException
+ */
+ public function testCondition()
+ {
+ $coll = new RouteCollection();
+ $route = new Route('/foo');
+ $route->setCondition('context.getMethod() == "POST"');
+ $coll->add('foo', $route);
+ $matcher = new UrlMatcher($coll, new RequestContext());
+ $matcher->match('/foo');
+ }
public function testDecodeOnce()
{
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RequestContextTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RequestContextTest.php
new file mode 100644
index 0000000..21a2999
--- /dev/null
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RequestContextTest.php
@@ -0,0 +1,101 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Routing\Tests;
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\RequestContext;
+
+class RequestContextTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstruct()
+ {
+ $requestContext = new RequestContext(
+ 'foo',
+ 'post',
+ 'foo.bar',
+ 'HTTPS',
+ 8080,
+ 444,
+ '/baz',
+ 'bar=foobar'
+ );
+
+ $this->assertEquals('foo', $requestContext->getBaseUrl());
+ $this->assertEquals('POST', $requestContext->getMethod());
+ $this->assertEquals('foo.bar', $requestContext->getHost());
+ $this->assertEquals('https', $requestContext->getScheme());
+ $this->assertSame(8080, $requestContext->getHttpPort());
+ $this->assertSame(444, $requestContext->getHttpsPort());
+ $this->assertEquals('/baz', $requestContext->getPathInfo());
+ $this->assertEquals('bar=foobar', $requestContext->getQueryString());
+ }
+
+ public function testFromRequest()
+ {
+ $request = Request::create('https://test.com:444/foo?bar=baz');
+ $requestContext = new RequestContext();
+ $requestContext->setHttpPort(123);
+ $requestContext->fromRequest($request);
+
+ $this->assertEquals('', $requestContext->getBaseUrl());
+ $this->assertEquals('GET', $requestContext->getMethod());
+ $this->assertEquals('test.com', $requestContext->getHost());
+ $this->assertEquals('https', $requestContext->getScheme());
+ $this->assertEquals('/foo', $requestContext->getPathInfo());
+ $this->assertEquals('bar=baz', $requestContext->getQueryString());
+ $this->assertSame(123, $requestContext->getHttpPort());
+ $this->assertSame(444, $requestContext->getHttpsPort());
+
+ $request = Request::create('http://test.com:8080/foo?bar=baz');
+ $requestContext = new RequestContext();
+ $requestContext->setHttpsPort(567);
+ $requestContext->fromRequest($request);
+
+ $this->assertSame(8080, $requestContext->getHttpPort());
+ $this->assertSame(567, $requestContext->getHttpsPort());
+ }
+
+ public function testGetParameters()
+ {
+ $requestContext = new RequestContext();
+ $this->assertEquals(array(), $requestContext->getParameters());
+
+ $requestContext->setParameters(array('foo' => 'bar'));
+ $this->assertEquals(array('foo' => 'bar'), $requestContext->getParameters());
+ }
+
+ public function testHasParameter()
+ {
+ $requestContext = new RequestContext();
+ $requestContext->setParameters(array('foo' => 'bar'));
+
+ $this->assertTrue($requestContext->hasParameter('foo'));
+ $this->assertFalse($requestContext->hasParameter('baz'));
+ }
+
+ public function testGetParameter()
+ {
+ $requestContext = new RequestContext();
+ $requestContext->setParameters(array('foo' => 'bar'));
+
+ $this->assertEquals('bar', $requestContext->getParameter('foo'));
+ $this->assertNull($requestContext->getParameter('baz'));
+ }
+
+ public function testSetParameter()
+ {
+ $requestContext = new RequestContext();
+ $requestContext->setParameter('foo', 'bar');
+
+ $this->assertEquals('bar', $requestContext->getParameter('foo'));
+ }
+}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCollectionTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCollectionTest.php
index 3d78adf..4c12ed5 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCollectionTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteCollectionTest.php
@@ -103,10 +103,6 @@ public function testAddCollection()
public function testAddCollectionWithResources()
{
- if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$collection = new RouteCollection();
$collection->addResource($foo = new FileResource(__DIR__.'/Fixtures/foo.xml'));
$collection1 = new RouteCollection();
@@ -178,10 +174,6 @@ public function testAddPrefixOverridesDefaultsAndRequirements()
public function testResource()
{
- if (!class_exists('Symfony\Component\Config\Resource\FileResource')) {
- $this->markTestSkipped('The "Config" component is not available');
- }
-
$collection = new RouteCollection();
$collection->addResource($foo = new FileResource(__DIR__.'/Fixtures/foo.xml'));
$collection->addResource($bar = new FileResource(__DIR__.'/Fixtures/bar.xml'));
@@ -252,4 +244,61 @@ public function testSetHost()
$this->assertEquals('{locale}.example.com', $routea->getHost());
$this->assertEquals('{locale}.example.com', $routeb->getHost());
}
+
+ public function testSetCondition()
+ {
+ $collection = new RouteCollection();
+ $routea = new Route('/a');
+ $routeb = new Route('/b', array(), array(), array(), '{locale}.example.net', array(), array(), 'context.getMethod() == "GET"');
+ $collection->add('a', $routea);
+ $collection->add('b', $routeb);
+
+ $collection->setCondition('context.getMethod() == "POST"');
+
+ $this->assertEquals('context.getMethod() == "POST"', $routea->getCondition());
+ $this->assertEquals('context.getMethod() == "POST"', $routeb->getCondition());
+ }
+
+ public function testClone()
+ {
+ $collection = new RouteCollection();
+ $collection->add('a', new Route('/a'));
+ $collection->add('b', new Route('/b', array('placeholder' => 'default'), array('placeholder' => '.+')));
+
+ $clonedCollection = clone $collection;
+
+ $this->assertCount(2, $clonedCollection);
+ $this->assertEquals($collection->get('a'), $clonedCollection->get('a'));
+ $this->assertNotSame($collection->get('a'), $clonedCollection->get('a'));
+ $this->assertEquals($collection->get('b'), $clonedCollection->get('b'));
+ $this->assertNotSame($collection->get('b'), $clonedCollection->get('b'));
+ }
+
+ public function testSetSchemes()
+ {
+ $collection = new RouteCollection();
+ $routea = new Route('/a', array(), array(), array(), '', 'http');
+ $routeb = new Route('/b');
+ $collection->add('a', $routea);
+ $collection->add('b', $routeb);
+
+ $collection->setSchemes(array('http', 'https'));
+
+ $this->assertEquals(array('http', 'https'), $routea->getSchemes());
+ $this->assertEquals(array('http', 'https'), $routeb->getSchemes());
+ }
+
+ public function testSetMethods()
+ {
+ $collection = new RouteCollection();
+ $routea = new Route('/a', array(), array(), array(), '', array(), array('GET', 'POST'));
+ $routeb = new Route('/b');
+ $collection->add('a', $routea);
+ $collection->add('b', $routeb);
+
+ $collection->setMethods('PUT');
+
+ $this->assertEquals(array('PUT'), $routea->getMethods());
+ $this->assertEquals(array('PUT'), $routeb->getMethods());
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteTest.php
index 31f1066..cbd5ccb 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouteTest.php
@@ -24,9 +24,10 @@ public function testConstructor()
$this->assertEquals('bar', $route->getOption('foo'), '__construct() takes options as its fourth argument');
$this->assertEquals('{locale}.example.com', $route->getHost(), '__construct() takes a host pattern as its fifth argument');
- $route = new Route('/', array(), array(), array(), '', array('Https'), array('POST', 'put'));
+ $route = new Route('/', array(), array(), array(), '', array('Https'), array('POST', 'put'), 'context.getMethod() == "GET"');
$this->assertEquals(array('https'), $route->getSchemes(), '__construct() takes schemes as its sixth argument and lowercases it');
$this->assertEquals(array('POST', 'PUT'), $route->getMethods(), '__construct() takes methods as its seventh argument and uppercases it');
+ $this->assertEquals('context.getMethod() == "GET"', $route->getCondition(), '__construct() takes a condition as its eight argument');
$route = new Route('/', array(), array(), array(), '', 'Https', 'Post');
$this->assertEquals(array('https'), $route->getSchemes(), '__construct() takes a single scheme as its sixth argument');
@@ -44,7 +45,7 @@ public function testPath()
$this->assertEquals('/bar', $route->getPath(), '->setPath() adds a / at the beginning of the path if needed');
$this->assertEquals($route, $route->setPath(''), '->setPath() implements a fluent interface');
$route->setPath('//path');
- $this->assertEquals('/path', $route->getPath(), '->setPath() does not allow two slahes "//" at the beginning of the path as it would be confused with a network path when generating the path from the route');
+ $this->assertEquals('/path', $route->getPath(), '->setPath() does not allow two slashes "//" at the beginning of the path as it would be confused with a network path when generating the path from the route');
}
public function testOptions()
@@ -62,6 +63,15 @@ public function testOptions()
$this->assertEquals(array('foo' => 'foo', 'bar' => 'bar', 'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler'), $route->getOptions(), '->addDefaults() keep previous defaults');
}
+ public function testOption()
+ {
+ $route = new Route('/{foo}');
+ $this->assertFalse($route->hasOption('foo'), '->hasOption() return false if option is not set');
+ $this->assertEquals($route, $route->setOption('foo', 'bar'), '->setOption() implements a fluent interface');
+ $this->assertEquals('bar', $route->getOption('foo'), '->setOption() sets the option');
+ $this->assertTrue($route->hasOption('foo'), '->hasOption() return true if option is set');
+ }
+
public function testDefaults()
{
$route = new Route('/{foo}');
@@ -74,7 +84,7 @@ public function testDefaults()
$route->setDefault('foo2', 'bar2');
$this->assertEquals('bar2', $route->getDefault('foo2'), '->getDefault() return the default value');
- $this->assertNull($route->getDefault('not_defined'), '->getDefault() return null if default value is not setted');
+ $this->assertNull($route->getDefault('not_defined'), '->getDefault() return null if default value is not set');
$route->setDefault('_controller', $closure = function () { return 'Hello'; });
$this->assertEquals($closure, $route->getDefault('_controller'), '->setDefault() sets a default value');
@@ -105,8 +115,10 @@ public function testRequirements()
public function testRequirement()
{
$route = new Route('/{foo}');
+ $this->assertFalse($route->hasRequirement('foo'), '->hasRequirement() return false if requirement is not set');
$route->setRequirement('foo', '^\d+$');
$this->assertEquals('\d+', $route->getRequirement('foo'), '->setRequirement() removes ^ and $ from the path');
+ $this->assertTrue($route->hasRequirement('foo'), '->hasRequirement() return true if requirement is set');
}
/**
@@ -141,10 +153,15 @@ public function testScheme()
{
$route = new Route('/');
$this->assertEquals(array(), $route->getSchemes(), 'schemes is initialized with array()');
+ $this->assertFalse($route->hasScheme('http'));
$route->setSchemes('hTTp');
$this->assertEquals(array('http'), $route->getSchemes(), '->setSchemes() accepts a single scheme string and lowercases it');
+ $this->assertTrue($route->hasScheme('htTp'));
+ $this->assertFalse($route->hasScheme('httpS'));
$route->setSchemes(array('HttpS', 'hTTp'));
$this->assertEquals(array('https', 'http'), $route->getSchemes(), '->setSchemes() accepts an array of schemes and lowercases them');
+ $this->assertTrue($route->hasScheme('htTp'));
+ $this->assertTrue($route->hasScheme('httpS'));
}
public function testSchemeIsBC()
@@ -153,6 +170,9 @@ public function testSchemeIsBC()
$route->setRequirement('_scheme', 'http|https');
$this->assertEquals('http|https', $route->getRequirement('_scheme'));
$this->assertEquals(array('http', 'https'), $route->getSchemes());
+ $this->assertTrue($route->hasScheme('https'));
+ $this->assertTrue($route->hasScheme('http'));
+ $this->assertFalse($route->hasScheme('ftp'));
$route->setSchemes(array('hTTp'));
$this->assertEquals('http', $route->getRequirement('_scheme'));
$route->setSchemes(array());
@@ -181,6 +201,14 @@ public function testMethodIsBC()
$this->assertNull($route->getRequirement('_method'));
}
+ public function testCondition()
+ {
+ $route = new Route('/');
+ $this->assertEquals(null, $route->getCondition());
+ $route->setCondition('context.getMethod() == "GET"');
+ $this->assertEquals('context.getMethod() == "GET"', $route->getCondition());
+ }
+
public function testCompile()
{
$route = new Route('/{foo}');
@@ -189,4 +217,24 @@ public function testCompile()
$route->setRequirement('foo', '.*');
$this->assertNotSame($compiled, $route->compile(), '->compile() recompiles if the route was modified');
}
+
+ public function testPattern()
+ {
+ $route = new Route('/{foo}');
+ $this->assertEquals('/{foo}', $route->getPattern());
+
+ $route->setPattern('/bar');
+ $this->assertEquals('/bar', $route->getPattern());
+ }
+
+ public function testSerialize()
+ {
+ $route = new Route('/{foo}', array('foo' => 'default'), array('foo' => '\d+'));
+
+ $serialized = serialize($route);
+ $unserialized = unserialize($serialized);
+
+ $this->assertEquals($route, $unserialized);
+ $this->assertNotSame($route, $unserialized);
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouterTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouterTest.php
index a3c336e..42a344c 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouterTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/RouterTest.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Routing\Tests;
use Symfony\Component\Routing\Router;
+use Symfony\Component\HttpFoundation\Request;
class RouterTest extends \PHPUnit_Framework_TestCase
{
@@ -135,4 +136,28 @@ public function provideGeneratorOptionsPreventingCaching()
array('generator_cache_class')
);
}
+
+ public function testMatchRequestWithUrlMatcherInterface()
+ {
+ $matcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
+ $matcher->expects($this->once())->method('match');
+
+ $p = new \ReflectionProperty($this->router, 'matcher');
+ $p->setAccessible(true);
+ $p->setValue($this->router, $matcher);
+
+ $this->router->matchRequest(Request::create('/'));
+ }
+
+ public function testMatchRequestWithRequestMatcherInterface()
+ {
+ $matcher = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface');
+ $matcher->expects($this->once())->method('matchRequest');
+
+ $p = new \ReflectionProperty($this->router, 'matcher');
+ $p->setAccessible(true);
+ $p->setValue($this->router, $matcher);
+
+ $this->router->matchRequest(Request::create('/'));
+ }
}
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/composer.json b/core/vendor/symfony/routing/Symfony/Component/Routing/composer.json
index 9a737c6..3517b23 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/composer.json
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/composer.json
@@ -2,7 +2,7 @@
"name": "symfony/routing",
"type": "library",
"description": "Symfony Routing Component",
- "keywords": [],
+ "keywords": ["routing", "router", "URL", "URI"],
"homepage": "http://symfony.com",
"license": "MIT",
"authors": [
@@ -21,13 +21,15 @@
"require-dev": {
"symfony/config": "~2.2",
"symfony/yaml": "~2.0",
- "doctrine/common": "~2.2",
+ "symfony/expression-language": "~2.4",
+ "doctrine/annotations": "~1.0",
"psr/log": "~1.0"
},
"suggest": {
- "symfony/config": "",
- "symfony/yaml": "",
- "doctrine/common": ""
+ "symfony/config": "For using the all-in-one router or any loader",
+ "symfony/yaml": "For using the YAML loader",
+ "symfony/expression-language": "For using expression matching",
+ "doctrine/annotations": "For using the annotation loader"
},
"autoload": {
"psr-0": { "Symfony\\Component\\Routing\\": "" }
@@ -36,7 +38,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/CHANGELOG.md b/core/vendor/symfony/serializer/Symfony/Component/Serializer/CHANGELOG.md
index 5a332da..5b85962 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/CHANGELOG.md
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========
+2.4.0
+-----
+
+ * added `$context` support for XMLEncoder.
+
2.3.0
-----
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainDecoder.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainDecoder.php
index 6ece3b2..5321a23 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainDecoder.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainDecoder.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\Serializer\Encoder;
-use Symfony\Component\Serializer\Encoder\DecoderInterface;
use Symfony\Component\Serializer\Exception\RuntimeException;
/**
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainEncoder.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainEncoder.php
index bd10a2a..088420b 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainEncoder.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainEncoder.php
@@ -11,8 +11,6 @@
namespace Symfony\Component\Serializer\Encoder;
-use Symfony\Component\Serializer\Encoder\EncoderInterface;
-use Symfony\Component\Serializer\Encoder\NormalizationAwareInterface;
use Symfony\Component\Serializer\Exception\RuntimeException;
/**
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/JsonDecode.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/JsonDecode.php
index d616286..f8dfab3 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/JsonDecode.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/JsonDecode.php
@@ -70,7 +70,7 @@ public function getLastError()
*
* json_decode_associative: boolean
* If true, returns the object as associative array.
- * If false, returns the object as nested StdClass
+ * If false, returns the object as nested stdClass
* If not specified, this method will use the default set in JsonDecode::__construct
*
* json_decode_recursion_depth: integer
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/JsonEncoder.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/JsonEncoder.php
index 02b179b..95dae7c 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/JsonEncoder.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/JsonEncoder.php
@@ -32,8 +32,8 @@ class JsonEncoder implements EncoderInterface, DecoderInterface
public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodingImpl = null)
{
- $this->encodingImpl = null === $encodingImpl ? new JsonEncode() : $encodingImpl;
- $this->decodingImpl = null === $decodingImpl ? new JsonDecode(true) : $decodingImpl;
+ $this->encodingImpl = $encodingImpl ?: new JsonEncode();
+ $this->decodingImpl = $decodingImpl ?: new JsonDecode(true);
}
/**
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/XmlEncoder.php
index 137f2fc..9cd2417 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/XmlEncoder.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/XmlEncoder.php
@@ -24,6 +24,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
{
private $dom;
private $format;
+ private $context;
private $rootNodeName = 'response';
/**
@@ -47,8 +48,9 @@ public function encode($data, $format, array $context = array())
$xmlRootNodeName = $this->resolveXmlRootName($context);
- $this->dom = new \DOMDocument();
+ $this->dom = $this->createDomDocument($context);
$this->format = $format;
+ $this->context = $context;
if (null !== $data && !is_scalar($data)) {
$root = $this->dom->createElement($xmlRootNodeName);
@@ -76,6 +78,10 @@ public function decode($data, $format, array $context = array())
libxml_use_internal_errors($internalErrors);
libxml_disable_entity_loader($disableEntities);
+ if ($error = libxml_get_last_error()) {
+ throw new UnexpectedValueException($error->message);
+ }
+
foreach ($dom->childNodes as $child) {
if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
throw new UnexpectedValueException('Document types are not allowed.');
@@ -105,24 +111,16 @@ public function decode($data, $format, array $context = array())
}
/**
- * Checks whether the serializer can encode to given format
- *
- * @param string $format format name
- *
- * @return Boolean
- */
+ * {@inheritdoc}
+ */
public function supportsEncoding($format)
{
return 'xml' === $format;
}
/**
- * Checks whether the serializer can decode from given format
- *
- * @param string $format format name
- *
- * @return Boolean
- */
+ * {@inheritdoc}
+ */
public function supportsDecoding($format)
{
return 'xml' === $format;
@@ -148,12 +146,12 @@ public function getRootNodeName()
}
/**
- * @param DOMNode $node
- * @param string $val
+ * @param \DOMNode $node
+ * @param string $val
*
* @return Boolean
*/
- final protected function appendXMLString($node, $val)
+ final protected function appendXMLString(\DOMNode $node, $val)
{
if (strlen($val) > 0) {
$frag = $this->dom->createDocumentFragment();
@@ -167,12 +165,12 @@ public function getRootNodeName()
}
/**
- * @param DOMNode $node
- * @param string $val
+ * @param \DOMNode $node
+ * @param string $val
*
* @return Boolean
*/
- final protected function appendText($node, $val)
+ final protected function appendText(\DOMNode $node, $val)
{
$nodeText = $this->dom->createTextNode($val);
$node->appendChild($nodeText);
@@ -181,12 +179,12 @@ public function getRootNodeName()
}
/**
- * @param DOMNode $node
- * @param string $val
+ * @param \DOMNode $node
+ * @param string $val
*
* @return Boolean
*/
- final protected function appendCData($node, $val)
+ final protected function appendCData(\DOMNode $node, $val)
{
$nodeText = $this->dom->createCDATASection($val);
$node->appendChild($nodeText);
@@ -195,12 +193,12 @@ public function getRootNodeName()
}
/**
- * @param DOMNode $node
- * @param DOMDocumentFragment $fragment
+ * @param \DOMNode $node
+ * @param \DOMDocumentFragment $fragment
*
* @return Boolean
*/
- final protected function appendDocumentFragment($node, $fragment)
+ final protected function appendDocumentFragment(\DOMNode $node, $fragment)
{
if ($fragment instanceof \DOMDocumentFragment) {
$node->appendChild($fragment);
@@ -228,11 +226,11 @@ public function getRootNodeName()
/**
* Parse the input SimpleXmlElement into an array.
*
- * @param SimpleXmlElement $node xml to parse
+ * @param \SimpleXmlElement $node xml to parse
*
* @return array
*/
- private function parseXml($node)
+ private function parseXml(\SimpleXmlElement $node)
{
$data = array();
if ($node->attributes()) {
@@ -256,9 +254,9 @@ private function parseXml($node)
if ($key === 'item') {
if (isset($value['@key'])) {
if (isset($value['#'])) {
- $data[(string) $value['@key']] = $value['#'];
+ $data[$value['@key']] = $value['#'];
} else {
- $data[(string) $value['@key']] = $value;
+ $data[$value['@key']] = $value;
}
} else {
$data['item'][] = $value;
@@ -279,15 +277,15 @@ private function parseXml($node)
/**
* Parse the data and convert it to DOMElements
*
- * @param DOMNode $parentNode
- * @param array|object $data data
- * @param string $xmlRootNodeName
+ * @param \DOMNode $parentNode
+ * @param array|object $data
+ * @param string|null $xmlRootNodeName
*
* @return Boolean
*
* @throws UnexpectedValueException
*/
- private function buildXml($parentNode, $data, $xmlRootNodeName = null)
+ private function buildXml(\DOMNode $parentNode, $data, $xmlRootNodeName = null)
{
$append = true;
@@ -325,7 +323,7 @@ private function buildXml($parentNode, $data, $xmlRootNodeName = null)
}
if (is_object($data)) {
- $data = $this->serializer->normalize($data, $this->format);
+ $data = $this->serializer->normalize($data, $this->format, $this->context);
if (null !== $data && !is_scalar($data)) {
return $this->buildXml($parentNode, $data, $xmlRootNodeName);
}
@@ -347,14 +345,14 @@ private function buildXml($parentNode, $data, $xmlRootNodeName = null)
/**
* Selects the type of node to create and appends it to the parent.
*
- * @param DOMNode $parentNode
+ * @param \DOMNode $parentNode
* @param array|object $data
* @param string $nodeName
* @param string $key
*
* @return Boolean
*/
- private function appendNode($parentNode, $data, $nodeName, $key = null)
+ private function appendNode(\DOMNode $parentNode, $data, $nodeName, $key = null)
{
$node = $this->dom->createElement($nodeName);
if (null !== $key) {
@@ -384,12 +382,12 @@ private function needsCdataWrapping($val)
/**
* Tests the value being passed and decide what sort of element to create
*
- * @param DOMNode $node
- * @param mixed $val
+ * @param \DOMNode $node
+ * @param mixed $val
*
* @return Boolean
*/
- private function selectNodeType($node, $val)
+ private function selectNodeType(\DOMNode $node, $val)
{
if (is_array($val)) {
return $this->buildXml($node, $val);
@@ -399,7 +397,7 @@ private function selectNodeType($node, $val)
} elseif ($val instanceof \Traversable) {
$this->buildXml($node, $val);
} elseif (is_object($val)) {
- return $this->buildXml($node, $this->serializer->normalize($val, $this->format));
+ return $this->buildXml($node, $this->serializer->normalize($val, $this->format, $this->context));
} elseif (is_numeric($val)) {
return $this->appendText($node, (string) $val);
} elseif (is_string($val) && $this->needsCdataWrapping($val)) {
@@ -426,4 +424,32 @@ private function resolveXmlRootName(array $context = array())
: $this->rootNodeName;
}
+ /**
+ * Create a DOM document, taking serializer options into account.
+ *
+ * @param array $context options that the encoder has access to.
+ *
+ * @return \DOMDocument
+ */
+ private function createDomDocument(array $context)
+ {
+ $document = new \DOMDocument();
+
+ // Set an attribute on the DOM document specifying, as part of the XML declaration,
+ $xmlOptions = array(
+ // the version number of the document
+ 'xml_version' => 'xmlVersion',
+ // the encoding of the document
+ 'xml_encoding' => 'encoding',
+ // whether the document is standalone
+ 'xml_standalone' => 'xmlStandalone',
+ );
+ foreach ($xmlOptions as $xmlOption => $documentProperty) {
+ if (isset($context[$xmlOption])) {
+ $document->$documentProperty = $context[$xmlOption];
+ }
+ }
+
+ return $document;
+ }
}
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
index 54854c6..1b1a5f5 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
@@ -41,9 +41,9 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal
protected $camelizedAttributes = array();
/**
- * Set normalization callbacks
+ * Set normalization callbacks.
*
- * @param array $callbacks help normalize the result
+ * @param callable[] $callbacks help normalize the result
*
* @throws InvalidArgumentException if a non-callable callback is set
*/
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/README.md b/core/vendor/symfony/serializer/Symfony/Component/Serializer/README.md
index 3e80805..5a1606c 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/README.md
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/README.md
@@ -11,5 +11,5 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Serializer/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/SerializerAwareInterface.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/SerializerAwareInterface.php
index dd0bb60..ad0b768 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/SerializerAwareInterface.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/SerializerAwareInterface.php
@@ -11,8 +11,6 @@
namespace Symfony\Component\Serializer;
-use Symfony\Component\Serializer\SerializerInterface;
-
/**
* Defines the interface of encoders
*
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php
index b5ec1a2..00714f2 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php
@@ -19,7 +19,7 @@ class JsonEncoderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
- $this->encoder = new JsonEncoder;
+ $this->encoder = new JsonEncoder();
$this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
}
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php
index b23d4c7..6ad2a6c 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php
@@ -20,16 +20,18 @@
class XmlEncoderTest extends \PHPUnit_Framework_TestCase
{
+ private $encoder;
+
protected function setUp()
{
- $this->encoder = new XmlEncoder;
+ $this->encoder = new XmlEncoder();
$serializer = new Serializer(array(new CustomNormalizer()), array('xml' => new XmlEncoder()));
$this->encoder->setSerializer($serializer);
}
public function testEncodeScalar()
{
- $obj = new ScalarDummy;
+ $obj = new ScalarDummy();
$obj->xmlFoo = "foo";
$expected = ''."\n".
@@ -40,7 +42,7 @@ public function testEncodeScalar()
public function testSetRootNodeName()
{
- $obj = new ScalarDummy;
+ $obj = new ScalarDummy();
$obj->xmlFoo = "foo";
$this->encoder->setRootNodeName('test');
@@ -51,7 +53,7 @@ public function testSetRootNodeName()
}
/**
- * @expectedException UnexpectedValueException
+ * @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
* @expectedExceptionMessage Document types are not allowed.
*/
public function testDocTypeIsNotAllowed()
@@ -61,7 +63,7 @@ public function testDocTypeIsNotAllowed()
public function testAttributes()
{
- $obj = new ScalarDummy;
+ $obj = new ScalarDummy();
$obj->xmlFoo = array(
'foo-bar' => array(
'@id' => 1,
@@ -90,7 +92,7 @@ public function testAttributes()
public function testElementNameValid()
{
- $obj = new ScalarDummy;
+ $obj = new ScalarDummy();
$obj->xmlFoo = array(
'foo-bar' => 'a',
'foo_bar' => 'a',
@@ -118,6 +120,23 @@ public function testEncodeSimpleXML()
$this->assertEquals($expected, $this->encoder->encode($array, 'xml'));
}
+ public function testEncodeXmlAttributes()
+ {
+ $xml = simplexml_load_string('Peter');
+ $array = array('person' => $xml);
+
+ $expected = ''."\n".
+ 'Peter'."\n";
+
+ $context = array(
+ 'xml_version' => '1.1',
+ 'xml_encoding' => 'utf-8',
+ 'xml_standalone' => true,
+ );
+
+ $this->assertSame($expected, $this->encoder->encode($array, 'xml', $context));
+ }
+
public function testEncodeScalarRootAttributes()
{
$array = array(
@@ -187,7 +206,7 @@ public function testEncode()
public function testEncodeSerializerXmlRootNodeNameOption()
{
$options = array('xml_root_node_name' => 'test');
- $this->encoder = new XmlEncoder;
+ $this->encoder = new XmlEncoder();
$serializer = new Serializer(array(), array('xml' => new XmlEncoder()));
$this->encoder->setSerializer($serializer);
@@ -270,7 +289,7 @@ public function testDecodeArray()
public function testDecodeWithoutItemHash()
{
- $obj = new ScalarDummy;
+ $obj = new ScalarDummy();
$obj->xmlFoo = array(
'foo-bar' => array(
'@key' => "value",
@@ -301,6 +320,14 @@ public function testDecodeWithoutItemHash()
$this->assertEquals($expected, $this->encoder->decode($xml, 'xml'));
}
+ /**
+ * @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
+ */
+ public function testDecodeInvalidXml()
+ {
+ $this->encoder->decode('', 'xml');
+ }
+
public function testPreventsComplexExternalEntities()
{
$oldCwd = getcwd();
@@ -335,7 +362,7 @@ protected function getXmlSource()
protected function getObject()
{
- $obj = new Dummy;
+ $obj = new Dummy();
$obj->foo = 'foo';
$obj->bar = array('a', 'b');
$obj->baz = array('key' => 'val', 'key2' => 'val', 'A B' => 'bar', 'item' => array(array('title' => 'title1'), array('title' => 'title2')), 'Barry' => array('FooBar' => array('Baz' => 'Ed', '@id' => 1)));
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/CustomNormalizerTest.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/CustomNormalizerTest.php
index 7b4b4ae..eef1634 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/CustomNormalizerTest.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/CustomNormalizerTest.php
@@ -19,13 +19,13 @@ class CustomNormalizerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
- $this->normalizer = new CustomNormalizer;
- $this->normalizer->setSerializer(new Serializer);
+ $this->normalizer = new CustomNormalizer();
+ $this->normalizer->setSerializer(new Serializer());
}
public function testSerialize()
{
- $obj = new ScalarDummy;
+ $obj = new ScalarDummy();
$obj->foo = 'foo';
$obj->xmlFoo = 'xml';
$this->assertEquals('foo', $this->normalizer->normalize($obj, 'json'));
@@ -34,18 +34,18 @@ public function testSerialize()
public function testDeserialize()
{
- $obj = $this->normalizer->denormalize('foo', get_class(new ScalarDummy), 'xml');
+ $obj = $this->normalizer->denormalize('foo', get_class(new ScalarDummy()), 'xml');
$this->assertEquals('foo', $obj->xmlFoo);
$this->assertNull($obj->foo);
- $obj = $this->normalizer->denormalize('foo', get_class(new ScalarDummy), 'json');
+ $obj = $this->normalizer->denormalize('foo', get_class(new ScalarDummy()), 'json');
$this->assertEquals('foo', $obj->foo);
$this->assertNull($obj->xmlFoo);
}
public function testSupportsNormalization()
{
- $this->assertTrue($this->normalizer->supportsNormalization(new ScalarDummy));
+ $this->assertTrue($this->normalizer->supportsNormalization(new ScalarDummy()));
$this->assertFalse($this->normalizer->supportsNormalization(new \stdClass));
}
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php
index 4284616..f3bf969 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php
@@ -17,13 +17,13 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
- $this->normalizer = new GetSetMethodNormalizer;
+ $this->normalizer = new GetSetMethodNormalizer();
$this->normalizer->setSerializer($this->getMock('Symfony\Component\Serializer\Serializer'));
}
public function testNormalize()
{
- $obj = new GetSetDummy;
+ $obj = new GetSetDummy();
$obj->setFoo('foo');
$obj->setBar('bar');
$obj->setCamelCase('camelcase');
@@ -118,7 +118,7 @@ public function testIgnoredAttributes()
{
$this->normalizer->setIgnoredAttributes(array('foo', 'bar', 'camelCase'));
- $obj = new GetSetDummy;
+ $obj = new GetSetDummy();
$obj->setFoo('foo');
$obj->setBar('bar');
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/SerializerTest.php b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/SerializerTest.php
index 3c18946..106bcff 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/SerializerTest.php
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/SerializerTest.php
@@ -34,14 +34,14 @@ public function testNormalizeNoMatch()
public function testNormalizeTraversable()
{
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
- $result = $this->serializer->serialize(new TraversableDummy, 'json');
+ $result = $this->serializer->serialize(new TraversableDummy(), 'json');
$this->assertEquals('{"foo":"foo","bar":"bar"}', $result);
}
public function testNormalizeGivesPriorityToInterfaceOverTraversable()
{
- $this->serializer = new Serializer(array(new CustomNormalizer), array('json' => new JsonEncoder()));
- $result = $this->serializer->serialize(new NormalizableTraversableDummy, 'json');
+ $this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
+ $result = $this->serializer->serialize(new NormalizableTraversableDummy(), 'json');
$this->assertEquals('{"foo":"normalizedFoo","bar":"normalizedBar"}', $result);
}
diff --git a/core/vendor/symfony/serializer/Symfony/Component/Serializer/composer.json b/core/vendor/symfony/serializer/Symfony/Component/Serializer/composer.json
index ab537b2..7043566 100644
--- a/core/vendor/symfony/serializer/Symfony/Component/Serializer/composer.json
+++ b/core/vendor/symfony/serializer/Symfony/Component/Serializer/composer.json
@@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/CHANGELOG.md b/core/vendor/symfony/validator/Symfony/Component/Validator/CHANGELOG.md
index 7ab8051..f5ae1ee 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/CHANGELOG.md
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/CHANGELOG.md
@@ -1,6 +1,12 @@
CHANGELOG
=========
+2.4.0
+-----
+
+ * added a constraint the uses the expression language
+ * added `minRatio`, `maxRatio`, `allowSquare`, `allowLandscape`, and `allowPortrait` to Image validator
+
2.3.0
-----
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraint.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraint.php
index 6c568aa..2f3cbdd 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraint.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraint.php
@@ -87,8 +87,9 @@ public function __construct($options = null)
$invalidOptions = array();
$missingOptions = array_flip((array) $this->getRequiredOptions());
- if (is_array($options) && count($options) == 1 && isset($options['value'])) {
- $options = $options['value'];
+ if (is_array($options) && count($options) >= 1 && isset($options['value']) && !property_exists($this, 'value')) {
+ $options[$this->getDefaultOption()] = $options['value'];
+ unset($options['value']);
}
if (is_array($options) && count($options) > 0 && is_string(key($options))) {
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintValidatorFactory.php b/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintValidatorFactory.php
index 88b5cef..5cf36ec 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintValidatorFactory.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintValidatorFactory.php
@@ -11,29 +11,53 @@
namespace Symfony\Component\Validator;
-use Symfony\Component\Validator\ConstraintValidatorFactoryInterface;
-use Symfony\Component\Validator\Constraint;
+use Symfony\Component\PropertyAccess\PropertyAccess;
+use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
+use Symfony\Component\Validator\Constraints\ExpressionValidator;
/**
* Default implementation of the ConstraintValidatorFactoryInterface.
*
* This enforces the convention that the validatedBy() method on any
- * Constrain will return the class name of the ConstraintValidator that
+ * Constraint will return the class name of the ConstraintValidator that
* should validate the Constraint.
+ *
+ * @author Bernhard Schussek
*/
class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
{
protected $validators = array();
/**
+ * @var PropertyAccessorInterface
+ */
+ private $propertyAccessor;
+
+ public function __construct(PropertyAccessorInterface $propertyAccessor = null)
+ {
+ $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
+ }
+
+ /**
* {@inheritDoc}
*/
public function getInstance(Constraint $constraint)
{
$className = $constraint->validatedBy();
- if (!isset($this->validators[$className]) || $className === 'Symfony\Component\Validator\Constraints\CollectionValidator') {
- $this->validators[$className] = new $className();
+ // The second condition is a hack that is needed when CollectionValidator
+ // calls itself recursively (Collection constraints can be nested).
+ // Since the context of the validator is overwritten when initialize()
+ // is called for the nested constraint, the outer validator is
+ // acting on the wrong context when the nested validation terminates.
+ //
+ // A better solution - which should be approached in Symfony 3.0 - is to
+ // remove the initialize() method and pass the context as last argument
+ // to validate() instead.
+ if (!isset($this->validators[$className]) || 'Symfony\Component\Validator\Constraints\CollectionValidator' === $className) {
+ $this->validators[$className] = 'validator.expression' === $className
+ ? new ExpressionValidator($this->propertyAccessor)
+ : new $className();
}
return $this->validators[$className];
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintValidatorFactoryInterface.php b/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintValidatorFactoryInterface.php
index 584f980..5e21627 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintValidatorFactoryInterface.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintValidatorFactoryInterface.php
@@ -11,11 +11,9 @@
namespace Symfony\Component\Validator;
-use Symfony\Component\Validator\Constraint;
-
/**
* Specifies an object able to return the correct ConstraintValidatorInterface
- * instance given a Constrain object.
+ * instance given a Constraint object.
*/
interface ConstraintValidatorFactoryInterface
{
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
index 6b76fc8..f6b9193 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
@@ -60,6 +60,10 @@ private function valueToType($value)
*/
private function valueToString($value)
{
+ if (is_object($value) && method_exists($value, '__toString')) {
+ return (string) $value;
+ }
+
if ($value instanceof \DateTime) {
return $value->format('Y-m-d H:i:s');
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Callback.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Callback.php
index e93efa4..01aeb6d 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Callback.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Callback.php
@@ -22,26 +22,52 @@
*/
class Callback extends Constraint
{
+ /**
+ * @var string|callable
+ *
+ * @since 2.4
+ */
+ public $callback;
+
+ /**
+ * @var array
+ *
+ * @deprecated Deprecated since version 2.4, to be removed in Symfony 3.0.
+ */
public $methods;
/**
- * {@inheritDoc}
+ * {@inheritdoc}
*/
- public function getRequiredOptions()
+ public function __construct($options = null)
{
- return array('methods');
+ // Invocation through annotations with an array parameter only
+ if (is_array($options) && 1 === count($options) && isset($options['value'])) {
+ $options = $options['value'];
+ }
+
+ if (is_array($options) && !isset($options['callback']) && !isset($options['methods']) && !isset($options['groups'])) {
+ if (is_callable($options)) {
+ $options = array('callback' => $options);
+ } else {
+ // BC with Symfony < 2.4
+ $options = array('methods' => $options);
+ }
+ }
+
+ parent::__construct($options);
}
/**
- * {@inheritDoc}
+ * {@inheritdoc}
*/
public function getDefaultOption()
{
- return 'methods';
+ return 'callback';
}
/**
- * {@inheritDoc}
+ * {@inheritdoc}
*/
public function getTargets()
{
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CallbackValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CallbackValidator.php
index ab3c56f..28b3425 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CallbackValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CallbackValidator.php
@@ -34,13 +34,20 @@ public function validate($object, Constraint $constraint)
return;
}
+ if (null !== $constraint->callback && null !== $constraint->methods) {
+ throw new ConstraintDefinitionException(
+ 'The Callback constraint supports either the option "callback" ' .
+ 'or "methods", but not both at the same time.'
+ );
+ }
+
// has to be an array so that we can differentiate between callables
// and method names
- if (!is_array($constraint->methods)) {
+ if (null !== $constraint->methods && !is_array($constraint->methods)) {
throw new UnexpectedTypeException($constraint->methods, 'array');
}
- $methods = $constraint->methods;
+ $methods = $constraint->methods ?: array($constraint->callback);
foreach ($methods as $method) {
if (is_array($method) || $method instanceof \Closure) {
@@ -54,7 +61,13 @@ public function validate($object, Constraint $constraint)
throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist', $method));
}
- $object->$method($this->context);
+ $reflMethod = new \ReflectionMethod($object, $method);
+
+ if ($reflMethod->isStatic()) {
+ $reflMethod->invoke(null, $object, $this->context);
+ } else {
+ $reflMethod->invoke($object, $this->context);
+ }
}
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Collection.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Collection.php
index d60f0c2..78fa5ae 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Collection.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Collection.php
@@ -12,8 +12,6 @@
namespace Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
-use Symfony\Component\Validator\Constraints\Required;
-use Symfony\Component\Validator\Constraints\Optional;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
/**
@@ -25,7 +23,7 @@
*/
class Collection extends Constraint
{
- public $fields;
+ public $fields = array();
public $allowExtraFields = false;
public $allowMissingFields = false;
public $extraFieldsMessage = 'This field was not expected.';
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CollectionValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CollectionValidator.php
index f59afe7..f273ac4 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CollectionValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/CollectionValidator.php
@@ -14,7 +14,6 @@
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
-use Symfony\Component\Validator\Constraints\Optional;
/**
* @author Bernhard Schussek
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/EmailValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/EmailValidator.php
index abe45a8..e059310 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/EmailValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/EmailValidator.php
@@ -41,11 +41,6 @@ public function validate($value, Constraint $constraint)
if ($valid) {
$host = substr($value, strpos($value, '@') + 1);
- if (version_compare(PHP_VERSION, '5.3.3', '<') && strpos($host, '.') === false) {
- // Likely not a FQDN, bug in PHP FILTER_VALIDATE_EMAIL prior to PHP 5.3.3
- $valid = false;
- }
-
// Check for host DNS resource records
if ($valid && $constraint->checkMX) {
$valid = $this->checkMX($host);
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Callback.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Expression.php
similarity index 61%
copy from core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Callback.php
copy to core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Expression.php
index e93efa4..b845a32 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Callback.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Expression.php
@@ -16,28 +16,28 @@
/**
* @Annotation
*
+ * @author Fabien Potencier
* @author Bernhard Schussek
- *
- * @api
*/
-class Callback extends Constraint
+class Expression extends Constraint
{
- public $methods;
+ public $message = 'This value is not valid.';
+ public $expression;
/**
* {@inheritDoc}
*/
- public function getRequiredOptions()
+ public function getDefaultOption()
{
- return array('methods');
+ return 'expression';
}
/**
* {@inheritDoc}
*/
- public function getDefaultOption()
+ public function getRequiredOptions()
{
- return 'methods';
+ return array('expression');
}
/**
@@ -45,6 +45,14 @@ public function getDefaultOption()
*/
public function getTargets()
{
- return self::CLASS_CONSTRAINT;
+ return array(self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validatedBy()
+ {
+ return 'validator.expression';
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/ExpressionValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/ExpressionValidator.php
new file mode 100644
index 0000000..e27859b
--- /dev/null
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/ExpressionValidator.php
@@ -0,0 +1,82 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Validator\Constraints;
+
+use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
+use Symfony\Component\PropertyAccess\PropertyPath;
+use Symfony\Component\Validator\Constraint;
+use Symfony\Component\Validator\ConstraintValidator;
+use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
+use Symfony\Component\Validator\Exception\RuntimeException;
+
+/**
+ * @author Fabien Potencier
+ * @author Bernhard Schussek
+ */
+class ExpressionValidator extends ConstraintValidator
+{
+ /**
+ * @var PropertyAccessorInterface
+ */
+ private $propertyAccessor;
+
+ /**
+ * @var ExpressionLanguage
+ */
+ private $expressionLanguage;
+
+ public function __construct(PropertyAccessorInterface $propertyAccessor)
+ {
+ $this->propertyAccessor = $propertyAccessor;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function validate($value, Constraint $constraint)
+ {
+ if (null === $value || '' === $value) {
+ return;
+ }
+
+ $variables = array();
+
+ if (null === $this->context->getPropertyName()) {
+ $variables['this'] = $value;
+ } else {
+ // Extract the object that the property belongs to from the object
+ // graph
+ $path = new PropertyPath($this->context->getPropertyPath());
+ $parentPath = $path->getParent();
+ $root = $this->context->getRoot();
+
+ $variables['value'] = $value;
+ $variables['this'] = $parentPath ? $this->propertyAccessor->getValue($root, $parentPath) : $root;
+ }
+
+ if (!$this->getExpressionLanguage()->evaluate($constraint->expression, $variables)) {
+ $this->context->addViolation($constraint->message);
+ }
+ }
+
+ private function getExpressionLanguage()
+ {
+ if (null === $this->expressionLanguage) {
+ if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
+ throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
+ }
+ $this->expressionLanguage = new ExpressionLanguage();
+ }
+
+ return $this->expressionLanguage;
+ }
+}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/IbanValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/IbanValidator.php
index 1afc8f0..3ec4c6e 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/IbanValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/IbanValidator.php
@@ -30,6 +30,13 @@ public function validate($value, Constraint $constraint)
return;
}
+ // An IBAN without a country code is not an IBAN.
+ if (0 === preg_match('/[A-Za-z]/', $value)) {
+ $this->context->addViolation($constraint->message, array('{{ value }}' => $value));
+
+ return;
+ }
+
$teststring = preg_replace('/\s+/', '', $value);
if (strlen($teststring) < 4) {
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Image.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Image.php
index a231064..9fa8725 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Image.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Image.php
@@ -23,6 +23,11 @@ class Image extends File
public $maxWidth = null;
public $maxHeight = null;
public $minHeight = null;
+ public $maxRatio = null;
+ public $minRatio = null;
+ public $allowSquare = true;
+ public $allowLandscape = true;
+ public $allowPortrait = true;
public $mimeTypesMessage = 'This file is not a valid image.';
public $sizeNotDetectedMessage = 'The size of the image could not be detected.';
@@ -30,4 +35,9 @@ class Image extends File
public $minWidthMessage = 'The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.';
public $maxHeightMessage = 'The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.';
public $minHeightMessage = 'The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.';
+ public $maxRatioMessage = 'The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.';
+ public $minRatioMessage = 'The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.';
+ public $allowSquareMessage = 'The image is square ({{ width }}x{{ height }}px). Square images are not allowed.';
+ public $allowLandscapeMessage = 'The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.';
+ public $allowPortraitMessage = 'The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.';
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/ImageValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/ImageValidator.php
index 79e6bdc..76ce876 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/ImageValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/ImageValidator.php
@@ -38,7 +38,9 @@ public function validate($value, Constraint $constraint)
}
if (null === $constraint->minWidth && null === $constraint->maxWidth
- && null === $constraint->minHeight && null === $constraint->maxHeight) {
+ && null === $constraint->minHeight && null === $constraint->maxHeight
+ && null === $constraint->minRatio && null === $constraint->maxRatio
+ && $constraint->allowSquare && $constraint->allowLandscape && $constraint->allowPortrait) {
return;
}
@@ -109,5 +111,55 @@ public function validate($value, Constraint $constraint)
));
}
}
+
+ $ratio = $width / $height;
+
+ if (null !== $constraint->minRatio) {
+ if (!is_numeric((string) $constraint->minRatio)) {
+ throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum ratio', $constraint->minRatio));
+ }
+
+ if ($ratio < $constraint->minRatio) {
+ $this->context->addViolation($constraint->minRatioMessage, array(
+ '{{ ratio }}' => $ratio,
+ '{{ min_ratio }}' => $constraint->minRatio
+ ));
+ }
+ }
+
+ if (null !== $constraint->maxRatio) {
+ if (!is_numeric((string) $constraint->maxRatio)) {
+ throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum ratio', $constraint->maxRatio));
+ }
+
+ if ($ratio > $constraint->maxRatio) {
+ $this->context->addViolation($constraint->maxRatioMessage, array(
+ '{{ ratio }}' => $ratio,
+ '{{ max_ratio }}' => $constraint->maxRatio
+ ));
+ }
+ }
+
+ if (!$constraint->allowSquare && $width == $height) {
+ $this->context->addViolation($constraint->allowSquareMessage, array(
+ '{{ width }}' => $width,
+ '{{ height }}' => $height
+ ));
+ }
+
+ if (!$constraint->allowLandscape && $width > $height) {
+ $this->context->addViolation($constraint->allowLandscapeMessage, array(
+ '{{ width }}' => $width,
+ '{{ height }}' => $height
+ ));
+ }
+
+ if (!$constraint->allowPortrait && $width < $height) {
+ $this->context->addViolation($constraint->allowPortraitMessage, array(
+ '{{ width }}' => $width,
+ '{{ height }}' => $height
+ ));
+ }
+
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/LuhnValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/LuhnValidator.php
index 0b60eee..d3802fe 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/LuhnValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/LuhnValidator.php
@@ -13,6 +13,7 @@
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
+use Symfony\Component\Validator\Exception\UnexpectedTypeException;
/**
* Validates a PAN using the LUHN Algorithm
@@ -38,6 +39,13 @@ public function validate($value, Constraint $constraint)
return;
}
+ /**
+ * need to work with strings only because long numbers are treated as floats and don't work with strlen
+ */
+ if (!is_string($value)) {
+ throw new UnexpectedTypeException($value, 'string');
+ }
+
if (!is_numeric($value)) {
$this->context->addViolation($constraint->message);
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/NotBlankValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/NotBlankValidator.php
index 8d3efae..dd3dbdd 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/NotBlankValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/NotBlankValidator.php
@@ -17,8 +17,6 @@
/**
* @author Bernhard Schussek
*
- * @author Bernhard Schussek
- *
* @api
*/
class NotBlankValidator extends ConstraintValidator
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/NullValidator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/NullValidator.php
index e8fa24e..9753f43 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/NullValidator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/NullValidator.php
@@ -27,6 +27,12 @@ class NullValidator extends ConstraintValidator
public function validate($value, Constraint $constraint)
{
if (null !== $value) {
+ if (is_object($value)) {
+ $value = get_class($value);
+ } elseif (is_array($value)) {
+ $value = 'Array';
+ }
+
$this->context->addViolation($constraint->message, array('{{ value }}' => $value));
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Exception/UnexpectedTypeException.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Exception/RuntimeException.php
similarity index 55%
copy from core/vendor/symfony/validator/Symfony/Component/Validator/Exception/UnexpectedTypeException.php
copy to core/vendor/symfony/validator/Symfony/Component/Validator/Exception/RuntimeException.php
index 573fecd..df4a50c 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Exception/UnexpectedTypeException.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Exception/RuntimeException.php
@@ -11,10 +11,11 @@
namespace Symfony\Component\Validator\Exception;
-class UnexpectedTypeException extends ValidatorException
+/**
+ * Base RuntimeException for the Validator component.
+ *
+ * @author Bernhard Schussek
+ */
+class RuntimeException extends \RuntimeException implements ExceptionInterface
{
- public function __construct($value, $expectedType)
- {
- parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, gettype($value)));
- }
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Exception/UnexpectedTypeException.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Exception/UnexpectedTypeException.php
index 573fecd..49d8cc2 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Exception/UnexpectedTypeException.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Exception/UnexpectedTypeException.php
@@ -15,6 +15,6 @@ class UnexpectedTypeException extends ValidatorException
{
public function __construct($value, $expectedType)
{
- parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, gettype($value)));
+ parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, is_object($value) ? get_class($value) : gettype($value)));
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php
index 4cd1175..90dd282 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php
@@ -11,15 +11,28 @@
namespace Symfony\Component\Validator\Mapping;
+use Symfony\Component\Validator\MetadataFactoryInterface;
+
/**
- * Simple implementation of ClassMetadataFactoryInterface that can be used when using ValidatorInterface::validateValue().
+ * Simple implementation of MetadataFactoryInterface that can be used when using ValidatorInterface::validateValue().
*
* @author Fabien Potencier
*/
-class BlackholeMetadataFactory implements ClassMetadataFactoryInterface
+class BlackholeMetadataFactory implements MetadataFactoryInterface
{
- public function getClassMetadata($class)
+ /**
+ * @inheritdoc
+ */
+ public function getMetadataFor($value)
{
throw new \LogicException('BlackholeClassMetadataFactory only works with ValidatorInterface::validateValue().');
}
+
+ /**
+ * @inheritdoc
+ */
+ public function hasMetadataFor($value)
+ {
+ return false;
+ }
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php
index 54c0dbe..8deea4e 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Validator\Mapping\Loader;
use Symfony\Component\Validator\Exception\MappingException;
+use Symfony\Component\Validator\Constraint;
abstract class AbstractLoader implements LoaderInterface
{
@@ -19,7 +20,7 @@
* Contains all known namespaces indexed by their prefix
* @var array
*/
- protected $namespaces;
+ protected $namespaces = array();
/**
* Adds a namespace alias.
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php
index 0e7e89b..10745c7 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Validator\Mapping\Loader;
use Doctrine\Common\Annotations\Reader;
+use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Exception\MappingException;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints\GroupSequence;
@@ -63,7 +64,12 @@ public function loadClassMetadata(ClassMetadata $metadata)
foreach ($reflClass->getMethods() as $method) {
if ($method->getDeclaringClass()->name == $className) {
foreach ($this->reader->getMethodAnnotations($method) as $constraint) {
- if ($constraint instanceof Constraint) {
+ if ($constraint instanceof Callback) {
+ $constraint->callback = $method->getName();
+ $constraint->methods = null;
+
+ $metadata->addConstraint($constraint);
+ } elseif ($constraint instanceof Constraint) {
if (preg_match('/^(get|is)(.+)$/i', $method->name, $matches)) {
$metadata->addGetterConstraint(lcfirst($matches[2]), $constraint);
} else {
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php
index a9ae396..cad247e 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php
@@ -183,7 +183,7 @@ protected function parseOptions(\SimpleXMLElement $nodes)
*
* @param string $file Path of file
*
- * @return SimpleXMLElement
+ * @return \SimpleXMLElement
*
* @throws MappingException
*/
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/README.md b/core/vendor/symfony/validator/Symfony/Component/Validator/README.md
index 70dd999..e1601cf 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/README.md
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/README.md
@@ -107,7 +107,7 @@ https://github.com/fabpot/Silex/blob/master/src/Silex/Provider/ValidatorServiceP
Documentation:
-http://symfony.com/doc/2.3/book/validation.html
+http://symfony.com/doc/2.4/book/validation.html
JSR-303 Specification:
@@ -116,5 +116,5 @@ http://jcp.org/en/jsr/detail?id=303
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Validator/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ConstraintTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ConstraintTest.php
index 007bb1e..015a6da 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ConstraintTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ConstraintTest.php
@@ -15,6 +15,8 @@
use Symfony\Component\Validator\Tests\Fixtures\ConstraintA;
use Symfony\Component\Validator\Tests\Fixtures\ConstraintB;
use Symfony\Component\Validator\Tests\Fixtures\ConstraintC;
+use Symfony\Component\Validator\Tests\Fixtures\ConstraintWithValue;
+use Symfony\Component\Validator\Tests\Fixtures\ConstraintWithValueAsDefault;
class ConstraintTest extends \PHPUnit_Framework_TestCase
{
@@ -71,6 +73,30 @@ public function testSetDefaultPropertyDoctrineStyle()
$this->assertEquals('foo', $constraint->property2);
}
+ public function testSetDefaultPropertyDoctrineStylePlusOtherProperty()
+ {
+ $constraint = new ConstraintA(array('value' => 'foo', 'property1' => 'bar'));
+
+ $this->assertEquals('foo', $constraint->property2);
+ $this->assertEquals('bar', $constraint->property1);
+ }
+
+ public function testSetDefaultPropertyDoctrineStyleWhenDefaultPropertyIsNamedValue()
+ {
+ $constraint = new ConstraintWithValueAsDefault(array('value' => 'foo'));
+
+ $this->assertEquals('foo', $constraint->value);
+ $this->assertNull($constraint->property);
+ }
+
+ public function testDontSetDefaultPropertyIfValuePropertyExists()
+ {
+ $constraint = new ConstraintWithValue(array('value' => 'foo'));
+
+ $this->assertEquals('foo', $constraint->value);
+ $this->assertNull($constraint->property);
+ }
+
public function testSetUndefinedDefaultProperty()
{
$this->setExpectedException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
@@ -117,14 +143,14 @@ public function testCanCreateConstraintWithNoDefaultOptionAndEmptyArray()
public function testGetTargetsCanBeString()
{
- $constraint = new ClassConstraint;
+ $constraint = new ClassConstraint();
$this->assertEquals('class', $constraint->getTargets());
}
public function testGetTargetsCanBeArray()
{
- $constraint = new ConstraintA;
+ $constraint = new ConstraintA();
$this->assertEquals(array('property', 'class'), $constraint->getTargets());
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php
index d72eaf2..36405e3 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php
@@ -14,6 +14,21 @@
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Constraints\AbstractComparisonValidator;
+class ComparisonTest_Class
+{
+ protected $value;
+
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ public function __toString()
+ {
+ return (string) $this->value;
+ }
+}
+
/**
* @author Daniel Holmes
*/
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php
index 4d248c1..cdcd49b 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php
@@ -17,9 +17,9 @@
class CallbackValidatorTest_Class
{
- public static function validateStatic($object, ExecutionContext $context)
+ public static function validateCallback($object, ExecutionContext $context)
{
- $context->addViolation('Static message', array('{{ value }}' => 'foobar'), 'invalidValue');
+ $context->addViolation('Callback message', array('{{ value }}' => 'foobar'), 'invalidValue');
return false;
}
@@ -27,16 +27,16 @@ public static function validateStatic($object, ExecutionContext $context)
class CallbackValidatorTest_Object
{
- public function validateOne(ExecutionContext $context)
+ public function validate(ExecutionContext $context)
{
$context->addViolation('My message', array('{{ value }}' => 'foobar'), 'invalidValue');
return false;
}
- public function validateTwo(ExecutionContext $context)
+ public static function validateStatic($object, ExecutionContext $context)
{
- $context->addViolation('Other message', array('{{ value }}' => 'baz'), 'otherInvalidValue');
+ $context->addViolation('Static message', array('{{ value }}' => 'baz'), 'otherInvalidValue');
return false;
}
@@ -68,10 +68,10 @@ public function testNullIsValid()
$this->validator->validate(null, new Callback(array('foo')));
}
- public function testCallbackSingleMethod()
+ public function testSingleMethod()
{
$object = new CallbackValidatorTest_Object();
- $constraint = new Callback(array('validateOne'));
+ $constraint = new Callback('validate');
$this->context->expects($this->once())
->method('addViolation')
@@ -82,24 +82,137 @@ public function testCallbackSingleMethod()
$this->validator->validate($object, $constraint);
}
- public function testCallbackSingleStaticMethod()
+ public function testSingleMethodExplicitName()
{
$object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array('callback' => 'validate'));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('My message', array(
+ '{{ value }}' => 'foobar',
+ ));
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ public function testSingleStaticMethod()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback('validateStatic');
$this->context->expects($this->once())
->method('addViolation')
->with('Static message', array(
+ '{{ value }}' => 'baz',
+ ));
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ public function testClosure()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(function ($object, ExecutionContext $context) {
+ $context->addViolation('My message', array('{{ value }}' => 'foobar'), 'invalidValue');
+
+ return false;
+ });
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('My message', array(
'{{ value }}' => 'foobar',
));
- $this->validator->validate($object, new Callback(array(
- array(__CLASS__.'_Class', 'validateStatic')
- )));
+ $this->validator->validate($object, $constraint);
+ }
+
+ public function testClosureExplicitName()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array(
+ 'callback' => function ($object, ExecutionContext $context) {
+ $context->addViolation('My message', array('{{ value }}' => 'foobar'), 'invalidValue');
+
+ return false;
+ },
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('My message', array(
+ '{{ value }}' => 'foobar',
+ ));
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ public function testArrayCallable()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array(__CLASS__.'_Class', 'validateCallback'));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('Callback message', array(
+ '{{ value }}' => 'foobar',
+ ));
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ public function testArrayCallableExplicitName()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array(
+ 'callback' => array(__CLASS__.'_Class', 'validateCallback'),
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('Callback message', array(
+ '{{ value }}' => 'foobar',
+ ));
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ // BC with Symfony < 2.4
+ public function testSingleMethodBc()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array('validate'));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('My message', array(
+ '{{ value }}' => 'foobar',
+ ));
+
+ $this->validator->validate($object, $constraint);
}
- public function testCallbackMultipleMethods()
+ // BC with Symfony < 2.4
+ public function testSingleMethodBcExplicitName()
{
$object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array('methods' => array('validate')));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('My message', array(
+ '{{ value }}' => 'foobar',
+ ));
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ // BC with Symfony < 2.4
+ public function testMultipleMethodsBc()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array('validate', 'validateStatic'));
$this->context->expects($this->at(0))
->method('addViolation')
@@ -108,23 +221,67 @@ public function testCallbackMultipleMethods()
));
$this->context->expects($this->at(1))
->method('addViolation')
- ->with('Other message', array(
+ ->with('Static message', array(
'{{ value }}' => 'baz',
));
- $this->validator->validate($object, new Callback(array(
- 'validateOne', 'validateTwo'
- )));
+ $this->validator->validate($object, $constraint);
}
- /**
- * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException
- */
- public function testExpectCallbackArray()
+ // BC with Symfony < 2.4
+ public function testMultipleMethodsBcExplicitName()
{
$object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array(
+ 'methods' => array('validate', 'validateStatic'),
+ ));
- $this->validator->validate($object, new Callback('foobar'));
+ $this->context->expects($this->at(0))
+ ->method('addViolation')
+ ->with('My message', array(
+ '{{ value }}' => 'foobar',
+ ));
+ $this->context->expects($this->at(1))
+ ->method('addViolation')
+ ->with('Static message', array(
+ '{{ value }}' => 'baz',
+ ));
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ // BC with Symfony < 2.4
+ public function testSingleStaticMethodBc()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array(
+ array(__CLASS__.'_Class', 'validateCallback')
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('Callback message', array(
+ '{{ value }}' => 'foobar',
+ ));
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ // BC with Symfony < 2.4
+ public function testSingleStaticMethodBcExplicitName()
+ {
+ $object = new CallbackValidatorTest_Object();
+ $constraint = new Callback(array(
+ 'methods' => array(array(__CLASS__.'_Class', 'validateCallback')),
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('Callback message', array(
+ '{{ value }}' => 'foobar',
+ ));
+
+ $this->validator->validate($object, $constraint);
}
/**
@@ -147,10 +304,43 @@ public function testExpectValidCallbacks()
$this->validator->validate($object, new Callback(array(array('foo', 'bar'))));
}
+ /**
+ * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
+ */
+ public function testExpectEitherCallbackOrMethods()
+ {
+ $object = new CallbackValidatorTest_Object();
+
+ $this->validator->validate($object, new Callback(array(
+ 'callback' => 'validate',
+ 'methods' => array('validateStatic'),
+ )));
+ }
+
public function testConstraintGetTargets()
{
$constraint = new Callback(array('foo'));
$this->assertEquals('class', $constraint->getTargets());
}
+
+ // Should succeed. Needed when defining constraints as annotations.
+ public function testNoConstructorArguments()
+ {
+ new Callback();
+ }
+
+ public function testAnnotationInvocationSingleValued()
+ {
+ $constraint = new Callback(array('value' => 'validateStatic'));
+
+ $this->assertEquals(new Callback('validateStatic'), $constraint);
+ }
+
+ public function testAnnotationInvocationMultiValued()
+ {
+ $constraint = new Callback(array('value' => array(__CLASS__.'_Class', 'validateCallback')));
+
+ $this->assertEquals(new Callback(array(__CLASS__.'_Class', 'validateCallback')), $constraint);
+ }
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php
index c1618b6..9267fdb 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php
@@ -105,7 +105,7 @@ public function testValidChoiceCallbackFunction()
public function testValidChoiceCallbackClosure()
{
- $constraint = new Choice(array('callback' => function() {
+ $constraint = new Choice(array('callback' => function () {
return array('foo', 'bar');
}));
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php
index 3eedaa3..95851e8 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php
@@ -104,4 +104,14 @@ public function getInvalidCountries()
array('EN'),
);
}
+
+ public function testValidateUsingCountrySpecificLocale()
+ {
+ \Locale::setDefault('en_GB');
+ $existingCountry = 'GB';
+ $this->context->expects($this->never())
+ ->method('addViolation');
+
+ $this->validator->validate($existingCountry, new Country());
+ }
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php
index d2e233c..ea6c2eb 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php
@@ -70,6 +70,18 @@ public function testValidCurrencies($currency)
$this->validator->validate($currency, new Currency());
}
+ /**
+ * @dataProvider getValidCurrencies
+ **/
+ public function testValidCurrenciesWithCountrySpecificLocale($currency)
+ {
+ \Locale::setDefault('en_GB');
+ $this->context->expects($this->never())
+ ->method('addViolation');
+
+ $this->validator->validate($currency, new Currency());
+ }
+
public function getValidCurrencies()
{
return array(
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php
index b47d9e6..6f8abc1 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php
@@ -13,7 +13,6 @@
use Symfony\Component\Validator\Constraints\EqualTo;
use Symfony\Component\Validator\Constraints\EqualToValidator;
-use Symfony\Component\Validator\Tests\Constraints\AbstractComparisonValidatorTestCase;
/**
* @author Daniel Holmes
@@ -40,6 +39,7 @@ public function provideValidComparisons()
array(3, '3'),
array('a', 'a'),
array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')),
+ array(new ComparisonTest_Class(5), new ComparisonTest_Class(5)),
array(null, 1),
);
}
@@ -52,7 +52,8 @@ public function provideInvalidComparisons()
return array(
array(1, 2, '2', 'integer'),
array('22', '333', "'333'", 'string'),
- array(new \DateTime('2001-01-01'), new \DateTime('2000-01-01'), '2000-01-01 00:00:00', 'DateTime')
+ array(new \DateTime('2001-01-01'), new \DateTime('2000-01-01'), '2000-01-01 00:00:00', 'DateTime'),
+ array(new ComparisonTest_Class(4), new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
);
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php
new file mode 100644
index 0000000..b71138e
--- /dev/null
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php
@@ -0,0 +1,197 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Validator\Tests\Constraints;
+
+use Symfony\Component\PropertyAccess\PropertyAccess;
+use Symfony\Component\Validator\Constraints\Expression;
+use Symfony\Component\Validator\Constraints\ExpressionValidator;
+
+class ExpressionValidatorTest extends \PHPUnit_Framework_TestCase
+{
+ protected $context;
+ protected $validator;
+
+ protected function setUp()
+ {
+ $this->context = $this->getMock('Symfony\Component\Validator\ExecutionContext', array(), array(), '', false);
+ $this->validator = new ExpressionValidator(PropertyAccess::createPropertyAccessor());
+ $this->validator->initialize($this->context);
+
+ $this->context->expects($this->any())
+ ->method('getClassName')
+ ->will($this->returnValue(__CLASS__));
+ }
+
+ protected function tearDown()
+ {
+ $this->context = null;
+ $this->validator = null;
+ }
+
+ public function testNullIsValid()
+ {
+ $this->context->expects($this->never())
+ ->method('addViolation');
+
+ $this->validator->validate(null, new Expression('value == 1'));
+ }
+
+ public function testEmptyStringIsValid()
+ {
+ $this->context->expects($this->never())
+ ->method('addViolation');
+
+ $this->validator->validate('', new Expression('value == 1'));
+ }
+
+ public function testSucceedingExpressionAtObjectLevel()
+ {
+ $constraint = new Expression('this.property == 1');
+
+ $object = (object) array('property' => '1');
+
+ $this->context->expects($this->any())
+ ->method('getPropertyName')
+ ->will($this->returnValue(null));
+
+ $this->context->expects($this->never())
+ ->method('addViolation');
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ public function testFailingExpressionAtObjectLevel()
+ {
+ $constraint = new Expression(array(
+ 'expression' => 'this.property == 1',
+ 'message' => 'myMessage',
+ ));
+
+ $object = (object) array('property' => '2');
+
+ $this->context->expects($this->any())
+ ->method('getPropertyName')
+ ->will($this->returnValue(null));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('myMessage');
+
+ $this->validator->validate($object, $constraint);
+ }
+
+ public function testSucceedingExpressionAtPropertyLevel()
+ {
+ $constraint = new Expression('value == this.expected');
+
+ $object = (object) array('expected' => '1');
+
+ $this->context->expects($this->any())
+ ->method('getPropertyName')
+ ->will($this->returnValue('property'));
+
+ $this->context->expects($this->any())
+ ->method('getPropertyPath')
+ ->will($this->returnValue('property'));
+
+ $this->context->expects($this->any())
+ ->method('getRoot')
+ ->will($this->returnValue($object));
+
+ $this->context->expects($this->never())
+ ->method('addViolation');
+
+ $this->validator->validate('1', $constraint);
+ }
+
+ public function testFailingExpressionAtPropertyLevel()
+ {
+ $constraint = new Expression(array(
+ 'expression' => 'value == this.expected',
+ 'message' => 'myMessage',
+ ));
+
+ $object = (object) array('expected' => '1');
+
+ $this->context->expects($this->any())
+ ->method('getPropertyName')
+ ->will($this->returnValue('property'));
+
+ $this->context->expects($this->any())
+ ->method('getPropertyPath')
+ ->will($this->returnValue('property'));
+
+ $this->context->expects($this->any())
+ ->method('getRoot')
+ ->will($this->returnValue($object));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('myMessage');
+
+ $this->validator->validate('2', $constraint);
+ }
+
+ public function testSucceedingExpressionAtNestedPropertyLevel()
+ {
+ $constraint = new Expression('value == this.expected');
+
+ $object = (object) array('expected' => '1');
+ $root = (object) array('nested' => $object);
+
+ $this->context->expects($this->any())
+ ->method('getPropertyName')
+ ->will($this->returnValue('property'));
+
+ $this->context->expects($this->any())
+ ->method('getPropertyPath')
+ ->will($this->returnValue('nested.property'));
+
+ $this->context->expects($this->any())
+ ->method('getRoot')
+ ->will($this->returnValue($root));
+
+ $this->context->expects($this->never())
+ ->method('addViolation');
+
+ $this->validator->validate('1', $constraint);
+ }
+
+ public function testFailingExpressionAtNestedPropertyLevel()
+ {
+ $constraint = new Expression(array(
+ 'expression' => 'value == this.expected',
+ 'message' => 'myMessage',
+ ));
+
+ $object = (object) array('expected' => '1');
+ $root = (object) array('nested' => $object);
+
+ $this->context->expects($this->any())
+ ->method('getPropertyName')
+ ->will($this->returnValue('property'));
+
+ $this->context->expects($this->any())
+ ->method('getPropertyPath')
+ ->will($this->returnValue('nested.property'));
+
+ $this->context->expects($this->any())
+ ->method('getRoot')
+ ->will($this->returnValue($root));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('myMessage');
+
+ $this->validator->validate('2', $constraint);
+ }
+}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
index 0ca9806..0927aed 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
@@ -24,10 +24,6 @@
protected function setUp()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\UploadedFile')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$this->context = $this->getMock('Symfony\Component\Validator\ExecutionContext', array(), array(), '', false);
$this->validator = new FileValidator();
$this->validator->initialize($this->context);
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/Fixtures/test_landscape.gif b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/Fixtures/test_landscape.gif
new file mode 100644
index 0000000..8701235
--- /dev/null
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/Fixtures/test_landscape.gif
@@ -0,0 +1,3 @@
+GIF89a !
+ , L
+ ;
\ No newline at end of file
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/Fixtures/test_portrait.gif b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/Fixtures/test_portrait.gif
new file mode 100644
index 0000000..cc480ca
--- /dev/null
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/Fixtures/test_portrait.gif
@@ -0,0 +1,3 @@
+GIF89a !
+ , L
+ ;
\ No newline at end of file
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php
index 72087fa..1fc5311 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php
@@ -37,6 +37,7 @@ public function provideValidComparisons()
return array(
array(2, 1),
array(new \DateTime('2005/01/01'), new \DateTime('2001/01/01')),
+ array(new ComparisonTest_Class(5), new ComparisonTest_Class(4)),
array('333', '22'),
array(null, 1),
);
@@ -52,6 +53,8 @@ public function provideInvalidComparisons()
array(2, 2, '2', 'integer'),
array(new \DateTime('2000/01/01'), new \DateTime('2005/01/01'), '2005-01-01 00:00:00', 'DateTime'),
array(new \DateTime('2000/01/01'), new \DateTime('2000/01/01'), '2000-01-01 00:00:00', 'DateTime'),
+ array(new ComparisonTest_Class(4), new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
+ array(new ComparisonTest_Class(5), new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
array('22', '333', "'333'", 'string'),
array('22', '22', "'22'", 'string')
);
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php
index cfd9f2c..fa3b020 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php
@@ -53,7 +53,6 @@ public function testValidIbans($iban)
public function getValidIbans()
{
return array(
- array('CH93 0076 2011 6238 5295 7'), //Switzerland
array('CH9300762011623852957'), // Switzerland without spaces
//Country list
@@ -182,6 +181,7 @@ public function getInvalidIbans()
array('CY170020 128 0000 0012 0052 7600'),
array('foo'),
array('123'),
+ array('0750447346')
);
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php
index a1f6a69..3923423 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php
@@ -13,7 +13,6 @@
use Symfony\Component\Validator\Constraints\IdenticalTo;
use Symfony\Component\Validator\Constraints\IdenticalToValidator;
-use Symfony\Component\Validator\Tests\Constraints\AbstractComparisonValidatorTestCase;
/**
* @author Daniel Holmes
@@ -36,11 +35,13 @@ protected function createConstraint(array $options)
public function provideValidComparisons()
{
$date = new \DateTime('2000-01-01');
+ $object = new ComparisonTest_Class(2);
return array(
array(3, 3),
array('a', 'a'),
array($date, $date),
+ array($object, $object),
array(null, 1),
);
}
@@ -55,7 +56,8 @@ public function provideInvalidComparisons()
array(2, '2', "'2'", 'string'),
array('22', '333', "'333'", 'string'),
array(new \DateTime('2001-01-01'), new \DateTime('2001-01-01'), '2001-01-01 00:00:00', 'DateTime'),
- array(new \DateTime('2001-01-01'), new \DateTime('1999-01-01'), '1999-01-01 00:00:00', 'DateTime')
+ array(new \DateTime('2001-01-01'), new \DateTime('1999-01-01'), '1999-01-01 00:00:00', 'DateTime'),
+ array(new ComparisonTest_Class(4), new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
);
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php
index 8854501..114c2d2 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php
@@ -20,6 +20,8 @@ class ImageValidatorTest extends \PHPUnit_Framework_TestCase
protected $validator;
protected $path;
protected $image;
+ protected $imageLandscape;
+ protected $imagePortrait;
protected function setUp()
{
@@ -27,6 +29,8 @@ protected function setUp()
$this->validator = new ImageValidator();
$this->validator->initialize($this->context);
$this->image = __DIR__.'/Fixtures/test.gif';
+ $this->imageLandscape = __DIR__.'/Fixtures/test_landscape.gif';
+ $this->imagePortrait = __DIR__.'/Fixtures/test_portrait.gif';
}
public function testNullIsValid()
@@ -47,10 +51,6 @@ public function testEmptyStringIsValid()
public function testValidImage()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$this->context->expects($this->never())
->method('addViolation');
@@ -59,10 +59,6 @@ public function testValidImage()
public function testValidSize()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$this->context->expects($this->never())
->method('addViolation');
@@ -78,10 +74,6 @@ public function testValidSize()
public function testWidthTooSmall()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$constraint = new Image(array(
'minWidth' => 3,
'minWidthMessage' => 'myMessage',
@@ -99,10 +91,6 @@ public function testWidthTooSmall()
public function testWidthTooBig()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$constraint = new Image(array(
'maxWidth' => 1,
'maxWidthMessage' => 'myMessage',
@@ -120,10 +108,6 @@ public function testWidthTooBig()
public function testHeightTooSmall()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$constraint = new Image(array(
'minHeight' => 3,
'minHeightMessage' => 'myMessage',
@@ -141,10 +125,6 @@ public function testHeightTooSmall()
public function testHeightTooBig()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$constraint = new Image(array(
'maxHeight' => 1,
'maxHeightMessage' => 'myMessage',
@@ -165,10 +145,6 @@ public function testHeightTooBig()
*/
public function testInvalidMinWidth()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$constraint = new Image(array(
'minWidth' => '1abc',
));
@@ -181,10 +157,6 @@ public function testInvalidMinWidth()
*/
public function testInvalidMaxWidth()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$constraint = new Image(array(
'maxWidth' => '1abc',
));
@@ -197,10 +169,6 @@ public function testInvalidMaxWidth()
*/
public function testInvalidMinHeight()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$constraint = new Image(array(
'minHeight' => '1abc',
));
@@ -213,14 +181,119 @@ public function testInvalidMinHeight()
*/
public function testInvalidMaxHeight()
{
- if (!class_exists('Symfony\Component\HttpFoundation\File\File')) {
- $this->markTestSkipped('The "HttpFoundation" component is not available');
- }
-
$constraint = new Image(array(
'maxHeight' => '1abc',
));
$this->validator->validate($this->image, $constraint);
}
+
+ public function testRatioTooSmall()
+ {
+ $constraint = new Image(array(
+ 'minRatio' => 2,
+ 'minRatioMessage' => 'myMessage',
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('myMessage', array(
+ '{{ ratio }}' => 1,
+ '{{ min_ratio }}' => 2,
+ ));
+
+ $this->validator->validate($this->image, $constraint);
+ }
+
+ public function testRatioTooBig()
+ {
+ $constraint = new Image(array(
+ 'maxRatio' => 0.5,
+ 'maxRatioMessage' => 'myMessage',
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('myMessage', array(
+ '{{ ratio }}' => 1,
+ '{{ max_ratio }}' => 0.5,
+ ));
+
+ $this->validator->validate($this->image, $constraint);
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
+ */
+ public function testInvalidMinRatio()
+ {
+ $constraint = new Image(array(
+ 'minRatio' => '1abc',
+ ));
+
+ $this->validator->validate($this->image, $constraint);
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
+ */
+ public function testInvalidMaxRatio()
+ {
+ $constraint = new Image(array(
+ 'maxRatio' => '1abc',
+ ));
+
+ $this->validator->validate($this->image, $constraint);
+ }
+
+ public function testSquareNotAllowed()
+ {
+ $constraint = new Image(array(
+ 'allowSquare' => false,
+ 'allowSquareMessage' => 'myMessage',
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('myMessage', array(
+ '{{ width }}' => 2,
+ '{{ height }}' => 2,
+ ));
+
+ $this->validator->validate($this->image, $constraint);
+ }
+
+ public function testLandscapeNotAllowed()
+ {
+ $constraint = new Image(array(
+ 'allowLandscape' => false,
+ 'allowLandscapeMessage' => 'myMessage',
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('myMessage', array(
+ '{{ width }}' => 2,
+ '{{ height }}' => 1,
+ ));
+
+ $this->validator->validate($this->imageLandscape, $constraint);
+ }
+
+ public function testPortraitNotAllowed()
+ {
+ $constraint = new Image(array(
+ 'allowPortrait' => false,
+ 'allowPortraitMessage' => 'myMessage',
+ ));
+
+ $this->context->expects($this->once())
+ ->method('addViolation')
+ ->with('myMessage', array(
+ '{{ width }}' => 1,
+ '{{ height }}' => 2,
+ ));
+
+ $this->validator->validate($this->imagePortrait, $constraint);
+ }
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php
index 1230e3f..3588887 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php
@@ -104,4 +104,16 @@ public function getInvalidLanguages()
array('foobar'),
);
}
+
+ public function testValidateUsingCountrySpecificLocale()
+ {
+ \Locale::setDefault('fr_FR');
+ $existingLanguage = 'en';
+ $this->context->expects($this->never())
+ ->method('addViolation');
+
+ $this->validator->validate($existingLanguage, new Language(array(
+ 'message' => 'aMessage'
+ )));
+ }
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php
index 406e222..24ad0fa 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php
@@ -39,6 +39,8 @@ public function provideValidComparisons()
array(1, 1),
array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')),
array(new \DateTime('2000-01-01'), new \DateTime('2020-01-01')),
+ array(new ComparisonTest_Class(4), new ComparisonTest_Class(5)),
+ array(new ComparisonTest_Class(5), new ComparisonTest_Class(5)),
array('a', 'a'),
array('a', 'z'),
array(null, 1),
@@ -53,6 +55,7 @@ public function provideInvalidComparisons()
return array(
array(2, 1, '1', 'integer'),
array(new \DateTime('2010-01-01'), new \DateTime('2000-01-01'), '2000-01-01 00:00:00', 'DateTime'),
+ array(new ComparisonTest_Class(5), new ComparisonTest_Class(4), '4', __NAMESPACE__.'\ComparisonTest_Class'),
array('c', 'b', "'b'", 'string')
);
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php
index f26269b..da7070e 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php
@@ -37,6 +37,7 @@ public function provideValidComparisons()
return array(
array(1, 2),
array(new \DateTime('2000-01-01'), new \DateTime('2010-01-01')),
+ array(new ComparisonTest_Class(4), new ComparisonTest_Class(5)),
array('22', '333'),
array(null, 1),
);
@@ -52,6 +53,8 @@ public function provideInvalidComparisons()
array(2, 2, '2', 'integer'),
array(new \DateTime('2010-01-01'), new \DateTime('2000-01-01'), '2000-01-01 00:00:00', 'DateTime'),
array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01'), '2000-01-01 00:00:00', 'DateTime'),
+ array(new ComparisonTest_Class(5), new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
+ array(new ComparisonTest_Class(6), new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
array('333', '22', "'22'", 'string')
);
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LuhnValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LuhnValidatorTest.php
index 9637108..11c6a7c 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LuhnValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/LuhnValidatorTest.php
@@ -103,7 +103,28 @@ public function getInvalidNumbers()
array('1234567812345678'),
array('4222222222222222'),
array('0000000000000000'),
+ );
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException
+ * @dataProvider getInvalidTypes
+ */
+ public function testInvalidTypes($number)
+ {
+ $constraint = new Luhn();
+
+ $this->validator->validate($number, $constraint);
+ }
+
+ public function getInvalidTypes()
+ {
+ return array(
array(0),
+ array(123),
+ array(42424242424242424242),
+ array(378282246310005),
+ array(371449635398431),
);
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php
index 0122643..dcf46a6 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php
@@ -13,7 +13,6 @@
use Symfony\Component\Validator\Constraints\NotEqualTo;
use Symfony\Component\Validator\Constraints\NotEqualToValidator;
-use Symfony\Component\Validator\Tests\Constraints\AbstractComparisonValidatorTestCase;
/**
* @author Daniel Holmes
@@ -39,6 +38,7 @@ public function provideValidComparisons()
array(1, 2),
array('22', '333'),
array(new \DateTime('2001-01-01'), new \DateTime('2000-01-01')),
+ array(new ComparisonTest_Class(6), new ComparisonTest_Class(5)),
array(null, 1),
);
}
@@ -52,7 +52,8 @@ public function provideInvalidComparisons()
array(3, 3, '3', 'integer'),
array('2', 2, '2', 'integer'),
array('a', 'a', "'a'", 'string'),
- array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01'), '2000-01-01 00:00:00', 'DateTime')
+ array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01'), '2000-01-01 00:00:00', 'DateTime'),
+ array(new ComparisonTest_Class(5), new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'),
);
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php
index 462202d..28026c0 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php
@@ -13,7 +13,6 @@
use Symfony\Component\Validator\Constraints\NotIdenticalTo;
use Symfony\Component\Validator\Constraints\NotIdenticalToValidator;
-use Symfony\Component\Validator\Tests\Constraints\AbstractComparisonValidatorTestCase;
/**
* @author Daniel Holmes
@@ -51,11 +50,13 @@ public function provideValidComparisons()
public function provideInvalidComparisons()
{
$date = new \DateTime('2000-01-01');
+ $object = new ComparisonTest_Class(2);
return array(
array(3, 3, '3', 'integer'),
array('a', 'a', "'a'", 'string'),
- array($date, $date, '2000-01-01 00:00:00', 'DateTime')
+ array($date, $date, '2000-01-01 00:00:00', 'DateTime'),
+ array($object, $object, '2', __NAMESPACE__.'\ComparisonTest_Class'),
);
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php
index 4466aa1..d343c86 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php
@@ -43,7 +43,7 @@ public function testNullIsValid()
/**
* @dataProvider getInvalidValues
*/
- public function testInvalidValues($value)
+ public function testInvalidValues($value, $readableValue)
{
$constraint = new Null(array(
'message' => 'myMessage'
@@ -52,7 +52,7 @@ public function testInvalidValues($value)
$this->context->expects($this->once())
->method('addViolation')
->with('myMessage', array(
- '{{ value }}' => $value,
+ '{{ value }}' => $readableValue,
));
$this->validator->validate($value, $constraint);
@@ -61,10 +61,13 @@ public function testInvalidValues($value)
public function getInvalidValues()
{
return array(
- array(0),
- array(false),
- array(true),
- array(''),
+ array(0, 0),
+ array(false, false),
+ array(true, true),
+ array('', ''),
+ array('foo bar', 'foo bar'),
+ array(new \DateTime(), 'DateTime'),
+ array(array(), 'Array'),
);
}
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/CallbackClass.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/CallbackClass.php
new file mode 100644
index 0000000..0f6a2f4
--- /dev/null
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/CallbackClass.php
@@ -0,0 +1,24 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Validator\Tests\Fixtures;
+
+use Symfony\Component\Validator\ExecutionContextInterface;
+
+/**
+ * @author Bernhard Schussek
+ */
+class CallbackClass
+{
+ public static function callback($object, ExecutionContextInterface $context)
+ {
+ }
+}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/ConstraintWithValue.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/ConstraintWithValue.php
new file mode 100644
index 0000000..4ebd981
--- /dev/null
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/ConstraintWithValue.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Validator\Tests\Fixtures;
+
+use Symfony\Component\Validator\Constraint;
+
+/** @Annotation */
+class ConstraintWithValue extends Constraint
+{
+ public $property;
+ public $value;
+
+ public function getDefaultOption()
+ {
+ return 'property';
+ }
+
+ public function getTargets()
+ {
+ return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT);
+ }
+}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/ConstraintWithValueAsDefault.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/ConstraintWithValueAsDefault.php
new file mode 100644
index 0000000..a975e07
--- /dev/null
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/ConstraintWithValueAsDefault.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Validator\Tests\Fixtures;
+
+use Symfony\Component\Validator\Constraint;
+
+/** @Annotation */
+class ConstraintWithValueAsDefault extends Constraint
+{
+ public $property;
+ public $value;
+
+ public function getDefaultOption()
+ {
+ return 'value';
+ }
+
+ public function getTargets()
+ {
+ return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT);
+ }
+}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/Entity.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/Entity.php
index e1cb3e0..70bdc5a 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/Entity.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Fixtures/Entity.php
@@ -12,10 +12,12 @@
namespace Symfony\Component\Validator\Tests\Fixtures;
use Symfony\Component\Validator\Constraints as Assert;
+use Symfony\Component\Validator\ExecutionContextInterface;
/**
* @Symfony\Component\Validator\Tests\Fixtures\ConstraintA
* @Assert\GroupSequence({"Foo", "Entity"})
+ * @Assert\Callback({"Symfony\Component\Validator\Tests\Fixtures\CallbackClass", "callback"})
*/
class Entity extends EntityParent implements EntityInterface
{
@@ -58,4 +60,18 @@ public function getData()
{
return 'Overridden data';
}
+
+ /**
+ * @Assert\Callback
+ */
+ public function validateMe(ExecutionContextInterface $context)
+ {
+ }
+
+ /**
+ * @Assert\Callback
+ */
+ public static function validateMeStatic($object, ExecutionContextInterface $context)
+ {
+ }
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/BlackholeMetadataFactoryTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/BlackholeMetadataFactoryTest.php
new file mode 100644
index 0000000..74bcc69
--- /dev/null
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/BlackholeMetadataFactoryTest.php
@@ -0,0 +1,33 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Validator\Tests\Mapping;
+
+use Symfony\Component\Validator\Mapping\BlackholeMetadataFactory;
+
+class BlackholeMetadataFactoryTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @expectedException \LogicException
+ */
+ public function testGetMetadataForThrowsALogicException()
+ {
+ $metadataFactory = new BlackholeMetadataFactory();
+ $metadataFactory->getMetadataFor('foo');
+ }
+
+ public function testHasMetadataForReturnsFalse()
+ {
+ $metadataFactory = new BlackholeMetadataFactory();
+
+ $this->assertFalse($metadataFactory->hasMetadataFor('foo'));
+ }
+}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php
index 6f842cd..bee4025 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php
@@ -77,7 +77,7 @@ public function testWriteMetadataToCache()
->will($this->returnValue(false));
$cache->expects($this->once())
->method('write')
- ->will($this->returnCallback(function($metadata) use ($tester, $constraints) {
+ ->will($this->returnCallback(function ($metadata) use ($tester, $constraints) {
$tester->assertEquals($constraints, $metadata->getConstraints());
}));
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractMethodStaticLoader.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractMethodStaticLoader.php
index 3a1416c..7c6f362 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractMethodStaticLoader.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractMethodStaticLoader.php
@@ -7,4 +7,4 @@
abstract class AbstractMethodStaticLoader
{
abstract public static function loadMetadata(ClassMetadata $metadata);
-}
\ No newline at end of file
+}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php
index 22a39c5..0d255b8 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php
@@ -13,6 +13,7 @@
use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\Validator\Constraints\All;
+use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Collection;
use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Component\Validator\Constraints\Range;
@@ -23,13 +24,6 @@
class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) {
- $this->markTestSkipped('The "Doctrine Common" library is not available');
- }
- }
-
public function testLoadClassMetadataReturnsTrueIfSuccessful()
{
$reader = new AnnotationReader();
@@ -57,6 +51,9 @@ public function testLoadClassMetadata()
$expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity');
$expected->setGroupSequence(array('Foo', 'Entity'));
$expected->addConstraint(new ConstraintA());
+ $expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback')));
+ $expected->addConstraint(new Callback('validateMe'));
+ $expected->addConstraint(new Callback('validateMeStatic'));
$expected->addPropertyConstraint('firstName', new NotNull());
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));
$expected->addPropertyConstraint('firstName', new All(array(new NotNull(), new Range(array('min' => 3)))));
@@ -121,6 +118,9 @@ public function testLoadClassMetadataAndMerge()
$expected->setGroupSequence(array('Foo', 'Entity'));
$expected->addConstraint(new ConstraintA());
+ $expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback')));
+ $expected->addConstraint(new Callback('validateMe'));
+ $expected->addConstraint(new Callback('validateMeStatic'));
$expected->addPropertyConstraint('firstName', new NotNull());
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));
$expected->addPropertyConstraint('firstName', new All(array(new NotNull(), new Range(array('min' => 3)))));
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/XmlFileLoaderTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/XmlFileLoaderTest.php
index 7c6e355..8219540 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/XmlFileLoaderTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/XmlFileLoaderTest.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Validator\Tests\Mapping\Loader;
use Symfony\Component\Validator\Constraints\All;
+use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Collection;
use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Component\Validator\Constraints\Range;
@@ -51,6 +52,9 @@ public function testLoadClassMetadata()
$expected->setGroupSequence(array('Foo', 'Entity'));
$expected->addConstraint(new ConstraintA());
$expected->addConstraint(new ConstraintB());
+ $expected->addConstraint(new Callback('validateMe'));
+ $expected->addConstraint(new Callback('validateMeStatic'));
+ $expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback')));
$expected->addPropertyConstraint('firstName', new NotNull());
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));
$expected->addPropertyConstraint('firstName', new Choice(array('A', 'B')));
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php
index 9e31cbb..0d9a0b6 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Validator\Tests\Mapping\Loader;
use Symfony\Component\Validator\Constraints\All;
+use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Collection;
use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Component\Validator\Constraints\Range;
@@ -23,13 +24,6 @@
class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
{
- protected function setUp()
- {
- if (!class_exists('Symfony\Component\Yaml\Yaml')) {
- $this->markTestSkipped('The "Yaml" component is not available');
- }
- }
-
public function testLoadClassMetadataReturnsFalseIfEmpty()
{
$loader = new YamlFileLoader(__DIR__.'/empty-mapping.yml');
@@ -75,6 +69,9 @@ public function testLoadClassMetadata()
$expected->setGroupSequence(array('Foo', 'Entity'));
$expected->addConstraint(new ConstraintA());
$expected->addConstraint(new ConstraintB());
+ $expected->addConstraint(new Callback('validateMe'));
+ $expected->addConstraint(new Callback('validateMeStatic'));
+ $expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback')));
$expected->addPropertyConstraint('firstName', new NotNull());
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));
$expected->addPropertyConstraint('firstName', new Choice(array('A', 'B')));
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.xml b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.xml
index dfac70d..1eee1cb 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.xml
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.xml
@@ -21,6 +21,16 @@
+
+ validateMe
+
+ validateMeStatic
+
+
+ Symfony\Component\Validator\Tests\Fixtures\CallbackClass
+ callback
+
+
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.yml b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.yml
index 38188dc..e52d3f0 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.yml
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/constraint-mapping.yml
@@ -11,6 +11,10 @@ Symfony\Component\Validator\Tests\Fixtures\Entity:
- Symfony\Component\Validator\Tests\Fixtures\ConstraintA: ~
# Custom constraint with namespaces prefix
- "custom:ConstraintB": ~
+ # Callbacks
+ - Callback: validateMe
+ - Callback: validateMeStatic
+ - Callback: [Symfony\Component\Validator\Tests\Fixtures\CallbackClass, callback]
properties:
firstName:
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php
index d48d6b1..900243f 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php
@@ -75,10 +75,6 @@ public function testAddMethodMappings()
public function testEnableAnnotationMapping()
{
- if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) {
- $this->markTestSkipped('Annotations is required for this test');
- }
-
$this->assertSame($this->builder, $this->builder->enableAnnotationMapping());
}
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorBuilder.php b/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorBuilder.php
index a5bfc1f..e24a707 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorBuilder.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorBuilder.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Validator;
+use Symfony\Component\PropertyAccess\PropertyAccess;
+use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Validator\Mapping\ClassMetadataFactory;
use Symfony\Component\Validator\Exception\ValidatorException;
use Symfony\Component\Validator\Mapping\Loader\LoaderChain;
@@ -85,6 +87,11 @@ class ValidatorBuilder implements ValidatorBuilderInterface
private $translationDomain;
/**
+ * @var PropertyAccessorInterface
+ */
+ private $propertyAccessor;
+
+ /**
* {@inheritdoc}
*/
public function addObjectInitializer(ObjectInitializerInterface $initializer)
@@ -198,8 +205,8 @@ public function enableAnnotationMapping(Reader $annotationReader = null)
}
if (null === $annotationReader) {
- if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) {
- throw new \RuntimeException('Requested a ValidatorFactory with an AnnotationLoader, but the AnnotationReader was not found. You should add Doctrine Common to your project.');
+ if (!class_exists('Doctrine\Common\Annotations\AnnotationReader') || !class_exists('Doctrine\Common\Cache\ArrayCache')) {
+ throw new \RuntimeException('Enabling annotation based constraint mapping requires the packages doctrine/annotations and doctrine/cache to be installed.');
}
$annotationReader = new CachedReader(new AnnotationReader(), new ArrayCache());
@@ -253,6 +260,10 @@ public function setMetadataCache(CacheInterface $cache)
*/
public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory)
{
+ if (null !== $this->propertyAccessor) {
+ throw new ValidatorException('You cannot set a validator factory after setting a custom property accessor. Remove the call to setPropertyAccessor() if you want to call setConstraintValidatorFactory().');
+ }
+
$this->validatorFactory = $validatorFactory;
return $this;
@@ -281,6 +292,20 @@ public function setTranslationDomain($translationDomain)
/**
* {@inheritdoc}
*/
+ public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor)
+ {
+ if (null !== $this->validatorFactory) {
+ throw new ValidatorException('You cannot set a property accessor after setting a custom validator factory. Configure your validator factory instead.');
+ }
+
+ $this->propertyAccessor = $propertyAccessor;
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
public function getValidator()
{
$metadataFactory = $this->metadataFactory;
@@ -319,7 +344,8 @@ public function getValidator()
$metadataFactory = new ClassMetadataFactory($loader, $this->metadataCache);
}
- $validatorFactory = $this->validatorFactory ?: new ConstraintValidatorFactory();
+ $propertyAccessor = $this->propertyAccessor ?: PropertyAccess::createPropertyAccessor();
+ $validatorFactory = $this->validatorFactory ?: new ConstraintValidatorFactory($propertyAccessor);
$translator = $this->translator ?: new DefaultTranslator();
return new Validator($metadataFactory, $validatorFactory, $translator, $this->translationDomain, $this->initializers);
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorBuilderInterface.php b/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorBuilderInterface.php
index 99f367b..92aaca7 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorBuilderInterface.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorBuilderInterface.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\Validator;
+use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Validator\Mapping\Cache\CacheInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Doctrine\Common\Annotations\Reader;
@@ -160,6 +161,15 @@ public function setTranslator(TranslatorInterface $translator);
public function setTranslationDomain($translationDomain);
/**
+ * Sets the property accessor for resolving property paths.
+ *
+ * @param PropertyAccessorInterface $propertyAccessor The property accessor.
+ *
+ * @return ValidatorBuilderInterface The builder object.
+ */
+ public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor);
+
+ /**
* Builds and returns a new validator object.
*
* @return ValidatorInterface The built validator.
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorInterface.php b/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorInterface.php
index b56c580..98e02d9 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorInterface.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/ValidatorInterface.php
@@ -11,8 +11,6 @@
namespace Symfony\Component\Validator;
-use Symfony\Component\Validator\Constraint;
-
/**
* Validates values and graphs of objects and arrays.
*
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/composer.json b/core/vendor/symfony/validator/Symfony/Component/Validator/composer.json
index 951ef01..1b4b6a6 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/composer.json
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/composer.json
@@ -17,16 +17,20 @@
],
"require": {
"php": ">=5.3.3",
- "symfony/translation": "~2.0"
+ "symfony/translation": "~2.0",
+ "symfony/property-access": "~2.2"
},
"require-dev": {
"symfony/http-foundation": "~2.1",
"symfony/intl": "~2.3",
"symfony/yaml": "~2.0",
- "symfony/config": "~2.2"
+ "symfony/config": "~2.2",
+ "doctrine/annotations": "~1.0",
+ "doctrine/cache": "~1.0"
},
"suggest": {
- "doctrine/common": "",
+ "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
+ "doctrine/cache": "For using the default cached annotation reader",
"symfony/http-foundation": "",
"symfony/intl": "",
"symfony/yaml": "",
@@ -39,7 +43,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php
index f77545d..3576e9a 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php
@@ -2,6 +2,7 @@
/*
* This file is part of the Symfony package.
+ *
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
@@ -71,7 +72,7 @@ public static function escapeWithDoubleQuotes($value)
*/
public static function requiresSingleQuoting($value)
{
- return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ - ? | < > = ! % @ ` ]/x', $value);
+ return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
}
/**
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php
index a27a005..938097b 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.php
@@ -11,6 +11,11 @@
namespace Symfony\Component\Yaml\Exception;
+if (!defined('JSON_UNESCAPED_UNICODE')) {
+ define('JSON_UNESCAPED_SLASHES', 64);
+ define('JSON_UNESCAPED_UNICODE', 256);
+}
+
/**
* Exception class thrown when an error occurs during parsing.
*
@@ -32,9 +37,9 @@ class ParseException extends RuntimeException
* @param integer $parsedLine The line where the error occurred
* @param integer $snippet The snippet of code near the problem
* @param string $parsedFile The file name where the error occurred
- * @param Exception $previous The previous exception
+ * @param \Exception $previous The previous exception
*/
- public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, Exception $previous = null)
+ public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, \Exception $previous = null)
{
$this->parsedFile = $parsedFile;
$this->parsedLine = $parsedLine;
@@ -125,7 +130,7 @@ private function updateRepr()
}
if (null !== $this->parsedFile) {
- $this->message .= sprintf(' in %s', json_encode($this->parsedFile));
+ $this->message .= sprintf(' in %s', json_encode($this->parsedFile, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
}
if ($this->parsedLine >= 0) {
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
index 45978a1..45efced 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
@@ -2,6 +2,7 @@
/*
* This file is part of the Symfony package.
+ *
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php
index d852cbf..e8fe918 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php
@@ -2,6 +2,7 @@
/*
* This file is part of the Symfony package.
+ *
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/README.md b/core/vendor/symfony/yaml/Symfony/Component/Yaml/README.md
index 0864e49..941a346 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/README.md
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/README.md
@@ -15,5 +15,5 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/Yaml/
- $ composer.phar install --dev
+ $ composer.phar install
$ phpunit
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml
index 5542b0d..ac0efa8 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsBasicTests.yml
@@ -56,7 +56,7 @@ test: Simple Mapping
brief: |
You can add a keyed list (also known as a dictionary or
hash) to your document by placing each member of the
- list on a new line, with a colon seperating the key
+ list on a new line, with a colon separating the key
from its value. In YAML, this type of list is called
a mapping.
yaml: |
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml
index 6f99f75..1e59f3b 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml
@@ -222,7 +222,7 @@ yaml: |
# Following node labeled SS
- &SS Sammy Sosa
rbi:
- - *SS # Subsequent occurance
+ - *SS # Subsequent occurrence
- Ken Griffey
php: |
array(
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml
index 9972c1f..aac4e68 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml
@@ -226,11 +226,11 @@ brief: >
time zone.
yaml: |
iso8601: 2001-12-14t21:59:43.10-05:00
- space seperated: 2001-12-14 21:59:43.10 -05:00
+ space separated: 2001-12-14 21:59:43.10 -05:00
php: |
array(
'iso8601' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ),
- 'space seperated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" )
+ 'space separated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" )
)
---
test: Date
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php
index a93b916..dc497ca 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\Yaml\Tests;
-use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Yaml\Inline;
class InlineTest extends \PHPUnit_Framework_TestCase
@@ -31,11 +30,11 @@ public function testDump()
$this->assertEquals($yaml, Inline::dump($value), sprintf('::dump() converts a PHP structure to an inline YAML (%s)', $yaml));
}
- foreach ($this->getTestsForParse() as $yaml => $value) {
+ foreach ($this->getTestsForParse() as $value) {
$this->assertEquals($value, Inline::parse(Inline::dump($value)), 'check consistency');
}
- foreach ($testsForDump as $yaml => $value) {
+ foreach ($testsForDump as $value) {
$this->assertEquals($value, Inline::parse(Inline::dump($value)), 'check consistency');
}
}
@@ -197,7 +196,6 @@ protected function getTestsForDump()
'.Inf' => -log(0),
'-.Inf' => log(0),
"'686e444'" => '686e444',
- '.Inf' => 646e444,
'"foo\r\nbar"' => "foo\r\nbar",
"'foo#bar'" => 'foo#bar',
"'foo # bar'" => 'foo # bar',
@@ -205,6 +203,9 @@ protected function getTestsForDump()
"'a \"string\" with ''quoted strings inside'''" => 'a "string" with \'quoted strings inside\'',
+ "'-dash'" => '-dash',
+ "'-'" => '-',
+
// sequences
'[foo, bar, false, null, 12]' => array('foo', 'bar', false, null, 12),
'[\'foo,bar\', \'foo bar\']' => array('foo,bar', 'foo bar'),
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php
new file mode 100644
index 0000000..289965e
--- /dev/null
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Yaml\Tests;
+
+use Symfony\Component\Yaml\Exception\ParseException;
+use Symfony\Component\Yaml\Yaml;
+
+class ParseExceptionTest extends \PHPUnit_Framework_TestCase
+{
+ public function testGetMessage()
+ {
+ $exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml');
+ if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
+ $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")';
+ } else {
+ $message = 'Error message in "\\/var\\/www\\/app\\/config.yml" at line 42 (near "foo: bar")';
+ }
+
+ $this->assertEquals($message, $exception->getMessage());
+ }
+}
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php
index 708f2a1..1b8eeed 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php
@@ -2,6 +2,7 @@
/*
* This file is part of the Symfony package.
+ *
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
@@ -48,7 +49,7 @@ public function unescapeSingleQuotedString($value)
public function unescapeDoubleQuotedString($value)
{
$self = $this;
- $callback = function($match) use ($self) {
+ $callback = function ($match) use ($self) {
return $self->unescapeCharacter($match[0]);
};
@@ -130,7 +131,7 @@ public function unescapeCharacter($value)
*
* @return string The string with the new encoding
*
- * @throws RuntimeException if no suitable encoding function is found (iconv or mbstring)
+ * @throws \RuntimeException if no suitable encoding function is found (iconv or mbstring)
*/
private function convertEncoding($value, $to, $from)
{
@@ -140,6 +141,6 @@ private function convertEncoding($value, $to, $from)
return iconv($from, $to, $value);
}
- throw new RuntimeException('No suitable convert encoding function (install the iconv or mbstring extension).');
+ throw new \RuntimeException('No suitable convert encoding function (install the iconv or mbstring extension).');
}
}
diff --git a/core/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json b/core/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json
index 1a009c1..33c2985 100644
--- a/core/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json
+++ b/core/vendor/symfony/yaml/Symfony/Component/Yaml/composer.json
@@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.4-dev"
}
}
}
diff --git a/core/vendor/twig/twig/.editorconfig b/core/vendor/twig/twig/.editorconfig
deleted file mode 100644
index 270f1d1..0000000
--- a/core/vendor/twig/twig/.editorconfig
+++ /dev/null
@@ -1,18 +0,0 @@
-; top-most EditorConfig file
-root = true
-
-; Unix-style newlines
-[*]
-end_of_line = LF
-
-[*.php]
-indent_style = space
-indent_size = 4
-
-[*.test]
-indent_style = space
-indent_size = 4
-
-[*.rst]
-indent_style = space
-indent_size = 4
diff --git a/core/vendor/twig/twig/.gitignore b/core/vendor/twig/twig/.gitignore
deleted file mode 100644
index 840b78e..0000000
--- a/core/vendor/twig/twig/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/ext/twig/autom4te.cache/
-
diff --git a/core/vendor/twig/twig/.travis.yml b/core/vendor/twig/twig/.travis.yml
deleted file mode 100644
index 8569a39..0000000
--- a/core/vendor/twig/twig/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-language: php
-
-php:
- - 5.2
- - 5.3
- - 5.4
- - 5.5
-
-env:
- - TWIG_EXT=no
- - TWIG_EXT=yes
-
-before_script:
- - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && sudo make install"; fi
- - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
diff --git a/core/vendor/twig/twig/AUTHORS b/core/vendor/twig/twig/AUTHORS
deleted file mode 100644
index 9757105..0000000
--- a/core/vendor/twig/twig/AUTHORS
+++ /dev/null
@@ -1,13 +0,0 @@
-Twig is written and maintained by the Twig Team:
-
-Lead Developer:
-
-- Fabien Potencier
-
-C Extension Developer:
-
-- Derick Rethans
-
-Project Founder:
-
-- Armin Ronacher
diff --git a/core/vendor/twig/twig/CHANGELOG b/core/vendor/twig/twig/CHANGELOG
deleted file mode 100644
index 6c39f7d..0000000
--- a/core/vendor/twig/twig/CHANGELOG
+++ /dev/null
@@ -1,671 +0,0 @@
-* 1.15.0 (2013-12-06)
-
- * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException
- * added min and max functions
- * added the round filter
- * fixed a bug that prevented the optimizers to be enabled/disabled selectively
- * fixed first and last filters for UTF-8 strings
- * added a source function to include the content of a template without rendering it
- * fixed the C extension sandbox behavior when get or set is prepend to method name
-
-* 1.14.2 (2013-10-30)
-
- * fixed error filename/line when an error occurs in an included file
- * allowed operators that contain whitespaces to have more than one whitespace
- * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by")
-
-* 1.14.1 (2013-10-15)
-
- * made it possible to use named operators as variables
- * fixed the possibility to have a variable named 'matches'
- * added support for PHP 5.5 DateTimeInterface
-
-* 1.14.0 (2013-10-03)
-
- * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy
- * added new operators: ends with, starts with, and matches
- * fixed some compatibility issues with HHVM
- * added a way to add custom escaping strategies
- * fixed the C extension compilation on Windows
- * fixed the batch filter when using a fill argument with an exact match of elements to batch
- * fixed the filesystem loader cache when a template name exists in several namespaces
- * fixed template_from_string when the template includes or extends other ones
- * fixed a crash of the C extension on an edge case
-
-* 1.13.2 (2013-08-03)
-
- * fixed the error line number for an error occurs in and embedded template
- * fixed crashes of the C extension on some edge cases
-
-* 1.13.1 (2013-06-06)
-
- * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
- * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface
- * adjusted backtrace call to reduce memory usage when an error occurs
- * added support for object instances as the second argument of the constant test
- * fixed the include function when used in an assignment
-
-* 1.13.0 (2013-05-10)
-
- * fixed getting a numeric-like item on a variable ('09' for instance)
- * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access:
- `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`)
- * made the escape filter 20% faster for happy path (escaping string for html with UTF-8)
- * changed ☃ to § in tests
- * enforced usage of named arguments after positional ones
-
-* 1.12.3 (2013-04-08)
-
- * fixed a security issue in the filesystem loader where it was possible to include a template one
- level above the configured path
- * fixed fatal error that should be an exception when adding a filter/function/test too late
- * added a batch filter
- * added support for encoding an array as query string in the url_encode filter
-
-* 1.12.2 (2013-02-09)
-
- * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00)
- * fixed globals when getGlobals is called early on
- * added the first and last filter
-
-* 1.12.1 (2013-01-15)
-
- * added support for object instances as the second argument of the constant function
- * relaxed globals management to avoid a BC break
- * added support for {{ some_string[:2] }}
-
-* 1.12.0 (2013-01-08)
-
- * added verbatim as an alias for the raw tag to avoid confusion with the raw filter
- * fixed registration of tests and functions as anonymous functions
- * fixed globals management
-
-* 1.12.0-RC1 (2012-12-29)
-
- * added an include function (does the same as the include tag but in a more flexible way)
- * added the ability to use any PHP callable to define filters, functions, and tests
- * added a syntax error when using a loop variable that is not defined
- * added the ability to set default values for macro arguments
- * added support for named arguments for filters, tests, and functions
- * moved filters/functions/tests syntax errors to the parser
- * added support for extended ternary operator syntaxes
-
-* 1.11.1 (2012-11-11)
-
- * fixed debug info line numbering (was off by 2)
- * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1)
- * optimized variable access on PHP 5.4
- * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX)
-
-* 1.11.0 (2012-11-07)
-
- * fixed macro compilation when a variable name is a PHP reserved keyword
- * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone
- * fixed bitwise operator precedences
- * added the template_from_string function
- * fixed default timezone usage for the date function
- * optimized the way Twig exceptions are managed (to make them faster)
- * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster)
-
-* 1.10.3 (2012-10-19)
-
- * fixed wrong template location in some error messages
- * reverted a BC break introduced in 1.10.2
- * added a split filter
-
-* 1.10.2 (2012-10-15)
-
- * fixed macro calls on PHP 5.4
-
-* 1.10.1 (2012-10-15)
-
- * made a speed optimization to macro calls when imported via the "import" tag
- * fixed C extension compilation on Windows
- * fixed a segfault in the C extension when using DateTime objects
-
-* 1.10.0 (2012-09-28)
-
- * extracted functional tests framework to make it reusable for third-party extensions
- * added namespaced templates support in Twig_Loader_Filesystem
- * added Twig_Loader_Filesystem::prependPath()
- * fixed an error when a token parser pass a closure as a test to the subparse() method
-
-* 1.9.2 (2012-08-25)
-
- * fixed the in operator for objects that contain circular references
- * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface
-
-* 1.9.1 (2012-07-22)
-
- * optimized macro calls when auto-escaping is on
- * fixed wrong parent class for Twig_Function_Node
- * made Twig_Loader_Chain more explicit about problems
-
-* 1.9.0 (2012-07-13)
-
- * made the parsing independent of the template loaders
- * fixed exception trace when an error occurs when rendering a child template
- * added escaping strategies for CSS, URL, and HTML attributes
- * fixed nested embed tag calls
- * added the date_modify filter
-
-* 1.8.3 (2012-06-17)
-
- * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash
- * fixed escaping when a project defines a function named html or js
- * fixed chmod mode to apply the umask correctly
-
-* 1.8.2 (2012-05-30)
-
- * added the abs filter
- * fixed a regression when using a number in template attributes
- * fixed compiler when mbstring.func_overload is set to 2
- * fixed DateTimeZone support in date filter
-
-* 1.8.1 (2012-05-17)
-
- * fixed a regression when dealing with SimpleXMLElement instances in templates
- * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini
- * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ)
-
-* 1.8.0 (2012-05-08)
-
- * enforced interface when adding tests, filters, functions, and node visitors from extensions
- * fixed a side-effect of the date filter where the timezone might be changed
- * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer)
- * added a way to dynamically change the auto-escaping strategy according to the template "filename"
- * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html)
- * added an embed tag
-
-* 1.7.0 (2012-04-24)
-
- * fixed a PHP warning when using CIFS
- * fixed template line number in some exceptions
- * added an iterable test
- * added an error when defining two blocks with the same name in a template
- * added the preserves_safety option for filters
- * fixed a PHP notice when trying to access a key on a non-object/array variable
- * enhanced error reporting when the template file is an instance of SplFileInfo
- * added Twig_Environment::mergeGlobals()
- * added compilation checks to avoid misuses of the sandbox tag
- * fixed filesystem loader freshness logic for high traffic websites
- * fixed random function when charset is null
-
-* 1.6.5 (2012-04-11)
-
- * fixed a regression when a template only extends another one without defining any blocks
-
-* 1.6.4 (2012-04-02)
-
- * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3
- * fixed performance when compiling large files
- * optimized parent template creation when the template does not use dynamic inheritance
-
-* 1.6.3 (2012-03-22)
-
- * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension
- * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot
- * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate
-
-* 1.6.2 (2012-03-18)
-
- * fixed sandbox mode when used with inheritance
- * added preserveKeys support for the slice filter
- * fixed the date filter when a DateTime instance is passed with a specific timezone
- * added a trim filter
-
-* 1.6.1 (2012-02-29)
-
- * fixed Twig C extension
- * removed the creation of Twig_Markup instances when not needed
- * added a way to set the default global timezone for dates
- * fixed the slice filter on strings when the length is not specified
- * fixed the creation of the cache directory in case of a race condition
-
-* 1.6.0 (2012-02-04)
-
- * fixed raw blocks when used with the whitespace trim option
- * made a speed optimization to macro calls when imported via the "from" tag
- * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added
- * fixed the attribute function when passing arguments
- * added slice notation support for the [] operator (syntactic sugar for the slice operator)
- * added a slice filter
- * added string support for the reverse filter
- * fixed the empty test and the length filter for Twig_Markup instances
- * added a date function to ease date comparison
- * fixed unary operators precedence
- * added recursive parsing support in the parser
- * added string and integer handling for the random function
-
-* 1.5.1 (2012-01-05)
-
- * fixed a regression when parsing strings
-
-* 1.5.0 (2012-01-04)
-
- * added Traversable objects support for the join filter
-
-* 1.5.0-RC2 (2011-12-30)
-
- * added a way to set the default global date interval format
- * fixed the date filter for DateInterval instances (setTimezone() does not exist for them)
- * refactored Twig_Template::display() to ease its extension
- * added a number_format filter
-
-* 1.5.0-RC1 (2011-12-26)
-
- * removed the need to quote hash keys
- * allowed hash keys to be any expression
- * added a do tag
- * added a flush tag
- * added support for dynamically named filters and functions
- * added a dump function to help debugging templates
- * added a nl2br filter
- * added a random function
- * added a way to change the default format for the date filter
- * fixed the lexer when an operator ending with a letter ends a line
- * added string interpolation support
- * enhanced exceptions for unknown filters, functions, tests, and tags
-
-* 1.4.0 (2011-12-07)
-
- * fixed lexer when using big numbers (> PHP_INT_MAX)
- * added missing preserveKeys argument to the reverse filter
- * fixed macros containing filter tag calls
-
-* 1.4.0-RC2 (2011-11-27)
-
- * removed usage of Reflection in Twig_Template::getAttribute()
- * added a C extension that can optionally replace Twig_Template::getAttribute()
- * added negative timestamp support to the date filter
-
-* 1.4.0-RC1 (2011-11-20)
-
- * optimized variable access when using PHP 5.4
- * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby
- * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders
- * added Twig_Function_Node to allow more complex functions to have their own Node class
- * added Twig_Filter_Node to allow more complex filters to have their own Node class
- * added Twig_Test_Node to allow more complex tests to have their own Node class
- * added a better error message when a template is empty but contain a BOM
- * fixed "in" operator for empty strings
- * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option)
- * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order)
- * added Twig_Environment::display()
- * made the escape filter smarter when the encoding is not supported by PHP
- * added a convert_encoding filter
- * moved all node manipulations outside the compile() Node method
- * made several speed optimizations
-
-* 1.3.0 (2011-10-08)
-
-no changes
-
-* 1.3.0-RC1 (2011-10-04)
-
- * added an optimization for the parent() function
- * added cache reloading when auto_reload is true and an extension has been modified
- * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup)
- * allowed empty templates to be used as traits
- * added traits support for the "parent" function
-
-* 1.2.0 (2011-09-13)
-
-no changes
-
-* 1.2.0-RC1 (2011-09-10)
-
- * enhanced the exception when a tag remains unclosed
- * added support for empty Countable objects for the "empty" test
- * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions)
- * added better support for encoding problems when escaping a string (available as of PHP 5.4)
- * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %})
- * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %})
- * added support for bitwise operators in expressions
- * added the "attribute" function to allow getting dynamic attributes on variables
- * added Twig_Loader_Chain
- * added Twig_Loader_Array::setTemplate()
- * added an optimization for the set tag when used to capture a large chunk of static text
- * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros)
- * removed the possibility to use the "extends" tag from a block
- * added "if" modifier support to "for" loops
-
-* 1.1.2 (2011-07-30)
-
- * fixed json_encode filter on PHP 5.2
- * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }})
- * fixed inheritance when using conditional parents
- * fixed compilation of templates when the body of a child template is not empty
- * fixed output when a macro throws an exception
- * fixed a parsing problem when a large chunk of text is enclosed in a comment tag
- * added PHPDoc for all Token parsers and Core extension functions
-
-* 1.1.1 (2011-07-17)
-
- * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls)
- * made some performance improvement for some edge cases
-
-* 1.1.0 (2011-06-28)
-
- * fixed json_encode filter
-
-* 1.1.0-RC3 (2011-06-24)
-
- * fixed method case-sensitivity when using the sandbox mode
- * added timezone support for the date filter
- * fixed possible security problems with NUL bytes
-
-* 1.1.0-RC2 (2011-06-16)
-
- * added an exception when the template passed to "use" is not a string
- * made 'a.b is defined' not throw an exception if a is not defined (in strict mode)
- * added {% line \d+ %} directive
-
-* 1.1.0-RC1 (2011-05-28)
-
-Flush your cache after upgrading.
-
- * fixed date filter when using a timestamp
- * fixed the defined test for some cases
- * fixed a parsing problem when a large chunk of text is enclosed in a raw tag
- * added support for horizontal reuse of template blocks (see docs for more information)
- * added whitespace control modifier to all tags (see docs for more information)
- * added null as an alias for none (the null test is also an alias for the none test now)
- * made TRUE, FALSE, NONE equivalent to their lowercase counterparts
- * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line
- * moved display() method to Twig_Template (generated templates should now use doDisplay() instead)
-
-* 1.0.0 (2011-03-27)
-
- * fixed output when using mbstring
- * fixed duplicate call of methods when using the sandbox
- * made the charset configurable for the escape filter
-
-* 1.0.0-RC2 (2011-02-21)
-
- * changed the way {% set %} works when capturing (the content is now marked as safe)
- * added support for macro name in the endmacro tag
- * make Twig_Error compatible with PHP 5.3.0 >
- * fixed an infinite loop on some Windows configurations
- * fixed the "length" filter for numbers
- * fixed Template::getAttribute() as properties in PHP are case sensitive
- * removed coupling between Twig_Node and Twig_Template
- * fixed the ternary operator precedence rule
-
-* 1.0.0-RC1 (2011-01-09)
-
-Backward incompatibilities:
-
- * the "items" filter, which has been deprecated for quite a long time now, has been removed
- * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10)
- * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }}
- * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }}
- * the "for" tag does not support "joined by" anymore
- * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off")
- * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %})
- * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %})
- * removed the grammar and simple token parser (moved to the Twig Extensions repository)
-
-Changes:
-
- * added "needs_context" option for filters and functions (the context is then passed as a first argument)
- * added global variables support
- * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode)
- * added the "from" tag to import macros as functions
- * added support for functions (a function is just syntactic sugar for a getAttribute() call)
- * made macros callable when sandbox mode is enabled
- * added an exception when a macro uses a reserved name
- * the "default" filter now uses the "empty" test instead of just checking for null
- * added the "empty" test
-
-* 0.9.10 (2010-12-16)
-
-Backward incompatibilities:
-
- * The Escaper extension is enabled by default, which means that all displayed
- variables are now automatically escaped. You can revert to the previous
- behavior by removing the extension via $env->removeExtension('escaper')
- or just set the 'autoescape' option to 'false'.
- * removed the "without loop" attribute for the "for" tag (not needed anymore
- as the Optimizer take care of that for most cases)
- * arrays and hashes have now a different syntax
- * arrays keep the same syntax with square brackets: [1, 2]
- * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"})
- * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1})
- * the i18n extension is now part of the Twig Extensions repository
-
-Changes:
-
- * added the merge filter
- * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead
- * fixed usage of operators as method names (like is, in, and not)
- * changed the order of execution for node visitors
- * fixed default() filter behavior when used with strict_variables set to on
- * fixed filesystem loader compatibility with PHAR files
- * enhanced error messages when an unexpected token is parsed in an expression
- * fixed filename not being added to syntax error messages
- * added the autoescape option to enable/disable autoescaping
- * removed the newline after a comment (mimics PHP behavior)
- * added a syntax error exception when parent block is used on a template that does not extend another one
- * made the Escaper extension enabled by default
- * fixed sandbox extension when used with auto output escaping
- * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved)
- * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters)
- * added priority to node visitors
-
-* 0.9.9 (2010-11-28)
-
-Backward incompatibilities:
- * the self special variable has been renamed to _self
- * the odd and even filters are now tests:
- {{ foo|odd }} must now be written {{ foo is odd }}
- * the "safe" filter has been renamed to "raw"
- * in Node classes,
- sub-nodes are now accessed via getNode() (instead of property access)
- attributes via getAttribute() (instead of array access)
- * the urlencode filter had been renamed to url_encode
- * the include tag now merges the passed variables with the current context by default
- (the old behavior is still possible by adding the "only" keyword)
- * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime)
- * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead)
- * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }})
-
-Changes:
- * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template
- * changed trans tag to accept any variable for the plural count
- * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements)
- * added the ** (power) operator
- * changed the algorithm used for parsing expressions
- * added the spaceless tag
- * removed trim_blocks option
- * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar())
- * changed all exceptions to extend Twig_Error
- * fixed unary expressions ({{ not(1 or 0) }})
- * fixed child templates (with an extend tag) that uses one or more imports
- * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }})
- * escaping has been rewritten
- * the implementation of template inheritance has been rewritten
- (blocks can now be called individually and still work with inheritance)
- * fixed error handling for if tag when a syntax error occurs within a subparse process
- * added a way to implement custom logic for resolving token parsers given a tag name
- * fixed js escaper to be stricter (now uses a whilelist-based js escaper)
- * added the following filers: "constant", "trans", "replace", "json_encode"
- * added a "constant" test
- * fixed objects with __toString() not being autoescaped
- * fixed subscript expressions when calling __call() (methods now keep the case)
- * added "test" feature (accessible via the "is" operator)
- * removed the debug tag (should be done in an extension)
- * fixed trans tag when no vars are used in plural form
- * fixed race condition when writing template cache
- * added the special _charset variable to reference the current charset
- * added the special _context variable to reference the current context
- * renamed self to _self (to avoid conflict)
- * fixed Twig_Template::getAttribute() for protected properties
-
-* 0.9.8 (2010-06-28)
-
-Backward incompatibilities:
- * the trans tag plural count is now attached to the plural tag:
- old: `{% trans count %}...{% plural %}...{% endtrans %}`
- new: `{% trans %}...{% plural count %}...{% endtrans %}`
-
- * added a way to translate strings coming from a variable ({% trans var %})
- * fixed trans tag when used with the Escaper extension
- * fixed default cache umask
- * removed Twig_Template instances from the debug tag output
- * fixed objects with __isset() defined
- * fixed set tag when used with a capture
- * fixed type hinting for Twig_Environment::addFilter() method
-
-* 0.9.7 (2010-06-12)
-
-Backward incompatibilities:
- * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %})
- * removed the sandboxed attribute of the include tag (use the new sandbox tag instead)
- * refactored the Node system (if you have custom nodes, you will have to update them to use the new API)
-
- * added self as a special variable that refers to the current template (useful for importing macros from the current template)
- * added Twig_Template instance support to the include tag
- * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %})
- * added a grammar sub-framework to ease the creation of custom tags
- * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface)
- * removed the Twig_Resource::resolveMissingFilter() method
- * fixed the filter tag which did not apply filtering to included files
- * added a bunch of unit tests
- * added a bunch of phpdoc
- * added a sandbox tag in the sandbox extension
- * changed the date filter to support any date format supported by DateTime
- * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default)
- * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor
- * changed the cache option to only accepts an explicit path to a cache directory or false
- * added a way to add token parsers, filters, and visitors without creating an extension
- * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface
- * changed the generated code to match the new coding standards
- * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }})
- * added an exception when a child template has a non-empty body (as it is always ignored when rendering)
-
-* 0.9.6 (2010-05-12)
-
- * fixed variables defined outside a loop and for which the value changes in a for loop
- * fixed the test suite for PHP 5.2 and older versions of PHPUnit
- * added support for __call() in expression resolution
- * fixed node visiting for macros (macros are now visited by visitors as any other node)
- * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now)
- * added the cycle filter
- * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII
- * added a long-syntax for the set tag ({% set foo %}...{% endset %})
- * unit tests are now powered by PHPUnit
- * added support for gettext via the `i18n` extension
- * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values
- * added a more useful exception if an if tag is not closed properly
- * added support for escaping strategy in the autoescape tag
- * fixed lexer when a template has a big chunk of text between/in a block
-
-* 0.9.5 (2010-01-20)
-
-As for any new release, don't forget to remove all cached templates after
-upgrading.
-
-If you have defined custom filters, you MUST upgrade them for this release. To
-upgrade, replace "array" with "new Twig_Filter_Function", and replace the
-environment constant by the "needs_environment" option:
-
- // before
- 'even' => array('twig_is_even_filter', false),
- 'escape' => array('twig_escape_filter', true),
-
- // after
- 'even' => new Twig_Filter_Function('twig_is_even_filter'),
- 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)),
-
-If you have created NodeTransformer classes, you will need to upgrade them to
-the new interface (please note that the interface is not yet considered
-stable).
-
- * fixed list nodes that did not extend the Twig_NodeListInterface
- * added the "without loop" option to the for tag (it disables the generation of the loop variable)
- * refactored node transformers to node visitors
- * fixed automatic-escaping for blocks
- * added a way to specify variables to pass to an included template
- * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules)
- * improved the filter system to allow object methods to be used as filters
- * changed the Array and String loaders to actually make use of the cache mechanism
- * included the default filter function definitions in the extension class files directly (Core, Escaper)
- * added the // operator (like the floor() PHP function)
- * added the .. operator (as a syntactic sugar for the range filter when the step is 1)
- * added the in operator (as a syntactic sugar for the in filter)
- * added the following filters in the Core extension: in, range
- * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes)
- * enhanced some error messages to provide better feedback in case of parsing errors
-
-* 0.9.4 (2009-12-02)
-
-If you have custom loaders, you MUST upgrade them for this release: The
-Twig_Loader base class has been removed, and the Twig_LoaderInterface has also
-been changed (see the source code for more information or the documentation).
-
- * added support for DateTime instances for the date filter
- * fixed loop.last when the array only has one item
- * made it possible to insert newlines in tag and variable blocks
- * fixed a bug when a literal '\n' were present in a template text
- * fixed bug when the filename of a template contains */
- * refactored loaders
-
-* 0.9.3 (2009-11-11)
-
-This release is NOT backward compatible with the previous releases.
-
- The loaders do not take the cache and autoReload arguments anymore. Instead,
- the Twig_Environment class has two new options: cache and auto_reload.
- Upgrading your code means changing this kind of code:
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true);
- $twig = new Twig_Environment($loader);
-
- to something like this:
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
- $twig = new Twig_Environment($loader, array(
- 'cache' => '/path/to/compilation_cache',
- 'auto_reload' => true,
- ));
-
- * deprecated the "items" filter as it is not needed anymore
- * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader
- * optimized template loading speed
- * removed output when an error occurs in a template and render() is used
- * made major speed improvements for loops (up to 300% on even the smallest loops)
- * added properties as part of the sandbox mode
- * added public properties support (obj.item can now be the item property on the obj object)
- * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} )
- * fixed bug when \ was used in HTML
-
-* 0.9.2 (2009-10-29)
-
- * made some speed optimizations
- * changed the cache extension to .php
- * added a js escaping strategy
- * added support for short block tag
- * changed the filter tag to allow chained filters
- * made lexer more flexible as you can now change the default delimiters
- * added set tag
- * changed default directory permission when cache dir does not exist (more secure)
- * added macro support
- * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance
- * made Twig_Autoloader::autoload() a static method
- * avoid writing template file if an error occurs
- * added $ escaping when outputting raw strings
- * enhanced some error messages to ease debugging
- * fixed empty cache files when the template contains an error
-
-* 0.9.1 (2009-10-14)
-
- * fixed a bug in PHP 5.2.6
- * fixed numbers with one than one decimal
- * added support for method calls with arguments ({{ foo.bar('a', 43) }})
- * made small speed optimizations
- * made minor tweaks to allow better extensibility and flexibility
-
-* 0.9.0 (2009-10-12)
-
- * Initial release
diff --git a/core/vendor/twig/twig/LICENSE b/core/vendor/twig/twig/LICENSE
deleted file mode 100644
index 3384cc5..0000000
--- a/core/vendor/twig/twig/LICENSE
+++ /dev/null
@@ -1,31 +0,0 @@
-Copyright (c) 2009-2013 by the Twig Team, see AUTHORS for more details.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * The names of the contributors may not be used to endorse or
- promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/core/vendor/twig/twig/README.rst b/core/vendor/twig/twig/README.rst
deleted file mode 100644
index 81737b0..0000000
--- a/core/vendor/twig/twig/README.rst
+++ /dev/null
@@ -1,15 +0,0 @@
-Twig, the flexible, fast, and secure template language for PHP
-==============================================================
-
-Twig is a template language for PHP, released under the new BSD license (code
-and documentation).
-
-Twig uses a syntax similar to the Django and Jinja template languages which
-inspired the Twig runtime environment.
-
-More Information
-----------------
-
-Read the `documentation`_ for more information.
-
-.. _documentation: http://twig.sensiolabs.org/documentation
diff --git a/core/vendor/twig/twig/composer.json b/core/vendor/twig/twig/composer.json
deleted file mode 100644
index 799a3eb..0000000
--- a/core/vendor/twig/twig/composer.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "twig/twig",
- "type": "library",
- "description": "Twig, the flexible, fast, and secure template language for PHP",
- "keywords": ["templating"],
- "homepage": "http://twig.sensiolabs.org",
- "license": "BSD-3-Clause",
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Armin Ronacher",
- "email": "armin.ronacher@active-4.com"
- }
- ],
- "require": {
- "php": ">=5.2.4"
- },
- "autoload": {
- "psr-0" : {
- "Twig_" : "lib/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.15-dev"
- }
- }
-}
diff --git a/core/vendor/twig/twig/doc/advanced.rst b/core/vendor/twig/twig/doc/advanced.rst
deleted file mode 100644
index ea82ce0..0000000
--- a/core/vendor/twig/twig/doc/advanced.rst
+++ /dev/null
@@ -1,834 +0,0 @@
-Extending Twig
-==============
-
-.. caution::
-
- This section describes how to extend Twig as of **Twig 1.12**. If you are
- using an older version, read the :doc:`legacy` chapter
- instead.
-
-Twig can be extended in many ways; you can add extra tags, filters, tests,
-operators, global variables, and functions. You can even extend the parser
-itself with node visitors.
-
-.. note::
-
- The first section of this chapter describes how to extend Twig easily. If
- you want to reuse your changes in different projects or if you want to
- share them with others, you should then create an extension as described
- in the following section.
-
-.. caution::
-
- When extending Twig without creating an extension, Twig won't be able to
- recompile your templates when the PHP code is updated. To see your changes
- in real-time, either disable template caching or package your code into an
- extension (see the next section of this chapter).
-
-Before extending Twig, you must understand the differences between all the
-different possible extension points and when to use them.
-
-First, remember that Twig has two main language constructs:
-
-* ``{{ }}``: used to print the result of an expression evaluation;
-
-* ``{% %}``: used to execute statements.
-
-To understand why Twig exposes so many extension points, let's see how to
-implement a *Lorem ipsum* generator (it needs to know the number of words to
-generate).
-
-You can use a ``lipsum`` *tag*:
-
-.. code-block:: jinja
-
- {% lipsum 40 %}
-
-That works, but using a tag for ``lipsum`` is not a good idea for at least
-three main reasons:
-
-* ``lipsum`` is not a language construct;
-* The tag outputs something;
-* The tag is not flexible as you cannot use it in an expression:
-
- .. code-block:: jinja
-
- {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }}
-
-In fact, you rarely need to create tags; and that's good news because tags are
-the most complex extension point of Twig.
-
-Now, let's use a ``lipsum`` *filter*:
-
-.. code-block:: jinja
-
- {{ 40|lipsum }}
-
-Again, it works, but it looks weird. A filter transforms the passed value to
-something else but here we use the value to indicate the number of words to
-generate (so, ``40`` is an argument of the filter, not the value we want to
-transform).
-
-Next, let's use a ``lipsum`` *function*:
-
-.. code-block:: jinja
-
- {{ lipsum(40) }}
-
-Here we go. For this specific example, the creation of a function is the
-extension point to use. And you can use it anywhere an expression is accepted:
-
-.. code-block:: jinja
-
- {{ 'some text' ~ lipsum(40) ~ 'some more text' }}
-
- {% set lipsum = lipsum(40) %}
-
-Last but not the least, you can also use a *global* object with a method able
-to generate lorem ipsum text:
-
-.. code-block:: jinja
-
- {{ text.lipsum(40) }}
-
-As a rule of thumb, use functions for frequently used features and global
-objects for everything else.
-
-Keep in mind the following when you want to extend Twig:
-
-========== ========================== ========== =========================
-What? Implementation difficulty? How often? When?
-========== ========================== ========== =========================
-*macro* trivial frequent Content generation
-*global* trivial frequent Helper object
-*function* trivial frequent Content generation
-*filter* trivial frequent Value transformation
-*tag* complex rare DSL language construct
-*test* trivial rare Boolean decision
-*operator* trivial rare Values transformation
-========== ========================== ========== =========================
-
-Globals
--------
-
-A global variable is like any other template variable, except that it's
-available in all templates and macros::
-
- $twig = new Twig_Environment($loader);
- $twig->addGlobal('text', new Text());
-
-You can then use the ``text`` variable anywhere in a template:
-
-.. code-block:: jinja
-
- {{ text.lipsum(40) }}
-
-Filters
--------
-
-Creating a filter is as simple as associating a name with a PHP callable::
-
- // an anonymous function
- $filter = new Twig_SimpleFilter('rot13', function ($string) {
- return str_rot13($string);
- });
-
- // or a simple PHP function
- $filter = new Twig_SimpleFilter('rot13', 'str_rot13');
-
- // or a class method
- $filter = new Twig_SimpleFilter('rot13', array('SomeClass', 'rot13Filter'));
-
-The first argument passed to the ``Twig_SimpleFilter`` constructor is the name
-of the filter you will use in templates and the second one is the PHP callable
-to associate with it.
-
-Then, add the filter to your Twig environment::
-
- $twig = new Twig_Environment($loader);
- $twig->addFilter($filter);
-
-And here is how to use it in a template:
-
-.. code-block:: jinja
-
- {{ 'Twig'|rot13 }}
-
- {# will output Gjvt #}
-
-When called by Twig, the PHP callable receives the left side of the filter
-(before the pipe ``|``) as the first argument and the extra arguments passed
-to the filter (within parentheses ``()``) as extra arguments.
-
-For instance, the following code:
-
-.. code-block:: jinja
-
- {{ 'TWIG'|lower }}
- {{ now|date('d/m/Y') }}
-
-is compiled to something like the following::
-
-
-
-
-The ``Twig_SimpleFilter`` class takes an array of options as its last
-argument::
-
- $filter = new Twig_SimpleFilter('rot13', 'str_rot13', $options);
-
-Environment-aware Filters
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you want to access the current environment instance in your filter, set the
-``needs_environment`` option to ``true``; Twig will pass the current
-environment as the first argument to the filter call::
-
- $filter = new Twig_SimpleFilter('rot13', function (Twig_Environment $env, $string) {
- // get the current charset for instance
- $charset = $env->getCharset();
-
- return str_rot13($string);
- }, array('needs_environment' => true));
-
-Context-aware Filters
-~~~~~~~~~~~~~~~~~~~~~
-
-If you want to access the current context in your filter, set the
-``needs_context`` option to ``true``; Twig will pass the current context as
-the first argument to the filter call (or the second one if
-``needs_environment`` is also set to ``true``)::
-
- $filter = new Twig_SimpleFilter('rot13', function ($context, $string) {
- // ...
- }, array('needs_context' => true));
-
- $filter = new Twig_SimpleFilter('rot13', function (Twig_Environment $env, $context, $string) {
- // ...
- }, array('needs_context' => true, 'needs_environment' => true));
-
-Automatic Escaping
-~~~~~~~~~~~~~~~~~~
-
-If automatic escaping is enabled, the output of the filter may be escaped
-before printing. If your filter acts as an escaper (or explicitly outputs HTML
-or JavaScript code), you will want the raw output to be printed. In such a
-case, set the ``is_safe`` option::
-
- $filter = new Twig_SimpleFilter('nl2br', 'nl2br', array('is_safe' => array('html')));
-
-Some filters may need to work on input that is already escaped or safe, for
-example when adding (safe) HTML tags to originally unsafe output. In such a
-case, set the ``pre_escape`` option to escape the input data before it is run
-through your filter::
-
- $filter = new Twig_SimpleFilter('somefilter', 'somefilter', array('pre_escape' => 'html', 'is_safe' => array('html')));
-
-Dynamic Filters
-~~~~~~~~~~~~~~~
-
-A filter name containing the special ``*`` character is a dynamic filter as
-the ``*`` can be any string::
-
- $filter = new Twig_SimpleFilter('*_path', function ($name, $arguments) {
- // ...
- });
-
-The following filters will be matched by the above defined dynamic filter:
-
-* ``product_path``
-* ``category_path``
-
-A dynamic filter can define more than one dynamic parts::
-
- $filter = new Twig_SimpleFilter('*_path_*', function ($name, $suffix, $arguments) {
- // ...
- });
-
-The filter will receive all dynamic part values before the normal filter
-arguments, but after the environment and the context. For instance, a call to
-``'foo'|a_path_b()`` will result in the following arguments to be passed to
-the filter: ``('a', 'b', 'foo')``.
-
-Functions
----------
-
-Functions are defined in the exact same way as filters, but you need to create
-an instance of ``Twig_SimpleFunction``::
-
- $twig = new Twig_Environment($loader);
- $function = new Twig_SimpleFunction('function_name', function () {
- // ...
- });
- $twig->addFunction($function);
-
-Functions support the same features as filters, except for the ``pre_escape``
-and ``preserves_safety`` options.
-
-Tests
------
-
-Tests are defined in the exact same way as filters and functions, but you need
-to create an instance of ``Twig_SimpleTest``::
-
- $twig = new Twig_Environment($loader);
- $test = new Twig_SimpleTest('test_name', function () {
- // ...
- });
- $twig->addTest($test);
-
-Tests allow you to create custom application specific logic for evaluating
-boolean conditions. As a simple example, let's create a Twig test that checks if
-objects are 'red'::
-
- $twig = new Twig_Environment($loader)
- $test = new Twig_SimpleTest('red', function ($value) {
- if (isset($value->color) && $value->color == 'red') {
- return true;
- }
- if (isset($value->paint) && $value->paint == 'red') {
- return true;
- }
- return false;
- });
- $twig->addTest($test);
-
-Test functions should always return true/false.
-
-When creating tests you can use the ``node_class`` option to provide custom test
-compilation. This is useful if your test can be compiled into PHP primitives.
-This is used by many of the tests built into Twig::
-
- $twig = new Twig_Environment($loader)
- $test = new Twig_SimpleTest(
- 'odd',
- null,
- array('node_class' => 'Twig_Node_Expression_Test_Odd'));
- $twig->addTest($test);
-
- class Twig_Node_Expression_Test_Odd extends Twig_Node_Expression_Test
- {
- public function compile(Twig_Compiler $compiler)
- {
- $compiler
- ->raw('(')
- ->subcompile($this->getNode('node'))
- ->raw(' % 2 == 1')
- ->raw(')')
- ;
- }
- }
-
-The above example shows how you can create tests that use a node class. The
-node class has access to one sub-node called 'node'. This sub-node contains the
-value that is being tested. When the ``odd`` filter is used in code such as:
-
-.. code-block:: jinja
-
- {% if my_value is odd %}
-
-The ``node`` sub-node will contain an expression of ``my_value``. Node-based
-tests also have access to the ``arguments`` node. This node will contain the
-various other arguments that have been provided to your test.
-
-Tags
-----
-
-One of the most exciting features of a template engine like Twig is the
-possibility to define new language constructs. This is also the most complex
-feature as you need to understand how Twig's internals work.
-
-Let's create a simple ``set`` tag that allows the definition of simple
-variables from within a template. The tag can be used like follows:
-
-.. code-block:: jinja
-
- {% set name = "value" %}
-
- {{ name }}
-
- {# should output value #}
-
-.. note::
-
- The ``set`` tag is part of the Core extension and as such is always
- available. The built-in version is slightly more powerful and supports
- multiple assignments by default (cf. the template designers chapter for
- more information).
-
-Three steps are needed to define a new tag:
-
-* Defining a Token Parser class (responsible for parsing the template code);
-
-* Defining a Node class (responsible for converting the parsed code to PHP);
-
-* Registering the tag.
-
-Registering a new tag
-~~~~~~~~~~~~~~~~~~~~~
-
-Adding a tag is as simple as calling the ``addTokenParser`` method on the
-``Twig_Environment`` instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addTokenParser(new Project_Set_TokenParser());
-
-Defining a Token Parser
-~~~~~~~~~~~~~~~~~~~~~~~
-
-Now, let's see the actual code of this class::
-
- class Project_Set_TokenParser extends Twig_TokenParser
- {
- public function parse(Twig_Token $token)
- {
- $parser = $this->parser;
- $stream = $parser->getStream();
-
- $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
- $stream->expect(Twig_Token::OPERATOR_TYPE, '=');
- $value = $parser->getExpressionParser()->parseExpression();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
- return new Project_Set_Node($name, $value, $token->getLine(), $this->getTag());
- }
-
- public function getTag()
- {
- return 'set';
- }
- }
-
-The ``getTag()`` method must return the tag we want to parse, here ``set``.
-
-The ``parse()`` method is invoked whenever the parser encounters a ``set``
-tag. It should return a ``Twig_Node`` instance that represents the node (the
-``Project_Set_Node`` calls creating is explained in the next section).
-
-The parsing process is simplified thanks to a bunch of methods you can call
-from the token stream (``$this->parser->getStream()``):
-
-* ``getCurrent()``: Gets the current token in the stream.
-
-* ``next()``: Moves to the next token in the stream, *but returns the old one*.
-
-* ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether
- the current token is of a particular type or value (or both). The value may be an
- array of several possible values.
-
-* ``expect($type[, $value[, $message]])``: If the current token isn't of the given
- type/value a syntax error is thrown. Otherwise, if the type and value are correct,
- the token is returned and the stream moves to the next token.
-
-* ``look()``: Looks a the next token without consuming it.
-
-Parsing expressions is done by calling the ``parseExpression()`` like we did for
-the ``set`` tag.
-
-.. tip::
-
- Reading the existing ``TokenParser`` classes is the best way to learn all
- the nitty-gritty details of the parsing process.
-
-Defining a Node
-~~~~~~~~~~~~~~~
-
-The ``Project_Set_Node`` class itself is rather simple::
-
- class Project_Set_Node extends Twig_Node
- {
- public function __construct($name, Twig_Node_Expression $value, $line, $tag = null)
- {
- parent::__construct(array('value' => $value), array('name' => $name), $line, $tag);
- }
-
- public function compile(Twig_Compiler $compiler)
- {
- $compiler
- ->addDebugInfo($this)
- ->write('$context[\''.$this->getAttribute('name').'\'] = ')
- ->subcompile($this->getNode('value'))
- ->raw(";\n")
- ;
- }
- }
-
-The compiler implements a fluid interface and provides methods that helps the
-developer generate beautiful and readable PHP code:
-
-* ``subcompile()``: Compiles a node.
-
-* ``raw()``: Writes the given string as is.
-
-* ``write()``: Writes the given string by adding indentation at the beginning
- of each line.
-
-* ``string()``: Writes a quoted string.
-
-* ``repr()``: Writes a PHP representation of a given value (see
- ``Twig_Node_For`` for a usage example).
-
-* ``addDebugInfo()``: Adds the line of the original template file related to
- the current node as a comment.
-
-* ``indent()``: Indents the generated code (see ``Twig_Node_Block`` for a
- usage example).
-
-* ``outdent()``: Outdents the generated code (see ``Twig_Node_Block`` for a
- usage example).
-
-.. _creating_extensions:
-
-Creating an Extension
----------------------
-
-The main motivation for writing an extension is to move often used code into a
-reusable class like adding support for internationalization. An extension can
-define tags, filters, tests, operators, global variables, functions, and node
-visitors.
-
-Creating an extension also makes for a better separation of code that is
-executed at compilation time and code needed at runtime. As such, it makes
-your code faster.
-
-Most of the time, it is useful to create a single extension for your project,
-to host all the specific tags and filters you want to add to Twig.
-
-.. tip::
-
- When packaging your code into an extension, Twig is smart enough to
- recompile your templates whenever you make a change to it (when
- ``auto_reload`` is enabled).
-
-.. note::
-
- Before writing your own extensions, have a look at the Twig official
- extension repository: http://github.com/fabpot/Twig-extensions.
-
-An extension is a class that implements the following interface::
-
- interface Twig_ExtensionInterface
- {
- /**
- * Initializes the runtime environment.
- *
- * This is where you can load some file that contains filter functions for instance.
- *
- * @param Twig_Environment $environment The current Twig_Environment instance
- */
- function initRuntime(Twig_Environment $environment);
-
- /**
- * Returns the token parser instances to add to the existing list.
- *
- * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
- */
- function getTokenParsers();
-
- /**
- * Returns the node visitor instances to add to the existing list.
- *
- * @return array An array of Twig_NodeVisitorInterface instances
- */
- function getNodeVisitors();
-
- /**
- * Returns a list of filters to add to the existing list.
- *
- * @return array An array of filters
- */
- function getFilters();
-
- /**
- * Returns a list of tests to add to the existing list.
- *
- * @return array An array of tests
- */
- function getTests();
-
- /**
- * Returns a list of functions to add to the existing list.
- *
- * @return array An array of functions
- */
- function getFunctions();
-
- /**
- * Returns a list of operators to add to the existing list.
- *
- * @return array An array of operators
- */
- function getOperators();
-
- /**
- * Returns a list of global variables to add to the existing list.
- *
- * @return array An array of global variables
- */
- function getGlobals();
-
- /**
- * Returns the name of the extension.
- *
- * @return string The extension name
- */
- function getName();
- }
-
-To keep your extension class clean and lean, it can inherit from the built-in
-``Twig_Extension`` class instead of implementing the whole interface. That
-way, you just need to implement the ``getName()`` method as the
-``Twig_Extension`` provides empty implementations for all other methods.
-
-The ``getName()`` method must return a unique identifier for your extension.
-
-Now, with this information in mind, let's create the most basic extension
-possible::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getName()
- {
- return 'project';
- }
- }
-
-.. note::
-
- Of course, this extension does nothing for now. We will customize it in
- the next sections.
-
-Twig does not care where you save your extension on the filesystem, as all
-extensions must be registered explicitly to be available in your templates.
-
-You can register an extension by using the ``addExtension()`` method on your
-main ``Environment`` object::
-
- $twig = new Twig_Environment($loader);
- $twig->addExtension(new Project_Twig_Extension());
-
-Of course, you need to first load the extension file by either using
-``require_once()`` or by using an autoloader (see `spl_autoload_register()`_).
-
-.. tip::
-
- The bundled extensions are great examples of how extensions work.
-
-Globals
-~~~~~~~
-
-Global variables can be registered in an extension via the ``getGlobals()``
-method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getGlobals()
- {
- return array(
- 'text' => new Text(),
- );
- }
-
- // ...
- }
-
-Functions
-~~~~~~~~~
-
-Functions can be registered in an extension via the ``getFunctions()``
-method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFunctions()
- {
- return array(
- new Twig_SimpleFunction('lipsum', 'generate_lipsum'),
- );
- }
-
- // ...
- }
-
-Filters
-~~~~~~~
-
-To add a filter to an extension, you need to override the ``getFilters()``
-method. This method must return an array of filters to add to the Twig
-environment::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- new Twig_SimpleFilter('rot13', 'str_rot13'),
- );
- }
-
- // ...
- }
-
-Tags
-~~~~
-
-Adding a tag in an extension can be done by overriding the
-``getTokenParsers()`` method. This method must return an array of tags to add
-to the Twig environment::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getTokenParsers()
- {
- return array(new Project_Set_TokenParser());
- }
-
- // ...
- }
-
-In the above code, we have added a single new tag, defined by the
-``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is
-responsible for parsing the tag and compiling it to PHP.
-
-Operators
-~~~~~~~~~
-
-The ``getOperators()`` methods lets you add new operators. Here is how to add
-``!``, ``||``, and ``&&`` operators::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getOperators()
- {
- return array(
- array(
- '!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),
- ),
- array(
- '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- ),
- );
- }
-
- // ...
- }
-
-Tests
-~~~~~
-
-The ``getTests()`` method lets you add new test functions::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getTests()
- {
- return array(
- new Twig_SimpleTest('even', 'twig_test_even'),
- );
- }
-
- // ...
- }
-
-Overloading
------------
-
-To overload an already defined filter, test, operator, global variable, or
-function, re-define it in an extension and register it **as late as
-possible** (order matters)::
-
- class MyCoreExtension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- new Twig_SimpleFilter('date', array($this, 'dateFilter')),
- );
- }
-
- public function dateFilter($timestamp, $format = 'F j, Y H:i')
- {
- // do something different from the built-in date filter
- }
-
- public function getName()
- {
- return 'project';
- }
- }
-
- $twig = new Twig_Environment($loader);
- $twig->addExtension(new MyCoreExtension());
-
-Here, we have overloaded the built-in ``date`` filter with a custom one.
-
-If you do the same on the Twig_Environment itself, beware that it takes
-precedence over any other registered extensions::
-
- $twig = new Twig_Environment($loader);
- $twig->addFilter(new Twig_SimpleFilter('date', function ($timestamp, $format = 'F j, Y H:i') {
- // do something different from the built-in date filter
- }));
- // the date filter will come from the above registration, not
- // from the registered extension below
- $twig->addExtension(new MyCoreExtension());
-
-.. caution::
-
- Note that overloading the built-in Twig elements is not recommended as it
- might be confusing.
-
-Testing an Extension
---------------------
-
-Functional Tests
-~~~~~~~~~~~~~~~~
-
-You can create functional tests for extensions simply by creating the
-following file structure in your test directory::
-
- Fixtures/
- filters/
- foo.test
- bar.test
- functions/
- foo.test
- bar.test
- tags/
- foo.test
- bar.test
- IntegrationTest.php
-
-The ``IntegrationTest.php`` file should look like this::
-
- class Project_Tests_IntegrationTest extends Twig_Test_IntegrationTestCase
- {
- public function getExtensions()
- {
- return array(
- new Project_Twig_Extension1(),
- new Project_Twig_Extension2(),
- );
- }
-
- public function getFixturesDir()
- {
- return dirname(__FILE__).'/Fixtures/';
- }
- }
-
-Fixtures examples can be found within the Twig repository
-`tests/Twig/Fixtures`_ directory.
-
-Node Tests
-~~~~~~~~~~
-
-Testing the node visitors can be complex, so extend your test cases from
-``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
-`tests/Twig/Node`_ directory.
-
-.. _`spl_autoload_register()`: http://www.php.net/spl_autoload_register
-.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
-.. _`tests/Twig/Fixtures`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Fixtures
-.. _`tests/Twig/Node`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Node
diff --git a/core/vendor/twig/twig/doc/advanced_legacy.rst b/core/vendor/twig/twig/doc/advanced_legacy.rst
deleted file mode 100644
index 2b33180..0000000
--- a/core/vendor/twig/twig/doc/advanced_legacy.rst
+++ /dev/null
@@ -1,887 +0,0 @@
-Extending Twig
-==============
-
-.. caution::
-
- This section describes how to extends Twig for versions **older than
- 1.12**. If you are using a newer version, read the :doc:`newer`
- chapter instead.
-
-Twig can be extended in many ways; you can add extra tags, filters, tests,
-operators, global variables, and functions. You can even extend the parser
-itself with node visitors.
-
-.. note::
-
- The first section of this chapter describes how to extend Twig easily. If
- you want to reuse your changes in different projects or if you want to
- share them with others, you should then create an extension as described
- in the following section.
-
-.. caution::
-
- When extending Twig by calling methods on the Twig environment instance,
- Twig won't be able to recompile your templates when the PHP code is
- updated. To see your changes in real-time, either disable template caching
- or package your code into an extension (see the next section of this
- chapter).
-
-Before extending Twig, you must understand the differences between all the
-different possible extension points and when to use them.
-
-First, remember that Twig has two main language constructs:
-
-* ``{{ }}``: used to print the result of an expression evaluation;
-
-* ``{% %}``: used to execute statements.
-
-To understand why Twig exposes so many extension points, let's see how to
-implement a *Lorem ipsum* generator (it needs to know the number of words to
-generate).
-
-You can use a ``lipsum`` *tag*:
-
-.. code-block:: jinja
-
- {% lipsum 40 %}
-
-That works, but using a tag for ``lipsum`` is not a good idea for at least
-three main reasons:
-
-* ``lipsum`` is not a language construct;
-* The tag outputs something;
-* The tag is not flexible as you cannot use it in an expression:
-
- .. code-block:: jinja
-
- {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }}
-
-In fact, you rarely need to create tags; and that's good news because tags are
-the most complex extension point of Twig.
-
-Now, let's use a ``lipsum`` *filter*:
-
-.. code-block:: jinja
-
- {{ 40|lipsum }}
-
-Again, it works, but it looks weird. A filter transforms the passed value to
-something else but here we use the value to indicate the number of words to
-generate (so, ``40`` is an argument of the filter, not the value we want to
-transform).
-
-Next, let's use a ``lipsum`` *function*:
-
-.. code-block:: jinja
-
- {{ lipsum(40) }}
-
-Here we go. For this specific example, the creation of a function is the
-extension point to use. And you can use it anywhere an expression is accepted:
-
-.. code-block:: jinja
-
- {{ 'some text' ~ ipsum(40) ~ 'some more text' }}
-
- {% set ipsum = ipsum(40) %}
-
-Last but not the least, you can also use a *global* object with a method able
-to generate lorem ipsum text:
-
-.. code-block:: jinja
-
- {{ text.lipsum(40) }}
-
-As a rule of thumb, use functions for frequently used features and global
-objects for everything else.
-
-Keep in mind the following when you want to extend Twig:
-
-========== ========================== ========== =========================
-What? Implementation difficulty? How often? When?
-========== ========================== ========== =========================
-*macro* trivial frequent Content generation
-*global* trivial frequent Helper object
-*function* trivial frequent Content generation
-*filter* trivial frequent Value transformation
-*tag* complex rare DSL language construct
-*test* trivial rare Boolean decision
-*operator* trivial rare Values transformation
-========== ========================== ========== =========================
-
-Globals
--------
-
-A global variable is like any other template variable, except that it's
-available in all templates and macros::
-
- $twig = new Twig_Environment($loader);
- $twig->addGlobal('text', new Text());
-
-You can then use the ``text`` variable anywhere in a template:
-
-.. code-block:: jinja
-
- {{ text.lipsum(40) }}
-
-Filters
--------
-
-A filter is a regular PHP function or an object method that takes the left
-side of the filter (before the pipe ``|``) as first argument and the extra
-arguments passed to the filter (within parentheses ``()``) as extra arguments.
-
-Defining a filter is as easy as associating the filter name with a PHP
-callable. For instance, let's say you have the following code in a template:
-
-.. code-block:: jinja
-
- {{ 'TWIG'|lower }}
-
-When compiling this template to PHP, Twig looks for the PHP callable
-associated with the ``lower`` filter. The ``lower`` filter is a built-in Twig
-filter, and it is simply mapped to the PHP ``strtolower()`` function. After
-compilation, the generated PHP code is roughly equivalent to:
-
-.. code-block:: html+php
-
-
-
-As you can see, the ``'TWIG'`` string is passed as a first argument to the PHP
-function.
-
-A filter can also take extra arguments like in the following example:
-
-.. code-block:: jinja
-
- {{ now|date('d/m/Y') }}
-
-In this case, the extra arguments are passed to the function after the main
-argument, and the compiled code is equivalent to:
-
-.. code-block:: html+php
-
-
-
-Let's see how to create a new filter.
-
-In this section, we will create a ``rot13`` filter, which should return the
-`rot13`_ transformation of a string. Here is an example of its usage and the
-expected output:
-
-.. code-block:: jinja
-
- {{ "Twig"|rot13 }}
-
- {# should displays Gjvt #}
-
-Adding a filter is as simple as calling the ``addFilter()`` method on the
-``Twig_Environment`` instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addFilter('rot13', new Twig_Filter_Function('str_rot13'));
-
-The second argument of ``addFilter()`` is an instance of ``Twig_Filter``.
-Here, we use ``Twig_Filter_Function`` as the filter is a PHP function. The
-first argument passed to the ``Twig_Filter_Function`` constructor is the name
-of the PHP function to call, here ``str_rot13``, a native PHP function.
-
-Let's say I now want to be able to add a prefix before the converted string:
-
-.. code-block:: jinja
-
- {{ "Twig"|rot13('prefix_') }}
-
- {# should displays prefix_Gjvt #}
-
-As the PHP ``str_rot13()`` function does not support this requirement, let's
-create a new PHP function::
-
- function project_compute_rot13($string, $prefix = '')
- {
- return $prefix.str_rot13($string);
- }
-
-As you can see, the ``prefix`` argument of the filter is passed as an extra
-argument to the ``project_compute_rot13()`` function.
-
-Adding this filter is as easy as before::
-
- $twig->addFilter('rot13', new Twig_Filter_Function('project_compute_rot13'));
-
-For better encapsulation, a filter can also be defined as a static method of a
-class. The ``Twig_Filter_Function`` class can also be used to register such
-static methods as filters::
-
- $twig->addFilter('rot13', new Twig_Filter_Function('SomeClass::rot13Filter'));
-
-.. tip::
-
- In an extension, you can also define a filter as a static method of the
- extension class.
-
-Environment aware Filters
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The ``Twig_Filter`` classes take options as their last argument. For instance,
-if you want access to the current environment instance in your filter, set the
-``needs_environment`` option to ``true``::
-
- $filter = new Twig_Filter_Function('str_rot13', array('needs_environment' => true));
-
-Twig will then pass the current environment as the first argument to the
-filter call::
-
- function twig_compute_rot13(Twig_Environment $env, $string)
- {
- // get the current charset for instance
- $charset = $env->getCharset();
-
- return str_rot13($string);
- }
-
-Automatic Escaping
-~~~~~~~~~~~~~~~~~~
-
-If automatic escaping is enabled, the output of the filter may be escaped
-before printing. If your filter acts as an escaper (or explicitly outputs HTML
-or JavaScript code), you will want the raw output to be printed. In such a
-case, set the ``is_safe`` option::
-
- $filter = new Twig_Filter_Function('nl2br', array('is_safe' => array('html')));
-
-Some filters may need to work on input that is already escaped or safe, for
-example when adding (safe) HTML tags to originally unsafe output. In such a
-case, set the ``pre_escape`` option to escape the input data before it is run
-through your filter::
-
- $filter = new Twig_Filter_Function('somefilter', array('pre_escape' => 'html', 'is_safe' => array('html')));
-
-Dynamic Filters
-~~~~~~~~~~~~~~~
-
-.. versionadded:: 1.5
- Dynamic filters support was added in Twig 1.5.
-
-A filter name containing the special ``*`` character is a dynamic filter as
-the ``*`` can be any string::
-
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
-
- function twig_path($name, $arguments)
- {
- // ...
- }
-
-The following filters will be matched by the above defined dynamic filter:
-
-* ``product_path``
-* ``category_path``
-
-A dynamic filter can define more than one dynamic parts::
-
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
-
- function twig_path($name, $suffix, $arguments)
- {
- // ...
- }
-
-The filter will receive all dynamic part values before the normal filters
-arguments. For instance, a call to ``'foo'|a_path_b()`` will result in the
-following PHP call: ``twig_path('a', 'b', 'foo')``.
-
-Functions
----------
-
-A function is a regular PHP function or an object method that can be called from
-templates.
-
-.. code-block:: jinja
-
- {{ constant("DATE_W3C") }}
-
-When compiling this template to PHP, Twig looks for the PHP callable
-associated with the ``constant`` function. The ``constant`` function is a built-in Twig
-function, and it is simply mapped to the PHP ``constant()`` function. After
-compilation, the generated PHP code is roughly equivalent to:
-
-.. code-block:: html+php
-
-
-
-Adding a function is similar to adding a filter. This can be done by calling the
-``addFunction()`` method on the ``Twig_Environment`` instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addFunction('functionName', new Twig_Function_Function('someFunction'));
-
-You can also expose extension methods as functions in your templates::
-
- // $this is an object that implements Twig_ExtensionInterface.
- $twig = new Twig_Environment($loader);
- $twig->addFunction('otherFunction', new Twig_Function_Method($this, 'someMethod'));
-
-Functions also support ``needs_environment`` and ``is_safe`` parameters.
-
-Dynamic Functions
-~~~~~~~~~~~~~~~~~
-
-.. versionadded:: 1.5
- Dynamic functions support was added in Twig 1.5.
-
-A function name containing the special ``*`` character is a dynamic function
-as the ``*`` can be any string::
-
- $twig->addFunction('*_path', new Twig_Function_Function('twig_path'));
-
- function twig_path($name, $arguments)
- {
- // ...
- }
-
-The following functions will be matched by the above defined dynamic function:
-
-* ``product_path``
-* ``category_path``
-
-A dynamic function can define more than one dynamic parts::
-
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
-
- function twig_path($name, $suffix, $arguments)
- {
- // ...
- }
-
-The function will receive all dynamic part values before the normal functions
-arguments. For instance, a call to ``a_path_b('foo')`` will result in the
-following PHP call: ``twig_path('a', 'b', 'foo')``.
-
-Tags
-----
-
-One of the most exciting feature of a template engine like Twig is the
-possibility to define new language constructs. This is also the most complex
-feature as you need to understand how Twig's internals work.
-
-Let's create a simple ``set`` tag that allows the definition of simple
-variables from within a template. The tag can be used like follows:
-
-.. code-block:: jinja
-
- {% set name = "value" %}
-
- {{ name }}
-
- {# should output value #}
-
-.. note::
-
- The ``set`` tag is part of the Core extension and as such is always
- available. The built-in version is slightly more powerful and supports
- multiple assignments by default (cf. the template designers chapter for
- more information).
-
-Three steps are needed to define a new tag:
-
-* Defining a Token Parser class (responsible for parsing the template code);
-
-* Defining a Node class (responsible for converting the parsed code to PHP);
-
-* Registering the tag.
-
-Registering a new tag
-~~~~~~~~~~~~~~~~~~~~~
-
-Adding a tag is as simple as calling the ``addTokenParser`` method on the
-``Twig_Environment`` instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addTokenParser(new Project_Set_TokenParser());
-
-Defining a Token Parser
-~~~~~~~~~~~~~~~~~~~~~~~
-
-Now, let's see the actual code of this class::
-
- class Project_Set_TokenParser extends Twig_TokenParser
- {
- public function parse(Twig_Token $token)
- {
- $lineno = $token->getLine();
- $name = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue();
- $this->parser->getStream()->expect(Twig_Token::OPERATOR_TYPE, '=');
- $value = $this->parser->getExpressionParser()->parseExpression();
-
- $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
- return new Project_Set_Node($name, $value, $lineno, $this->getTag());
- }
-
- public function getTag()
- {
- return 'set';
- }
- }
-
-The ``getTag()`` method must return the tag we want to parse, here ``set``.
-
-The ``parse()`` method is invoked whenever the parser encounters a ``set``
-tag. It should return a ``Twig_Node`` instance that represents the node (the
-``Project_Set_Node`` calls creating is explained in the next section).
-
-The parsing process is simplified thanks to a bunch of methods you can call
-from the token stream (``$this->parser->getStream()``):
-
-* ``getCurrent()``: Gets the current token in the stream.
-
-* ``next()``: Moves to the next token in the stream, *but returns the old one*.
-
-* ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether
- the current token is of a particular type or value (or both). The value may be an
- array of several possible values.
-
-* ``expect($type[, $value[, $message]])``: If the current token isn't of the given
- type/value a syntax error is thrown. Otherwise, if the type and value are correct,
- the token is returned and the stream moves to the next token.
-
-* ``look()``: Looks a the next token without consuming it.
-
-Parsing expressions is done by calling the ``parseExpression()`` like we did for
-the ``set`` tag.
-
-.. tip::
-
- Reading the existing ``TokenParser`` classes is the best way to learn all
- the nitty-gritty details of the parsing process.
-
-Defining a Node
-~~~~~~~~~~~~~~~
-
-The ``Project_Set_Node`` class itself is rather simple::
-
- class Project_Set_Node extends Twig_Node
- {
- public function __construct($name, Twig_Node_Expression $value, $lineno, $tag = null)
- {
- parent::__construct(array('value' => $value), array('name' => $name), $lineno, $tag);
- }
-
- public function compile(Twig_Compiler $compiler)
- {
- $compiler
- ->addDebugInfo($this)
- ->write('$context[\''.$this->getAttribute('name').'\'] = ')
- ->subcompile($this->getNode('value'))
- ->raw(";\n")
- ;
- }
- }
-
-The compiler implements a fluid interface and provides methods that helps the
-developer generate beautiful and readable PHP code:
-
-* ``subcompile()``: Compiles a node.
-
-* ``raw()``: Writes the given string as is.
-
-* ``write()``: Writes the given string by adding indentation at the beginning
- of each line.
-
-* ``string()``: Writes a quoted string.
-
-* ``repr()``: Writes a PHP representation of a given value (see
- ``Twig_Node_For`` for a usage example).
-
-* ``addDebugInfo()``: Adds the line of the original template file related to
- the current node as a comment.
-
-* ``indent()``: Indents the generated code (see ``Twig_Node_Block`` for a
- usage example).
-
-* ``outdent()``: Outdents the generated code (see ``Twig_Node_Block`` for a
- usage example).
-
-.. _creating_extensions:
-
-Creating an Extension
----------------------
-
-The main motivation for writing an extension is to move often used code into a
-reusable class like adding support for internationalization. An extension can
-define tags, filters, tests, operators, global variables, functions, and node
-visitors.
-
-Creating an extension also makes for a better separation of code that is
-executed at compilation time and code needed at runtime. As such, it makes
-your code faster.
-
-Most of the time, it is useful to create a single extension for your project,
-to host all the specific tags and filters you want to add to Twig.
-
-.. tip::
-
- When packaging your code into an extension, Twig is smart enough to
- recompile your templates whenever you make a change to it (when the
- ``auto_reload`` is enabled).
-
-.. note::
-
- Before writing your own extensions, have a look at the Twig official
- extension repository: http://github.com/fabpot/Twig-extensions.
-
-An extension is a class that implements the following interface::
-
- interface Twig_ExtensionInterface
- {
- /**
- * Initializes the runtime environment.
- *
- * This is where you can load some file that contains filter functions for instance.
- *
- * @param Twig_Environment $environment The current Twig_Environment instance
- */
- function initRuntime(Twig_Environment $environment);
-
- /**
- * Returns the token parser instances to add to the existing list.
- *
- * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
- */
- function getTokenParsers();
-
- /**
- * Returns the node visitor instances to add to the existing list.
- *
- * @return array An array of Twig_NodeVisitorInterface instances
- */
- function getNodeVisitors();
-
- /**
- * Returns a list of filters to add to the existing list.
- *
- * @return array An array of filters
- */
- function getFilters();
-
- /**
- * Returns a list of tests to add to the existing list.
- *
- * @return array An array of tests
- */
- function getTests();
-
- /**
- * Returns a list of functions to add to the existing list.
- *
- * @return array An array of functions
- */
- function getFunctions();
-
- /**
- * Returns a list of operators to add to the existing list.
- *
- * @return array An array of operators
- */
- function getOperators();
-
- /**
- * Returns a list of global variables to add to the existing list.
- *
- * @return array An array of global variables
- */
- function getGlobals();
-
- /**
- * Returns the name of the extension.
- *
- * @return string The extension name
- */
- function getName();
- }
-
-To keep your extension class clean and lean, it can inherit from the built-in
-``Twig_Extension`` class instead of implementing the whole interface. That
-way, you just need to implement the ``getName()`` method as the
-``Twig_Extension`` provides empty implementations for all other methods.
-
-The ``getName()`` method must return a unique identifier for your extension.
-
-Now, with this information in mind, let's create the most basic extension
-possible::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getName()
- {
- return 'project';
- }
- }
-
-.. note::
-
- Of course, this extension does nothing for now. We will customize it in
- the next sections.
-
-Twig does not care where you save your extension on the filesystem, as all
-extensions must be registered explicitly to be available in your templates.
-
-You can register an extension by using the ``addExtension()`` method on your
-main ``Environment`` object::
-
- $twig = new Twig_Environment($loader);
- $twig->addExtension(new Project_Twig_Extension());
-
-Of course, you need to first load the extension file by either using
-``require_once()`` or by using an autoloader (see `spl_autoload_register()`_).
-
-.. tip::
-
- The bundled extensions are great examples of how extensions work.
-
-Globals
-~~~~~~~
-
-Global variables can be registered in an extension via the ``getGlobals()``
-method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getGlobals()
- {
- return array(
- 'text' => new Text(),
- );
- }
-
- // ...
- }
-
-Functions
-~~~~~~~~~
-
-Functions can be registered in an extension via the ``getFunctions()``
-method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFunctions()
- {
- return array(
- 'lipsum' => new Twig_Function_Function('generate_lipsum'),
- );
- }
-
- // ...
- }
-
-Filters
-~~~~~~~
-
-To add a filter to an extension, you need to override the ``getFilters()``
-method. This method must return an array of filters to add to the Twig
-environment::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- 'rot13' => new Twig_Filter_Function('str_rot13'),
- );
- }
-
- // ...
- }
-
-As you can see in the above code, the ``getFilters()`` method returns an array
-where keys are the name of the filters (``rot13``) and the values the
-definition of the filter (``new Twig_Filter_Function('str_rot13')``).
-
-As seen in the previous chapter, you can also define filters as static methods
-on the extension class::
-
-$twig->addFilter('rot13', new Twig_Filter_Function('Project_Twig_Extension::rot13Filter'));
-
-You can also use ``Twig_Filter_Method`` instead of ``Twig_Filter_Function``
-when defining a filter to use a method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- 'rot13' => new Twig_Filter_Method($this, 'rot13Filter'),
- );
- }
-
- public function rot13Filter($string)
- {
- return str_rot13($string);
- }
-
- // ...
- }
-
-The first argument of the ``Twig_Filter_Method`` constructor is always
-``$this``, the current extension object. The second one is the name of the
-method to call.
-
-Using methods for filters is a great way to package your filter without
-polluting the global namespace. This also gives the developer more flexibility
-at the cost of a small overhead.
-
-Overriding default Filters
-..........................
-
-If some default core filters do not suit your needs, you can easily override
-them by creating your own extension. Just use the same names as the one you
-want to override::
-
- class MyCoreExtension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- 'date' => new Twig_Filter_Method($this, 'dateFilter'),
- // ...
- );
- }
-
- public function dateFilter($timestamp, $format = 'F j, Y H:i')
- {
- return '...'.twig_date_format_filter($timestamp, $format);
- }
-
- public function getName()
- {
- return 'project';
- }
- }
-
-Here, we override the ``date`` filter with a custom one. Using this extension
-is as simple as registering the ``MyCoreExtension`` extension by calling the
-``addExtension()`` method on the environment instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addExtension(new MyCoreExtension());
-
-Tags
-~~~~
-
-Adding a tag in an extension can be done by overriding the
-``getTokenParsers()`` method. This method must return an array of tags to add
-to the Twig environment::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getTokenParsers()
- {
- return array(new Project_Set_TokenParser());
- }
-
- // ...
- }
-
-In the above code, we have added a single new tag, defined by the
-``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is
-responsible for parsing the tag and compiling it to PHP.
-
-Operators
-~~~~~~~~~
-
-The ``getOperators()`` methods allows to add new operators. Here is how to add
-``!``, ``||``, and ``&&`` operators::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getOperators()
- {
- return array(
- array(
- '!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),
- ),
- array(
- '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- ),
- );
- }
-
- // ...
- }
-
-Tests
-~~~~~
-
-The ``getTests()`` methods allows to add new test functions::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getTests()
- {
- return array(
- 'even' => new Twig_Test_Function('twig_test_even'),
- );
- }
-
- // ...
- }
-
-Testing an Extension
---------------------
-
-.. versionadded:: 1.10
- Support for functional tests was added in Twig 1.10.
-
-Functional Tests
-~~~~~~~~~~~~~~~~
-
-You can create functional tests for extensions simply by creating the
-following file structure in your test directory::
-
- Fixtures/
- filters/
- foo.test
- bar.test
- functions/
- foo.test
- bar.test
- tags/
- foo.test
- bar.test
- IntegrationTest.php
-
-The ``IntegrationTest.php`` file should look like this::
-
- class Project_Tests_IntegrationTest extends Twig_Test_IntegrationTestCase
- {
- public function getExtensions()
- {
- return array(
- new Project_Twig_Extension1(),
- new Project_Twig_Extension2(),
- );
- }
-
- public function getFixturesDir()
- {
- return dirname(__FILE__).'/Fixtures/';
- }
- }
-
-Fixtures examples can be found within the Twig repository
-`tests/Twig/Fixtures`_ directory.
-
-Node Tests
-~~~~~~~~~~
-
-Testing the node visitors can be complex, so extend your test cases from
-``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
-`tests/Twig/Node`_ directory.
-
-.. _`spl_autoload_register()`: http://www.php.net/spl_autoload_register
-.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
-.. _`tests/Twig/Fixtures`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Fixtures
-.. _`tests/Twig/Node`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Node
diff --git a/core/vendor/twig/twig/doc/api.rst b/core/vendor/twig/twig/doc/api.rst
deleted file mode 100644
index b00d61e..0000000
--- a/core/vendor/twig/twig/doc/api.rst
+++ /dev/null
@@ -1,529 +0,0 @@
-Twig for Developers
-===================
-
-This chapter describes the API to Twig and not the template language. It will
-be most useful as reference to those implementing the template interface to
-the application and not those who are creating Twig templates.
-
-Basics
-------
-
-Twig uses a central object called the **environment** (of class
-``Twig_Environment``). Instances of this class are used to store the
-configuration and extensions, and are used to load templates from the file
-system or other locations.
-
-Most applications will create one ``Twig_Environment`` object on application
-initialization and use that to load templates. In some cases it's however
-useful to have multiple environments side by side, if different configurations
-are in use.
-
-The simplest way to configure Twig to load templates for your application
-looks roughly like this::
-
- require_once '/path/to/lib/Twig/Autoloader.php';
- Twig_Autoloader::register();
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
- $twig = new Twig_Environment($loader, array(
- 'cache' => '/path/to/compilation_cache',
- ));
-
-This will create a template environment with the default settings and a loader
-that looks up the templates in the ``/path/to/templates/`` folder. Different
-loaders are available and you can also write your own if you want to load
-templates from a database or other resources.
-
-.. note::
-
- Notice that the second argument of the environment is an array of options.
- The ``cache`` option is a compilation cache directory, where Twig caches
- the compiled templates to avoid the parsing phase for sub-sequent
- requests. It is very different from the cache you might want to add for
- the evaluated templates. For such a need, you can use any available PHP
- cache library.
-
-To load a template from this environment you just have to call the
-``loadTemplate()`` method which then returns a ``Twig_Template`` instance::
-
- $template = $twig->loadTemplate('index.html');
-
-To render the template with some variables, call the ``render()`` method::
-
- echo $template->render(array('the' => 'variables', 'go' => 'here'));
-
-.. note::
-
- The ``display()`` method is a shortcut to output the template directly.
-
-You can also load and render the template in one fell swoop::
-
- echo $twig->render('index.html', array('the' => 'variables', 'go' => 'here'));
-
-.. _environment_options:
-
-Environment Options
--------------------
-
-When creating a new ``Twig_Environment`` instance, you can pass an array of
-options as the constructor second argument::
-
- $twig = new Twig_Environment($loader, array('debug' => true));
-
-The following options are available:
-
-* ``debug``: When set to ``true``, the generated templates have a
- ``__toString()`` method that you can use to display the generated nodes
- (default to ``false``).
-
-* ``charset``: The charset used by the templates (default to ``utf-8``).
-
-* ``base_template_class``: The base template class to use for generated
- templates (default to ``Twig_Template``).
-
-* ``cache``: An absolute path where to store the compiled templates, or
- ``false`` to disable caching (which is the default).
-
-* ``auto_reload``: When developing with Twig, it's useful to recompile the
- template whenever the source code changes. If you don't provide a value for
- the ``auto_reload`` option, it will be determined automatically based on the
- ``debug`` value.
-
-* ``strict_variables``: If set to ``false``, Twig will silently ignore invalid
- variables (variables and or attributes/methods that do not exist) and
- replace them with a ``null`` value. When set to ``true``, Twig throws an
- exception instead (default to ``false``).
-
-* ``autoescape``: If set to ``true``, auto-escaping will be enabled by default
- for all templates (default to ``true``). As of Twig 1.8, you can set the
- escaping strategy to use (``html``, ``js``, ``false`` to disable).
- As of Twig 1.9, you can set the escaping strategy to use (``css``, ``url``,
- ``html_attr``, or a PHP callback that takes the template "filename" and must
- return the escaping strategy to use -- the callback cannot be a function name
- to avoid collision with built-in escaping strategies).
-
-* ``optimizations``: A flag that indicates which optimizations to apply
- (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to
- disable).
-
-Loaders
--------
-
-Loaders are responsible for loading templates from a resource such as the file
-system.
-
-Compilation Cache
-~~~~~~~~~~~~~~~~~
-
-All template loaders can cache the compiled templates on the filesystem for
-future reuse. It speeds up Twig a lot as templates are only compiled once; and
-the performance boost is even larger if you use a PHP accelerator such as APC.
-See the ``cache`` and ``auto_reload`` options of ``Twig_Environment`` above
-for more information.
-
-Built-in Loaders
-~~~~~~~~~~~~~~~~
-
-Here is a list of the built-in loaders Twig provides:
-
-``Twig_Loader_Filesystem``
-..........................
-
-.. versionadded:: 1.10
- The ``prependPath()`` and support for namespaces were added in Twig 1.10.
-
-``Twig_Loader_Filesystem`` loads templates from the file system. This loader
-can find templates in folders on the file system and is the preferred way to
-load them::
-
- $loader = new Twig_Loader_Filesystem($templateDir);
-
-It can also look for templates in an array of directories::
-
- $loader = new Twig_Loader_Filesystem(array($templateDir1, $templateDir2));
-
-With such a configuration, Twig will first look for templates in
-``$templateDir1`` and if they do not exist, it will fallback to look for them
-in the ``$templateDir2``.
-
-You can add or prepend paths via the ``addPath()`` and ``prependPath()``
-methods::
-
- $loader->addPath($templateDir3);
- $loader->prependPath($templateDir4);
-
-The filesystem loader also supports namespaced templates. This allows to group
-your templates under different namespaces which have their own template paths.
-
-When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods,
-specify the namespace as the second argument (when not specified, these
-methods act on the "main" namespace)::
-
- $loader->addPath($templateDir, 'admin');
-
-Namespaced templates can be accessed via the special
-``@namespace_name/template_path`` notation::
-
- $twig->render('@admin/index.html', array());
-
-``Twig_Loader_String``
-......................
-
-``Twig_Loader_String`` loads templates from strings. It's a dummy loader as
-the template reference is the template source code::
-
- $loader = new Twig_Loader_String();
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('Hello {{ name }}!', array('name' => 'Fabien'));
-
-This loader should only be used for unit testing as it has severe limitations:
-several tags, like ``extends`` or ``include`` do not make sense to use as the
-reference to the template is the template source code itself.
-
-``Twig_Loader_Array``
-.....................
-
-``Twig_Loader_Array`` loads a template from a PHP array. It's passed an array
-of strings bound to template names::
-
- $loader = new Twig_Loader_Array(array(
- 'index.html' => 'Hello {{ name }}!',
- ));
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('index.html', array('name' => 'Fabien'));
-
-This loader is very useful for unit testing. It can also be used for small
-projects where storing all templates in a single PHP file might make sense.
-
-.. tip::
-
- When using the ``Array`` or ``String`` loaders with a cache mechanism, you
- should know that a new cache key is generated each time a template content
- "changes" (the cache key being the source code of the template). If you
- don't want to see your cache grows out of control, you need to take care
- of clearing the old cache file by yourself.
-
-``Twig_Loader_Chain``
-.....................
-
-``Twig_Loader_Chain`` delegates the loading of templates to other loaders::
-
- $loader1 = new Twig_Loader_Array(array(
- 'base.html' => '{% block content %}{% endblock %}',
- ));
- $loader2 = new Twig_Loader_Array(array(
- 'index.html' => '{% extends "base.twig" %}{% block content %}Hello {{ name }}{% endblock %}',
- 'base.html' => 'Will never be loaded',
- ));
-
- $loader = new Twig_Loader_Chain(array($loader1, $loader2));
-
- $twig = new Twig_Environment($loader);
-
-When looking for a template, Twig will try each loader in turn and it will
-return as soon as the template is found. When rendering the ``index.html``
-template from the above example, Twig will load it with ``$loader2`` but the
-``base.html`` template will be loaded from ``$loader1``.
-
-``Twig_Loader_Chain`` accepts any loader that implements
-``Twig_LoaderInterface``.
-
-.. note::
-
- You can also add loaders via the ``addLoader()`` method.
-
-Create your own Loader
-~~~~~~~~~~~~~~~~~~~~~~
-
-All loaders implement the ``Twig_LoaderInterface``::
-
- interface Twig_LoaderInterface
- {
- /**
- * Gets the source code of a template, given its name.
- *
- * @param string $name string The name of the template to load
- *
- * @return string The template source code
- */
- function getSource($name);
-
- /**
- * Gets the cache key to use for the cache for a given template name.
- *
- * @param string $name string The name of the template to load
- *
- * @return string The cache key
- */
- function getCacheKey($name);
-
- /**
- * Returns true if the template is still fresh.
- *
- * @param string $name The template name
- * @param timestamp $time The last modification time of the cached template
- */
- function isFresh($name, $time);
- }
-
-As an example, here is how the built-in ``Twig_Loader_String`` reads::
-
- class Twig_Loader_String implements Twig_LoaderInterface
- {
- public function getSource($name)
- {
- return $name;
- }
-
- public function getCacheKey($name)
- {
- return $name;
- }
-
- public function isFresh($name, $time)
- {
- return false;
- }
- }
-
-The ``isFresh()`` method must return ``true`` if the current cached template
-is still fresh, given the last modification time, or ``false`` otherwise.
-
-.. tip::
-
- As of Twig 1.11.0, you can also implement ``Twig_ExistsLoaderInterface``
- to make your loader faster when used with the chain loader.
-
-Using Extensions
-----------------
-
-Twig extensions are packages that add new features to Twig. Using an
-extension is as simple as using the ``addExtension()`` method::
-
- $twig->addExtension(new Twig_Extension_Sandbox());
-
-Twig comes bundled with the following extensions:
-
-* *Twig_Extension_Core*: Defines all the core features of Twig.
-
-* *Twig_Extension_Escaper*: Adds automatic output-escaping and the possibility
- to escape/unescape blocks of code.
-
-* *Twig_Extension_Sandbox*: Adds a sandbox mode to the default Twig
- environment, making it safe to evaluate untrusted code.
-
-* *Twig_Extension_Optimizer*: Optimizes the node tree before compilation.
-
-The core, escaper, and optimizer extensions do not need to be added to the
-Twig environment, as they are registered by default.
-
-Built-in Extensions
--------------------
-
-This section describes the features added by the built-in extensions.
-
-.. tip::
-
- Read the chapter about extending Twig to learn how to create your own
- extensions.
-
-Core Extension
-~~~~~~~~~~~~~~
-
-The ``core`` extension defines all the core features of Twig:
-
-* :doc:`Tags `;
-* :doc:`Filters `;
-* :doc:`Functions `;
-* :doc:`Tests `.
-
-Escaper Extension
-~~~~~~~~~~~~~~~~~
-
-The ``escaper`` extension adds automatic output escaping to Twig. It defines a
-tag, ``autoescape``, and a filter, ``raw``.
-
-When creating the escaper extension, you can switch on or off the global
-output escaping strategy::
-
- $escaper = new Twig_Extension_Escaper('html');
- $twig->addExtension($escaper);
-
-If set to ``html``, all variables in templates are escaped (using the ``html``
-escaping strategy), except those using the ``raw`` filter:
-
-.. code-block:: jinja
-
- {{ article.to_html|raw }}
-
-You can also change the escaping mode locally by using the ``autoescape`` tag
-(see the :doc:`autoescape` doc for the syntax used before
-Twig 1.8):
-
-.. code-block:: jinja
-
- {% autoescape 'html' %}
- {{ var }}
- {{ var|raw }} {# var won't be escaped #}
- {{ var|escape }} {# var won't be double-escaped #}
- {% endautoescape %}
-
-.. warning::
-
- The ``autoescape`` tag has no effect on included files.
-
-The escaping rules are implemented as follows:
-
-* Literals (integers, booleans, arrays, ...) used in the template directly as
- variables or filter arguments are never automatically escaped:
-
- .. code-block:: jinja
-
- {{ "Twig " }} {# won't be escaped #}
-
- {% set text = "Twig " %}
- {{ text }} {# will be escaped #}
-
-* Expressions which the result is always a literal or a variable marked safe
- are never automatically escaped:
-
- .. code-block:: jinja
-
- {{ foo ? "Twig " : " Twig" }} {# won't be escaped #}
-
- {% set text = "Twig " %}
- {{ foo ? text : " Twig" }} {# will be escaped #}
-
- {% set text = "Twig " %}
- {{ foo ? text|raw : " Twig" }} {# won't be escaped #}
-
- {% set text = "Twig " %}
- {{ foo ? text|escape : " Twig" }} {# the result of the expression won't be escaped #}
-
-* Escaping is applied before printing, after any other filter is applied:
-
- .. code-block:: jinja
-
- {{ var|upper }} {# is equivalent to {{ var|upper|escape }} #}
-
-* The `raw` filter should only be used at the end of the filter chain:
-
- .. code-block:: jinja
-
- {{ var|raw|upper }} {# will be escaped #}
-
- {{ var|upper|raw }} {# won't be escaped #}
-
-* Automatic escaping is not applied if the last filter in the chain is marked
- safe for the current context (e.g. ``html`` or ``js``). ``escape`` and
- ``escape('html')`` are marked safe for HTML, ``escape('js')`` is marked
- safe for JavaScript, ``raw`` is marked safe for everything.
-
- .. code-block:: jinja
-
- {% autoescape 'js' %}
- {{ var|escape('html') }} {# will be escaped for HTML and JavaScript #}
- {{ var }} {# will be escaped for JavaScript #}
- {{ var|escape('js') }} {# won't be double-escaped #}
- {% endautoescape %}
-
-.. note::
-
- Note that autoescaping has some limitations as escaping is applied on
- expressions after evaluation. For instance, when working with
- concatenation, ``{{ foo|raw ~ bar }}`` won't give the expected result as
- escaping is applied on the result of the concatenation, not on the
- individual variables (so, the ``raw`` filter won't have any effect here).
-
-Sandbox Extension
-~~~~~~~~~~~~~~~~~
-
-The ``sandbox`` extension can be used to evaluate untrusted code. Access to
-unsafe attributes and methods is prohibited. The sandbox security is managed
-by a policy instance. By default, Twig comes with one policy class:
-``Twig_Sandbox_SecurityPolicy``. This class allows you to white-list some
-tags, filters, properties, and methods::
-
- $tags = array('if');
- $filters = array('upper');
- $methods = array(
- 'Article' => array('getTitle', 'getBody'),
- );
- $properties = array(
- 'Article' => array('title', 'body'),
- );
- $functions = array('range');
- $policy = new Twig_Sandbox_SecurityPolicy($tags, $filters, $methods, $properties, $functions);
-
-With the previous configuration, the security policy will only allow usage of
-the ``if`` tag, and the ``upper`` filter. Moreover, the templates will only be
-able to call the ``getTitle()`` and ``getBody()`` methods on ``Article``
-objects, and the ``title`` and ``body`` public properties. Everything else
-won't be allowed and will generate a ``Twig_Sandbox_SecurityError`` exception.
-
-The policy object is the first argument of the sandbox constructor::
-
- $sandbox = new Twig_Extension_Sandbox($policy);
- $twig->addExtension($sandbox);
-
-By default, the sandbox mode is disabled and should be enabled when including
-untrusted template code by using the ``sandbox`` tag:
-
-.. code-block:: jinja
-
- {% sandbox %}
- {% include 'user.html' %}
- {% endsandbox %}
-
-You can sandbox all templates by passing ``true`` as the second argument of
-the extension constructor::
-
- $sandbox = new Twig_Extension_Sandbox($policy, true);
-
-Optimizer Extension
-~~~~~~~~~~~~~~~~~~~
-
-The ``optimizer`` extension optimizes the node tree before compilation::
-
- $twig->addExtension(new Twig_Extension_Optimizer());
-
-By default, all optimizations are turned on. You can select the ones you want
-to enable by passing them to the constructor::
-
- $optimizer = new Twig_Extension_Optimizer(Twig_NodeVisitor_Optimizer::OPTIMIZE_FOR);
-
- $twig->addExtension($optimizer);
-
-Twig supports the following optimizations:
-
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_ALL``, enables all optimizations
- (this is the default value).
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_NONE``, disables all optimizations.
- This reduces the compilation time, but it can increase the execution time
- and the consumed memory.
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_FOR``, optimizes the ``for`` tag by
- removing the ``loop`` variable creation whenever possible.
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_RAW_FILTER``, removes the ``raw``
- filter whenever possible.
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_VAR_ACCESS``, simplifies the creation
- and access of variables in the compiled templates whenever possible.
-
-Exceptions
-----------
-
-Twig can throw exceptions:
-
-* ``Twig_Error``: The base exception for all errors.
-
-* ``Twig_Error_Syntax``: Thrown to tell the user that there is a problem with
- the template syntax.
-
-* ``Twig_Error_Runtime``: Thrown when an error occurs at runtime (when a filter
- does not exist for instance).
-
-* ``Twig_Error_Loader``: Thrown when an error occurs during template loading.
-
-* ``Twig_Sandbox_SecurityError``: Thrown when an unallowed tag, filter, or
- method is called in a sandboxed template.
diff --git a/core/vendor/twig/twig/doc/coding_standards.rst b/core/vendor/twig/twig/doc/coding_standards.rst
deleted file mode 100644
index f435df4..0000000
--- a/core/vendor/twig/twig/doc/coding_standards.rst
+++ /dev/null
@@ -1,101 +0,0 @@
-Coding Standards
-================
-
-When writing Twig templates, we recommend you to follow these official coding
-standards:
-
-* Put one (and only one) space after the start of a delimiter (``{{``, ``{%``,
- and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``):
-
- .. code-block:: jinja
-
- {{ foo }}
- {# comment #}
- {% if foo %}{% endif %}
-
- When using the whitespace control character, do not put any spaces between
- it and the delimiter:
-
- .. code-block:: jinja
-
- {{- foo -}}
- {#- comment -#}
- {%- if foo -%}{%- endif -%}
-
-* Put one (and only one) space before and after the following operators:
- comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math
- operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic
- operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary
- operator (``?:``):
-
- .. code-block:: jinja
-
- {{ 1 + 2 }}
- {{ foo ~ bar }}
- {{ true ? true : false }}
-
-* Put one (and only one) space after the ``:`` sign in hashes and ``,`` in
- arrays and hashes:
-
- .. code-block:: jinja
-
- {{ [1, 2, 3] }}
- {{ {'foo': 'bar'} }}
-
-* Do not put any spaces after an opening parenthesis and before a closing
- parenthesis in expressions:
-
- .. code-block:: jinja
-
- {{ 1 + (2 * 3) }}
-
-* Do not put any spaces before and after string delimiters:
-
- .. code-block:: jinja
-
- {{ 'foo' }}
- {{ "foo" }}
-
-* Do not put any spaces before and after the following operators: ``|``,
- ``.``, ``..``, ``[]``:
-
- .. code-block:: jinja
-
- {{ foo|upper|lower }}
- {{ user.name }}
- {{ user[name] }}
- {% for i in 1..12 %}{% endfor %}
-
-* Do not put any spaces before and after the parenthesis used for filter and
- function calls:
-
- .. code-block:: jinja
-
- {{ foo|default('foo') }}
- {{ range(1..10) }}
-
-* Do not put any spaces before and after the opening and the closing of arrays
- and hashes:
-
- .. code-block:: jinja
-
- {{ [1, 2, 3] }}
- {{ {'foo': 'bar'} }}
-
-* Use lower cased and underscored variable names:
-
- .. code-block:: jinja
-
- {% set foo = 'foo' %}
- {% set foo_bar = 'foo' %}
-
-* Indent your code inside tags (use the same indentation as the one used for
- the target language of the rendered template):
-
- .. code-block:: jinja
-
- {% block foo %}
- {% if true %}
- true
- {% endif %}
- {% endblock %}
diff --git a/core/vendor/twig/twig/doc/deprecated.rst b/core/vendor/twig/twig/doc/deprecated.rst
deleted file mode 100644
index 61917a8..0000000
--- a/core/vendor/twig/twig/doc/deprecated.rst
+++ /dev/null
@@ -1,103 +0,0 @@
-Deprecated Features
-===================
-
-This document lists all deprecated features in Twig. Deprecated features are
-kept for backward compatibility and removed in the next major release (a
-feature that was deprecated in Twig 1.x is removed in Twig 2.0).
-
-Token Parsers
--------------
-
-* As of Twig 1.x, the token parser broker sub-system is deprecated. The
- following class and interface will be removed in 2.0:
-
- * ``Twig_TokenParserBrokerInterface``
- * ``Twig_TokenParserBroker``
-
-Extensions
-----------
-
-* As of Twig 1.x, the ability to remove an extension is deprecated and the
- ``Twig_Environment::removeExtension()`` method will be removed in 2.0.
-
-PEAR
-----
-
-PEAR support will be discontinued in Twig 2.0, and no PEAR packages will be
-provided. Use Composer instead.
-
-Filters
--------
-
-* As of Twig 1.x, use ``Twig_SimpleFilter`` to add a filter. The following
- classes and interfaces will be removed in 2.0:
-
- * ``Twig_FilterInterface``
- * ``Twig_FilterCallableInterface``
- * ``Twig_Filter``
- * ``Twig_Filter_Function``
- * ``Twig_Filter_Method``
- * ``Twig_Filter_Node``
-
-* As of Twig 2.x, the ``Twig_SimpleFilter`` class is deprecated and will be
- removed in Twig 3.x (use ``Twig_Filter`` instead). In Twig 2.x,
- ``Twig_SimpleFilter`` is just an alias for ``Twig_Filter``.
-
-Functions
----------
-
-* As of Twig 1.x, use ``Twig_SimpleFunction`` to add a function. The following
- classes and interfaces will be removed in 2.0:
-
- * ``Twig_FunctionInterface``
- * ``Twig_FunctionCallableInterface``
- * ``Twig_Function``
- * ``Twig_Function_Function``
- * ``Twig_Function_Method``
- * ``Twig_Function_Node``
-
-* As of Twig 2.x, the ``Twig_SimpleFunction`` class is deprecated and will be
- removed in Twig 3.x (use ``Twig_Function`` instead). In Twig 2.x,
- ``Twig_SimpleFunction`` is just an alias for ``Twig_Function``.
-
-Tests
------
-
-* As of Twig 1.x, use ``Twig_SimpleTest`` to add a test. The following classes
- and interfaces will be removed in 2.0:
-
- * ``Twig_TestInterface``
- * ``Twig_TestCallableInterface``
- * ``Twig_Test``
- * ``Twig_Test_Function``
- * ``Twig_Test_Method``
- * ``Twig_Test_Node``
-
-* As of Twig 2.x, the ``Twig_SimpleTest`` class is deprecated and will be
- removed in Twig 3.x (use ``Twig_Test`` instead). In Twig 2.x,
- ``Twig_SimpleTest`` is just an alias for ``Twig_Test``.
-
-* The ``sameas`` and ``divisibleby`` tests are deprecated in favor of ``same
- as`` and ``divisible by`` respectively.
-
-Interfaces
-----------
-
-* As of Twig 2.x, the following interfaces are deprecated and empty (they will
- be removed in Twig 3.0):
-
-* ``Twig_CompilerInterface`` (use ``Twig_Compiler`` instead)
-* ``Twig_LexerInterface`` (use ``Twig_Lexer`` instead)
-* ``Twig_NodeInterface`` (use ``Twig_Node`` instead)
-* ``Twig_ParserInterface`` (use ``Twig_Parser`` instead)
-* ``Twig_ExistsLoaderInterface`` (merged with ``Twig_LoaderInterface``)
-* ``Twig_TemplateInterface`` (use ``Twig_Template`` instead, and use
- those constants Twig_Template::ANY_CALL, Twig_Template::ARRAY_CALL,
- Twig_Template::METHOD_CALL)
-
-Globals
--------
-
-* As of Twig 2.x, the ability to register a global variable after the runtime
- or the extensions have been initialized is not possible anymore (but
- changing the value of an already registered global is possible).
diff --git a/core/vendor/twig/twig/doc/filters/abs.rst b/core/vendor/twig/twig/doc/filters/abs.rst
deleted file mode 100644
index 22fa59d..0000000
--- a/core/vendor/twig/twig/doc/filters/abs.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-``abs``
-=======
-
-The ``abs`` filter returns the absolute value.
-
-.. code-block:: jinja
-
- {# number = -5 #}
-
- {{ number|abs }}
-
- {# outputs 5 #}
-
-.. note::
-
- Internally, Twig uses the PHP `abs`_ function.
-
-.. _`abs`: http://php.net/abs
diff --git a/core/vendor/twig/twig/doc/filters/batch.rst b/core/vendor/twig/twig/doc/filters/batch.rst
deleted file mode 100644
index b0b9964..0000000
--- a/core/vendor/twig/twig/doc/filters/batch.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-``batch``
-=========
-
-.. versionadded:: 1.12.3
- The batch filter was added in Twig 1.12.3.
-
-The ``batch`` filter "batches" items by returning a list of lists with the
-given number of items. If you provide a second parameter, it is used to fill
-missing items:
-
-.. code-block:: jinja
-
- {% set items = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] %}
-
-
- {% for row in items|batch(3, 'No item') %}
-
- {% for column in row %}
-
{{ column }}
- {% endfor %}
-
- {% endfor %}
-
-
-The above example will be rendered as:
-
-.. code-block:: jinja
-
-
-
-
a
-
b
-
c
-
-
-
d
-
e
-
f
-
-
-
g
-
No item
-
No item
-
-
diff --git a/core/vendor/twig/twig/doc/filters/capitalize.rst b/core/vendor/twig/twig/doc/filters/capitalize.rst
deleted file mode 100644
index 10546a1..0000000
--- a/core/vendor/twig/twig/doc/filters/capitalize.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``capitalize``
-==============
-
-The ``capitalize`` filter capitalizes a value. The first character will be
-uppercase, all others lowercase:
-
-.. code-block:: jinja
-
- {{ 'my first car'|capitalize }}
-
- {# outputs 'My first car' #}
diff --git a/core/vendor/twig/twig/doc/filters/convert_encoding.rst b/core/vendor/twig/twig/doc/filters/convert_encoding.rst
deleted file mode 100644
index c417e12..0000000
--- a/core/vendor/twig/twig/doc/filters/convert_encoding.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-``convert_encoding``
-====================
-
-.. versionadded:: 1.4
- The ``convert_encoding`` filter was added in Twig 1.4.
-
-The ``convert_encoding`` filter converts a string from one encoding to
-another. The first argument is the expected output charset and the second one
-is the input charset:
-
-.. code-block:: jinja
-
- {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }}
-
-.. note::
-
- This filter relies on the `iconv`_ or `mbstring`_ extension, so one of
- them must be installed. In case both are installed, `mbstring`_ is used by
- default (Twig before 1.8.1 uses `iconv`_ by default).
-
-Arguments
----------
-
-* ``from``: The input charset
-* ``to``: The output charset
-
-.. _`iconv`: http://php.net/iconv
-.. _`mbstring`: http://php.net/mbstring
diff --git a/core/vendor/twig/twig/doc/filters/date.rst b/core/vendor/twig/twig/doc/filters/date.rst
deleted file mode 100644
index c86d42b..0000000
--- a/core/vendor/twig/twig/doc/filters/date.rst
+++ /dev/null
@@ -1,94 +0,0 @@
-``date``
-========
-
-.. versionadded:: 1.1
- The timezone support has been added in Twig 1.1.
-
-.. versionadded:: 1.5
- The default date format support has been added in Twig 1.5.
-
-.. versionadded:: 1.6.1
- The default timezone support has been added in Twig 1.6.1.
-
-.. versionadded:: 1.11.0
- The introduction of the false value for the timezone was introduced in Twig 1.11.0
-
-The ``date`` filter formats a date to a given format:
-
-.. code-block:: jinja
-
- {{ post.published_at|date("m/d/Y") }}
-
-The format specifier is the same as supported by `date`_,
-except when the filtered data is of type `DateInterval`_, when the format must conform to
-`DateInterval::format`_ instead.
-
-The ``date`` filter accepts strings (it must be in a format supported by the
-`strtotime`_ function), `DateTime`_ instances, or `DateInterval`_ instances. For
-instance, to display the current date, filter the word "now":
-
-.. code-block:: jinja
-
- {{ "now"|date("m/d/Y") }}
-
-To escape words and characters in the date format use ``\\`` in front of each
-character:
-
-.. code-block:: jinja
-
- {{ post.published_at|date("F jS \\a\\t g:ia") }}
-
-If the value passed to the ``date`` filter is ``null``, it will return the
-current date by default. If an empty string is desired instead of the current
-date, use a ternary operator:
-
-.. code-block:: jinja
-
- {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }}
-
-If no format is provided, Twig will use the default one: ``F j, Y H:i``. This
-default can be easily changed by calling the ``setDateFormat()`` method on the
-``core`` extension instance. The first argument is the default format for
-dates and the second one is the default format for date intervals:
-
-.. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setDateFormat('d/m/Y', '%d days');
-
-Timezone
---------
-
-By default, the date is displayed by applying the default timezone (the one
-specified in php.ini or declared in Twig -- see below), but you can override
-it by explicitly specifying a timezone:
-
-.. code-block:: jinja
-
- {{ post.published_at|date("m/d/Y", "Europe/Paris") }}
-
-If the date is already a DateTime object, and if you want to keep its current
-timezone, pass ``false`` as the timezone value:
-
-.. code-block:: jinja
-
- {{ post.published_at|date("m/d/Y", false) }}
-
-The default timezone can also be set globally by calling ``setTimezone()``:
-
-.. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setTimezone('Europe/Paris');
-
-Arguments
----------
-
-* ``format``: The date format
-* ``timezone``: The date timezone
-
-.. _`strtotime`: http://www.php.net/strtotime
-.. _`DateTime`: http://www.php.net/DateTime
-.. _`DateInterval`: http://www.php.net/DateInterval
-.. _`date`: http://www.php.net/date
-.. _`DateInterval::format`: http://www.php.net/DateInterval.format
diff --git a/core/vendor/twig/twig/doc/filters/date_modify.rst b/core/vendor/twig/twig/doc/filters/date_modify.rst
deleted file mode 100644
index add40b5..0000000
--- a/core/vendor/twig/twig/doc/filters/date_modify.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-``date_modify``
-===============
-
-.. versionadded:: 1.9.0
- The date_modify filter has been added in Twig 1.9.0.
-
-The ``date_modify`` filter modifies a date with a given modifier string:
-
-.. code-block:: jinja
-
- {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }}
-
-The ``date_modify`` filter accepts strings (it must be in a format supported
-by the `strtotime`_ function) or `DateTime`_ instances. You can easily combine
-it with the :doc:`date` filter for formatting.
-
-Arguments
----------
-
-* ``modifier``: The modifier
-
-.. _`strtotime`: http://www.php.net/strtotime
-.. _`DateTime`: http://www.php.net/DateTime
diff --git a/core/vendor/twig/twig/doc/filters/default.rst b/core/vendor/twig/twig/doc/filters/default.rst
deleted file mode 100644
index 641ac6e..0000000
--- a/core/vendor/twig/twig/doc/filters/default.rst
+++ /dev/null
@@ -1,33 +0,0 @@
-``default``
-===========
-
-The ``default`` filter returns the passed default value if the value is
-undefined or empty, otherwise the value of the variable:
-
-.. code-block:: jinja
-
- {{ var|default('var is not defined') }}
-
- {{ var.foo|default('foo item on var is not defined') }}
-
- {{ var['foo']|default('foo item on var is not defined') }}
-
- {{ ''|default('passed var is empty') }}
-
-When using the ``default`` filter on an expression that uses variables in some
-method calls, be sure to use the ``default`` filter whenever a variable can be
-undefined:
-
-.. code-block:: jinja
-
- {{ var.method(foo|default('foo'))|default('foo') }}
-
-.. note::
-
- Read the documentation for the :doc:`defined<../tests/defined>` and
- :doc:`empty<../tests/empty>` tests to learn more about their semantics.
-
-Arguments
----------
-
-* ``default``: The default value
diff --git a/core/vendor/twig/twig/doc/filters/escape.rst b/core/vendor/twig/twig/doc/filters/escape.rst
deleted file mode 100644
index fc9771a..0000000
--- a/core/vendor/twig/twig/doc/filters/escape.rst
+++ /dev/null
@@ -1,116 +0,0 @@
-``escape``
-==========
-
-.. versionadded:: 1.9.0
- The ``css``, ``url``, and ``html_attr`` strategies were added in Twig
- 1.9.0.
-
-.. versionadded:: 1.14.0
- The ability to define custom escapers was added in Twig 1.14.0.
-
-The ``escape`` filter escapes a string for safe insertion into the final
-output. It supports different escaping strategies depending on the template
-context.
-
-By default, it uses the HTML escaping strategy:
-
-.. code-block:: jinja
-
- {{ user.username|escape }}
-
-For convenience, the ``e`` filter is defined as an alias:
-
-.. code-block:: jinja
-
- {{ user.username|e }}
-
-The ``escape`` filter can also be used in other contexts than HTML thanks to
-an optional argument which defines the escaping strategy to use:
-
-.. code-block:: jinja
-
- {{ user.username|e }}
- {# is equivalent to #}
- {{ user.username|e('html') }}
-
-And here is how to escape variables included in JavaScript code:
-
-.. code-block:: jinja
-
- {{ user.username|escape('js') }}
- {{ user.username|e('js') }}
-
-The ``escape`` filter supports the following escaping strategies:
-
-* ``html``: escapes a string for the **HTML body** context.
-
-* ``js``: escapes a string for the **JavaScript context**.
-
-* ``css``: escapes a string for the **CSS context**. CSS escaping can be
- applied to any string being inserted into CSS and escapes everything except
- alphanumerics.
-
-* ``url``: escapes a string for the **URI or parameter contexts**. This should
- not be used to escape an entire URI; only a subcomponent being inserted.
-
-* ``html_attr``: escapes a string for the **HTML attribute** context.
-
-.. note::
-
- Internally, ``escape`` uses the PHP native `htmlspecialchars`_ function
- for the HTML escaping strategy.
-
-.. caution::
-
- When using automatic escaping, Twig tries to not double-escape a variable
- when the automatic escaping strategy is the same as the one applied by the
- escape filter; but that does not work when using a variable as the
- escaping strategy:
-
- .. code-block:: jinja
-
- {% set strategy = 'html' %}
-
- {% autoescape 'html' %}
- {{ var|escape('html') }} {# won't be double-escaped #}
- {{ var|escape(strategy) }} {# will be double-escaped #}
- {% endautoescape %}
-
- When using a variable as the escaping strategy, you should disable
- automatic escaping:
-
- .. code-block:: jinja
-
- {% set strategy = 'html' %}
-
- {% autoescape 'html' %}
- {{ var|escape(strategy)|raw }} {# won't be double-escaped #}
- {% endautoescape %}
-
-Custom Escapers
----------------
-
-You can define custom escapers by calling the ``setEscaper()`` method on the
-``core`` extension instance. The first argument is the escaper name (to be
-used in the ``escape`` call) and the second one must be a valid PHP callable:
-
-.. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setEscaper('csv', 'csv_escaper'));
-
-When called by Twig, the callable receives the Twig environment instance, the
-string to escape, and the charset.
-
-.. note::
-
- Built-in escapers cannot be overridden mainly they should be considered as
- the final implementation and also for better performance.
-
-Arguments
----------
-
-* ``strategy``: The escaping strategy
-* ``charset``: The string charset
-
-.. _`htmlspecialchars`: http://php.net/htmlspecialchars
diff --git a/core/vendor/twig/twig/doc/filters/first.rst b/core/vendor/twig/twig/doc/filters/first.rst
deleted file mode 100644
index 4295e83..0000000
--- a/core/vendor/twig/twig/doc/filters/first.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-``first``
-=========
-
-.. versionadded:: 1.12.2
- The first filter was added in Twig 1.12.2.
-
-The ``first`` filter returns the first "element" of a sequence, a mapping, or
-a string:
-
-.. code-block:: jinja
-
- {{ [1, 2, 3, 4]|first }}
- {# outputs 1 #}
-
- {{ { a: 1, b: 2, c: 3, d: 4 }|first }}
- {# outputs 1 #}
-
- {{ '1234'|first }}
- {# outputs 1 #}
-
-.. note::
-
- It also works with objects implementing the `Traversable`_ interface.
-
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
diff --git a/core/vendor/twig/twig/doc/filters/format.rst b/core/vendor/twig/twig/doc/filters/format.rst
deleted file mode 100644
index f8effd9..0000000
--- a/core/vendor/twig/twig/doc/filters/format.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-``format``
-==========
-
-The ``format`` filter formats a given string by replacing the placeholders
-(placeholders follows the `sprintf`_ notation):
-
-.. code-block:: jinja
-
- {{ "I like %s and %s."|format(foo, "bar") }}
-
- {# outputs I like foo and bar
- if the foo parameter equals to the foo string. #}
-
-.. _`sprintf`: http://www.php.net/sprintf
-
-.. seealso:: :doc:`replace`
diff --git a/core/vendor/twig/twig/doc/filters/index.rst b/core/vendor/twig/twig/doc/filters/index.rst
deleted file mode 100644
index 3ed0952..0000000
--- a/core/vendor/twig/twig/doc/filters/index.rst
+++ /dev/null
@@ -1,37 +0,0 @@
-Filters
-=======
-
-.. toctree::
- :maxdepth: 1
-
- abs
- batch
- capitalize
- convert_encoding
- date
- date_modify
- default
- escape
- first
- format
- join
- json_encode
- keys
- last
- length
- lower
- nl2br
- number_format
- merge
- upper
- raw
- replace
- reverse
- round
- slice
- sort
- split
- striptags
- title
- trim
- url_encode
diff --git a/core/vendor/twig/twig/doc/filters/join.rst b/core/vendor/twig/twig/doc/filters/join.rst
deleted file mode 100644
index 2fab945..0000000
--- a/core/vendor/twig/twig/doc/filters/join.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-``join``
-========
-
-The ``join`` filter returns a string which is the concatenation of the items
-of a sequence:
-
-.. code-block:: jinja
-
- {{ [1, 2, 3]|join }}
- {# returns 123 #}
-
-The separator between elements is an empty string per default, but you can
-define it with the optional first parameter:
-
-.. code-block:: jinja
-
- {{ [1, 2, 3]|join('|') }}
- {# outputs 1|2|3 #}
-
-Arguments
----------
-
-* ``glue``: The separator
diff --git a/core/vendor/twig/twig/doc/filters/json_encode.rst b/core/vendor/twig/twig/doc/filters/json_encode.rst
deleted file mode 100644
index 9821b11..0000000
--- a/core/vendor/twig/twig/doc/filters/json_encode.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-``json_encode``
-===============
-
-The ``json_encode`` filter returns the JSON representation of a string:
-
-.. code-block:: jinja
-
- {{ data|json_encode() }}
-
-.. note::
-
- Internally, Twig uses the PHP `json_encode`_ function.
-
-Arguments
----------
-
-* ``options``: A bitmask of `json_encode options`_ (``{{
- data|json_encode(constant('JSON_PRETTY_PRINT')) }}``)
-
-.. _`json_encode`: http://php.net/json_encode
-.. _`json_encode options`: http://www.php.net/manual/en/json.constants.php
diff --git a/core/vendor/twig/twig/doc/filters/keys.rst b/core/vendor/twig/twig/doc/filters/keys.rst
deleted file mode 100644
index e4f090c..0000000
--- a/core/vendor/twig/twig/doc/filters/keys.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``keys``
-========
-
-The ``keys`` filter returns the keys of an array. It is useful when you want to
-iterate over the keys of an array:
-
-.. code-block:: jinja
-
- {% for key in array|keys %}
- ...
- {% endfor %}
diff --git a/core/vendor/twig/twig/doc/filters/last.rst b/core/vendor/twig/twig/doc/filters/last.rst
deleted file mode 100644
index 723c0b5..0000000
--- a/core/vendor/twig/twig/doc/filters/last.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-``last``
-========
-
-.. versionadded:: 1.12.2
- The last filter was added in Twig 1.12.2.
-
-The ``last`` filter returns the last "element" of a sequence, a mapping, or
-a string:
-
-.. code-block:: jinja
-
- {{ [1, 2, 3, 4]|last }}
- {# outputs 4 #}
-
- {{ { a: 1, b: 2, c: 3, d: 4 }|last }}
- {# outputs 4 #}
-
- {{ '1234'|last }}
- {# outputs 4 #}
-
-.. note::
-
- It also works with objects implementing the `Traversable`_ interface.
-
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
diff --git a/core/vendor/twig/twig/doc/filters/length.rst b/core/vendor/twig/twig/doc/filters/length.rst
deleted file mode 100644
index 5e0f73a..0000000
--- a/core/vendor/twig/twig/doc/filters/length.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``length``
-==========
-
-The ``length`` filters returns the number of items of a sequence or mapping, or
-the length of a string:
-
-.. code-block:: jinja
-
- {% if users|length > 10 %}
- ...
- {% endif %}
diff --git a/core/vendor/twig/twig/doc/filters/lower.rst b/core/vendor/twig/twig/doc/filters/lower.rst
deleted file mode 100644
index ef9faa9..0000000
--- a/core/vendor/twig/twig/doc/filters/lower.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-``lower``
-=========
-
-The ``lower`` filter converts a value to lowercase:
-
-.. code-block:: jinja
-
- {{ 'WELCOME'|lower }}
-
- {# outputs 'welcome' #}
diff --git a/core/vendor/twig/twig/doc/filters/merge.rst b/core/vendor/twig/twig/doc/filters/merge.rst
deleted file mode 100644
index 05a2ae7..0000000
--- a/core/vendor/twig/twig/doc/filters/merge.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-``merge``
-=========
-
-The ``merge`` filter merges an array with another array:
-
-.. code-block:: jinja
-
- {% set values = [1, 2] %}
-
- {% set values = values|merge(['apple', 'orange']) %}
-
- {# values now contains [1, 2, 'apple', 'orange'] #}
-
-New values are added at the end of the existing ones.
-
-The ``merge`` filter also works on hashes:
-
-.. code-block:: jinja
-
- {% set items = { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'unknown' } %}
-
- {% set items = items|merge({ 'peugeot': 'car', 'renault': 'car' }) %}
-
- {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'renault': 'car' } #}
-
-For hashes, the merging process occurs on the keys: if the key does not
-already exist, it is added but if the key already exists, its value is
-overridden.
-
-.. tip::
-
- If you want to ensure that some values are defined in an array (by given
- default values), reverse the two elements in the call:
-
- .. code-block:: jinja
-
- {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
-
- {% set items = { 'apple': 'unknown' }|merge(items) %}
-
- {# items now contains { 'apple': 'fruit', 'orange': 'fruit' } #}
diff --git a/core/vendor/twig/twig/doc/filters/nl2br.rst b/core/vendor/twig/twig/doc/filters/nl2br.rst
deleted file mode 100644
index 694c672..0000000
--- a/core/vendor/twig/twig/doc/filters/nl2br.rst
+++ /dev/null
@@ -1,22 +0,0 @@
-``nl2br``
-=========
-
-.. versionadded:: 1.5
- The nl2br filter was added in Twig 1.5.
-
-The ``nl2br`` filter inserts HTML line breaks before all newlines in a string:
-
-.. code-block:: jinja
-
- {{ "I like Twig.\nYou will like it too."|nl2br }}
- {# outputs
-
- I like Twig.
- You will like it too.
-
- #}
-
-.. note::
-
- The ``nl2br`` filter pre-escapes the input before applying the
- transformation.
diff --git a/core/vendor/twig/twig/doc/filters/number_format.rst b/core/vendor/twig/twig/doc/filters/number_format.rst
deleted file mode 100644
index 3e60691..0000000
--- a/core/vendor/twig/twig/doc/filters/number_format.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-``number_format``
-=================
-
-.. versionadded:: 1.5
- The number_format filter was added in Twig 1.5
-
-The ``number_format`` filter formats numbers. It is a wrapper around PHP's
-`number_format`_ function:
-
-.. code-block:: jinja
-
- {{ 200.35|number_format }}
-
-You can control the number of decimal places, decimal point, and thousands
-separator using the additional arguments:
-
-.. code-block:: jinja
-
- {{ 9800.333|number_format(2, '.', ',') }}
-
-If no formatting options are provided then Twig will use the default formatting
-options of:
-
-* 0 decimal places.
-* ``.`` as the decimal point.
-* ``,`` as the thousands separator.
-
-These defaults can be easily changed through the core extension:
-
-.. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setNumberFormat(3, '.', ',');
-
-The defaults set for ``number_format`` can be over-ridden upon each call using the
-additional parameters.
-
-Arguments
----------
-
-* ``decimal``: The number of decimal points to display
-* ``decimal_point``: The character(s) to use for the decimal point
-* ``thousand_sep``: The character(s) to use for the thousands separator
-
-.. _`number_format`: http://php.net/number_format
diff --git a/core/vendor/twig/twig/doc/filters/raw.rst b/core/vendor/twig/twig/doc/filters/raw.rst
deleted file mode 100644
index a9900c7..0000000
--- a/core/vendor/twig/twig/doc/filters/raw.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-``raw``
-=======
-
-The ``raw`` filter marks the value as being "safe", which means that in an
-environment with automatic escaping enabled this variable will not be escaped
-if ``raw`` is the last filter applied to it:
-
-.. code-block:: jinja
-
- {% autoescape %}
- {{ var|raw }} {# var won't be escaped #}
- {% endautoescape %}
diff --git a/core/vendor/twig/twig/doc/filters/replace.rst b/core/vendor/twig/twig/doc/filters/replace.rst
deleted file mode 100644
index 1227957..0000000
--- a/core/vendor/twig/twig/doc/filters/replace.rst
+++ /dev/null
@@ -1,19 +0,0 @@
-``replace``
-===========
-
-The ``replace`` filter formats a given string by replacing the placeholders
-(placeholders are free-form):
-
-.. code-block:: jinja
-
- {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }}
-
- {# outputs I like foo and bar
- if the foo parameter equals to the foo string. #}
-
-Arguments
----------
-
-* ``replace_pairs``: The placeholder values
-
-.. seealso:: :doc:`format`
diff --git a/core/vendor/twig/twig/doc/filters/reverse.rst b/core/vendor/twig/twig/doc/filters/reverse.rst
deleted file mode 100644
index 76fd2c1..0000000
--- a/core/vendor/twig/twig/doc/filters/reverse.rst
+++ /dev/null
@@ -1,47 +0,0 @@
-``reverse``
-===========
-
-.. versionadded:: 1.6
- Support for strings has been added in Twig 1.6.
-
-The ``reverse`` filter reverses a sequence, a mapping, or a string:
-
-.. code-block:: jinja
-
- {% for user in users|reverse %}
- ...
- {% endfor %}
-
- {{ '1234'|reverse }}
-
- {# outputs 4321 #}
-
-.. tip::
-
- For sequences and mappings, numeric keys are not preserved. To reverse
- them as well, pass ``true`` as an argument to the ``reverse`` filter:
-
- .. code-block:: jinja
-
- {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse %}
- {{ key }}: {{ value }}
- {%- endfor %}
-
- {# output: 0: c 1: b 2: a #}
-
- {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse(true) %}
- {{ key }}: {{ value }}
- {%- endfor %}
-
- {# output: 3: c 2: b 1: a #}
-
-.. note::
-
- It also works with objects implementing the `Traversable`_ interface.
-
-Arguments
----------
-
-* ``preserve_keys``: Preserve keys when reversing a mapping or a sequence.
-
-.. _`Traversable`: http://php.net/Traversable
diff --git a/core/vendor/twig/twig/doc/filters/round.rst b/core/vendor/twig/twig/doc/filters/round.rst
deleted file mode 100644
index 2521cf1..0000000
--- a/core/vendor/twig/twig/doc/filters/round.rst
+++ /dev/null
@@ -1,37 +0,0 @@
-``round``
-=========
-
-.. versionadded:: 1.15.0
- The ``round`` filter was added in Twig 1.15.0.
-
-The ``round`` filter rounds a number to a given precision:
-
-.. code-block:: jinja
-
- {{ 42.55|round }}
- {# outputs 43 #}
-
- {{ 42.55|round(1, 'floor') }}
- {# outputs 42.5 #}
-
-The ``round`` filter takes two optional arguments; the first one specifies the
-precision (default is ``0``) and the second the rounding method (default is
-``common``):
-
-* ``common`` rounds either up or down (rounds the value up to precision decimal
- places away from zero, when it is half way there -- making 1.5 into 2 and
- -1.5 into -2);
-
-* ``ceil`` always rounds up;
-
-* ``floor`` always rounds down.
-
-.. note::
-
- The ``//`` operator is equivalent to ``|round(0, 'floor')``.
-
-Arguments
----------
-
-* ``precision``: The rounding precision
-* ``method``: The rounding method
diff --git a/core/vendor/twig/twig/doc/filters/slice.rst b/core/vendor/twig/twig/doc/filters/slice.rst
deleted file mode 100644
index c76c61c..0000000
--- a/core/vendor/twig/twig/doc/filters/slice.rst
+++ /dev/null
@@ -1,70 +0,0 @@
-``slice``
-===========
-
-.. versionadded:: 1.6
- The slice filter was added in Twig 1.6.
-
-The ``slice`` filter extracts a slice of a sequence, a mapping, or a string:
-
-.. code-block:: jinja
-
- {% for i in [1, 2, 3, 4, 5]|slice(1, 2) %}
- {# will iterate over 2 and 3 #}
- {% endfor %}
-
- {{ '12345'|slice(1, 2) }}
-
- {# outputs 23 #}
-
-You can use any valid expression for both the start and the length:
-
-.. code-block:: jinja
-
- {% for i in [1, 2, 3, 4, 5]|slice(start, length) %}
- {# ... #}
- {% endfor %}
-
-As syntactic sugar, you can also use the ``[]`` notation:
-
-.. code-block:: jinja
-
- {% for i in [1, 2, 3, 4, 5][start:length] %}
- {# ... #}
- {% endfor %}
-
- {{ '12345'[1:2] }}
-
- {# you can omit the first argument -- which is the same as 0 #}
- {{ '12345'[:2] }} {# will display "12" #}
-
- {# you can omit the last argument -- which will select everything till the end #}
- {{ '12345'[2:] }} {# will display "345" #}
-
-The ``slice`` filter works as the `array_slice`_ PHP function for arrays and
-`substr`_ for strings.
-
-If the start is non-negative, the sequence will start at that start in the
-variable. If start is negative, the sequence will start that far from the end
-of the variable.
-
-If length is given and is positive, then the sequence will have up to that
-many elements in it. If the variable is shorter than the length, then only the
-available variable elements will be present. If length is given and is
-negative then the sequence will stop that many elements from the end of the
-variable. If it is omitted, then the sequence will have everything from offset
-up until the end of the variable.
-
-.. note::
-
- It also works with objects implementing the `Traversable`_ interface.
-
-Arguments
----------
-
-* ``start``: The start of the slice
-* ``length``: The size of the slice
-* ``preserve_keys``: Whether to preserve key or not (when the input is an array)
-
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
-.. _`array_slice`: http://php.net/array_slice
-.. _`substr`: http://php.net/substr
diff --git a/core/vendor/twig/twig/doc/filters/sort.rst b/core/vendor/twig/twig/doc/filters/sort.rst
deleted file mode 100644
index 3331152..0000000
--- a/core/vendor/twig/twig/doc/filters/sort.rst
+++ /dev/null
@@ -1,17 +0,0 @@
-``sort``
-========
-
-The ``sort`` filter sorts an array:
-
-.. code-block:: jinja
-
- {% for user in users|sort %}
- ...
- {% endfor %}
-
-.. note::
-
- Internally, Twig uses the PHP `asort`_ function to maintain index
- association.
-
-.. _`asort`: http://php.net/asort
diff --git a/core/vendor/twig/twig/doc/filters/split.rst b/core/vendor/twig/twig/doc/filters/split.rst
deleted file mode 100644
index 3db8141..0000000
--- a/core/vendor/twig/twig/doc/filters/split.rst
+++ /dev/null
@@ -1,53 +0,0 @@
-``split``
-=========
-
-.. versionadded:: 1.10.3
- The split filter was added in Twig 1.10.3.
-
-The ``split`` filter splits a string by the given delimiter and returns a list
-of strings:
-
-.. code-block:: jinja
-
- {{ "one,two,three"|split(',') }}
- {# returns ['one', 'two', 'three'] #}
-
-You can also pass a ``limit`` argument:
-
- * If ``limit`` is positive, the returned array will contain a maximum of
- limit elements with the last element containing the rest of string;
-
- * If ``limit`` is negative, all components except the last -limit are
- returned;
-
- * If ``limit`` is zero, then this is treated as 1.
-
-.. code-block:: jinja
-
- {{ "one,two,three,four,five"|split(',', 3) }}
- {# returns ['one', 'two', 'three,four,five'] #}
-
-If the ``delimiter`` is an empty string, then value will be split by equal
-chunks. Length is set by the ``limit`` argument (one character by default).
-
-.. code-block:: jinja
-
- {{ "123"|split('') }}
- {# returns ['1', '2', '3'] #}
-
- {{ "aabbcc"|split('', 2) }}
- {# returns ['aa', 'bb', 'cc'] #}
-
-.. note::
-
- Internally, Twig uses the PHP `explode`_ or `str_split`_ (if delimiter is
- empty) functions for string splitting.
-
-Arguments
----------
-
-* ``delimiter``: The delimiter
-* ``limit``: The limit argument
-
-.. _`explode`: http://php.net/explode
-.. _`str_split`: http://php.net/str_split
diff --git a/core/vendor/twig/twig/doc/filters/striptags.rst b/core/vendor/twig/twig/doc/filters/striptags.rst
deleted file mode 100644
index 72c6f25..0000000
--- a/core/vendor/twig/twig/doc/filters/striptags.rst
+++ /dev/null
@@ -1,15 +0,0 @@
-``striptags``
-=============
-
-The ``striptags`` filter strips SGML/XML tags and replace adjacent whitespace
-by one space:
-
-.. code-block:: jinja
-
- {{ some_html|striptags }}
-
-.. note::
-
- Internally, Twig uses the PHP `strip_tags`_ function.
-
-.. _`strip_tags`: http://php.net/strip_tags
diff --git a/core/vendor/twig/twig/doc/filters/title.rst b/core/vendor/twig/twig/doc/filters/title.rst
deleted file mode 100644
index c5a318e..0000000
--- a/core/vendor/twig/twig/doc/filters/title.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``title``
-=========
-
-The ``title`` filter returns a titlecased version of the value. Words will
-start with uppercase letters, all remaining characters are lowercase:
-
-.. code-block:: jinja
-
- {{ 'my first car'|title }}
-
- {# outputs 'My First Car' #}
diff --git a/core/vendor/twig/twig/doc/filters/trim.rst b/core/vendor/twig/twig/doc/filters/trim.rst
deleted file mode 100644
index 0c5b32e..0000000
--- a/core/vendor/twig/twig/doc/filters/trim.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-``trim``
-========
-
-.. versionadded:: 1.6.2
- The trim filter was added in Twig 1.6.2.
-
-The ``trim`` filter strips whitespace (or other characters) from the beginning
-and end of a string:
-
-.. code-block:: jinja
-
- {{ ' I like Twig. '|trim }}
-
- {# outputs 'I like Twig.' #}
-
- {{ ' I like Twig.'|trim('.') }}
-
- {# outputs ' I like Twig' #}
-
-.. note::
-
- Internally, Twig uses the PHP `trim`_ function.
-
-Arguments
----------
-
-* ``character_mask``: The characters to strip
-
-.. _`trim`: http://php.net/trim
diff --git a/core/vendor/twig/twig/doc/filters/upper.rst b/core/vendor/twig/twig/doc/filters/upper.rst
deleted file mode 100644
index 561cebe..0000000
--- a/core/vendor/twig/twig/doc/filters/upper.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-``upper``
-=========
-
-The ``upper`` filter converts a value to uppercase:
-
-.. code-block:: jinja
-
- {{ 'welcome'|upper }}
-
- {# outputs 'WELCOME' #}
diff --git a/core/vendor/twig/twig/doc/filters/url_encode.rst b/core/vendor/twig/twig/doc/filters/url_encode.rst
deleted file mode 100644
index 7a35ed1..0000000
--- a/core/vendor/twig/twig/doc/filters/url_encode.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-``url_encode``
-==============
-
-.. versionadded:: 1.12.3
- Support for encoding an array as query string was added in Twig 1.12.3.
-
-The ``url_encode`` filter percent encodes a given string as URL segment
-or an array as query string:
-
-.. code-block:: jinja
-
- {{ "path-seg*ment"|url_encode }}
- {# outputs "path-seg%2Ament" #}
-
- {{ "string with spaces"|url_encode(true) }}
- {# outputs "string%20with%20spaces" #}
-
- {{ {'param': 'value', 'foo': 'bar'}|url_encode }}
- {# outputs "param=value&foo=bar" #}
-
-.. note::
-
- Internally, Twig uses the PHP `urlencode`_ (or `rawurlencode`_ if you pass
- ``true`` as the first parameter) or the `http_build_query`_ function.
-
-.. _`urlencode`: http://php.net/urlencode
-.. _`rawurlencode`: http://php.net/rawurlencode
-.. _`http_build_query`: http://php.net/http_build_query
diff --git a/core/vendor/twig/twig/doc/functions/attribute.rst b/core/vendor/twig/twig/doc/functions/attribute.rst
deleted file mode 100644
index 3051bda..0000000
--- a/core/vendor/twig/twig/doc/functions/attribute.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-``attribute``
-=============
-
-.. versionadded:: 1.2
- The ``attribute`` function was added in Twig 1.2.
-
-``attribute`` can be used to access a "dynamic" attribute of a variable:
-
-.. code-block:: jinja
-
- {{ attribute(object, method) }}
- {{ attribute(object, method, arguments) }}
- {{ attribute(array, item) }}
-
-.. note::
-
- The resolution algorithm is the same as the one used for the ``.``
- notation, except that the item can be any valid expression.
diff --git a/core/vendor/twig/twig/doc/functions/block.rst b/core/vendor/twig/twig/doc/functions/block.rst
deleted file mode 100644
index fd571ef..0000000
--- a/core/vendor/twig/twig/doc/functions/block.rst
+++ /dev/null
@@ -1,15 +0,0 @@
-``block``
-=========
-
-When a template uses inheritance and if you want to print a block multiple
-times, use the ``block`` function:
-
-.. code-block:: jinja
-
- {% block title %}{% endblock %}
-
-
{{ block('title') }}
-
- {% block body %}{% endblock %}
-
-.. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>`
diff --git a/core/vendor/twig/twig/doc/functions/constant.rst b/core/vendor/twig/twig/doc/functions/constant.rst
deleted file mode 100644
index bea0e9f..0000000
--- a/core/vendor/twig/twig/doc/functions/constant.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-``constant``
-============
-
-.. versionadded: 1.12.1
- constant now accepts object instances as the second argument.
-
-``constant`` returns the constant value for a given string:
-
-.. code-block:: jinja
-
- {{ some_date|date(constant('DATE_W3C')) }}
- {{ constant('Namespace\\Classname::CONSTANT_NAME') }}
-
-As of 1.12.1 you can read constants from object instances as well:
-
-.. code-block:: jinja
-
- {{ constant('RSS', date) }}
diff --git a/core/vendor/twig/twig/doc/functions/cycle.rst b/core/vendor/twig/twig/doc/functions/cycle.rst
deleted file mode 100644
index 94f7008..0000000
--- a/core/vendor/twig/twig/doc/functions/cycle.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-``cycle``
-=========
-
-The ``cycle`` function cycles on an array of values:
-
-.. code-block:: jinja
-
- {% for i in 0..10 %}
- {{ cycle(['odd', 'even'], i) }}
- {% endfor %}
-
-The array can contain any number of values:
-
-.. code-block:: jinja
-
- {% set fruits = ['apple', 'orange', 'citrus'] %}
-
- {% for i in 0..10 %}
- {{ cycle(fruits, i) }}
- {% endfor %}
-
-Arguments
----------
-
-* ``position``: The cycle position
diff --git a/core/vendor/twig/twig/doc/functions/date.rst b/core/vendor/twig/twig/doc/functions/date.rst
deleted file mode 100644
index 9442c39..0000000
--- a/core/vendor/twig/twig/doc/functions/date.rst
+++ /dev/null
@@ -1,52 +0,0 @@
-``date``
-========
-
-.. versionadded:: 1.6
- The date function has been added in Twig 1.6.
-
-.. versionadded:: 1.6.1
- The default timezone support has been added in Twig 1.6.1.
-
-Converts an argument to a date to allow date comparison:
-
-.. code-block:: jinja
-
- {% if date(user.created_at) < date('-2days') %}
- {# do something #}
- {% endif %}
-
-The argument must be in a format supported by the `date`_ function.
-
-You can pass a timezone as the second argument:
-
-.. code-block:: jinja
-
- {% if date(user.created_at) < date('-2days', 'Europe/Paris') %}
- {# do something #}
- {% endif %}
-
-If no argument is passed, the function returns the current date:
-
-.. code-block:: jinja
-
- {% if date(user.created_at) < date() %}
- {# always! #}
- {% endif %}
-
-.. note::
-
- You can set the default timezone globally by calling ``setTimezone()`` on
- the ``core`` extension instance:
-
- .. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setTimezone('Europe/Paris');
-
-Arguments
----------
-
-* ``date``: The date
-* ``timezone``: The timezone
-
-.. _`date`: http://www.php.net/date
diff --git a/core/vendor/twig/twig/doc/functions/dump.rst b/core/vendor/twig/twig/doc/functions/dump.rst
deleted file mode 100644
index 54f8d4e..0000000
--- a/core/vendor/twig/twig/doc/functions/dump.rst
+++ /dev/null
@@ -1,69 +0,0 @@
-``dump``
-========
-
-.. versionadded:: 1.5
- The dump function was added in Twig 1.5.
-
-The ``dump`` function dumps information about a template variable. This is
-mostly useful to debug a template that does not behave as expected by
-introspecting its variables:
-
-.. code-block:: jinja
-
- {{ dump(user) }}
-
-.. note::
-
- The ``dump`` function is not available by default. You must add the
- ``Twig_Extension_Debug`` extension explicitly when creating your Twig
- environment::
-
- $twig = new Twig_Environment($loader, array(
- 'debug' => true,
- // ...
- ));
- $twig->addExtension(new Twig_Extension_Debug());
-
- Even when enabled, the ``dump`` function won't display anything if the
- ``debug`` option on the environment is not enabled (to avoid leaking debug
- information on a production server).
-
-In an HTML context, wrap the output with a ``pre`` tag to make it easier to
-read:
-
-.. code-block:: jinja
-
-
- {{ dump(user) }}
-
-
-.. tip::
-
- Using a ``pre`` tag is not needed when `XDebug`_ is enabled and
- ``html_errors`` is ``on``; as a bonus, the output is also nicer with
- XDebug enabled.
-
-You can debug several variables by passing them as additional arguments:
-
-.. code-block:: jinja
-
- {{ dump(user, categories) }}
-
-If you don't pass any value, all variables from the current context are
-dumped:
-
-.. code-block:: jinja
-
- {{ dump() }}
-
-.. note::
-
- Internally, Twig uses the PHP `var_dump`_ function.
-
-Arguments
----------
-
-* ``context``: The context to dump
-
-.. _`XDebug`: http://xdebug.org/docs/display
-.. _`var_dump`: http://php.net/var_dump
diff --git a/core/vendor/twig/twig/doc/functions/include.rst b/core/vendor/twig/twig/doc/functions/include.rst
deleted file mode 100644
index 8feb0f1..0000000
--- a/core/vendor/twig/twig/doc/functions/include.rst
+++ /dev/null
@@ -1,80 +0,0 @@
-``include``
-===========
-
-.. versionadded:: 1.12
- The include function was added in Twig 1.12.
-
-The ``include`` function returns the rendered content of a template:
-
-.. code-block:: jinja
-
- {{ include('template.html') }}
- {{ include(some_var) }}
-
-Included templates have access to the variables of the active context.
-
-If you are using the filesystem loader, the templates are looked for in the
-paths defined by it.
-
-The context is passed by default to the template but you can also pass
-additional variables:
-
-.. code-block:: jinja
-
- {# template.html will have access to the variables from the current context and the additional ones provided #}
- {{ include('template.html', {foo: 'bar'}) }}
-
-You can disable access to the context by setting ``with_context`` to
-``false``:
-
-.. code-block:: jinja
-
- {# only the foo variable will be accessible #}
- {{ include('template.html', {foo: 'bar'}, with_context = false) }}
-
-.. code-block:: jinja
-
- {# no variables will be accessible #}
- {{ include('template.html', with_context = false) }}
-
-And if the expression evaluates to a ``Twig_Template`` object, Twig will use it
-directly::
-
- // {{ include(template) }}
-
- $template = $twig->loadTemplate('some_template.twig');
-
- $twig->loadTemplate('template.twig')->display(array('template' => $template));
-
-When you set the ``ignore_missing`` flag, Twig will return an empty string if
-the template does not exist:
-
-.. code-block:: jinja
-
- {{ include('sidebar.html', ignore_missing = true) }}
-
-You can also provide a list of templates that are checked for existence before
-inclusion. The first template that exists will be rendered:
-
-.. code-block:: jinja
-
- {{ include(['page_detailed.html', 'page.html']) }}
-
-If ``ignore_missing`` is set, it will fall back to rendering nothing if none
-of the templates exist, otherwise it will throw an exception.
-
-When including a template created by an end user, you should consider
-sandboxing it:
-
-.. code-block:: jinja
-
- {{ include('page.html', sandboxed = true) }}
-
-Arguments
----------
-
-* ``template``: The template to render
-* ``variables``: The variables to pass to the template
-* ``with_context``: Whether to pass the current context variables or not
-* ``ignore_missing``: Whether to ignore missing templates or not
-* ``sandboxed``: Whether to sandbox the template or not
diff --git a/core/vendor/twig/twig/doc/functions/index.rst b/core/vendor/twig/twig/doc/functions/index.rst
deleted file mode 100644
index 07214a7..0000000
--- a/core/vendor/twig/twig/doc/functions/index.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-Functions
-=========
-
-.. toctree::
- :maxdepth: 1
-
- attribute
- block
- constant
- cycle
- date
- dump
- include
- max
- min
- parent
- random
- range
- source
- template_from_string
diff --git a/core/vendor/twig/twig/doc/functions/max.rst b/core/vendor/twig/twig/doc/functions/max.rst
deleted file mode 100644
index bdc5b75..0000000
--- a/core/vendor/twig/twig/doc/functions/max.rst
+++ /dev/null
@@ -1,19 +0,0 @@
-``max``
-=======
-
-.. versionadded:: 1.15
- The ``max`` function was added in Twig 1.15.
-
-``max`` returns the biggest value of a sequence or a set of values:
-
-.. code-block:: jinja
-
- {{ max(1, 3, 2) }}
- {{ max([1, 3, 2]) }}
-
-When called with a mapping, max ignores keys and only compares values:
-
-.. code-block:: jinja
-
- {{ max({2: "two", 1: "one", 3: "three", 5: "five", 4: "for"}) }}
- {# return "two" #}
diff --git a/core/vendor/twig/twig/doc/functions/min.rst b/core/vendor/twig/twig/doc/functions/min.rst
deleted file mode 100644
index b924b03..0000000
--- a/core/vendor/twig/twig/doc/functions/min.rst
+++ /dev/null
@@ -1,19 +0,0 @@
-``min``
-=======
-
-.. versionadded:: 1.15
- The ``min`` function was added in Twig 1.15.
-
-``min`` returns the lowest value of a sequence or a set of values:
-
-.. code-block:: jinja
-
- {{ min(1, 3, 2) }}
- {{ min([1, 3, 2]) }}
-
-When called with a mapping, min ignores keys and only compares values:
-
-.. code-block:: jinja
-
- {{ min({2: "two", 1: "one", 3: "three", 5: "five", 4: "for"}) }}
- {# return "five" #}
diff --git a/core/vendor/twig/twig/doc/functions/parent.rst b/core/vendor/twig/twig/doc/functions/parent.rst
deleted file mode 100644
index f5bd200..0000000
--- a/core/vendor/twig/twig/doc/functions/parent.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-``parent``
-==========
-
-When a template uses inheritance, it's possible to render the contents of the
-parent block when overriding a block by using the ``parent`` function:
-
-.. code-block:: jinja
-
- {% extends "base.html" %}
-
- {% block sidebar %}
-
Table Of Contents
- ...
- {{ parent() }}
- {% endblock %}
-
-The ``parent()`` call will return the content of the ``sidebar`` block as
-defined in the ``base.html`` template.
-
-.. seealso:: :doc:`extends<../tags/extends>`, :doc:`block<../functions/block>`, :doc:`block<../tags/block>`
diff --git a/core/vendor/twig/twig/doc/functions/random.rst b/core/vendor/twig/twig/doc/functions/random.rst
deleted file mode 100644
index acbffe5..0000000
--- a/core/vendor/twig/twig/doc/functions/random.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-``random``
-==========
-
-.. versionadded:: 1.5
- The random function was added in Twig 1.5.
-
-.. versionadded:: 1.6
- String and integer handling was added in Twig 1.6.
-
-The ``random`` function returns a random value depending on the supplied
-parameter type:
-
-* a random item from a sequence;
-* a random character from a string;
-* a random integer between 0 and the integer parameter (inclusive).
-
-.. code-block:: jinja
-
- {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #}
- {{ random('ABC') }} {# example output: C #}
- {{ random() }} {# example output: 15386094 (works as the native PHP mt_rand function) #}
- {{ random(5) }} {# example output: 3 #}
-
-Arguments
----------
-
-* ``values``: The values
-
-.. _`mt_rand`: http://php.net/mt_rand
diff --git a/core/vendor/twig/twig/doc/functions/range.rst b/core/vendor/twig/twig/doc/functions/range.rst
deleted file mode 100644
index b7cd011..0000000
--- a/core/vendor/twig/twig/doc/functions/range.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-``range``
-=========
-
-Returns a list containing an arithmetic progression of integers:
-
-.. code-block:: jinja
-
- {% for i in range(0, 3) %}
- {{ i }},
- {% endfor %}
-
- {# outputs 0, 1, 2, 3, #}
-
-When step is given (as the third parameter), it specifies the increment (or
-decrement):
-
-.. code-block:: jinja
-
- {% for i in range(0, 6, 2) %}
- {{ i }},
- {% endfor %}
-
- {# outputs 0, 2, 4, 6, #}
-
-The Twig built-in ``..`` operator is just syntactic sugar for the ``range``
-function (with a step of 1):
-
-.. code-block:: jinja
-
- {% for i in 0..3 %}
- {{ i }},
- {% endfor %}
-
-.. tip::
-
- The ``range`` function works as the native PHP `range`_ function.
-
-Arguments
----------
-
-* ``low``: The first value of the sequence.
-* ``high``: The highest possible value of the sequence.
-* ``step``: The increment between elements of the sequence.
-
-.. _`range`: http://php.net/range
diff --git a/core/vendor/twig/twig/doc/functions/source.rst b/core/vendor/twig/twig/doc/functions/source.rst
deleted file mode 100644
index defa5fb..0000000
--- a/core/vendor/twig/twig/doc/functions/source.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-``source``
-==========
-
-.. versionadded:: 1.15
- The source function was added in Twig 1.15.
-
-The ``source`` function returns the content of a template without rendering it:
-
-.. code-block:: jinja
-
- {{ source('template.html') }}
- {{ source(some_var) }}
-
-The function uses the same template loaders as the ones used to include
-templates. So, if you are using the filesystem loader, the templates are looked
-for in the paths defined by it.
-
-Arguments
----------
-
-* ``name``: The name of the template to read
diff --git a/core/vendor/twig/twig/doc/functions/template_from_string.rst b/core/vendor/twig/twig/doc/functions/template_from_string.rst
deleted file mode 100644
index 95d9256..0000000
--- a/core/vendor/twig/twig/doc/functions/template_from_string.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-``template_from_string``
-========================
-
-.. versionadded:: 1.11
- The template_from_string function was added in Twig 1.11.
-
-The ``template_from_string`` function loads a template from a string:
-
-.. code-block:: jinja
-
- {{ include(template_from_string("Hello {{ name }}")) }}
- {{ include(template_from_string(page.template)) }}
-
-.. note::
-
- The ``template_from_string`` function is not available by default. You
- must add the ``Twig_Extension_StringLoader`` extension explicitly when
- creating your Twig environment::
-
- $twig = new Twig_Environment(...);
- $twig->addExtension(new Twig_Extension_StringLoader());
-
-.. note::
-
- Even if you will probably always use the ``template_from_string`` function
- with the ``include`` function, you can use it with any tag or function that
- takes a template as an argument (like the ``embed`` or ``extends`` tags).
-
-Arguments
----------
-
-* ``template``: The template
diff --git a/core/vendor/twig/twig/doc/index.rst b/core/vendor/twig/twig/doc/index.rst
deleted file mode 100644
index 3109c73..0000000
--- a/core/vendor/twig/twig/doc/index.rst
+++ /dev/null
@@ -1,19 +0,0 @@
-Twig
-====
-
-.. toctree::
- :maxdepth: 2
-
- intro
- templates
- api
- advanced
- internals
- recipes
- coding_standards
- tags/index
- filters/index
- functions/index
- tests/index
- installation
- deprecated
diff --git a/core/vendor/twig/twig/doc/installation.rst b/core/vendor/twig/twig/doc/installation.rst
deleted file mode 100644
index 278ef61..0000000
--- a/core/vendor/twig/twig/doc/installation.rst
+++ /dev/null
@@ -1,118 +0,0 @@
-Installation
-============
-
-You have multiple ways to install Twig.
-
-Installing the Twig PHP package
--------------------------------
-
-Installing via Composer (recommended)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-1. Install Composer in your project:
-
-.. code-block:: bash
-
- curl -s http://getcomposer.org/installer | php
-
-2. Create a ``composer.json`` file in your project root:
-
-.. code-block:: javascript
-
- {
- "require": {
- "twig/twig": "1.*"
- }
- }
-
-3. Install via Composer
-
-.. code-block:: bash
-
- php composer.phar install
-
-.. note::
- If you want to learn more about Composer, the ``composer.json`` file syntax
- and its usage, you can read the `online documentation`_.
-
-Installing from the tarball release
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-1. Download the most recent tarball from the `download page`_
-2. Unpack the tarball
-3. Move the files somewhere in your project
-
-Installing the development version
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-1. Install Git
-2. ``git clone git://github.com/fabpot/Twig.git``
-
-Installing the PEAR package
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-1. Install PEAR
-2. ``pear channel-discover pear.twig-project.org``
-3. ``pear install twig/Twig`` (or ``pear install twig/Twig-beta``)
-
-Installing the C extension
---------------------------
-
-.. versionadded:: 1.4
- The C extension was added in Twig 1.4.
-
-Twig comes with a C extension that enhances the performance of the Twig
-runtime engine.
-
-You can install it via PEAR:
-
-1. Install PEAR
-2. ``pear channel-discover pear.twig-project.org``
-3. ``pear install twig/CTwig`` (or ``pear install twig/CTwig-beta``)
-
-Or manually like any other PHP extension:
-
-.. code-block:: bash
-
- $ cd ext/twig
- $ phpize
- $ ./configure
- $ make
- $ make install
-
-For Windows:
-
-1. Setup the build environment following the `PHP documentation`_
-2. Put Twig's C extension source code into ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\ext\twig``
-3. Use the ``configure --disable-all --enable-cli --enable-twig=shared`` command instead of step 14
-4. ``nmake``
-5. Copy the ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\Release_TS\php_twig.dll`` file to your PHP setup.
-
-.. tip::
-
- For Windows ZendServer, TS is not enabled as mentionned in `Zend Server
- FAQ`_.
-
- You have to use `configure --disable-all --disable-zts --enable-cli
- --enable-twig=shared` to be able to build the twig C extension for
- ZendServer.
-
- The built DLL will be available in
- C:\\php-sdk\\phpdev\\vcXX\\x86\\php-source-directory\\Release
-
-Finally, enable the extension in your ``php.ini`` configuration file:
-
-.. code-block:: ini
-
- extension=twig.so #For Unix systems
- extension=php_twig.dll #For Windows systems
-
-And from now on, Twig will automatically compile your templates to take
-advantage of the C extension. Note that this extension does not replace the
-PHP code but only provides an optimized version of the
-``Twig_Template::getAttribute()`` method.
-
-.. _`download page`: https://github.com/fabpot/Twig/tags
-.. _`online documentation`: http://getcomposer.org/doc
-.. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild
-.. _`Zend Server FAQ`: http://www.zend.com/en/products/server/faq#faqD6
diff --git a/core/vendor/twig/twig/doc/internals.rst b/core/vendor/twig/twig/doc/internals.rst
deleted file mode 100644
index 16f425a..0000000
--- a/core/vendor/twig/twig/doc/internals.rst
+++ /dev/null
@@ -1,138 +0,0 @@
-Twig Internals
-==============
-
-Twig is very extensible and you can easily hack it. Keep in mind that you
-should probably try to create an extension before hacking the core, as most
-features and enhancements can be handled with extensions. This chapter is also
-useful for people who want to understand how Twig works under the hood.
-
-How does Twig work?
--------------------
-
-The rendering of a Twig template can be summarized into four key steps:
-
-* **Load** the template: If the template is already compiled, load it and go
- to the *evaluation* step, otherwise:
-
- * First, the **lexer** tokenizes the template source code into small pieces
- for easier processing;
- * Then, the **parser** converts the token stream into a meaningful tree
- of nodes (the Abstract Syntax Tree);
- * Eventually, the *compiler* transforms the AST into PHP code.
-
-* **Evaluate** the template: It basically means calling the ``display()``
- method of the compiled template and passing it the context.
-
-The Lexer
----------
-
-The lexer tokenizes a template source code into a token stream (each token is
-an instance of ``Twig_Token``, and the stream is an instance of
-``Twig_TokenStream``). The default lexer recognizes 13 different token types:
-
-* ``Twig_Token::BLOCK_START_TYPE``, ``Twig_Token::BLOCK_END_TYPE``: Delimiters for blocks (``{% %}``)
-* ``Twig_Token::VAR_START_TYPE``, ``Twig_Token::VAR_END_TYPE``: Delimiters for variables (``{{ }}``)
-* ``Twig_Token::TEXT_TYPE``: A text outside an expression;
-* ``Twig_Token::NAME_TYPE``: A name in an expression;
-* ``Twig_Token::NUMBER_TYPE``: A number in an expression;
-* ``Twig_Token::STRING_TYPE``: A string in an expression;
-* ``Twig_Token::OPERATOR_TYPE``: An operator;
-* ``Twig_Token::PUNCTUATION_TYPE``: A punctuation sign;
-* ``Twig_Token::INTERPOLATION_START_TYPE``, ``Twig_Token::INTERPOLATION_END_TYPE`` (as of Twig 1.5): Delimiters for string interpolation;
-* ``Twig_Token::EOF_TYPE``: Ends of template.
-
-You can manually convert a source code into a token stream by calling the
-``tokenize()`` method of an environment::
-
- $stream = $twig->tokenize($source, $identifier);
-
-As the stream has a ``__toString()`` method, you can have a textual
-representation of it by echoing the object::
-
- echo $stream."\n";
-
-Here is the output for the ``Hello {{ name }}`` template:
-
-.. code-block:: text
-
- TEXT_TYPE(Hello )
- VAR_START_TYPE()
- NAME_TYPE(name)
- VAR_END_TYPE()
- EOF_TYPE()
-
-.. note::
-
- The default lexer (``Twig_Lexer``) can be changed by calling
- the ``setLexer()`` method::
-
- $twig->setLexer($lexer);
-
-The Parser
-----------
-
-The parser converts the token stream into an AST (Abstract Syntax Tree), or a
-node tree (an instance of ``Twig_Node_Module``). The core extension defines
-the basic nodes like: ``for``, ``if``, ... and the expression nodes.
-
-You can manually convert a token stream into a node tree by calling the
-``parse()`` method of an environment::
-
- $nodes = $twig->parse($stream);
-
-Echoing the node object gives you a nice representation of the tree::
-
- echo $nodes."\n";
-
-Here is the output for the ``Hello {{ name }}`` template:
-
-.. code-block:: text
-
- Twig_Node_Module(
- Twig_Node_Text(Hello )
- Twig_Node_Print(
- Twig_Node_Expression_Name(name)
- )
- )
-
-.. note::
-
- The default parser (``Twig_TokenParser``) can be changed by calling the
- ``setParser()`` method::
-
- $twig->setParser($parser);
-
-The Compiler
-------------
-
-The last step is done by the compiler. It takes a node tree as an input and
-generates PHP code usable for runtime execution of the template.
-
-You can manually compile a node tree to PHP code with the ``compile()`` method
-of an environment::
-
- $php = $twig->compile($nodes);
-
-The generated template for a ``Hello {{ name }}`` template reads as follows
-(the actual output can differ depending on the version of Twig you are
-using)::
-
- /* Hello {{ name }} */
- class __TwigTemplate_1121b6f109fe93ebe8c6e22e3712bceb extends Twig_Template
- {
- protected function doDisplay(array $context, array $blocks = array())
- {
- // line 1
- echo "Hello ";
- echo twig_escape_filter($this->env, $this->getContext($context, "name"), "ndex", null, true);
- }
-
- // some more code
- }
-
-.. note::
-
- The default compiler (``Twig_Compiler``) can be changed by calling the
- ``setCompiler()`` method::
-
- $twig->setCompiler($compiler);
diff --git a/core/vendor/twig/twig/doc/intro.rst b/core/vendor/twig/twig/doc/intro.rst
deleted file mode 100644
index 9f0cdf0..0000000
--- a/core/vendor/twig/twig/doc/intro.rst
+++ /dev/null
@@ -1,79 +0,0 @@
-Introduction
-============
-
-This is the documentation for Twig, the flexible, fast, and secure template
-engine for PHP.
-
-If you have any exposure to other text-based template languages, such as
-Smarty, Django, or Jinja, you should feel right at home with Twig. It's both
-designer and developer friendly by sticking to PHP's principles and adding
-functionality useful for templating environments.
-
-The key-features are...
-
-* *Fast*: Twig compiles templates down to plain optimized PHP code. The
- overhead compared to regular PHP code was reduced to the very minimum.
-
-* *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This
- allows Twig to be used as a template language for applications where users
- may modify the template design.
-
-* *Flexible*: Twig is powered by a flexible lexer and parser. This allows the
- developer to define its own custom tags and filters, and create its own DSL.
-
-Prerequisites
--------------
-
-Twig needs at least **PHP 5.2.4** to run.
-
-Installation
-------------
-
-The recommended way to install Twig is via Composer:
-
-.. code-block:: bash
-
- composer require twig/twig:1.*
-
-.. note::
-
- To learn more about the other installation methods, read the
- :doc:`installation` chapter; it also explains how to install
- the Twig C extension.
-
-Basic API Usage
----------------
-
-This section gives you a brief introduction to the PHP API for Twig.
-
-.. code-block:: php
-
- require_once '/path/to/vendor/autoload.php';
-
- $loader = new Twig_Loader_String();
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('Hello {{ name }}!', array('name' => 'Fabien'));
-
-Twig uses a loader (``Twig_Loader_String``) to locate templates, and an
-environment (``Twig_Environment``) to store the configuration.
-
-The ``render()`` method loads the template passed as a first argument and
-renders it with the variables passed as a second argument.
-
-As templates are generally stored on the filesystem, Twig also comes with a
-filesystem loader::
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
- $twig = new Twig_Environment($loader, array(
- 'cache' => '/path/to/compilation_cache',
- ));
-
- echo $twig->render('index.html', array('name' => 'Fabien'));
-
-.. tip::
-
- If you are not using Composer, use the Twig built-in autoloader::
-
- require_once '/path/to/lib/Twig/Autoloader.php';
- Twig_Autoloader::register();
diff --git a/core/vendor/twig/twig/doc/recipes.rst b/core/vendor/twig/twig/doc/recipes.rst
deleted file mode 100644
index bfdfc0d..0000000
--- a/core/vendor/twig/twig/doc/recipes.rst
+++ /dev/null
@@ -1,475 +0,0 @@
-Recipes
-=======
-
-Making a Layout conditional
----------------------------
-
-Working with Ajax means that the same content is sometimes displayed as is,
-and sometimes decorated with a layout. As Twig layout template names can be
-any valid expression, you can pass a variable that evaluates to ``true`` when
-the request is made via Ajax and choose the layout accordingly:
-
-.. code-block:: jinja
-
- {% extends request.ajax ? "base_ajax.html" : "base.html" %}
-
- {% block content %}
- This is the content to be displayed.
- {% endblock %}
-
-Making an Include dynamic
--------------------------
-
-When including a template, its name does not need to be a string. For
-instance, the name can depend on the value of a variable:
-
-.. code-block:: jinja
-
- {% include var ~ '_foo.html' %}
-
-If ``var`` evaluates to ``index``, the ``index_foo.html`` template will be
-rendered.
-
-As a matter of fact, the template name can be any valid expression, such as
-the following:
-
-.. code-block:: jinja
-
- {% include var|default('index') ~ '_foo.html' %}
-
-Overriding a Template that also extends itself
-----------------------------------------------
-
-A template can be customized in two different ways:
-
-* *Inheritance*: A template *extends* a parent template and overrides some
- blocks;
-
-* *Replacement*: If you use the filesystem loader, Twig loads the first
- template it finds in a list of configured directories; a template found in a
- directory *replaces* another one from a directory further in the list.
-
-But how do you combine both: *replace* a template that also extends itself
-(aka a template in a directory further in the list)?
-
-Let's say that your templates are loaded from both ``.../templates/mysite``
-and ``.../templates/default`` in this order. The ``page.twig`` template,
-stored in ``.../templates/default`` reads as follows:
-
-.. code-block:: jinja
-
- {# page.twig #}
- {% extends "layout.twig" %}
-
- {% block content %}
- {% endblock %}
-
-You can replace this template by putting a file with the same name in
-``.../templates/mysite``. And if you want to extend the original template, you
-might be tempted to write the following:
-
-.. code-block:: jinja
-
- {# page.twig in .../templates/mysite #}
- {% extends "page.twig" %} {# from .../templates/default #}
-
-Of course, this will not work as Twig will always load the template from
-``.../templates/mysite``.
-
-It turns out it is possible to get this to work, by adding a directory right
-at the end of your template directories, which is the parent of all of the
-other directories: ``.../templates`` in our case. This has the effect of
-making every template file within our system uniquely addressable. Most of the
-time you will use the "normal" paths, but in the special case of wanting to
-extend a template with an overriding version of itself we can reference its
-parent's full, unambiguous template path in the extends tag:
-
-.. code-block:: jinja
-
- {# page.twig in .../templates/mysite #}
- {% extends "default/page.twig" %} {# from .../templates #}
-
-.. note::
-
- This recipe was inspired by the following Django wiki page:
- http://code.djangoproject.com/wiki/ExtendingTemplates
-
-Customizing the Syntax
-----------------------
-
-Twig allows some syntax customization for the block delimiters. It's not
-recommended to use this feature as templates will be tied with your custom
-syntax. But for specific projects, it can make sense to change the defaults.
-
-To change the block delimiters, you need to create your own lexer object::
-
- $twig = new Twig_Environment();
-
- $lexer = new Twig_Lexer($twig, array(
- 'tag_comment' => array('{#', '#}'),
- 'tag_block' => array('{%', '%}'),
- 'tag_variable' => array('{{', '}}'),
- 'interpolation' => array('#{', '}'),
- ));
- $twig->setLexer($lexer);
-
-Here are some configuration example that simulates some other template engines
-syntax::
-
- // Ruby erb syntax
- $lexer = new Twig_Lexer($twig, array(
- 'tag_comment' => array('<%#', '%>'),
- 'tag_block' => array('<%', '%>'),
- 'tag_variable' => array('<%=', '%>'),
- ));
-
- // SGML Comment Syntax
- $lexer = new Twig_Lexer($twig, array(
- 'tag_comment' => array(''),
- 'tag_block' => array(''),
- 'tag_variable' => array('${', '}'),
- ));
-
- // Smarty like
- $lexer = new Twig_Lexer($twig, array(
- 'tag_comment' => array('{*', '*}'),
- 'tag_block' => array('{', '}'),
- 'tag_variable' => array('{$', '}'),
- ));
-
-Using dynamic Object Properties
--------------------------------
-
-When Twig encounters a variable like ``article.title``, it tries to find a
-``title`` public property in the ``article`` object.
-
-It also works if the property does not exist but is rather defined dynamically
-thanks to the magic ``__get()`` method; you just need to also implement the
-``__isset()`` magic method like shown in the following snippet of code::
-
- class Article
- {
- public function __get($name)
- {
- if ('title' == $name) {
- return 'The title';
- }
-
- // throw some kind of error
- }
-
- public function __isset($name)
- {
- if ('title' == $name) {
- return true;
- }
-
- return false;
- }
- }
-
-Accessing the parent Context in Nested Loops
---------------------------------------------
-
-Sometimes, when using nested loops, you need to access the parent context. The
-parent context is always accessible via the ``loop.parent`` variable. For
-instance, if you have the following template data::
-
- $data = array(
- 'topics' => array(
- 'topic1' => array('Message 1 of topic 1', 'Message 2 of topic 1'),
- 'topic2' => array('Message 1 of topic 2', 'Message 2 of topic 2'),
- ),
- );
-
-And the following template to display all messages in all topics:
-
-.. code-block:: jinja
-
- {% for topic, messages in topics %}
- * {{ loop.index }}: {{ topic }}
- {% for message in messages %}
- - {{ loop.parent.loop.index }}.{{ loop.index }}: {{ message }}
- {% endfor %}
- {% endfor %}
-
-The output will be similar to:
-
-.. code-block:: text
-
- * 1: topic1
- - 1.1: The message 1 of topic 1
- - 1.2: The message 2 of topic 1
- * 2: topic2
- - 2.1: The message 1 of topic 2
- - 2.2: The message 2 of topic 2
-
-In the inner loop, the ``loop.parent`` variable is used to access the outer
-context. So, the index of the current ``topic`` defined in the outer for loop
-is accessible via the ``loop.parent.loop.index`` variable.
-
-Defining undefined Functions and Filters on the Fly
----------------------------------------------------
-
-When a function (or a filter) is not defined, Twig defaults to throw a
-``Twig_Error_Syntax`` exception. However, it can also call a `callback`_ (any
-valid PHP callable) which should return a function (or a filter).
-
-For filters, register callbacks with ``registerUndefinedFilterCallback()``.
-For functions, use ``registerUndefinedFunctionCallback()``::
-
- // auto-register all native PHP functions as Twig functions
- // don't try this at home as it's not secure at all!
- $twig->registerUndefinedFunctionCallback(function ($name) {
- if (function_exists($name)) {
- return new Twig_Function_Function($name);
- }
-
- return false;
- });
-
-If the callable is not able to return a valid function (or filter), it must
-return ``false``.
-
-If you register more than one callback, Twig will call them in turn until one
-does not return ``false``.
-
-.. tip::
-
- As the resolution of functions and filters is done during compilation,
- there is no overhead when registering these callbacks.
-
-Validating the Template Syntax
-------------------------------
-
-When template code is providing by a third-party (through a web interface for
-instance), it might be interesting to validate the template syntax before
-saving it. If the template code is stored in a `$template` variable, here is
-how you can do it::
-
- try {
- $twig->parse($twig->tokenize($template));
-
- // the $template is valid
- } catch (Twig_Error_Syntax $e) {
- // $template contains one or more syntax errors
- }
-
-If you iterate over a set of files, you can pass the filename to the
-``tokenize()`` method to get the filename in the exception message::
-
- foreach ($files as $file) {
- try {
- $twig->parse($twig->tokenize($template, $file));
-
- // the $template is valid
- } catch (Twig_Error_Syntax $e) {
- // $template contains one or more syntax errors
- }
- }
-
-.. note::
-
- This method won't catch any sandbox policy violations because the policy
- is enforced during template rendering (as Twig needs the context for some
- checks like allowed methods on objects).
-
-Refreshing modified Templates when APC is enabled and apc.stat = 0
-------------------------------------------------------------------
-
-When using APC with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing
-the template cache won't update the APC cache. To get around this, one can
-extend ``Twig_Environment`` and force the update of the APC cache when Twig
-rewrites the cache::
-
- class Twig_Environment_APC extends Twig_Environment
- {
- protected function writeCacheFile($file, $content)
- {
- parent::writeCacheFile($file, $content);
-
- // Compile cached file into bytecode cache
- apc_compile_file($file);
- }
- }
-
-Reusing a stateful Node Visitor
--------------------------------
-
-When attaching a visitor to a ``Twig_Environment`` instance, Twig uses it to
-visit *all* templates it compiles. If you need to keep some state information
-around, you probably want to reset it when visiting a new template.
-
-This can be easily achieved with the following code::
-
- protected $someTemplateState = array();
-
- public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
- {
- if ($node instanceof Twig_Node_Module) {
- // reset the state as we are entering a new template
- $this->someTemplateState = array();
- }
-
- // ...
-
- return $node;
- }
-
-Using the Template name to set the default Escaping Strategy
-------------------------------------------------------------
-
-.. versionadded:: 1.8
- This recipe requires Twig 1.8 or later.
-
-The ``autoescape`` option determines the default escaping strategy to use when
-no escaping is applied on a variable. When Twig is used to mostly generate
-HTML files, you can set it to ``html`` and explicitly change it to ``js`` when
-you have some dynamic JavaScript files thanks to the ``autoescape`` tag:
-
-.. code-block:: jinja
-
- {% autoescape 'js' %}
- ... some JS ...
- {% endautoescape %}
-
-But if you have many HTML and JS files, and if your template names follow some
-conventions, you can instead determine the default escaping strategy to use
-based on the template name. Let's say that your template names always end
-with ``.html`` for HTML files, ``.js`` for JavaScript ones, and ``.css`` for
-stylesheets, here is how you can configure Twig::
-
- class TwigEscapingGuesser
- {
- function guess($filename)
- {
- // get the format
- $format = substr($filename, strrpos($filename, '.') + 1);
-
- switch ($format) {
- case 'js':
- return 'js';
- case 'css':
- return 'css';
- case 'html':
- default:
- return 'html';
- }
- }
- }
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
- $twig = new Twig_Environment($loader, array(
- 'autoescape' => array(new TwigEscapingGuesser(), 'guess'),
- ));
-
-This dynamic strategy does not incur any overhead at runtime as auto-escaping
-is done at compilation time.
-
-Using a Database to store Templates
------------------------------------
-
-If you are developing a CMS, templates are usually stored in a database. This
-recipe gives you a simple PDO template loader you can use as a starting point
-for your own.
-
-First, let's create a temporary in-memory SQLite3 database to work with::
-
- $dbh = new PDO('sqlite::memory:');
- $dbh->exec('CREATE TABLE templates (name STRING, source STRING, last_modified INTEGER)');
- $base = '{% block content %}{% endblock %}';
- $index = '
- {% extends "base.twig" %}
- {% block content %}Hello {{ name }}{% endblock %}
- ';
- $now = time();
- $dbh->exec("INSERT INTO templates (name, source, last_modified) VALUES ('base.twig', '$base', $now)");
- $dbh->exec("INSERT INTO templates (name, source, last_modified) VALUES ('index.twig', '$index', $now)");
-
-We have created a simple ``templates`` table that hosts two templates:
-``base.twig`` and ``index.twig``.
-
-Now, let's define a loader able to use this database::
-
- class DatabaseTwigLoader implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
- {
- protected $dbh;
-
- public function __construct(PDO $dbh)
- {
- $this->dbh = $dbh;
- }
-
- public function getSource($name)
- {
- if (false === $source = $this->getValue('source', $name)) {
- throw new Twig_Error_Loader(sprintf('Template "%s" does not exist.', $name));
- }
-
- return $source;
- }
-
- // Twig_ExistsLoaderInterface as of Twig 1.11
- public function exists($name)
- {
- return $name === $this->getValue('name', $name);
- }
-
- public function getCacheKey($name)
- {
- return $name;
- }
-
- public function isFresh($name, $time)
- {
- if (false === $lastModified = $this->getValue('last_modified', $name)) {
- return false;
- }
-
- return $lastModified <= $time;
- }
-
- protected function getValue($column, $name)
- {
- $sth = $this->dbh->prepare('SELECT '.$column.' FROM templates WHERE name = :name');
- $sth->execute(array(':name' => (string) $name));
-
- return $sth->fetchColumn();
- }
- }
-
-Finally, here is an example on how you can use it::
-
- $loader = new DatabaseTwigLoader($dbh);
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('index.twig', array('name' => 'Fabien'));
-
-Using different Template Sources
---------------------------------
-
-This recipe is the continuation of the previous one. Even if you store the
-contributed templates in a database, you might want to keep the original/base
-templates on the filesystem. When templates can be loaded from different
-sources, you need to use the ``Twig_Loader_Chain`` loader.
-
-As you can see in the previous recipe, we reference the template in the exact
-same way as we would have done it with a regular filesystem loader. This is
-the key to be able to mix and match templates coming from the database, the
-filesystem, or any other loader for that matter: the template name should be a
-logical name, and not the path from the filesystem::
-
- $loader1 = new DatabaseTwigLoader($dbh);
- $loader2 = new Twig_Loader_Array(array(
- 'base.twig' => '{% block content %}{% endblock %}',
- ));
- $loader = new Twig_Loader_Chain(array($loader1, $loader2));
-
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('index.twig', array('name' => 'Fabien'));
-
-Now that the ``base.twig`` templates is defined in an array loader, you can
-remove it from the database, and everything else will still work as before.
-
-.. _callback: http://www.php.net/manual/en/function.is-callable.php
diff --git a/core/vendor/twig/twig/doc/tags/autoescape.rst b/core/vendor/twig/twig/doc/tags/autoescape.rst
deleted file mode 100644
index c5ff0c2..0000000
--- a/core/vendor/twig/twig/doc/tags/autoescape.rst
+++ /dev/null
@@ -1,71 +0,0 @@
-``autoescape``
-==============
-
-Whether automatic escaping is enabled or not, you can mark a section of a
-template to be escaped or not by using the ``autoescape`` tag:
-
-.. code-block:: jinja
-
- {# The following syntax works as of Twig 1.8 -- see the note below for previous versions #}
-
- {% autoescape %}
- Everything will be automatically escaped in this block
- using the HTML strategy
- {% endautoescape %}
-
- {% autoescape 'html' %}
- Everything will be automatically escaped in this block
- using the HTML strategy
- {% endautoescape %}
-
- {% autoescape 'js' %}
- Everything will be automatically escaped in this block
- using the js escaping strategy
- {% endautoescape %}
-
- {% autoescape false %}
- Everything will be outputted as is in this block
- {% endautoescape %}
-
-.. note::
-
- Before Twig 1.8, the syntax was different:
-
- .. code-block:: jinja
-
- {% autoescape true %}
- Everything will be automatically escaped in this block
- using the HTML strategy
- {% endautoescape %}
-
- {% autoescape false %}
- Everything will be outputted as is in this block
- {% endautoescape %}
-
- {% autoescape true js %}
- Everything will be automatically escaped in this block
- using the js escaping strategy
- {% endautoescape %}
-
-When automatic escaping is enabled everything is escaped by default except for
-values explicitly marked as safe. Those can be marked in the template by using
-the :doc:`raw<../filters/raw>` filter:
-
-.. code-block:: jinja
-
- {% autoescape %}
- {{ safe_value|raw }}
- {% endautoescape %}
-
-Functions returning template data (like :doc:`macros` and
-:doc:`parent<../functions/parent>`) always return safe markup.
-
-.. note::
-
- Twig is smart enough to not escape an already escaped value by the
- :doc:`escape<../filters/escape>` filter.
-
-.. note::
-
- The chapter :doc:`Twig for Developers<../api>` gives more information
- about when and how automatic escaping is applied.
diff --git a/core/vendor/twig/twig/doc/tags/block.rst b/core/vendor/twig/twig/doc/tags/block.rst
deleted file mode 100644
index e380482..0000000
--- a/core/vendor/twig/twig/doc/tags/block.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``block``
-=========
-
-Blocks are used for inheritance and act as placeholders and replacements at
-the same time. They are documented in detail in the documentation for the
-:doc:`extends<../tags/extends>` tag.
-
-Block names should consist of alphanumeric characters, and underscores. Dashes
-are not permitted.
-
-.. seealso:: :doc:`block<../functions/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>`, :doc:`extends<../tags/extends>`
diff --git a/core/vendor/twig/twig/doc/tags/do.rst b/core/vendor/twig/twig/doc/tags/do.rst
deleted file mode 100644
index eca63d0..0000000
--- a/core/vendor/twig/twig/doc/tags/do.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-``do``
-======
-
-.. versionadded:: 1.5
- The do tag was added in Twig 1.5.
-
-The ``do`` tag works exactly like the regular variable expression (``{{ ...
-}}``) just that it doesn't print anything:
-
-.. code-block:: jinja
-
- {% do 1 + 2 %}
diff --git a/core/vendor/twig/twig/doc/tags/embed.rst b/core/vendor/twig/twig/doc/tags/embed.rst
deleted file mode 100644
index 5a6a029..0000000
--- a/core/vendor/twig/twig/doc/tags/embed.rst
+++ /dev/null
@@ -1,178 +0,0 @@
-``embed``
-=========
-
-.. versionadded:: 1.8
- The ``embed`` tag was added in Twig 1.8.
-
-The ``embed`` tag combines the behaviour of :doc:`include` and
-:doc:`extends`.
-It allows you to include another template's contents, just like ``include``
-does. But it also allows you to override any block defined inside the
-included template, like when extending a template.
-
-Think of an embedded template as a "micro layout skeleton".
-
-.. code-block:: jinja
-
- {% embed "teasers_skeleton.twig" %}
- {# These blocks are defined in "teasers_skeleton.twig" #}
- {# and we override them right here: #}
- {% block left_teaser %}
- Some content for the left teaser box
- {% endblock %}
- {% block right_teaser %}
- Some content for the right teaser box
- {% endblock %}
- {% endembed %}
-
-The ``embed`` tag takes the idea of template inheritance to the level of
-content fragments. While template inheritance allows for "document skeletons",
-which are filled with life by child templates, the ``embed`` tag allows you to
-create "skeletons" for smaller units of content and re-use and fill them
-anywhere you like.
-
-Since the use case may not be obvious, let's look at a simplified example.
-Imagine a base template shared by multiple HTML pages, defining a single block
-named "content":
-
-.. code-block:: text
-
- ┌─── page layout ─────────────────────┐
- │ │
- │ ┌── block "content" ──┐ │
- │ │ │ │
- │ │ │ │
- │ │ (child template to │ │
- │ │ put content here) │ │
- │ │ │ │
- │ │ │ │
- │ └─────────────────────┘ │
- │ │
- └─────────────────────────────────────┘
-
-Some pages ("foo" and "bar") share the same content structure -
-two vertically stacked boxes:
-
-.. code-block:: text
-
- ┌─── page layout ─────────────────────┐
- │ │
- │ ┌── block "content" ──┐ │
- │ │ ┌─ block "top" ───┐ │ │
- │ │ │ │ │ │
- │ │ └─────────────────┘ │ │
- │ │ ┌─ block "bottom" ┐ │ │
- │ │ │ │ │ │
- │ │ └─────────────────┘ │ │
- │ └─────────────────────┘ │
- │ │
- └─────────────────────────────────────┘
-
-While other pages ("boom" and "baz") share a different content structure -
-two boxes side by side:
-
-.. code-block:: text
-
- ┌─── page layout ─────────────────────┐
- │ │
- │ ┌── block "content" ──┐ │
- │ │ │ │
- │ │ ┌ block ┐ ┌ block ┐ │ │
- │ │ │"left" │ │"right"│ │ │
- │ │ │ │ │ │ │ │
- │ │ │ │ │ │ │ │
- │ │ └───────┘ └───────┘ │ │
- │ └─────────────────────┘ │
- │ │
- └─────────────────────────────────────┘
-
-Without the ``embed`` tag, you have two ways to design your templates:
-
- * Create two "intermediate" base templates that extend the master layout
- template: one with vertically stacked boxes to be used by the "foo" and
- "bar" pages and another one with side-by-side boxes for the "boom" and
- "baz" pages.
-
- * Embed the markup for the top/bottom and left/right boxes into each page
- template directly.
-
-These two solutions do not scale well because they each have a major drawback:
-
- * The first solution may indeed work for this simplified example. But imagine
- we add a sidebar, which may again contain different, recurring structures
- of content. Now we would need to create intermediate base templates for
- all occurring combinations of content structure and sidebar structure...
- and so on.
-
- * The second solution involves duplication of common code with all its negative
- consequences: any change involves finding and editing all affected copies
- of the structure, correctness has to be verified for each copy, copies may
- go out of sync by careless modifications etc.
-
-In such a situation, the ``embed`` tag comes in handy. The common layout
-code can live in a single base template, and the two different content structures,
-let's call them "micro layouts" go into separate templates which are embedded
-as necessary:
-
-Page template ``foo.twig``:
-
-.. code-block:: jinja
-
- {% extends "layout_skeleton.twig" %}
-
- {% block content %}
- {% embed "vertical_boxes_skeleton.twig" %}
- {% block top %}
- Some content for the top box
- {% endblock %}
-
- {% block bottom %}
- Some content for the bottom box
- {% endblock %}
- {% endembed %}
- {% endblock %}
-
-And here is the code for ``vertical_boxes_skeleton.twig``:
-
-.. code-block:: html+jinja
-
-
- {% block top %}
- Top box default content
- {% endblock %}
-
-
-The goal of the ``vertical_boxes_skeleton.twig`` template being to factor
-out the HTML markup for the boxes.
-
-The ``embed`` tag takes the exact same arguments as the ``include`` tag:
-
-.. code-block:: jinja
-
- {% embed "base" with {'foo': 'bar'} %}
- ...
- {% endembed %}
-
- {% embed "base" with {'foo': 'bar'} only %}
- ...
- {% endembed %}
-
- {% embed "base" ignore missing %}
- ...
- {% endembed %}
-
-.. warning::
-
- As embedded templates do not have "names", auto-escaping strategies based
- on the template "filename" won't work as expected if you change the
- context (for instance, if you embed a CSS/JavaScript template into an HTML
- one). In that case, explicitly set the default auto-escaping strategy with
- the ``autoescape`` tag.
-
-.. seealso:: :doc:`include<../tags/include>`
diff --git a/core/vendor/twig/twig/doc/tags/extends.rst b/core/vendor/twig/twig/doc/tags/extends.rst
deleted file mode 100644
index d962a30..0000000
--- a/core/vendor/twig/twig/doc/tags/extends.rst
+++ /dev/null
@@ -1,268 +0,0 @@
-``extends``
-===========
-
-The ``extends`` tag can be used to extend a template from another one.
-
-.. note::
-
- Like PHP, Twig does not support multiple inheritance. So you can only have
- one extends tag called per rendering. However, Twig supports horizontal
- :doc:`reuse