Updating vendors

skala
Julio Montoya 12 years ago
parent 0a833f12cf
commit a6fe7c4dc6
  1. 80
      composer.lock
  2. 2
      vendor/autoload.php
  3. 6
      vendor/composer/autoload_real.php
  4. 690
      vendor/composer/installed.json
  5. 5
      vendor/doctrine/cache/composer.json
  6. 2
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php
  7. 3
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php
  8. 23
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php
  9. 59
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php
  10. 10
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php
  11. 23
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php
  12. 1
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php
  13. 8
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php
  14. 8
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php
  15. 1
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php
  16. 8
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php
  17. 2
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php
  18. 7
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php
  19. 1
      vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php
  20. 107
      vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php
  21. 1
      vendor/doctrine/collections/.travis.yml
  22. 5
      vendor/doctrine/collections/composer.json
  23. 181
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php
  24. 36
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php
  25. 61
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Criteria.php
  26. 55
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php
  27. 30
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Comparison.php
  28. 22
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php
  29. 6
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Expression.php
  30. 13
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php
  31. 13
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Expr/Value.php
  32. 25
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/ExpressionBuilder.php
  33. 6
      vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php
  34. 49
      vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php
  35. 8
      vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php
  36. 8
      vendor/doctrine/inflector/.travis.yml
  37. 7
      vendor/doctrine/inflector/composer.json
  38. 48
      vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php
  39. 5
      vendor/doctrine/lexer/composer.json
  40. 49
      vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php
  41. 4
      vendor/silex/silex/src/Silex/Application.php
  42. 2
      vendor/silex/silex/src/Silex/ControllerCollection.php

80
composer.lock generated

@ -134,22 +134,27 @@
},
{
"name": "doctrine/cache",
"version": "v1.0",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "v1.0"
"reference": "f82e2e24d429d36a02266a584b889bd2d09e4fd2"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/cache/archive/v1.0.zip",
"reference": "v1.0",
"url": "https://api.github.com/repos/doctrine/cache/zipball/f82e2e24d429d36a02266a584b889bd2d09e4fd2",
"reference": "f82e2e24d429d36a02266a584b889bd2d09e4fd2",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Cache\\": "lib/"
@ -166,7 +171,7 @@
"homepage": "http://www.jwage.com/"
},
{
"name": "Christoph Dorn",
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": "http://www.instaclick.com"
},
@ -179,7 +184,7 @@
"email": "kontakt@beberlei.de"
},
{
"name": "Johannes M. Schmitt",
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
@ -191,26 +196,31 @@
"cache",
"caching"
],
"time": "2013-01-10 22:43:46"
"time": "2013-03-07 12:15:13"
},
{
"name": "doctrine/collections",
"version": "v1.0",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "v1.0"
"reference": "560f29c39cfcfbcd210e5d549d993a39d898b04b"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/collections/archive/v1.0.zip",
"reference": "v1.0",
"url": "https://api.github.com/repos/doctrine/collections/zipball/560f29c39cfcfbcd210e5d549d993a39d898b04b",
"reference": "560f29c39cfcfbcd210e5d549d993a39d898b04b",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Collections\\": "lib/"
@ -253,7 +263,7 @@
"collections",
"iterator"
],
"time": "2013-01-12 16:36:50"
"time": "2013-03-07 12:15:54"
},
{
"name": "doctrine/common",
@ -401,22 +411,27 @@
},
{
"name": "doctrine/inflector",
"version": "v1.0",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "v1.0"
"reference": "04d0ec2dc46453e0da3161ed6fd1496159547ae7"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/inflector/archive/v1.0.zip",
"reference": "v1.0",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/04d0ec2dc46453e0da3161ed6fd1496159547ae7",
"reference": "04d0ec2dc46453e0da3161ed6fd1496159547ae7",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Inflector\\": "lib/"
@ -433,7 +448,7 @@
"homepage": "http://www.jwage.com/"
},
{
"name": "Christoph Dorn",
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": "http://www.instaclick.com"
},
@ -446,7 +461,7 @@
"email": "kontakt@beberlei.de"
},
{
"name": "Johannes M. Schmitt",
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
@ -456,30 +471,35 @@
"homepage": "http://www.doctrine-project.org",
"keywords": [
"inflection",
"pluarlize",
"singuarlize",
"pluralize",
"singularize",
"string"
],
"time": "2013-01-10 21:49:15"
"time": "2013-03-07 12:15:34"
},
{
"name": "doctrine/lexer",
"version": "v1.0",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "v1.0"
"reference": "bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/lexer/archive/v1.0.zip",
"reference": "v1.0",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94",
"reference": "bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Lexer\\": "lib/"
@ -512,7 +532,7 @@
"lexer",
"parser"
],
"time": "2013-01-12 18:59:04"
"time": "2013-03-07 12:15:25"
},
{
"name": "doctrine/migrations",
@ -1075,12 +1095,12 @@
"source": {
"type": "git",
"url": "https://github.com/fabpot/Silex.git",
"reference": "9705ba7d5dd709262c451854f4e18f8c58171dfa"
"reference": "b77b5f26ea261d1fd4f7e849c8bc61c12adb12e7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fabpot/Silex/zipball/9705ba7d5dd709262c451854f4e18f8c58171dfa",
"reference": "9705ba7d5dd709262c451854f4e18f8c58171dfa",
"url": "https://api.github.com/repos/fabpot/Silex/zipball/b77b5f26ea261d1fd4f7e849c8bc61c12adb12e7",
"reference": "b77b5f26ea261d1fd4f7e849c8bc61c12adb12e7",
"shasum": ""
},
"require": {
@ -1147,7 +1167,7 @@
"keywords": [
"microframework"
],
"time": "2013-02-26 12:56:45"
"time": "2013-03-07 13:03:26"
},
{
"name": "swiftmailer/swiftmailer",

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit307b7e14ed20493499a65f7933fe4c9c::getLoader();
return ComposerAutoloaderInit16fd50eef71f85f5ae794601008586a9::getLoader();

@ -2,7 +2,7 @@
// autoload_real.php generated by Composer
class ComposerAutoloaderInit307b7e14ed20493499a65f7933fe4c9c
class ComposerAutoloaderInit16fd50eef71f85f5ae794601008586a9
{
private static $loader;
@ -19,9 +19,9 @@ class ComposerAutoloaderInit307b7e14ed20493499a65f7933fe4c9c
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit307b7e14ed20493499a65f7933fe4c9c', 'loadClassLoader'));
spl_autoload_register(array('ComposerAutoloaderInit16fd50eef71f85f5ae794601008586a9', 'loadClassLoader'));
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit307b7e14ed20493499a65f7933fe4c9c', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit16fd50eef71f85f5ae794601008586a9', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

@ -39,60 +39,6 @@
"psr-3"
]
},
{
"name": "doctrine/lexer",
"version": "v1.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "v1.0"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/lexer/archive/v1.0.zip",
"reference": "v1.0",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-01-12 18:59:04",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Lexer\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": "http://www.instaclick.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"lexer",
"parser"
]
},
{
"name": "doctrine/annotations",
"version": "v1.0",
@ -161,198 +107,6 @@
"parser"
]
},
{
"name": "doctrine/collections",
"version": "v1.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "v1.0"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/collections/archive/v1.0.zip",
"reference": "v1.0",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-01-12 16:36:50",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Collections\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/"
},
{
"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": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Collections Abstraction library",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"array",
"collections",
"iterator"
]
},
{
"name": "doctrine/cache",
"version": "v1.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "v1.0"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/cache/archive/v1.0.zip",
"reference": "v1.0",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-01-10 22:43:46",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Cache\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/"
},
{
"name": "Christoph Dorn",
"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 M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Caching library offering an object-oriented API for many cache backends",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"cache",
"caching"
]
},
{
"name": "doctrine/inflector",
"version": "v1.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "v1.0"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/inflector/archive/v1.0.zip",
"reference": "v1.0",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-01-10 21:49:15",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Inflector\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/"
},
{
"name": "Christoph Dorn",
"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 M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Common String Manipulations with regard to casing and singular/plural rules.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"inflection",
"pluarlize",
"singuarlize",
"string"
]
},
{
"name": "doctrine/common",
"version": "dev-master",
@ -574,105 +328,23 @@
]
},
{
"name": "silex/silex",
"name": "doctrine/migrations",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/fabpot/Silex.git",
"reference": "9705ba7d5dd709262c451854f4e18f8c58171dfa"
"url": "https://github.com/doctrine/migrations.git",
"reference": "e1f6efcd94993b493de5c6a413cbc327ea9c0caa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fabpot/Silex/zipball/9705ba7d5dd709262c451854f4e18f8c58171dfa",
"reference": "9705ba7d5dd709262c451854f4e18f8c58171dfa",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/e1f6efcd94993b493de5c6a413cbc327ea9c0caa",
"reference": "e1f6efcd94993b493de5c6a413cbc327ea9c0caa",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"pimple/pimple": "1.*",
"symfony/event-dispatcher": ">=2.1,<2.3-dev",
"symfony/http-foundation": ">=2.1,<2.3-dev",
"symfony/http-kernel": ">=2.1,<2.3-dev",
"symfony/routing": ">=2.1,<2.3-dev"
},
"require-dev": {
"doctrine/dbal": ">=2.2.0,<2.4.0-dev",
"swiftmailer/swiftmailer": "4.2.*",
"symfony/browser-kit": ">=2.1,<2.3-dev",
"symfony/config": ">=2.1,<2.3-dev",
"symfony/css-selector": ">=2.1,<2.3-dev",
"symfony/dom-crawler": ">=2.1,<2.3-dev",
"symfony/finder": ">=2.1,<2.3-dev",
"symfony/form": ">=2.1,<2.3-dev",
"symfony/locale": ">=2.1,<2.3-dev",
"symfony/monolog-bridge": ">=2.1,<2.3-dev",
"symfony/options-resolver": ">=2.1,<2.3-dev",
"symfony/process": ">=2.1,<2.3-dev",
"symfony/security": ">=2.1,<2.3-dev",
"symfony/serializer": ">=2.1,<2.3-dev",
"symfony/translation": ">=2.1,<2.3-dev",
"symfony/twig-bridge": ">=2.1,<2.3-dev",
"symfony/validator": ">=2.1,<2.3-dev",
"twig/twig": ">=1.8.0,<2.0-dev"
},
"suggest": {
"symfony/browser-kit": ">=2.1,<2.3-dev",
"symfony/css-selector": ">=2.1,<2.3-dev",
"symfony/dom-crawler": ">=2.1,<2.3-dev"
},
"time": "2013-02-26 12:56:45",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Silex": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch",
"homepage": "http://wiedler.ch/igor/"
}
],
"description": "The PHP micro-framework based on the Symfony2 Components",
"homepage": "http://silex.sensiolabs.org",
"keywords": [
"microframework"
]
},
{
"name": "doctrine/migrations",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/doctrine/migrations.git",
"reference": "e1f6efcd94993b493de5c6a413cbc327ea9c0caa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/e1f6efcd94993b493de5c6a413cbc327ea9c0caa",
"reference": "e1f6efcd94993b493de5c6a413cbc327ea9c0caa",
"shasum": ""
},
"require": {
"doctrine/dbal": ">=2.0,<2.5.x-dev",
"php": ">=5.3.2"
"doctrine/dbal": ">=2.0,<2.5.x-dev",
"php": ">=5.3.2"
},
"require-dev": {
"symfony/console": "2.*",
@ -2365,5 +2037,353 @@
"tree",
"uploadable"
]
},
{
"name": "doctrine/inflector",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "04d0ec2dc46453e0da3161ed6fd1496159547ae7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/04d0ec2dc46453e0da3161ed6fd1496159547ae7",
"reference": "04d0ec2dc46453e0da3161ed6fd1496159547ae7",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-03-07 12:15:34",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Inflector\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/"
},
{
"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": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Common String Manipulations with regard to casing and singular/plural rules.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"inflection",
"pluralize",
"singularize",
"string"
]
},
{
"name": "doctrine/cache",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "f82e2e24d429d36a02266a584b889bd2d09e4fd2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/f82e2e24d429d36a02266a584b889bd2d09e4fd2",
"reference": "f82e2e24d429d36a02266a584b889bd2d09e4fd2",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-03-07 12:15:13",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Cache\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/"
},
{
"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": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Caching library offering an object-oriented API for many cache backends",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"cache",
"caching"
]
},
{
"name": "doctrine/collections",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "560f29c39cfcfbcd210e5d549d993a39d898b04b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/collections/zipball/560f29c39cfcfbcd210e5d549d993a39d898b04b",
"reference": "560f29c39cfcfbcd210e5d549d993a39d898b04b",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-03-07 12:15:54",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Collections\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/"
},
{
"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": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Collections Abstraction library",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"array",
"collections",
"iterator"
]
},
{
"name": "doctrine/lexer",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94",
"reference": "bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-03-07 12:15:25",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Doctrine\\Common\\Lexer\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": "http://www.instaclick.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"lexer",
"parser"
]
},
{
"name": "silex/silex",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/fabpot/Silex.git",
"reference": "b77b5f26ea261d1fd4f7e849c8bc61c12adb12e7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fabpot/Silex/zipball/b77b5f26ea261d1fd4f7e849c8bc61c12adb12e7",
"reference": "b77b5f26ea261d1fd4f7e849c8bc61c12adb12e7",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"pimple/pimple": "1.*",
"symfony/event-dispatcher": ">=2.1,<2.3-dev",
"symfony/http-foundation": ">=2.1,<2.3-dev",
"symfony/http-kernel": ">=2.1,<2.3-dev",
"symfony/routing": ">=2.1,<2.3-dev"
},
"require-dev": {
"doctrine/dbal": ">=2.2.0,<2.4.0-dev",
"swiftmailer/swiftmailer": "4.2.*",
"symfony/browser-kit": ">=2.1,<2.3-dev",
"symfony/config": ">=2.1,<2.3-dev",
"symfony/css-selector": ">=2.1,<2.3-dev",
"symfony/dom-crawler": ">=2.1,<2.3-dev",
"symfony/finder": ">=2.1,<2.3-dev",
"symfony/form": ">=2.1,<2.3-dev",
"symfony/locale": ">=2.1,<2.3-dev",
"symfony/monolog-bridge": ">=2.1,<2.3-dev",
"symfony/options-resolver": ">=2.1,<2.3-dev",
"symfony/process": ">=2.1,<2.3-dev",
"symfony/security": ">=2.1,<2.3-dev",
"symfony/serializer": ">=2.1,<2.3-dev",
"symfony/translation": ">=2.1,<2.3-dev",
"symfony/twig-bridge": ">=2.1,<2.3-dev",
"symfony/validator": ">=2.1,<2.3-dev",
"twig/twig": ">=1.8.0,<2.0-dev"
},
"suggest": {
"symfony/browser-kit": ">=2.1,<2.3-dev",
"symfony/css-selector": ">=2.1,<2.3-dev",
"symfony/dom-crawler": ">=2.1,<2.3-dev"
},
"time": "2013-03-07 13:03:26",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Silex": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch",
"homepage": "http://wiedler.ch/igor/"
}
],
"description": "The PHP micro-framework based on the Symfony2 Components",
"homepage": "http://silex.sensiolabs.org",
"keywords": [
"microframework"
]
}
]

@ -17,5 +17,10 @@
},
"autoload": {
"psr-0": { "Doctrine\\Common\\Cache\\": "lib/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -23,7 +22,6 @@ namespace Doctrine\Common\Cache;
/**
* APC cache provider.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>

@ -1,7 +1,5 @@
<?php
/*
* $Id$
*
* 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
@ -24,7 +22,6 @@ namespace Doctrine\Common\Cache;
/**
* Array cache driver.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>

@ -1,7 +1,5 @@
<?php
/*
* $Id$
*
* 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
@ -24,7 +22,6 @@ namespace Doctrine\Common\Cache;
/**
* Interface for cache drivers.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
@ -44,15 +41,17 @@ interface Cache
/**
* Fetches an entry from the cache.
*
* @param string $id cache id The id of the cache entry to fetch.
* @param string $id The id of the cache entry to fetch.
*
* @return mixed The cached data or FALSE, if no cache entry exists for the given id.
*/
function fetch($id);
/**
* Test if an entry exists in the cache.
* Tests if an entry exists in the cache.
*
* @param string $id The cache id of the entry to check for.
*
* @param string $id cache id The cache id of the entry to check for.
* @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.
*/
function contains($id);
@ -62,7 +61,9 @@ interface Cache
*
* @param string $id The cache id.
* @param mixed $data The cache entry/data.
* @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
* @param int $lifeTime The cache lifetime.
* If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
*
* @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
*/
function save($id, $data, $lifeTime = 0);
@ -70,13 +71,14 @@ interface Cache
/**
* Deletes a cache entry.
*
* @param string $id cache id
* @param string $id The cache id.
*
* @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
*/
function delete($id);
/**
* Retrieves cached information from data store
* Retrieves cached information from the data store.
*
* The server's statistics array has the following values:
*
@ -96,7 +98,8 @@ interface Cache
* Memory allowed to use for storage.
*
* @since 2.2
* @return array Associative array with server's statistics if available, NULL otherwise.
*
* @return array|null An associative array with server's statistics if available, NULL otherwise.
*/
function getStats();
}

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -35,19 +34,24 @@ abstract class CacheProvider implements Cache
const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]';
/**
* @var string The namespace to prefix all cache ids with
* The namespace to prefix all cache ids with.
*
* @var string
*/
private $namespace = '';
/**
* @var string The namespace version
* The namespace version.
*
* @var string
*/
private $namespaceVersion;
/**
* Set the namespace to prefix all cache ids with.
* Sets the namespace to prefix all cache ids with.
*
* @param string $namespace
*
* @return void
*/
public function setNamespace($namespace)
@ -56,7 +60,7 @@ abstract class CacheProvider implements Cache
}
/**
* Retrieve the namespace that prefixes all cache ids.
* Retrieves the namespace that prefixes all cache ids.
*
* @return string
*/
@ -106,7 +110,7 @@ abstract class CacheProvider implements Cache
}
/**
* Deletes all cache entries.
* Flushes all cache entries.
*
* @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise.
*/
@ -116,7 +120,7 @@ abstract class CacheProvider implements Cache
}
/**
* Delete all cache entries.
* Deletes all cache entries.
*
* @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise.
*/
@ -131,10 +135,11 @@ abstract class CacheProvider implements Cache
}
/**
* Prefix the passed id with the configured namespace value
* Prefixes the passed id with the configured namespace value.
*
* @param string $id The id to namespace
* @return string $id The namespaced id
* @param string $id The id to namespace.
*
* @return string The namespaced id.
*/
private function getNamespacedId($id)
{
@ -144,9 +149,9 @@ abstract class CacheProvider implements Cache
}
/**
* Namespace cache key
* Returns the namespace cache key.
*
* @return string $namespaceCacheKey
* @return string
*/
private function getNamespaceCacheKey()
{
@ -154,9 +159,9 @@ abstract class CacheProvider implements Cache
}
/**
* Namespace version
* Returns the namespace version.
*
* @return string $namespaceVersion
* @return string
*/
private function getNamespaceVersion()
{
@ -181,15 +186,17 @@ abstract class CacheProvider implements Cache
/**
* Fetches an entry from the cache.
*
* @param string $id cache id The id of the cache entry to fetch.
* @return string The cached data or FALSE, if no cache entry exists for the given id.
* @param string $id The id of the cache entry to fetch.
*
* @return string|bool The cached data or FALSE, if no cache entry exists for the given id.
*/
abstract protected function doFetch($id);
/**
* Test if an entry exists in the cache.
* Tests if an entry exists in the cache.
*
* @param string $id The cache id of the entry to check for.
*
* @param string $id cache id The cache id of the entry to check for.
* @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.
*/
abstract protected function doContains($id);
@ -199,33 +206,35 @@ abstract class CacheProvider implements Cache
*
* @param string $id The cache id.
* @param string $data The cache entry/data.
* @param bool|int $lifeTime The lifetime. If != false, sets a specific lifetime for this
* cache entry (null => infinite lifeTime).
* @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this
* cache entry (0 => infinite lifeTime).
*
* @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
*/
abstract protected function doSave($id, $data, $lifeTime = false);
abstract protected function doSave($id, $data, $lifeTime = 0);
/**
* Deletes a cache entry.
*
* @param string $id cache id
* @param string $id The cache id.
*
* @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
*/
abstract protected function doDelete($id);
/**
* Deletes all cache entries.
* Flushes all cache entries.
*
* @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
*/
abstract protected function doFlush();
/**
* Retrieves cached information from data store
* Retrieves cached information from the data store.
*
* @since 2.2
* @return array An associative array with server's statistics if available, NULL otherwise.
*
* @return array|null An associative array with server's statistics if available, NULL otherwise.
*/
abstract protected function doGetStats();
}

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -25,16 +24,14 @@ use \Couchbase;
/**
* Couchbase cache provider.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.4
* @author Michael Nitschinger <michael@nitschinger.at>
*/
class CouchbaseCache extends CacheProvider
{
/**
* @var Couchbase
* @var Couchbase|null
*/
private $couchbase;
@ -42,6 +39,8 @@ class CouchbaseCache extends CacheProvider
* Sets the Couchbase instance to use.
*
* @param Couchbase $couchbase
*
* @return void
*/
public function setCouchbase(Couchbase $couchbase)
{
@ -51,7 +50,7 @@ class CouchbaseCache extends CacheProvider
/**
* Gets the Couchbase instance used by the cache.
*
* @return Couchbase
* @return Couchbase|null
*/
public function getCouchbase()
{
@ -119,5 +118,4 @@ class CouchbaseCache extends CacheProvider
Cache::STATS_MEMORY_AVAILIABLE => $stats['limit_maxbytes'],
);
}
}

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -29,20 +28,24 @@ namespace Doctrine\Common\Cache;
abstract class FileCache extends CacheProvider
{
/**
* @var string Cache directory.
* The cache directory.
*
* @var string
*/
protected $directory;
/**
* @var string Cache file extension.
* The cache file extension.
*
* @var string|null
*/
protected $extension;
/**
* Constructor
* Constructor.
*
* @param string $directory Cache directory.
* @param string $directory Cache file extension.
* @param string $directory The cache directory.
* @param string|null $extension The cache file extension.
*
* @throws \InvalidArgumentException
*/
@ -79,7 +82,7 @@ abstract class FileCache extends CacheProvider
/**
* Gets the cache file extension.
*
* @return string
* @return string|null
*/
public function getExtension()
{
@ -87,12 +90,16 @@ abstract class FileCache extends CacheProvider
}
/**
* @param string $id
*
* @return string
*/
protected function getFilename($id)
{
$path = implode(str_split(md5($id), 12), DIRECTORY_SEPARATOR);
$hash = hash('sha256', $id);
$path = implode(str_split($hash, 16), DIRECTORY_SEPARATOR);
$path = $this->directory . DIRECTORY_SEPARATOR . $path;
$id = preg_replace('@[\\\/:"*?<>|]+@', '', $id);
return $path . DIRECTORY_SEPARATOR . $id . $this->extension;
}

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -25,7 +24,6 @@ use \Memcache;
/**
* Memcache cache provider.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
@ -37,7 +35,7 @@ use \Memcache;
class MemcacheCache extends CacheProvider
{
/**
* @var Memcache
* @var Memcache|null
*/
private $memcache;
@ -45,6 +43,8 @@ class MemcacheCache extends CacheProvider
* Sets the memcache instance to use.
*
* @param Memcache $memcache
*
* @return void
*/
public function setMemcache(Memcache $memcache)
{
@ -54,7 +54,7 @@ class MemcacheCache extends CacheProvider
/**
* Gets the memcache instance used by the cache.
*
* @return Memcache
* @return Memcache|null
*/
public function getMemcache()
{

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -25,7 +24,6 @@ use \Memcached;
/**
* Memcached cache provider.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.2
* @author Benjamin Eberlei <kontakt@beberlei.de>
@ -37,7 +35,7 @@ use \Memcached;
class MemcachedCache extends CacheProvider
{
/**
* @var Memcached
* @var Memcached|null
*/
private $memcached;
@ -45,6 +43,8 @@ class MemcachedCache extends CacheProvider
* Sets the memcache instance to use.
*
* @param Memcached $memcached
*
* @return void
*/
public function setMemcached(Memcached $memcached)
{
@ -54,7 +54,7 @@ class MemcachedCache extends CacheProvider
/**
* Gets the memcached instance used by the cache.
*
* @return Memcached
* @return Memcached|null
*/
public function getMemcached()
{

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -25,7 +24,6 @@ use Redis;
/**
* Redis cache provider.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.2
* @author Osman Ungur <osmanungur@gmail.com>
@ -33,7 +31,7 @@ use Redis;
class RedisCache extends CacheProvider
{
/**
* @var Redis
* @var Redis|null
*/
private $redis;
@ -41,6 +39,8 @@ class RedisCache extends CacheProvider
* Sets the redis instance to use.
*
* @param Redis $redis
*
* @return void
*/
public function setRedis(Redis $redis)
{
@ -51,7 +51,7 @@ class RedisCache extends CacheProvider
/**
* Gets the redis instance used by the cache.
*
* @return Redis
* @return Redis|null
*/
public function getRedis()
{

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -23,7 +22,6 @@ namespace Doctrine\Common\Cache;
/**
* WinCache cache provider.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.2
* @author Benjamin Eberlei <kontakt@beberlei.de>

@ -1,5 +1,4 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -23,7 +22,6 @@ namespace Doctrine\Common\Cache;
/**
* Xcache cache driver.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
@ -79,10 +77,11 @@ class XcacheCache extends CacheProvider
}
/**
* Checks that xcache.admin.enable_auth is Off
* Checks that xcache.admin.enable_auth is Off.
*
* @throws \BadMethodCallException When xcache.admin.enable_auth is On
* @return void
*
* @throws \BadMethodCallException When xcache.admin.enable_auth is On.
*/
protected function checkAuthorization()
{

@ -22,7 +22,6 @@ namespace Doctrine\Common\Cache;
/**
* Zend Data Cache cache driver.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @author Ralph Schindler <ralph.schindler@zend.com>

@ -0,0 +1,107 @@
<?php
namespace Doctrine\Tests\Common\Cache;
/**
* @group DCOM-101
*/
class FileCacheTest extends \Doctrine\Tests\DoctrineTestCase
{
/**
* @var \Doctrine\Common\Cache\FileCache
*/
private $driver;
protected function setUp()
{
$this->driver = $this->getMock(
'Doctrine\Common\Cache\FileCache',
array('doFetch', 'doContains', 'doSave'),
array(), '', false
);
}
public function getProviderFileName()
{
return array(
//The characters :\/<>"*?| are not valid in Windows filenames.
array('key:1', 'key1'),
array('key\2', 'key2'),
array('key/3', 'key3'),
array('key<4', 'key4'),
array('key>5', 'key5'),
array('key"6', 'key6'),
array('key*7', 'key7'),
array('key?8', 'key8'),
array('key|9', 'key9'),
array('key[0]','key[0]'),
);
}
/**
* @dataProvider getProviderFileName
*/
public function testInvalidFilename($key, $expected)
{
$cache = $this->driver;
$method = new \ReflectionMethod($cache, 'getFilename');
$method->setAccessible(true);
$value = $method->invoke($cache, $key);
$actual = pathinfo($value, PATHINFO_FILENAME);
$this->assertEquals($expected, $actual);
}
public function testFilenameCollision()
{
$data['key:0'] = 'key0';
$data['key\0'] = 'key0';
$data['key/0'] = 'key0';
$data['key<0'] = 'key0';
$data['key>0'] = 'key0';
$data['key"0'] = 'key0';
$data['key*0'] = 'key0';
$data['key?0'] = 'key0';
$data['key|0'] = 'key0';
$paths = array();
$cache = $this->driver;
$method = new \ReflectionMethod($cache, 'getFilename');
$method->setAccessible(true);
foreach ($data as $key => $expected) {
$path = $method->invoke($cache, $key);
$actual = pathinfo($path, PATHINFO_FILENAME);
$this->assertNotContains($path, $paths);
$this->assertEquals($expected, $actual);
$paths[] = $path;
}
}
public function testFilenameShouldCreateThePathWithFourSubDirectories()
{
$cache = $this->driver;
$method = new \ReflectionMethod($cache, 'getFilename');
$key = 'item-key';
$expectedDir[] = '84e0e2e893febb73';
$expectedDir[] = '7a0fee0c89d53f4b';
$expectedDir[] = 'b7fcb44c57cdf3d3';
$expectedDir[] = '2ce7363f5d597760';
$expectedDir = implode(DIRECTORY_SEPARATOR, $expectedDir);
$method->setAccessible(true);
$path = $method->invoke($cache, $key);
$filename = pathinfo($path, PATHINFO_FILENAME);
$dirname = pathinfo($path, PATHINFO_DIRNAME);
$this->assertEquals('item-key', $filename);
$this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir, $dirname);
$this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir . DIRECTORY_SEPARATOR . $key, $path);
}
}

@ -3,6 +3,7 @@ language: php
php:
- 5.3
- 5.4
- 5.5
before_script:
- composer --prefer-source --dev install

@ -17,5 +17,10 @@
},
"autoload": {
"psr-0": { "Doctrine\\Common\\Collections\\": "lib/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
}
}

@ -20,7 +20,6 @@
namespace Doctrine\Common\Collections;
use Closure, ArrayIterator;
use Doctrine\Common\Collections\Expr\Expression;
use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor;
/**
@ -51,9 +50,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Gets the PHP array representation of this collection.
*
* @return array The PHP array representation of this collection.
* {@inheritDoc}
*/
public function toArray()
{
@ -61,10 +58,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Sets the internal iterator to the first element in the collection and
* returns this element.
*
* @return mixed
* {@inheritDoc}
*/
public function first()
{
@ -72,10 +66,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Sets the internal iterator to the last element in the collection and
* returns this element.
*
* @return mixed
* {@inheritDoc}
*/
public function last()
{
@ -83,9 +74,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Gets the current key/index at the current internal iterator position.
*
* @return mixed
* {@inheritDoc}
*/
public function key()
{
@ -93,9 +82,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Moves the internal iterator position to the next element.
*
* @return mixed
* {@inheritDoc}
*/
public function next()
{
@ -103,9 +90,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Gets the element of the collection at the current internal iterator position.
*
* @return mixed
* {@inheritDoc}
*/
public function current()
{
@ -113,10 +98,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Removes an element with a specific key/index from the collection.
*
* @param mixed $key
* @return mixed The removed element or NULL, if no element exists for the given key.
* {@inheritDoc}
*/
public function remove($key)
{
@ -131,10 +113,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Removes the specified element from the collection, if it is found.
*
* @param mixed $element The element to remove.
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
* {@inheritDoc}
*/
public function removeElement($element)
{
@ -150,12 +129,9 @@ class ArrayCollection implements Collection, Selectable
}
/**
* ArrayAccess implementation of offsetExists()
*
* @see containsKey()
* Required by interface ArrayAccess.
*
* @param mixed $offset
* @return bool
* {@inheritDoc}
*/
public function offsetExists($offset)
{
@ -163,12 +139,9 @@ class ArrayCollection implements Collection, Selectable
}
/**
* ArrayAccess implementation of offsetGet()
* Required by interface ArrayAccess.
*
* @see get()
*
* @param mixed $offset
* @return mixed
* {@inheritDoc}
*/
public function offsetGet($offset)
{
@ -176,14 +149,9 @@ class ArrayCollection implements Collection, Selectable
}
/**
* ArrayAccess implementation of offsetSet()
*
* @see add()
* @see set()
* Required by interface ArrayAccess.
*
* @param mixed $offset
* @param mixed $value
* @return bool
* {@inheritDoc}
*/
public function offsetSet($offset, $value)
{
@ -194,12 +162,9 @@ class ArrayCollection implements Collection, Selectable
}
/**
* ArrayAccess implementation of offsetUnset()
* Required by interface ArrayAccess.
*
* @see remove()
*
* @param mixed $offset
* @return mixed
* {@inheritDoc}
*/
public function offsetUnset($offset)
{
@ -207,10 +172,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Checks whether the collection contains a specific key/index.
*
* @param mixed $key The key to check for.
* @return boolean TRUE if the given key/index exists, FALSE otherwise.
* {@inheritDoc}
*/
public function containsKey($key)
{
@ -218,14 +180,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Checks whether the given element is contained in the collection.
* Only element values are compared, not keys. The comparison of two elements
* is strict, that means not only the value but also the type must match.
* For objects this means reference equality.
*
* @param mixed $element
* @return boolean TRUE if the given element is contained in the collection,
* FALSE otherwise.
* {@inheritDoc}
*/
public function contains($element)
{
@ -233,10 +188,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Tests for the existence of an element that satisfies the given predicate.
*
* @param Closure $p The predicate.
* @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
* {@inheritDoc}
*/
public function exists(Closure $p)
{
@ -249,13 +201,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Searches for a given element and, if found, returns the corresponding key/index
* of that element. The comparison of two elements is strict, that means not
* only the value but also the type must match.
* For objects this means reference equality.
*
* @param mixed $element The element to search for.
* @return mixed The key/index of the element or FALSE if the element was not found.
* {@inheritDoc}
*/
public function indexOf($element)
{
@ -263,10 +209,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Gets the element with the given key/index.
*
* @param mixed $key The key.
* @return mixed The element or NULL, if no element exists for the given key.
* {@inheritDoc}
*/
public function get($key)
{
@ -277,9 +220,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Gets all keys/indexes of the collection elements.
*
* @return array
* {@inheritDoc}
*/
public function getKeys()
{
@ -287,9 +228,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Gets all elements.
*
* @return array
* {@inheritDoc}
*/
public function getValues()
{
@ -297,11 +236,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Returns the number of elements in the collection.
*
* Implementation of the Countable interface.
*
* @return integer The number of elements in the collection.
* {@inheritDoc}
*/
public function count()
{
@ -309,13 +244,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Adds/sets an element in the collection at the index / with the specified key.
*
* When the collection is a Map this is like put(key,value)/add(key,value).
* When the collection is a List this is like add(position,value).
*
* @param mixed $key
* @param mixed $value
* {@inheritDoc}
*/
public function set($key, $value)
{
@ -323,10 +252,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Adds an element to the collection.
*
* @param mixed $value
* @return boolean Always TRUE.
* {@inheritDoc}
*/
public function add($value)
{
@ -335,11 +261,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Checks whether the collection is empty.
*
* Note: This is preferable over count() == 0.
*
* @return boolean TRUE if the collection is empty, FALSE otherwise.
* {@inheritDoc}
*/
public function isEmpty()
{
@ -347,9 +269,9 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Gets an iterator for iterating over the elements in the collection.
* Required by interface IteratorAggregate.
*
* @return ArrayIterator
* {@inheritDoc}
*/
public function getIterator()
{
@ -357,11 +279,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Applies the given function to each element in the collection and returns
* a new collection with the elements returned by the function.
*
* @param Closure $func
* @return Collection
* {@inheritDoc}
*/
public function map(Closure $func)
{
@ -369,11 +287,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Returns all the elements of this collection that satisfy the predicate p.
* The order of the elements is preserved.
*
* @param Closure $p The predicate used for filtering.
* @return Collection A collection with the results of the filter operation.
* {@inheritDoc}
*/
public function filter(Closure $p)
{
@ -381,11 +295,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Applies the given predicate p to all elements of this collection,
* returning true, if the predicate yields true for all elements.
*
* @param Closure $p The predicate.
* @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
* {@inheritDoc}
*/
public function forAll(Closure $p)
{
@ -399,13 +309,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Partitions this collection in two collections according to a predicate.
* Keys are preserved in the resulting collections.
*
* @param Closure $p The predicate on which to partition.
* @return array An array with two elements. The first element contains the collection
* of elements where the predicate returned TRUE, the second element
* contains the collection of elements where the predicate returned FALSE.
* {@inheritDoc}
*/
public function partition(Closure $p)
{
@ -431,7 +335,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Clears the collection.
* {@inheritDoc}
*/
public function clear()
{
@ -439,15 +343,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Extract a slice of $length elements starting at position $offset from the Collection.
*
* If $length is null it returns all elements from $offset to the end of the Collection.
* Keys have to be preserved by this method. Calling this method will only return the
* selected slice and NOT change the elements contained in the collection slice is called on.
*
* @param int $offset
* @param int $length
* @return array
* {@inheritDoc}
*/
public function slice($offset, $length = null)
{
@ -455,11 +351,7 @@ class ArrayCollection implements Collection, Selectable
}
/**
* Select all elements from a selectable that match the criteria and
* return a new collection containing these elements.
*
* @param Criteria $criteria
* @return Collection
* {@inheritDoc}
*/
public function matching(Criteria $criteria)
{
@ -491,4 +383,3 @@ class ArrayCollection implements Collection, Selectable
return new static($filtered);
}
}

@ -49,12 +49,15 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* Adds an element at the end of the collection.
*
* @param mixed $element The element to add.
*
* @return boolean Always TRUE.
*/
function add($element);
/**
* Clears the collection, removing all elements.
*
* @return void
*/
function clear();
@ -63,6 +66,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* This is an O(n) operation, where n is the size of the collection.
*
* @param mixed $element The element to search for.
*
* @return boolean TRUE if the collection contains the element, FALSE otherwise.
*/
function contains($element);
@ -78,6 +82,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* Removes the element at the specified index from the collection.
*
* @param string|integer $key The kex/index of the element to remove.
*
* @return mixed The removed element or NULL, if the collection did not contain the element.
*/
function remove($key);
@ -86,6 +91,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* Removes the specified element from the collection, if it is found.
*
* @param mixed $element The element to remove.
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
function removeElement($element);
@ -94,6 +100,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* Checks whether the collection contains an element with the specified key/index.
*
* @param string|integer $key The key/index to check for.
*
* @return boolean TRUE if the collection contains an element with the specified key/index,
* FALSE otherwise.
*/
@ -103,6 +110,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* Gets the element at the specified key/index.
*
* @param string|integer $key The key/index of the element to retrieve.
*
* @return mixed
*/
function get($key);
@ -128,6 +136,8 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
*
* @param string|integer $key The key/index of the element to set.
* @param mixed $value The element to set.
*
* @return void
*/
function set($key, $value);
@ -139,16 +149,14 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
function toArray();
/**
* Sets the internal iterator to the first element in the collection and
* returns this element.
* Sets the internal iterator to the first element in the collection and returns this element.
*
* @return mixed
*/
function first();
/**
* Sets the internal iterator to the last element in the collection and
* returns this element.
* Sets the internal iterator to the last element in the collection and returns this element.
*
* @return mixed
*/
@ -157,18 +165,21 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
/**
* Gets the key/index of the element at the current iterator position.
*
* @return int|string
*/
function key();
/**
* Gets the element of the collection at the current iterator position.
*
* @return mixed
*/
function current();
/**
* Moves the internal iterator position to the next element.
* Moves the internal iterator position to the next element and returns this element.
*
* @return mixed
*/
function next();
@ -176,6 +187,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* Tests for the existence of an element that satisfies the given predicate.
*
* @param Closure $p The predicate.
*
* @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
*/
function exists(Closure $p);
@ -185,6 +197,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* The order of the elements is preserved.
*
* @param Closure $p The predicate used for filtering.
*
* @return Collection A collection with the results of the filter operation.
*/
function filter(Closure $p);
@ -194,6 +207,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* returning true, if the predicate yields true for all elements.
*
* @param Closure $p The predicate.
*
* @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
*/
function forAll(Closure $p);
@ -203,6 +217,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* a new collection with the elements returned by the function.
*
* @param Closure $func
*
* @return Collection
*/
function map(Closure $func);
@ -212,6 +227,7 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* Keys are preserved in the resulting collections.
*
* @param Closure $p The predicate on which to partition.
*
* @return array An array with two elements. The first element contains the collection
* of elements where the predicate returned TRUE, the second element
* contains the collection of elements where the predicate returned FALSE.
@ -224,19 +240,21 @@ interface Collection extends Countable, IteratorAggregate, ArrayAccess
* For objects this means reference equality.
*
* @param mixed $element The element to search for.
* @return mixed The key/index of the element or FALSE if the element was not found.
*
* @return int|string|bool The key/index of the element or FALSE if the element was not found.
*/
function indexOf($element);
/**
* Extract a slice of $length elements starting at position $offset from the Collection.
* Extracts a slice of $length elements starting at position $offset from the Collection.
*
* If $length is null it returns all elements from $offset to the end of the Collection.
* Keys have to be preserved by this method. Calling this method will only return the
* selected slice and NOT change the elements contained in the collection slice is called on.
*
* @param int $offset
* @param int $length
* @param int $offset The offset to start from.
* @param int|null $length The maximum number of elements to return, or null for no limit.
*
* @return array
*/
function slice($offset, $length = null);

@ -41,12 +41,12 @@ class Criteria
const DESC = 'DESC';
/**
* @var \Doctrine\Common\Collections\ExpressionBuilder
* @var \Doctrine\Common\Collections\ExpressionBuilder|null
*/
private static $expressionBuilder;
/**
* @var \Doctrine\Common\Collections\Expr\Expression
* @var \Doctrine\Common\Collections\Expr\Expression|null
*/
private $expression;
@ -56,12 +56,12 @@ class Criteria
private $orderings;
/**
* @var int
* @var int|null
*/
private $firstResult;
/**
* @var int
* @var int|null
*/
private $maxResults;
@ -76,7 +76,7 @@ class Criteria
}
/**
* Return the expression builder.
* Returns the expression builder.
*
* @return \Doctrine\Common\Collections\ExpressionBuilder
*/
@ -89,12 +89,12 @@ class Criteria
}
/**
* Construct new criteria
* Construct a new Criteria.
*
* @param Expression $expression
* @param array $orderings
* @param int $firstResult
* @param int $maxResults
* @param array|null $orderings
* @param int|null $firstResult
* @param int|null $maxResults
*/
public function __construct(Expression $expression = null, array $orderings = null, $firstResult = null, $maxResults = null)
{
@ -105,9 +105,10 @@ class Criteria
}
/**
* Set the where expression to evaluate when this criteria is searched for.
* Sets the where expression to evaluate when this Criteria is searched for.
*
* @param Expression $expression
*
* @param Expression
* @return Criteria
*/
public function where(Expression $expression)
@ -117,10 +118,11 @@ class Criteria
}
/**
* Append the where expression to evaluate when this criteria is searched for
* Appends the where expression to evaluate when this Criteria is searched for
* using an AND with previous expression.
*
* @param Expression
* @param Expression $expression
*
* @return Criteria
*/
public function andWhere(Expression $expression)
@ -137,10 +139,11 @@ class Criteria
}
/**
* Append the where expression to evaluate when this criteria is searched for
* Appends the where expression to evaluate when this Criteria is searched for
* using an OR with previous expression.
*
* @param Expression
* @param Expression $expression
*
* @return Criteria
*/
public function orWhere(Expression $expression)
@ -157,7 +160,7 @@ class Criteria
}
/**
* Get the expression attached to this criteria.
* Gets the expression attached to this Criteria.
*
* @return Expression|null
*/
@ -167,7 +170,7 @@ class Criteria
}
/**
* Get current orderings of this Criteria
* Gets the current orderings of this Criteria.
*
* @return array
*/
@ -177,14 +180,15 @@ class Criteria
}
/**
* Set the ordering of the result of this criteria.
* Sets the ordering of the result of this Criteria.
*
* Keys are field and values are the order, being either ASC or DESC.
*
* @see Criteria::ASC
* @see Criteria::DESC
*
* @param array
* @param array $orderings
*
* @return Criteria
*/
public function orderBy(array $orderings)
@ -194,9 +198,9 @@ class Criteria
}
/**
* Get current first result option of the critera.
* Gets the current first result option of this Criteria.
*
* @return firstResult.
* @return int|null
*/
public function getFirstResult()
{
@ -204,9 +208,10 @@ class Criteria
}
/**
* Set number of first result that this criteria should return.
* Set the number of first result that this Criteria should return.
*
* @param int|null $firstResult The value to set.
*
* @param firstResult the value to set.
* @return Criteria
*/
public function setFirstResult($firstResult)
@ -216,9 +221,9 @@ class Criteria
}
/**
* Get maxResults.
* Gets maxResults.
*
* @return maxResults.
* @return int|null
*/
public function getMaxResults()
{
@ -226,9 +231,10 @@ class Criteria
}
/**
* Set maxResults.
* Sets maxResults.
*
* @param int|null $maxResults The value to set.
*
* @param maxResults the value to set.
* @return Criteria
*/
public function setMaxResults($maxResults)
@ -237,4 +243,3 @@ class Criteria
return $this;
}
}

@ -31,22 +31,37 @@ namespace Doctrine\Common\Collections\Expr;
class ClosureExpressionVisitor extends ExpressionVisitor
{
/**
* Access the field of a given object. This field has to be public directly
* or indirectly (through an accessor get* or a magic method, __get, __call).
* Accesses the field of a given object. This field has to be public
* directly or indirectly (through an accessor get*, is*, or a magic
* method, __get, __call).
*
* is*() is not supported.
* @param object $object
* @param string $field
*
* @return mixed
*/
static public function getObjectFieldValue($object, $field)
public static function getObjectFieldValue($object, $field)
{
$accessor = "get" . $field;
$accessors = array('get', 'is');
foreach ($accessors as $accessor) {
$accessor .= $field;
if ( ! method_exists($object, $accessor)) {
continue;
}
if (method_exists($object, $accessor) || method_exists($object, '__call')) {
return $object->$accessor();
}
if ($object instanceof \ArrayAccess) {
// __call should be triggered for get.
$accessor = $accessors[0] . $field;
if (method_exists($object, '__call')) {
return $object->$accessor();
}
if ($object instanceof \ArrayAccess || is_array($object)) {
return $object[$field];
}
@ -54,15 +69,15 @@ class ClosureExpressionVisitor extends ExpressionVisitor
}
/**
* Helper for sorting arrays of objects based on multiple fields +
* orientations.
* Helper for sorting arrays of objects based on multiple fields + orientations.
*
* @param string $name
* @param int $orientation
* @param Closure $next
* @return Closure
* @param \Closure $next
*
* @return \Closure
*/
static public function sortByField($name, $orientation = 1, \Closure $next = null)
public static function sortByField($name, $orientation = 1, \Closure $next = null)
{
if (!$next) {
$next = function() {
@ -132,6 +147,11 @@ class ClosureExpressionVisitor extends ExpressionVisitor
return ! in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
};
case Comparison::CONTAINS:
return function ($object) use ($field, $value) {
return false !== strpos(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
};
default:
throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator());
}
@ -168,6 +188,11 @@ class ClosureExpressionVisitor extends ExpressionVisitor
}
}
/**
* @param array $expressions
*
* @return callable
*/
private function andExpressions($expressions)
{
return function ($object) use ($expressions) {
@ -180,6 +205,11 @@ class ClosureExpressionVisitor extends ExpressionVisitor
};
}
/**
* @param array $expressions
*
* @return callable
*/
private function orExpressions($expressions)
{
return function ($object) use ($expressions) {
@ -192,4 +222,3 @@ class ClosureExpressionVisitor extends ExpressionVisitor
};
}
}

@ -36,11 +36,28 @@ class Comparison implements Expression
const IS = 'IS';
const IN = 'IN';
const NIN = 'NIN';
const CONTAINS = 'CONTAINS';
/**
* @var string
*/
private $field;
/**
* @var string
*/
private $op;
/**
* @var Value
*/
private $value;
/**
* @param string $field
* @param string $operator
* @param mixed $value
*/
public function __construct($field, $operator, $value)
{
if ( ! ($value instanceof Value)) {
@ -52,24 +69,35 @@ class Comparison implements Expression
$this->value = $value;
}
/**
* @return string
*/
public function getField()
{
return $this->field;
}
/**
* @return Value
*/
public function getValue()
{
return $this->value;
}
/**
* @return string
*/
public function getOperator()
{
return $this->op;
}
/**
* {@inheritDoc}
*/
public function visit(ExpressionVisitor $visitor)
{
return $visitor->walkComparison($this);
}
}

@ -30,9 +30,22 @@ class CompositeExpression implements Expression
const TYPE_AND = 'AND';
const TYPE_OR = 'OR';
/**
* @var string
*/
private $type;
/**
* @var Expression[]
*/
private $expressions = array();
/**
* @param string $type
* @param array $expressions
*
* @throws \RuntimeException
*/
public function __construct($type, array $expressions)
{
$this->type = $type;
@ -50,7 +63,7 @@ class CompositeExpression implements Expression
}
/**
* Return the list of expressions nested in this composite.
* Returns the list of expressions nested in this composite.
*
* @return Expression[]
*/
@ -59,14 +72,19 @@ class CompositeExpression implements Expression
return $this->expressions;
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* {@inheritDoc}
*/
public function visit(ExpressionVisitor $visitor)
{
return $visitor->walkCompositeExpression($this);
}
}

@ -26,6 +26,10 @@ namespace Doctrine\Common\Collections\Expr;
*/
interface Expression
{
/**
* @param ExpressionVisitor $visitor
*
* @return mixed
*/
public function visit(ExpressionVisitor $visitor);
}

@ -28,7 +28,7 @@ namespace Doctrine\Common\Collections\Expr;
abstract class ExpressionVisitor
{
/**
* Convert a comparison expression into the target query language output
* Converts a comparison expression into the target query language output.
*
* @param Comparison $comparison
*
@ -37,7 +37,7 @@ abstract class ExpressionVisitor
abstract public function walkComparison(Comparison $comparison);
/**
* Convert a value expression into the target query language part.
* Converts a value expression into the target query language part.
*
* @param Value $value
*
@ -46,7 +46,7 @@ abstract class ExpressionVisitor
abstract public function walkValue(Value $value);
/**
* Convert a composite expression into the target query language output
* Converts a composite expression into the target query language output.
*
* @param CompositeExpression $expr
*
@ -55,11 +55,13 @@ abstract class ExpressionVisitor
abstract public function walkCompositeExpression(CompositeExpression $expr);
/**
* Dispatch walking an expression to the appropriate handler.
* Dispatches walking an expression to the appropriate handler.
*
* @param Expression
* @param Expression $expr
*
* @return mixed
*
* @throws \RuntimeException
*/
public function dispatch(Expression $expr)
{
@ -78,4 +80,3 @@ abstract class ExpressionVisitor
}
}
}

@ -21,21 +21,32 @@ namespace Doctrine\Common\Collections\Expr;
class Value implements Expression
{
/**
* @var mixed
*/
private $value;
/**
* @param mixed $value
*/
public function __construct($value)
{
$this->value = $value;
}
/**
* @return mixed
*/
public function getValue()
{
return $this->value;
}
/**
* {@inheritDoc}
*/
public function visit(ExpressionVisitor $visitor)
{
return $visitor->walkValue($this);
}
}

@ -1,9 +1,9 @@
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYvalue HOLDERS AND CONTRIBUTORS
* 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 COPYvalue
* 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,
@ -32,6 +32,8 @@ use Doctrine\Common\Collections\Expr\Value;
class ExpressionBuilder
{
/**
* @param mixed $x
*
* @return CompositeExpression
*/
public function andX($x = null)
@ -40,6 +42,8 @@ class ExpressionBuilder
}
/**
* @param mixed $x
*
* @return CompositeExpression
*/
public function orX($x = null)
@ -115,7 +119,6 @@ class ExpressionBuilder
/**
* @param string $field
* @param mixed $value
*
* @return Comparison
*/
@ -126,7 +129,7 @@ class ExpressionBuilder
/**
* @param string $field
* @param mixed $value
* @param mixed $values
*
* @return Comparison
*/
@ -137,7 +140,7 @@ class ExpressionBuilder
/**
* @param string $field
* @param mixed $value
* @param mixed $values
*
* @return Comparison
*/
@ -145,5 +148,15 @@ class ExpressionBuilder
{
return new Comparison($field, Comparison::NIN, new Value($values));
}
}
/**
* @param string $field
* @param mixed $value
*
* @return Comparison
*/
public function contains($field, $value)
{
return new Comparison($field, Comparison::CONTAINS, new Value($value));
}
}

@ -37,12 +37,12 @@ namespace Doctrine\Common\Collections;
interface Selectable
{
/**
* Select all elements from a selectable that match the expression and
* return a new collection containing these elements.
* Selects all elements from a selectable that match the expression and
* returns a new collection containing these elements.
*
* @param Criteria $criteria
*
* @return Collection
*/
function matching(Criteria $criteria);
}

@ -13,7 +13,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
@ -36,6 +36,20 @@ class ClosureExpressionVisitorTest extends \PHPUnit_Framework_TestCase
$this->builder = new ExpressionBuilder();
}
public function testGetObjectFieldValueIsAccessor()
{
$object = new TestObject(1, 2, true);
$this->assertTrue($this->visitor->getObjectFieldValue($object, 'baz'));
}
public function testGetObjectFieldValueMagicCallMethod()
{
$object = new TestObject(1, 2, true, 3);
$this->assertEquals(3, $this->visitor->getObjectFieldValue($object, 'qux'));
}
public function testWalkEqualsComparison()
{
$closure = $this->visitor->walkComparison($this->builder->eq("foo", 1));
@ -106,6 +120,14 @@ class ClosureExpressionVisitorTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($closure(new TestObject(4)));
}
public function testWalkContainsComparison()
{
$closure = $this->visitor->walkComparison($this->builder->contains('foo', 'hello'));
$this->assertTrue($closure(new TestObject('hello world')));
$this->assertFalse($closure(new TestObject('world')));
}
public function testWalkAndCompositeExpression()
{
$closure = $this->visitor->walkCompositeExpression(
@ -172,17 +194,35 @@ class ClosureExpressionVisitorTest extends \PHPUnit_Framework_TestCase
$this->assertEquals("b", $objects[1]->getBar());
$this->assertEquals("c", $objects[2]->getBar());
}
public function testArrayComparison()
{
$closure = $this->visitor->walkComparison($this->builder->eq("foo", 42));
$this->assertTrue($closure(array('foo' => 42)));
}
}
class TestObject
{
private $foo;
private $bar;
private $baz;
private $qux;
public function __construct($foo = null, $bar = null)
public function __construct($foo = null, $bar = null, $baz = null, $qux = null)
{
$this->foo = $foo;
$this->bar = $bar;
$this->baz = $baz;
$this->qux = $qux;
}
public function __call($name, $arguments)
{
if ('getqux' === $name) {
return $this->qux;
}
}
public function getFoo()
@ -194,5 +234,10 @@ class TestObject
{
return $this->bar;
}
public function isBaz()
{
return $this->baz;
}
}

@ -110,5 +110,13 @@ class ExpressionBuilderTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr);
$this->assertEquals(Comparison::IS, $expr->getOperator());
}
public function testContains()
{
$expr = $this->builder->contains("a", "b");
$this->assertInstanceOf("Doctrine\Common\Collections\Expr\Comparison", $expr);
$this->assertEquals(Comparison::CONTAINS, $expr->getOperator());
}
}

@ -0,0 +1,8 @@
language: php
php:
- 5.3
- 5.4
before_script:
- composer --prefer-source --dev install

@ -2,7 +2,7 @@
"name": "doctrine/inflector",
"type": "library",
"description": "Common String Manipulations with regard to casing and singular/plural rules.",
"keywords": ["string", "inflection", "singuarlize", "pluarlize"],
"keywords": ["string", "inflection", "singularize", "pluralize"],
"homepage": "http://www.doctrine-project.org",
"license": "MIT",
"authors": [
@ -17,5 +17,10 @@
},
"autoload": {
"psr-0": { "Doctrine\\Common\\Inflector\\": "lib/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}

@ -20,7 +20,7 @@
namespace Doctrine\Common\Inflector;
/**
* Doctrine inflector has static methods for inflecting text
* Doctrine inflector has static methods for inflecting text.
*
* The methods in these classes are from several different sources collected
* across several different php projects and several different authors. The
@ -36,7 +36,7 @@ namespace Doctrine\Common\Inflector;
class Inflector
{
/**
* Plural inflector rules
* Plural inflector rules.
*
* @var array
*/
@ -105,7 +105,7 @@ class Inflector
);
/**
* Singular inflector rules
* Singular inflector rules.
*
* @var array
*/
@ -157,7 +157,7 @@ class Inflector
);
/**
* Words that should not be inflected
* Words that should not be inflected.
*
* @var array
*/
@ -191,10 +191,11 @@ class Inflector
private static $initialState = array();
/**
* Convert word in to the format for a Doctrine table name. Converts 'ModelName' to 'model_name'
* Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'.
*
* @param string $word Word to tableize
* @return string $word Tableized word
* @param string $word The word to tableize.
*
* @return string The tableized word.
*/
public static function tableize($word)
{
@ -202,10 +203,11 @@ class Inflector
}
/**
* Convert a word in to the format for a Doctrine class name. Converts 'table_name' to 'TableName'
* Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'.
*
* @param string $word The word to classify.
*
* @param string $word Word to classify
* @return string $word Classified word
* @return string The classified word.
*/
public static function classify($word)
{
@ -213,10 +215,11 @@ class Inflector
}
/**
* Camelize a word. This uses the classify() method and turns the first character to lowercase
* Camelizes a word. This uses the classify() method and turns the first character to lowercase.
*
* @param string $word The word to camelize.
*
* @param string $word
* @return string $word
* @return string The camelized word.
*/
public static function camelize($word)
{
@ -224,7 +227,7 @@ class Inflector
}
/**
* Clears Inflectors inflected value caches. And resets the inflection
* Clears Inflectors inflected value caches, and resets the inflection
* rules to the initial values.
*
* @return void
@ -257,9 +260,10 @@ class Inflector
* }}}
*
* @param string $type The type of inflection, either 'plural' or 'singular'
* @param array $rules Array of rules to be added.
* @param array $rules An array of rules to be added.
* @param boolean $reset If true, will unset default inflections for all
* new rules that are being defined in $rules.
*
* @return void
*/
public static function rules($type, $rules, $reset = false)
@ -290,10 +294,11 @@ class Inflector
}
/**
* Return $word in plural form.
* Returns a word in plural form.
*
* @param string $word The word in singular form.
*
* @param string $word Word in singular
* @return string Word in plural
* @return string The word in plural form.
*/
public static function pluralize($word)
{
@ -333,10 +338,11 @@ class Inflector
}
/**
* Return $word in singular form.
* Returns a word in singular form.
*
* @param string $word The word in plural form.
*
* @param string $word Word in plural
* @return string Word in singular
* @return string The word in singular form.
*/
public static function singularize($word)
{

@ -15,5 +15,10 @@
},
"autoload": {
"psr-0": { "Doctrine\\Common\\Lexer\\": "lib/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}

@ -30,27 +30,37 @@ namespace Doctrine\Common\Lexer;
abstract class AbstractLexer
{
/**
* @var array Array of scanned tokens
* Array of scanned tokens.
*
* @var array
*/
private $tokens = array();
/**
* @var integer Current lexer position in input string
* Current lexer position in input string.
*
* @var integer
*/
private $position = 0;
/**
* @var integer Current peek of current lexer position
* Current peek of current lexer position.
*
* @var integer
*/
private $peek = 0;
/**
* @var array The next token in the input.
* The next token in the input.
*
* @var array
*/
public $lookahead;
/**
* @var array The last matched/seen token.
* The last matched/seen token.
*
* @var array
*/
public $token;
@ -61,6 +71,8 @@ abstract class AbstractLexer
* Any unprocessed tokens from any previous input are lost.
*
* @param string $input The input to be tokenized.
*
* @return void
*/
public function setInput($input)
{
@ -71,6 +83,8 @@ abstract class AbstractLexer
/**
* Resets the lexer.
*
* @return void
*/
public function reset()
{
@ -82,6 +96,8 @@ abstract class AbstractLexer
/**
* Resets the peek pointer to 0.
*
* @return void
*/
public function resetPeek()
{
@ -91,7 +107,9 @@ abstract class AbstractLexer
/**
* Resets the lexer position on the input to the given position.
*
* @param integer $position Position to place the lexical scanner
* @param integer $position Position to place the lexical scanner.
*
* @return void
*/
public function resetPosition($position = 0)
{
@ -102,6 +120,7 @@ abstract class AbstractLexer
* Checks whether a given token matches the current lookahead.
*
* @param integer|string $token
*
* @return boolean
*/
public function isNextToken($token)
@ -110,9 +129,10 @@ abstract class AbstractLexer
}
/**
* Checks whether any of the given tokens matches the current lookahead
* Checks whether any of the given tokens matches the current lookahead.
*
* @param array $tokens
*
* @return boolean
*/
public function isNextTokenAny(array $tokens)
@ -129,7 +149,7 @@ abstract class AbstractLexer
* parameter, none)
* - 'position' : the position of the token in the input string
*
* @return array|null the next token; null if there is no more tokens left
* @return array|null The next token; null if there is no more tokens left.
*/
public function moveNext()
{
@ -145,6 +165,8 @@ abstract class AbstractLexer
* Tells the lexer to skip input tokens until it sees a token with the given value.
*
* @param string $type The token type to skip until.
*
* @return void
*/
public function skipUntil($type)
{
@ -154,10 +176,11 @@ abstract class AbstractLexer
}
/**
* Checks if given value is identical to the given token
* Checks if given value is identical to the given token.
*
* @param mixed $value
* @param integer $token
*
* @return boolean
*/
public function isA($value, $token)
@ -168,7 +191,7 @@ abstract class AbstractLexer
/**
* Moves the lookahead token forward.
*
* @return array | null The next token or NULL if there are no more tokens ahead.
* @return array|null The next token or NULL if there are no more tokens ahead.
*/
public function peek()
{
@ -194,7 +217,9 @@ abstract class AbstractLexer
/**
* Scans the input string for tokens.
*
* @param string $input a query string
* @param string $input A query string.
*
* @return void
*/
protected function scan($input)
{
@ -224,6 +249,7 @@ abstract class AbstractLexer
* Gets the literal for a given token.
*
* @param integer $token
*
* @return string
*/
public function getLiteral($token)
@ -259,6 +285,7 @@ abstract class AbstractLexer
* Retrieve token type. Also processes the token value if necessary.
*
* @param string $value
*
* @return integer
*/
abstract protected function getType(&$value);

@ -364,7 +364,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
*/
public function flush($prefix = '')
{
$this['routes']->addCollection($this['controllers']->flush($prefix), $prefix);
$this['routes']->addCollection($this['controllers']->flush($prefix));
}
/**
@ -462,7 +462,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
throw new \LogicException('The "mount" method takes either a ControllerCollection or a ControllerProviderInterface instance.');
}
$this['routes']->addCollection($controllers->flush($prefix), $prefix);
$this['routes']->addCollection($controllers->flush($prefix));
return $this;
}

@ -148,6 +148,8 @@ class ControllerCollection
$controller->freeze();
}
$routes->addPrefix($prefix);
$this->controllers = array();
return $routes;

Loading…
Cancel
Save