Ver código fonte

Updating vendor folder

Julio Montoya 12 anos atrás
pai
commit
2a5e2038ee
100 arquivos alterados com 12497 adições e 15 exclusões
  1. 0 6
      main/calendar/agenda_js.php
  2. 22 9
      main/newscorm/learnpath.class.php
  3. 1 0
      vendor/bin/doctrine
  4. 1 0
      vendor/bin/doctrine.php
  5. 12 0
      vendor/dflydev/doctrine-orm-service-provider/.travis.yml
  6. 19 0
      vendor/dflydev/doctrine-orm-service-provider/LICENSE
  7. 388 0
      vendor/dflydev/doctrine-orm-service-provider/README.md
  8. 42 0
      vendor/dflydev/doctrine-orm-service-provider/composer.json
  9. 18 0
      vendor/dflydev/doctrine-orm-service-provider/phpunit.xml.dist
  10. 40 0
      vendor/dflydev/doctrine-orm-service-provider/src/Dflydev/Cilex/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php
  11. 322 0
      vendor/dflydev/doctrine-orm-service-provider/src/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php
  12. 40 0
      vendor/dflydev/doctrine-orm-service-provider/src/Dflydev/Silex/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php
  13. 71 0
      vendor/dflydev/doctrine-orm-service-provider/tests/Dflydev/Cilex/Provider/DoctrineOrm/DoctrineormServiceProviderTest.php
  14. 261 0
      vendor/dflydev/doctrine-orm-service-provider/tests/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProviderTest.php
  15. 71 0
      vendor/dflydev/doctrine-orm-service-provider/tests/Dflydev/Silex/Provider/DoctrineOrm/DoctrineormServiceProviderTest.php
  16. 10 0
      vendor/doctrine/common/.travis.yml
  17. 19 0
      vendor/doctrine/common/LICENSE
  18. 12 0
      vendor/doctrine/common/README.md
  19. 39 0
      vendor/doctrine/common/UPGRADE_TO_2_1
  20. 61 0
      vendor/doctrine/common/UPGRADE_TO_2_2
  21. 141 0
      vendor/doctrine/common/bin/travis-setup.php
  22. 6 0
      vendor/doctrine/common/build.properties
  23. 59 0
      vendor/doctrine/common/build.xml
  24. 26 0
      vendor/doctrine/common/composer.json
  25. 79 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php
  26. 47 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php
  27. 37 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php
  28. 85 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Enum.php
  29. 54 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
  30. 33 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php
  31. 107 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php
  32. 150 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php
  33. 310 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php
  34. 139 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php
  35. 250 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php
  36. 132 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php
  37. 1041 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
  38. 269 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php
  39. 141 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php
  40. 89 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php
  41. 67 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php
  42. 157 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php
  43. 175 0
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/TokenParser.php
  44. 93 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php
  45. 96 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php
  46. 102 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php
  47. 231 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php
  48. 132 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/FileCache.php
  49. 114 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/FilesystemCache.php
  50. 121 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php
  51. 124 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php
  52. 108 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/PhpFileCache.php
  53. 119 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/RedisCache.php
  54. 93 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php
  55. 110 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php
  56. 84 0
      vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php
  57. 262 0
      vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php
  58. 500 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php
  59. 243 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php
  60. 240 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Criteria.php
  61. 195 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php
  62. 75 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php
  63. 72 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php
  64. 31 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Expression.php
  65. 81 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php
  66. 41 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Value.php
  67. 149 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/ExpressionBuilder.php
  68. 48 0
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Selectable.php
  69. 28 0
      vendor/doctrine/common/lib/Doctrine/Common/CommonException.php
  70. 49 0
      vendor/doctrine/common/lib/Doctrine/Common/Comparable.php
  71. 67 0
      vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php
  72. 147 0
      vendor/doctrine/common/lib/Doctrine/Common/EventManager.php
  73. 45 0
      vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php
  74. 266 0
      vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
  75. 45 0
      vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php
  76. 259 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
  77. 63 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php
  78. 88 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
  79. 76 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
  80. 59 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
  81. 84 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
  82. 133 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
  83. 112 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php
  84. 383 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
  85. 165 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
  86. 74 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
  87. 214 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
  88. 170 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
  89. 214 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
  90. 71 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
  91. 56 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
  92. 168 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
  93. 72 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php
  94. 141 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php
  95. 214 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php
  96. 86 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php
  97. 80 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php
  98. 102 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
  99. 107 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php
  100. 152 0
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php

+ 0 - 6
main/calendar/agenda_js.php

@@ -186,13 +186,7 @@ if ((api_is_allowed_to_edit() || $is_group_tutor) && $course_code != '-1' && $ty
     $select = $agenda->construct_not_selected_select_form($group_list, $user_list);
     $tpl->assign('visible_to', $select);
 }
-
-//Loading Agenda template
-//$content .= gettext('Hello');
-//$content .= gettext('Admin');
 $content = $tpl->fetch('default/agenda/month.tpl');
-
 $tpl->assign('content', $content);
-
 //Loading main Chamilo 1 col template
 $tpl->display_one_col_template();

+ 22 - 9
main/newscorm/learnpath.class.php

@@ -2262,7 +2262,7 @@ class learnpath {
         }
     }
 
-    public function get_preview_image_path($size = null) {
+    public function get_preview_image_path($size = null, $path_type = 'web') {
         $preview_image = $this->get_preview_image();
         if (isset($preview_image) && !empty($preview_image)) {
             $image_sys_path = api_get_path(SYS_COURSE_PATH).$this->course_info['path'].'/upload/learning_path/images/';
@@ -2271,10 +2271,18 @@ class learnpath {
                 $info = pathinfo($preview_image);
                 $image_custom_size = $info['filename'].'.'.$size.'.'.$info['extension'];
                 if (file_exists($image_sys_path.$image_custom_size)) {
-                    return $image_path.$image_custom_size;
+                    if ($path_type == 'web') {
+                        return $image_path.$image_custom_size;
+                    } else {
+                        return $image_sys_path.$image_custom_size;
+                    }
                 }
             } else {
-                return $image_path.$preview_image;
+                if ($path_type == 'web') {
+                    return $image_path.$preview_image;
+                } else {
+                    return $image_sys_path.$preview_image;
+                }
             }
         }
         return false;
@@ -4158,7 +4166,7 @@ class learnpath {
         if ($this->debug > 2) {
             error_log('New LP - lp updated with new preview image : ' . $this->preview_image, 0);
         }
-        $res = Database::query($sql);
+        Database::query($sql);
         return true;
     }
 
@@ -9052,12 +9060,17 @@ EOD;
     public function delete_lp_image() {
         $img = $this->get_preview_image();
         if ($img != '') {
-            $del_file = api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/upload/learning_path/images/' . $img;
-            $this->set_preview_image('');
-            return @unlink($del_file);
-        } else {
-            return false;
+            $del_file = $this->get_preview_image_path(null, 'sys');
+            if (isset($del_file) && file_exists($del_file)) {
+                $del_file_2 = $this->get_preview_image_path(64, 'sys');
+                if (file_exists($del_file_2)) {
+                    unlink($del_file_2);
+                }
+                $this->set_preview_image('');
+                return @unlink($del_file);
+            }
         }
+        return false;
     }
 
     /**

+ 1 - 0
vendor/bin/doctrine

@@ -0,0 +1 @@
+../doctrine/orm/bin/doctrine

+ 1 - 0
vendor/bin/doctrine.php

@@ -0,0 +1 @@
+../doctrine/orm/bin/doctrine.php

+ 12 - 0
vendor/dflydev/doctrine-orm-service-provider/.travis.yml

@@ -0,0 +1,12 @@
+language: php
+
+php:
+  - 5.3.3
+  - 5.3
+  - 5.4
+
+before_script:
+  - wget -nc http://getcomposer.org/composer.phar
+  - php composer.phar install --dev
+
+script: phpunit --coverage-text --verbose

+ 19 - 0
vendor/dflydev/doctrine-orm-service-provider/LICENSE

@@ -0,0 +1,19 @@
+Copyright (c) 2012 Dragonfly Development Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 388 - 0
vendor/dflydev/doctrine-orm-service-provider/README.md

@@ -0,0 +1,388 @@
+Doctrine ORM Service Provider
+=============================
+
+Provides Doctrine ORM Entity Managers as services to Pimple applications.
+
+
+Features
+--------
+
+ * Leverages the core [Doctrine Service Provider][1] for either
+   Silex or Cilex.
+ * Default Entity Manager can be bound to any database connection
+ * Multiple Entity Managers can be defined
+ * Mechanism for allowing Service Providers to register their own
+   mappings
+
+
+Requirements
+------------
+
+ * PHP 5.3+
+ * Doctrine ~2.3
+
+Currently requires both **dbs** and **dbs.event_manager** services in
+order to work. These can be provided by a Doctrine Service Provider
+like the [Silex][1] or [Cilex][8] service providers. If you can or
+want to fake it, go for it. :)
+
+
+Optional Dependencies
+---------------------
+
+### PSR-0 Resource Locator Service Provider
+
+An implementation of [dflydev/psr0-resource-locator-service-provider][6]
+is required if using namespaceish resource mapping. See documentation
+for **orm.generate_psr0_mapping** for more information.
+
+ 
+Installation
+------------
+ 
+Through [Composer](http://getcomposer.org) as [dflydev/doctrine-orm-service-provider][7].
+
+
+Usage
+-----
+
+To get up and running, register `DoctrineOrmServiceProvider` and
+manually specify the directory that will contain the proxies along
+with at least one mapping.
+
+In each of these examples an Entity Manager that is bound to the
+default database connection will be provided. It will be accessible
+via **orm.em**.
+
+```php
+<?php
+
+// Default entity manager.
+$em = $app['orm.em'];
+```
+
+### Pimple
+
+```php
+<?php
+
+use Dflydev\Pimple\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
+
+$container = new \Pimple;
+
+$container["db.options"] = array(
+    "driver" => "pdo_sqlite",
+    "path" => "/path/to/sqlite.db",
+);
+
+// ensure that $container['dbs'] and $container['dbs.event_manager']
+// are available, most likely by way of a core service provider.
+
+$container["orm.proxies_dir"] = "/path/to/proxies";
+$container["orm.em.options"] = array(
+    "mappings" => array(
+        // Using actual filesystem paths
+        array(
+            "type" => "annotation",
+            "namespace" => "Foo\Entities",
+            "path" => __DIR__."/src/Foo/Entities",
+        ),
+        array(
+            "type" => "xml",
+            "namespace" => "Bat\Entities",
+            "path" => __DIR__."/src/Bat/Resources/mappings",
+        ),
+        // Using PSR-0 namespaceish embedded resources
+        // (requires registering a PSR-0 Resource Locator
+        // Service Provider)
+        array(
+            "type" => "annotations",
+            "namespace" => "Baz\Entities",
+            "resources_namespace" => "Baz\Entities",
+        ),
+        array(
+            "type" => "xml",
+            "namespace" => "Bar\Entities",
+            "resources_namespace" => "Bar\Resources\mappings",
+        ),
+    ),
+);
+
+$doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+$doctrineormServiceProvider->register($container);
+```
+
+### Silex
+
+```php
+<?php
+
+use Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
+use Silex\Application;
+use Silex\Provider\DoctrineServiceProvider;
+
+$app = new Application;
+
+$app->register(new DoctrineServiceProvider, array(
+    "db.options" => array(
+        "driver" => "pdo_sqlite",
+        "path" => "/path/to/sqlite.db",
+    ),
+));
+
+$app->register(new DoctrineOrmServiceProvider, array(
+    "orm.proxies_dir" => "/path/to/proxies",
+    "orm.em.options" => array(
+        "mappings" => array(
+            // Using actual filesystem paths
+            array(
+                "type" => "annotation",
+                "namespace" => "Foo\Entities",
+                "path" => __DIR__."/src/Foo/Entities",
+            ),
+            array(
+                "type" => "xml",
+                "namespace" => "Bat\Entities",
+                "path" => __DIR__."/src/Bat/Resources/mappings",
+            ),
+            // Using PSR-0 namespaceish embedded resources
+            // (requires registering a PSR-0 Resource Locator
+            // Service Provider)
+            array(
+                "type" => "annotations",
+                "namespace" => "Baz\Entities",
+                "resources_namespace" => "Baz\Entities",
+            ),
+            array(
+                "type" => "xml",
+                "namespace" => "Bar\Entities",
+                "resources_namespace" => "Bar\Resources\mappings",
+            ),
+        ),
+    ),
+));
+```
+
+### Cilex
+
+```php
+<?php
+
+use Dflydev\Cilex\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
+use Cilex\Application;
+use Cilex\Provider\DoctrineServiceProvider;
+
+$app = new Application('My Application');
+
+$app->register(new DoctrineServiceProvider, array(
+    /** same as the Silex example **/
+));
+
+$app->register(new DoctrineOrmServiceProvider, array(
+    /** same as the Silex example **/
+));
+```
+
+
+Configuration
+-------------
+
+### Parameters
+
+ * **orm.em.options**:
+   Array of Entity Manager options.
+
+   These options are available:
+   * **connection**:
+     String defining which database connection to use. Used when using
+     named databases via **dbs**.
+     *Default: default*
+   * **mappings**:
+     Array of mapping definitions.
+
+     Each mapping definition should be an array with the following
+     options:
+     * **type**: Mapping driver type, one of `annotation`, `xml`, or `yml`.
+     * **namespace**: Namespace in which the entities reside.
+
+     Additionally, each mapping definition should contain one of the
+     following options:
+     * **path**: Path to where the mapping files are located. This should
+       be an actual filesystem path.
+     * **resources_namespace**: A namespaceish path to where the mapping
+       files are located. Example: `Path\To\Foo\Resources\mappings`
+
+     Each **annotation** mapping may also specify the following options:
+     * **use_simple_annotation_reader**:
+       If `true`, only simple notations like `@Entity` will work.
+       If `false`, more advanced notations and aliasing via `use` will
+       work. (Example: `use Doctrine\ORM\Mapping AS ORM`, `@ORM\Entity`)
+       Note that if set to `false`, the `AnnotationRegistry` will probably
+       need to be configured correctly so that it can load your Annotations
+       classes. See this FAQ:
+       [Why aren't my Annotations classes being found?](#why-arent-my-annotations-classes-being-found)
+   * **query_cache**:
+     String or array describing query cache implementation.
+     *Default: setting specified by orm.default_cache*
+   * **metadata_cache**:
+     String or array describing metadata cache implementation.
+     *Default: setting specified by orm.default_cache*
+   * **result_cache**:
+     String or array describing result cache implementation.
+     *Default: setting specified by orm.default_cache*
+ * **orm.ems.options**:
+   Array of Entity Manager configuration sets indexed by each Entity Manager's
+   name. Each value should look like **orm.em.options**.
+   
+   Example configuration:
+
+   ```php
+   <?php
+   $app['orm.ems.default'] = 'sqlite';
+   $app['orm.ems.options'] = array(
+       'mysql' => array(
+           'connection' => 'mysql',
+           'mappings' => array(), 
+       ),
+       'sqlite' => array(
+           'connection' => 'sqlite',
+           'mappings' => array(),
+       ),
+   );
+   ```
+
+   Example usage:
+
+   ```php
+   <?php
+   $emMysql = $app['orm.ems']['mysql'];
+   $emSqlite = $app['orm.ems']['sqlite'];
+   ```
+ * **orm.ems.default**:
+   String defining the name of the default Entity Manager.
+   *Default: first Entity Manager processed*
+ * **orm.proxies_dir**:
+   String defining path to where Doctrine generated proxies should be located.
+ * **orm.proxies_namespace**:
+   String defining namespace in which Doctrine generated proxies should reside.
+   *Default: DoctrineProxy*
+ * **orm.auto_generate_proxies**:
+   Boolean defining whether or not proxies should be generated automatically.
+ * **orm.default_cache**:
+   String or array describing default cache implementation.
+ * **orm.add_mapping_driver**:
+   Function providing the ability to add a mapping driver to an Entity Manager.
+
+   These params are available:
+    * **$mappingDriver**:
+      Mapping driver to be added,
+      instance `Doctrine\Common\Persistence\Mapping\Driver\MappingDriver`.
+    * **$namespace**:
+      Namespace to be mapped by `$mappingDriver`, string.
+    * **$name**:
+      Name of Entity Manager to add mapping to, string, default `null`.
+ * **orm.em_name_from_param**:
+   Function providing the ability to retrieve an entity manager's name from
+   a param.
+
+   This is useful for being able to optionally allow users to specify which
+   entity manager should be configured for a 3rd party service provider
+   but fallback to the default entity manager if not explitely specified.
+
+   For example:
+
+   ```php
+   <?php
+   $emName = $app['orm.em_name_from_param']('3rdparty.provider.em');
+   $em = $app['orm.ems'][$emName];
+   ```
+
+   This code should be able to be used inside of a 3rd party service provider
+   safely, whether the user has defined `3rdparty.provider.em` or not.
+ * **orm.generate_psr0_mapping**:
+   Leverages [dflydev/psr0-resource-locator-service-provider][6] to process
+   a map of namespaceish resource directories to their mapped entities.
+
+   Example usage:
+   ```php
+   <?php
+   $app['orm.ems.config'] = $app->share($app->extend('orm.ems.config', function ($config, $app) {
+       $mapping = $app['orm.generate_psr0_mapping'](array(
+           'Foo\Resources\mappings' => 'Foo\Entities',
+           'Bar\Resources\mappings' => 'Bar\Entities',
+       ));
+
+       $chain = $app['orm.mapping_driver_chain.locator']();
+
+       foreach ($mapping as $directory => $namespace) {
+           $driver = new XmlDriver($directory);
+           $chain->addDriver($driver, $namespace);
+       }
+
+       return $config;
+   }));
+   ```
+
+### Services
+
+ * **orm.em**:
+   Entity Manager, instance `Doctrine\ORM\EntityManager`.
+ * **orm.ems**:
+   Entity Managers, array of `Doctrine\ORM\EntityManager` indexed by name.
+
+
+Frequently Asked Questions
+--------------------------
+
+### Why aren't my Annotations classes being found?
+
+When **use_simple_annotation_reader** is set to `False` for an entity,
+the `AnnotationRegistry` needs to have the project's autoloader added
+to it.
+
+Example:
+
+```php
+<?php
+$loader = require __DIR__ . '/../vendor/autoload.php';
+
+\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
+```
+
+License
+-------
+
+MIT, see LICENSE.
+
+
+Community
+---------
+
+If you have questions or want to help out, join us in the
+[#dflydev][#dflydev] or [#silex-php][#silex-php] channels on
+irc.freenode.net.
+
+
+Not Invented Here
+-----------------
+
+This project is based heavily on both the core
+[Doctrine Service Provider][1] and the work done by [@docteurklein][2]
+on the [docteurklein/silex-doctrine-service-providers][3] project.
+Some inspiration was also taken from [Doctrine Bundle][4] and
+[Doctrine Bridge][5].
+
+
+[1]: http://silex.sensiolabs.org/doc/providers/doctrine.html
+[2]: https://github.com/docteurklein
+[3]: https://github.com/docteurklein/SilexServiceProviders
+[4]: https://github.com/doctrine/DoctrineBundle
+[5]: https://github.com/symfony/symfony/tree/master/src/Symfony/Bridge/Doctrine
+[6]: http://github.com/dflydev/dflydev-psr0-resource-locator-service-provider
+[7]: https://packagist.org/packages/dflydev/doctrine-orm-service-provider
+[8]: https://github.com/Cilex/Cilex/blob/master/src/Cilex/Provider/DoctrineServiceProvider.php
+
+[#dflydev]: irc://irc.freenode.net/#dflydev
+[#silex-php]: irc://irc.freenode.net/#silex-php
+
+

+ 42 - 0
vendor/dflydev/doctrine-orm-service-provider/composer.json

@@ -0,0 +1,42 @@
+{
+    "name": "dflydev/doctrine-orm-service-provider",
+    "description": "Doctrine ORM Service Provider",
+    "keywords": ["pimple", "cilex", "silex", "doctrine", "orm"],
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Dragonfly Development Inc.",
+            "email": "info@dflydev.com",
+            "homepage": "http://dflydev.com"
+        },
+        {
+            "name": "Beau Simensen",
+            "email": "beau@dflydev.com",
+            "homepage": "http://beausimensen.com"
+        }
+    ],
+    "require": {
+        "php": ">=5.3.3",
+        "pimple/pimple": "1.*@dev",
+        "doctrine/orm": "~2.3"
+    },
+    "require-dev": {
+        "cilex/cilex": "1.*@dev",
+        "silex/silex": "1.*@dev"
+    },
+    "suggest": {
+        "dflydev/psr0-resource-locator-service-provider": "1.0.*@dev"
+    },
+    "autoload": {
+        "psr-0": {
+            "Dflydev\\Cilex\\Provider\\DoctrineOrm": "src",
+            "Dflydev\\Pimple\\Provider\\DoctrineOrm": "src",
+            "Dflydev\\Silex\\Provider\\DoctrineOrm": "src"
+        }
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "1.0-dev"
+        }
+    }
+}

+ 18 - 0
vendor/dflydev/doctrine-orm-service-provider/phpunit.xml.dist

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit colors="true" bootstrap="vendor/autoload.php">
+    <testsuites>
+        <testsuite name="Doctrine ORM Service Provider Test Suite">
+            <directory>./tests/Dflydev/Cilex/Provider/DoctrineOrm</directory>
+            <directory>./tests/Dflydev/Pimple/Provider/DoctrineOrm</directory>
+            <directory>./tests/Dflydev/Silex/Provider/DoctrineOrm</directory>
+        </testsuite>
+    </testsuites>
+
+    <filter>
+        <whitelist>
+            <directory>./src/Dflydev/Cilex/Provider/DoctrineOrm/</directory>
+            <directory>./src/Dflydev/Pimple/Provider/DoctrineOrm/</directory>
+            <directory>./src/Dflydev/Silex/Provider/DoctrineOrm/</directory>
+        </whitelist>
+    </filter>
+</phpunit>

+ 40 - 0
vendor/dflydev/doctrine-orm-service-provider/src/Dflydev/Cilex/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php

@@ -0,0 +1,40 @@
+<?php
+
+/*
+ * This file is a part of dflydev/doctrine-orm-service-provider.
+ *
+ * (c) Dragonfly Development Inc.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Dflydev\Cilex\Provider\DoctrineOrm;
+
+use Dflydev\Pimple\Provider\DoctrineOrm\DoctrineOrmServiceProvider as PimpleDoctrineOrmServiceProvider;
+use Cilex\Application;
+use Cilex\ServiceProviderInterface;
+
+/**
+ * Doctrine ORM Cilex Service Provider.
+ *
+ * @author Beau Simensen <beau@dflydev.com>
+ */
+class DoctrineOrmServiceProvider implements ServiceProviderInterface
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function boot(Application $app)
+    {
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function register(Application $app)
+    {
+        $pimpleServiceProvider = new PimpleDoctrineOrmServiceProvider;
+        $pimpleServiceProvider->register($app);
+    }
+}

+ 322 - 0
vendor/dflydev/doctrine-orm-service-provider/src/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php

@@ -0,0 +1,322 @@
+<?php
+
+/*
+ * This file is a part of dflydev/doctrine-orm-service-provider.
+ *
+ * (c) Dragonfly Development Inc.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Dflydev\Pimple\Provider\DoctrineOrm;
+
+use Doctrine\Common\Cache\ApcCache;
+use Doctrine\Common\Cache\ArrayCache;
+use Doctrine\Common\Cache\MemcacheCache;
+use Doctrine\Common\Cache\MemcachedCache;
+use Doctrine\Common\Cache\XcacheCache;
+use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
+use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
+use Doctrine\ORM\Configuration;
+use Doctrine\ORM\EntityManager;
+use Doctrine\ORM\Mapping\Driver\Driver;
+use Doctrine\ORM\Mapping\Driver\XmlDriver;
+use Doctrine\ORM\Mapping\Driver\YamlDriver;
+
+/**
+ * Doctrine ORM Pimple Service Provider.
+ *
+ * @author Beau Simensen <beau@dflydev.com>
+ */
+class DoctrineOrmServiceProvider
+{
+    public function register(\Pimple $app)
+    {
+        foreach ($this->getOrmDefaults($app) as $key => $value) {
+            if (!isset($app[$key])) {
+                $app[$key] = $value;
+            }
+        }
+
+        $app['orm.em.default_options'] = array(
+            'connection' => 'default',
+            'mappings' => array(),
+        );
+
+        $app['orm.ems.options.initializer'] = $app->protect(function () use ($app) {
+            static $initialized = false;
+
+            if ($initialized) {
+                return;
+            }
+
+            $initialized = true;
+
+            if (!isset($app['orm.ems.options'])) {
+                $app['orm.ems.options'] = array('default' => isset($app['orm.em.options']) ? $app['orm.em.options'] : array());
+            }
+
+            $tmp = $app['orm.ems.options'];
+            foreach ($tmp as $name => &$options) {
+                $options = array_replace($app['orm.em.default_options'], $options);
+
+                if (!isset($app['orm.ems.default'])) {
+                    $app['orm.ems.default'] = $name;
+                }
+            }
+            $app['orm.ems.options'] = $tmp;
+        });
+
+        $app['orm.em_name_from_param_key'] = $app->protect(function ($paramKey) use ($app) {
+            $app['orm.ems.options.initializer']();
+
+            if (isset($app[$paramKey])) {
+                return $app[$paramKey];
+            }
+
+            return $app['orm.ems.default'];
+        });
+
+        $app['orm.ems'] = $app->share(function($app) {
+            $app['orm.ems.options.initializer']();
+
+            $ems = new \Pimple();
+            foreach ($app['orm.ems.options'] as $name => $options) {
+                if ($app['orm.ems.default'] === $name) {
+                    // we use shortcuts here in case the default has been overridden
+                    $config = $app['orm.em.config'];
+                } else {
+                    $config = $app['orm.ems.config'][$name];
+                }
+
+                $ems[$name] = EntityManager::create(
+                    $app['dbs'][$options['connection']],
+                    $config,
+                    $app['dbs.event_manager'][$options['connection']]
+                );
+            }
+
+            return $ems;
+        });
+
+        $app['orm.ems.config'] = $app->share(function($app) {
+            $app['orm.ems.options.initializer']();
+
+            $configs = new \Pimple();
+            foreach ($app['orm.ems.options'] as $name => $options) {
+                $config = new Configuration;
+
+                $app['orm.cache.configurer']($name, $config, $options);
+
+                $config->setProxyDir($app['orm.proxies_dir']);
+                $config->setProxyNamespace($app['orm.proxies_namespace']);
+                $config->setAutoGenerateProxyClasses($app['orm.auto_generate_proxies']);
+
+                $chain = $app['orm.mapping_driver_chain.locator']($name);
+                foreach ((array) $options['mappings'] as $entity) {
+                    if (!empty($entity['resources_namespace'])) {
+                        $entity['path'] = $app['psr0_resource_locator']->findFirstDirectory($entity['resources_namespace']);
+                    }
+
+                    switch ($entity['type']) {
+                        case 'annotation':
+                            $useSimpleAnnotationReader =
+                                isset($entity['use_simple_annotation_reader'])
+                                ? $entity['use_simple_annotation_reader']
+                                : true;
+                            $driver = $config->newDefaultAnnotationDriver((array) $entity['path'], $useSimpleAnnotationReader);
+                            $chain->addDriver($driver, $entity['namespace']);
+                            break;
+                        case 'yml':
+                            $driver = new YamlDriver($entity['path']);
+                            $chain->addDriver($driver, $entity['namespace']);
+                            break;
+                        case 'xml':
+                            $driver = new XmlDriver($entity['path']);
+                            $chain->addDriver($driver, $entity['namespace']);
+                            break;
+                        default:
+                            throw new \InvalidArgumentException(sprintf('"%s" is not a recognized driver', $entity['type']));
+                            break;
+                    }
+                }
+                $config->setMetadataDriverImpl($chain);
+
+                $configs[$name] = $config;
+            }
+
+            return $configs;
+        });
+
+        $app['orm.cache.configurer'] = $app->protect(function($name, Configuration $config, $options) use ($app) {
+            $config->setMetadataCacheImpl($app['orm.cache.locator']($name, 'metadata', $options));
+            $config->setQueryCacheImpl($app['orm.cache.locator']($name, 'query', $options));
+            $config->setResultCacheImpl($app['orm.cache.locator']($name, 'result', $options));
+        });
+
+        $app['orm.cache.locator'] = $app->protect(function($name, $cacheName, $options) use ($app) {
+            $cacheNameKey = $cacheName . '_cache';
+
+            if (!isset($options[$cacheNameKey])) {
+                $options[$cacheNameKey] = $app['orm.default_cache'];
+            }
+
+            if (isset($options[$cacheNameKey]) && !is_array($options[$cacheNameKey])) {
+                $options[$cacheNameKey] = array(
+                    'driver' => $options[$cacheNameKey],
+                );
+            }
+
+            if (!isset($options[$cacheNameKey]['driver'])) {
+                throw new \RuntimeException("No driver specified for '$cacheName'");
+            }
+
+            $driver = $options[$cacheNameKey]['driver'];
+
+            $cacheInstanceKey = 'orm.cache.instances.'.$name.'.'.$cacheName;
+            if (isset($app[$cacheInstanceKey])) {
+                return $app[$cacheInstanceKey];
+            }
+
+            return $app[$cacheInstanceKey] = $app['orm.cache.factory']($driver, $options);
+        });
+
+        $app['orm.cache.factory.backing_memcache'] = $app->protect(function() {
+            return new \Memcache;
+        });
+
+        $app['orm.cache.factory.memcache'] = $app->protect(function($cacheOptions) use ($app) {
+            if (empty($cacheOptions['host']) || empty($cacheOptions['port'])) {
+                throw new \RuntimeException('Host and port options need to be specified for memcache cache');
+            }
+
+            $memcache = $app['orm.cache.factory.backing_memcache']();
+            $memcache->connect($cacheOptions['host'], $cacheOptions['port']);
+
+            $cache = new MemcacheCache;
+            $cache->setMemcache($memcache);
+
+            return $cache;
+        });
+
+        $app['orm.cache.factory.backing_memcached'] = $app->protect(function() {
+            return new \Memcached;
+        });
+
+        $app['orm.cache.factory.memcached'] = $app->protect(function($cacheOptions) use ($app) {
+            if (empty($cacheOptions['host']) || empty($cacheOptions['port'])) {
+                throw new \RuntimeException('Host and port options need to be specified for memcached cache');
+            }
+
+            $memcached = $app['orm.cache.factory.backing_memcached']();
+            $memcached->addServer($cacheOptions['host'], $cacheOptions['port']);
+
+            $cache = new MemcachedCache;
+            $cache->setMemcached($memcache);
+
+            return $cache;
+        });
+
+        $app['orm.cache.factory.array'] = $app->protect(function() {
+            return new ArrayCache;
+        });
+
+        $app['orm.cache.factory.apc'] = $app->protect(function() {
+            return new ApcCache;
+        });
+
+        $app['orm.cache.factory.xcache'] = $app->protect(function() {
+            return new XcacheCache;
+        });
+
+        $app['orm.cache.factory'] = $app->protect(function($driver, $cacheOptions) use ($app) {
+            switch ($driver) {
+                case 'array':
+                    return $app['orm.cache.factory.array']();
+                case 'apc':
+                    return $app['orm.cache.factory.apc']();
+                case 'xcache':
+                    return $app['orm.cache.factory.xcache']();
+                case 'memcache':
+                    return $app['orm.cache.factory.memcache']($cacheOptions);
+                case 'memcached':
+                    return $app['orm.cache.factory.memcached']($cacheOptions);
+                default:
+                    throw new \RuntimeException("Unsupported cache type '$driver' specified");
+            }
+        });
+
+        $app['orm.mapping_driver_chain.locator'] = $app->protect(function($name = null) use ($app) {
+            $app['orm.ems.options.initializer']();
+
+            if (null === $name) {
+                $name = $app['orm.ems.default'];
+            }
+
+            $cacheInstanceKey = 'orm.mapping_driver_chain.instances.'.$name;
+            if (isset($app[$cacheInstanceKey])) {
+                return $app[$cacheInstanceKey];
+            }
+
+            return $app[$cacheInstanceKey] = $app['orm.mapping_driver_chain.factory']($name);
+        });
+
+        $app['orm.mapping_driver_chain.factory'] = $app->protect(function($name) use ($app) {
+            return new MappingDriverChain;
+        });
+
+        $app['orm.add_mapping_driver'] = $app->protect(function(MappingDriver $mappingDriver, $namespace, $name = null) use ($app) {
+            $app['orm.ems.options.initializer']();
+
+            if (null === $name) {
+                $name = $app['orm.ems.default'];
+            }
+
+            $driverChain = $app['orm.mapping_driver_chain.locator']($name);
+            $driverChain->addDriver($mappingDriver, $namespace);
+        });
+
+        $app['orm.generate_psr0_mapping'] = $app->protect(function($resourceMapping) use ($app) {
+            $mapping = array();
+            foreach ($resourceMapping as $resourceNamespace => $entityNamespace) {
+                $directory = $app['psr0_resource_locator']->findFirstDirectory($resourceNamespace);
+                if (!$directory) {
+                    throw new \InvalidArgumentException("Resources for mapping '$entityNamespace' could not be located; Looked for mapping resources at '$resourceNamespace'");
+                }
+                $mapping[$directory] = $entityNamespace;
+            }
+
+            return $mapping;
+        });
+
+        $app['orm.em'] = $app->share(function($app) {
+            $ems = $app['orm.ems'];
+
+            return $ems[$app['orm.ems.default']];
+        });
+
+        $app['orm.em.config'] = $app->share(function($app) {
+            $configs = $app['orm.ems.config'];
+
+            return $configs[$app['orm.ems.default']];
+        });
+    }
+
+    /**
+     * Get default ORM configuration settings.
+     *
+     * @param Application $app Application
+     *
+     * @return array
+     */
+    protected function getOrmDefaults(\Pimple $app)
+    {
+        return array(
+            'orm.proxies_dir' => __DIR__.'/../../../../../../../../cache/doctrine/proxies',
+            'orm.proxies_namespace' => 'DoctrineProxy',
+            'orm.auto_generate_proxies' => true,
+            'orm.default_cache' => 'array',
+        );
+    }
+}

+ 40 - 0
vendor/dflydev/doctrine-orm-service-provider/src/Dflydev/Silex/Provider/DoctrineOrm/DoctrineOrmServiceProvider.php

@@ -0,0 +1,40 @@
+<?php
+
+/*
+ * This file is a part of dflydev/doctrine-orm-service-provider.
+ *
+ * (c) Dragonfly Development Inc.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Dflydev\Silex\Provider\DoctrineOrm;
+
+use Dflydev\Pimple\Provider\DoctrineOrm\DoctrineOrmServiceProvider as PimpleDoctrineOrmServiceProvider;
+use Silex\Application;
+use Silex\ServiceProviderInterface;
+
+/**
+ * Doctrine ORM Silex Service Provider.
+ *
+ * @author Beau Simensen <beau@dflydev.com>
+ */
+class DoctrineOrmServiceProvider implements ServiceProviderInterface
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function boot(Application $app)
+    {
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function register(Application $app)
+    {
+        $pimpleServiceProvider = new PimpleDoctrineOrmServiceProvider;
+        $pimpleServiceProvider->register($app);
+    }
+}

+ 71 - 0
vendor/dflydev/doctrine-orm-service-provider/tests/Dflydev/Cilex/Provider/DoctrineOrm/DoctrineormServiceProviderTest.php

@@ -0,0 +1,71 @@
+<?php
+
+/*
+ * This file is a part of dflydev/doctrine-orm-service-provider.
+ *
+ * (c) Dragonfly Development Inc.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Dflydev\Cilex\Provider\DoctrineOrm;
+
+use Cilex\Application;
+
+/**
+ * DoctrineOrmServiceProvider Test.
+ *
+ * @author Beau Simensen <beau@dflydev.com>
+ */
+class DoctrineOrmServiceProviderTest extends \PHPUnit_Framework_TestCase
+{
+    protected function createMockDefaultAppAndDeps()
+    {
+        $app = new Application('test');
+
+        $eventManager = $this->getMock('Doctrine\Common\EventManager');
+        $connection = $this
+            ->getMockBuilder('Doctrine\DBAL\Connection')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $connection
+            ->expects($this->any())
+            ->method('getEventManager')
+            ->will($this->returnValue($eventManager));
+
+        $app['dbs'] = new \Pimple(array(
+            'default' => $connection,
+        ));
+
+        $app['dbs.event_manager'] = new \Pimple(array(
+            'default' => $eventManager,
+        ));
+
+        return array($app, $connection, $eventManager);;
+    }
+
+    protected function createMockDefaultApp()
+    {
+        list ($app, $connection, $eventManager) = $this->createMockDefaultAppAndDeps();
+
+        return $app;
+    }
+
+    /**
+     * Test registration
+     */
+    public function testRegister()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $app->register(new DoctrineOrmServiceProvider);
+
+        $this->assertEquals($app['orm.em'], $app['orm.ems']['default']);
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getQueryCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getResultCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getMetadataCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain', $app['orm.em.config']->getMetadataDriverImpl());
+    }
+}

+ 261 - 0
vendor/dflydev/doctrine-orm-service-provider/tests/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProviderTest.php

@@ -0,0 +1,261 @@
+<?php
+
+/*
+ * This file is a part of dflydev/doctrine-orm-service-provider.
+ *
+ * (c) Dragonfly Development Inc.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Dflydev\Pimple\Provider\DoctrineOrm;
+
+/**
+ * DoctrineOrmServiceProvider Test.
+ *
+ * @author Beau Simensen <beau@dflydev.com>
+ */
+class DoctrineOrmServiceProviderTest extends \PHPUnit_Framework_TestCase
+{
+    protected function createMockDefaultAppAndDeps()
+    {
+        $app = new \Pimple;
+
+        $eventManager = $this->getMock('Doctrine\Common\EventManager');
+        $connection = $this
+            ->getMockBuilder('Doctrine\DBAL\Connection')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $connection
+            ->expects($this->any())
+            ->method('getEventManager')
+            ->will($this->returnValue($eventManager));
+
+        $app['dbs'] = new \Pimple(array(
+            'default' => $connection,
+        ));
+
+        $app['dbs.event_manager'] = new \Pimple(array(
+            'default' => $eventManager,
+        ));
+
+        return array($app, $connection, $eventManager);;
+    }
+
+    protected function createMockDefaultApp()
+    {
+        list ($app, $connection, $eventManager) = $this->createMockDefaultAppAndDeps();
+
+        return $app;
+    }
+
+    /**
+     * Test registration (test expected class for default implementations)
+     */
+    public function testRegisterDefaultImplementations()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $this->assertEquals($app['orm.em'], $app['orm.ems']['default']);
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getQueryCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getResultCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getMetadataCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain', $app['orm.em.config']->getMetadataDriverImpl());
+    }
+
+    /**
+     * Test registration (test equality for defined implementations)
+     */
+    public function testRegisterDefinedImplementations()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $queryCache = $this->getMock('Doctrine\Common\Cache\ArrayCache');
+        $resultCache = $this->getMock('Doctrine\Common\Cache\ArrayCache');
+        $metadataCache = $this->getMock('Doctrine\Common\Cache\ArrayCache');
+
+        $mappingDriverChain = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain');
+
+        $app['orm.cache.instances.default.query'] = $queryCache;
+        $app['orm.cache.instances.default.result'] = $resultCache;
+        $app['orm.cache.instances.default.metadata'] = $metadataCache;
+
+        $app['orm.mapping_driver_chain.instances.default'] = $mappingDriverChain;
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $this->assertEquals($app['orm.em'], $app['orm.ems']['default']);
+        $this->assertEquals($queryCache, $app['orm.em.config']->getQueryCacheImpl());
+        $this->assertEquals($resultCache, $app['orm.em.config']->getResultCacheImpl());
+        $this->assertEquals($metadataCache, $app['orm.em.config']->getMetadataCacheImpl());
+        $this->assertEquals($mappingDriverChain, $app['orm.em.config']->getMetadataDriverImpl());
+    }
+
+    /**
+     * Test proxy configuration (defaults)
+     */
+    public function testProxyConfigurationDefaults()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $this->assertContains('/../../../../../../../cache/doctrine/proxies', $app['orm.em.config']->getProxyDir());
+        $this->assertEquals('DoctrineProxy', $app['orm.em.config']->getProxyNamespace());
+        $this->assertTrue($app['orm.em.config']->getAutoGenerateProxyClasses());
+    }
+
+    /**
+     * Test proxy configuration (defined)
+     */
+    public function testProxyConfigurationDefined()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $app['orm.proxies_dir'] = '/path/to/proxies';
+        $app['orm.proxies_namespace'] = 'TestDoctrineOrmProxiesNamespace';
+        $app['orm.auto_generate_proxies'] = false;
+
+        $this->assertEquals('/path/to/proxies', $app['orm.em.config']->getProxyDir());
+        $this->assertEquals('TestDoctrineOrmProxiesNamespace', $app['orm.em.config']->getProxyNamespace());
+        $this->assertFalse($app['orm.em.config']->getAutoGenerateProxyClasses());
+    }
+
+    /**
+     * Test Driver Chain locator
+     */
+    public function testMappingDriverChainLocator()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $default = $app['orm.mapping_driver_chain.locator']();
+        $this->assertEquals($default, $app['orm.mapping_driver_chain.locator']('default'));
+        $this->assertEquals($default, $app['orm.em.config']->getMetadataDriverImpl());
+    }
+
+    /**
+     * Test adding a mapping driver (use default entity manager)
+     */
+    public function testAddMappingDriverDefault()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $mappingDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
+
+        $mappingDriverChain = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain');
+        $mappingDriverChain
+            ->expects($this->once())
+            ->method('addDriver')
+            ->with($mappingDriver, 'Test\Namespace');
+
+        $app['orm.mapping_driver_chain.instances.default'] = $mappingDriverChain;
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $app['orm.add_mapping_driver']($mappingDriver, 'Test\Namespace');
+    }
+
+    /**
+     * Test adding a mapping driver (specify default entity manager by name)
+     */
+    public function testAddMappingDriverNamedEntityManager()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $mappingDriver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver');
+
+        $mappingDriverChain = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain');
+        $mappingDriverChain
+            ->expects($this->once())
+            ->method('addDriver')
+            ->with($mappingDriver, 'Test\Namespace');
+
+        $app['orm.mapping_driver_chain.instances.default'] = $mappingDriverChain;
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $app['orm.add_mapping_driver']($mappingDriver, 'Test\Namespace');
+    }
+
+    /**
+     * Test specifying an invalid cache type (just named)
+     */
+    public function testInvalidCacheTypeNamed()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $app['orm.em.options'] = array(
+            'query_cache' => 'INVALID',
+        );
+
+        try {
+            $app['orm.em'];
+
+            $this->fail('Expected invalid query cache driver exception');
+        } catch (\RuntimeException $e) {
+            $this->assertEquals("Unsupported cache type 'INVALID' specified", $e->getMessage());
+        }
+    }
+
+    /**
+     * Test specifying an invalid cache type (driver as option)
+     */
+    public function testInvalidCacheTypeDriverAsOption()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $app['orm.em.options'] = array(
+            'query_cache' => array(
+                'driver' => 'INVALID',
+            ),
+        );
+
+        try {
+            $app['orm.em'];
+
+            $this->fail('Expected invalid query cache driver exception');
+        } catch (\RuntimeException $e) {
+            $this->assertEquals("Unsupported cache type 'INVALID' specified", $e->getMessage());
+        }
+    }
+
+    /**
+     * Test orm.em_name_from_param_key ()
+     */
+    public function testNameFromParamKey()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $app['my.baz'] = 'baz';
+
+        $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider;
+        $doctrineOrmServiceProvider->register($app);
+
+        $app['orm.ems.default'] = 'foo';
+
+        $this->assertEquals('foo', $app['orm.ems.default']);
+        $this->assertEquals('foo', $app['orm.em_name_from_param_key']('my.bar'));
+        $this->assertEquals('baz', $app['orm.em_name_from_param_key']('my.baz'));
+    }
+}

+ 71 - 0
vendor/dflydev/doctrine-orm-service-provider/tests/Dflydev/Silex/Provider/DoctrineOrm/DoctrineormServiceProviderTest.php

@@ -0,0 +1,71 @@
+<?php
+
+/*
+ * This file is a part of dflydev/doctrine-orm-service-provider.
+ *
+ * (c) Dragonfly Development Inc.
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Dflydev\Silex\Provider\DoctrineOrm;
+
+use Silex\Application;
+
+/**
+ * DoctrineOrmServiceProvider Test.
+ *
+ * @author Beau Simensen <beau@dflydev.com>
+ */
+class DoctrineOrmServiceProviderTest extends \PHPUnit_Framework_TestCase
+{
+    protected function createMockDefaultAppAndDeps()
+    {
+        $app = new Application;
+
+        $eventManager = $this->getMock('Doctrine\Common\EventManager');
+        $connection = $this
+            ->getMockBuilder('Doctrine\DBAL\Connection')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $connection
+            ->expects($this->any())
+            ->method('getEventManager')
+            ->will($this->returnValue($eventManager));
+
+        $app['dbs'] = new \Pimple(array(
+            'default' => $connection,
+        ));
+
+        $app['dbs.event_manager'] = new \Pimple(array(
+            'default' => $eventManager,
+        ));
+
+        return array($app, $connection, $eventManager);;
+    }
+
+    protected function createMockDefaultApp()
+    {
+        list ($app, $connection, $eventManager) = $this->createMockDefaultAppAndDeps();
+
+        return $app;
+    }
+
+    /**
+     * Test registration
+     */
+    public function testRegister()
+    {
+        $app = $this->createMockDefaultApp();
+
+        $app->register(new DoctrineOrmServiceProvider);
+
+        $this->assertEquals($app['orm.em'], $app['orm.ems']['default']);
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getQueryCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getResultCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $app['orm.em.config']->getMetadataCacheImpl());
+        $this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain', $app['orm.em.config']->getMetadataDriverImpl());
+    }
+}

+ 10 - 0
vendor/doctrine/common/.travis.yml

@@ -0,0 +1,10 @@
+language: php
+
+env:
+  - OPCODE_CACHE=apc
+
+php:
+  - 5.3
+  - 5.4
+
+before_script: php ./bin/travis-setup.php $OPCODE_CACHE

+ 19 - 0
vendor/doctrine/common/LICENSE

@@ -0,0 +1,19 @@
+Copyright (c) 2006-2012 Doctrine Project
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 12 - 0
vendor/doctrine/common/README.md

@@ -0,0 +1,12 @@
+# Doctrine Common
+
+[![Build Status](https://secure.travis-ci.org/doctrine/common.png)](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)

+ 39 - 0
vendor/doctrine/common/UPGRADE_TO_2_1

@@ -0,0 +1,39 @@
+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.
+

+ 61 - 0
vendor/doctrine/common/UPGRADE_TO_2_2

@@ -0,0 +1,61 @@
+This document details all the possible changes that you should investigate when 
+updating your project from Doctrine Common 2.1 to 2.2:
+
+## Annotation Changes
+
+- AnnotationReader::setIgnoreNotImportedAnnotations has been removed, you need to 
+  add ignore annotation names which are supposed to be ignored via
+  AnnotationReader::addGlobalIgnoredName
+  
+- AnnotationReader::setAutoloadAnnotations was deprecated by the AnnotationRegistry
+  in 2.1 and has been removed in 2.2
+
+- AnnotationReader::setEnableParsePhpImports was added to ease transition to the new
+  annotation mechanism in 2.1 and is removed in 2.2
+
+- AnnotationReader::isParsePhpImportsEnabled is removed (see above)
+
+- AnnotationReader::setDefaultAnnotationNamespace was deprecated in favor of explicit
+  configuration in 2.1 and will be removed in 2.2 (for isolated projects where you
+  have full-control over _all_ available annotations, we offer a dedicated reader
+  class ``SimpleAnnotationReader``)
+
+- AnnotationReader::setAnnotationCreationFunction was deprecated in 2.1 and will be
+  removed in 2.2. We only offer two creation mechanisms which cannot be changed
+  anymore to allow the same reader instance to work with all annotations regardless
+  of which library they are coming from.
+  
+- AnnotationReader::setAnnotationNamespaceAlias was deprecated in 2.1 and will be
+  removed in 2.2 (see setDefaultAnnotationNamespace)
+
+- If you use a class as annotation which has not the @Annotation marker in it's 
+  class block, we will now throw an exception instead of silently ignoring it. You
+  can however still achieve the previous behavior using the @IgnoreAnnotation, or
+  AnnotationReader::addGlobalIgnoredName (the exception message will contain detailed
+  instructions when you run into this problem).
+
+## Cache Changes
+  
+- Renamed old AbstractCache to CacheProvider
+
+- Dropped the support to the following functions of all cache providers:
+
+ - CacheProvider::deleteByWildcard
+
+ - CacheProvider::deleteByRegEx
+
+ - CacheProvider::deleteByPrefix
+
+ - CacheProvider::deleteBySuffix
+
+- CacheProvider::deleteAll will not remove ALL entries, it will only mark them as invalid
+
+- CacheProvider::flushAll will remove ALL entries, namespaced or not
+
+- Added support to MemcachedCache
+
+- Added support to WincacheCache
+
+## ClassLoader Changes
+
+- ClassLoader::fileExistsInIncludePath() no longer exists. Use the native stream_resolve_include_path() PHP function

+ 141 - 0
vendor/doctrine/common/bin/travis-setup.php

@@ -0,0 +1,141 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the LGPL. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+/**
+ * Install PHP extensions required for testing by Travis CI.
+ *
+ * @author Victor Berchet <victor@suumit.com>
+ * @since 2.2
+ */
+$installer = new PhpExtensions();
+
+if (isset($argv[1]) && 'APC' === strtoupper($argv[1])) {
+    $installer->install('apc');
+} else {
+    $installer->install('xcache');
+}
+
+$installer->install('memcache');
+$installer->install('memcached');
+
+class PhpExtensions
+{
+    protected $extensions;
+    protected $phpVersion;
+    protected $iniPath;
+
+    public function __construct()
+    {
+        $this->phpVersion = phpversion();
+        $this->iniPath = php_ini_loaded_file();
+        $this->extensions = array(
+        'memcache' => array(
+            'url'        => 'http://pecl.php.net/get/memcache-2.2.6.tgz',
+            'php_version' => array(),
+            'cfg'         => array('--enable-memcache'),
+            'ini'         => array('extension=memcache.so'),
+        ),
+        'memcached' => array(
+            'url'        => 'http://pecl.php.net/get/memcached-1.0.2.tgz',
+            'php_version' => array(
+                // memcached 1.0.2 does not build on PHP 5.4
+                array('<', '5.4'),
+            ),
+            'cfg'         => array(),
+            'ini'         => array('extension=memcached.so'),
+        ),
+        'apc' => array(
+            'url'        => 'http://pecl.php.net/get/APC-3.1.9.tgz',
+            'php_version' => array(
+                // apc 3.1.9 causes a segfault on PHP 5.4
+                array('<', '5.4'),
+            ),
+            'cfg'         => array(),
+            'ini'         => array(
+                'extension=apc.so',
+                'apc.enabled=1',
+                'apc.enable_cli=1'
+            ),
+        ),
+        'xcache' => array(
+            'url'        => 'http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz',
+            'php_version' => array(
+                // xcache does not build with Travis CI (as of 2012-01-09)
+                array('<', '5'),
+            ),
+            'cfg'         => array('--enable-xcache'),
+            'ini'         => array(
+                'extension=xcache.so',
+                'xcache.cacher=false',
+                'xcache.admin.enable_auth=0',
+                'xcache.var_size=1M',
+            ),
+        ),
+    );
+    }
+
+    public function install($name)
+    {
+        if (array_key_exists($name, $this->extensions)) {
+            $extension = $this->extensions[$name];
+
+
+            echo "== extension: $name ==\n";
+
+            foreach ($extension['php_version'] as $version) {
+                if (!version_compare($this->phpVersion, $version[1], $version[0])) {
+                    printf(
+                        "=> not installed, requires a PHP version %s %s (%s installed)\n",
+                        $version[0],
+                        $version[1],
+                        $this->phpVersion
+                    );
+
+                    return;
+                }
+            }
+
+            $this->system(sprintf("wget %s > /dev/null 2>&1", $extension['url']));
+            $file = basename($extension['url']);
+            $this->system(sprintf("tar -xzf %s > /dev/null 2>&1", $file));
+            $folder = basename($file, ".tgz");
+            $folder = basename($folder, ".tar.gz");
+            $this->system(sprintf(
+                'sh -c "cd %s && phpize && ./configure %s && make && sudo make install" > /dev/null 2>&1',
+                $folder,
+                implode(' ', $extension['cfg'])
+            ));
+            foreach ($extension['ini'] as $ini) {
+                $this->system(sprintf("echo %s >> %s", $ini, $this->iniPath));
+            }
+            printf("=> installed (%s)\n", $folder);
+        }
+    }
+
+    private function system($cmd)
+    {
+        $ret = 0;
+        system($cmd, $ret);
+        if (0 !== $ret) {
+            printf("=> Command '%s' failed !", $cmd);
+            
+            exit($ret);
+        }
+    }
+}

+ 6 - 0
vendor/doctrine/common/build.properties

@@ -0,0 +1,6 @@
+# Project Name
+project.name=DoctrineCommon
+
+# Version class and file
+project.version_class = Doctrine\Common\Version
+project.version_file = lib/Doctrine/Common/Version.php

+ 59 - 0
vendor/doctrine/common/build.xml

@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<project name="Doctrine2" default="build" basedir=".">
+    <taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
+    <import file="${project.basedir}/lib/vendor/doctrine-build-common/packaging.xml" />
+
+    <property file="build.properties" />
+    
+    <!-- 
+        Fileset for artifacts shared across all distributed packages.
+    -->
+    <fileset id="shared-artifacts" dir=".">
+        <include name="LICENSE"/>
+        <include name="COPYRIGHT"/>
+        <include name="CHANGELOG"/>
+    </fileset>
+
+    <!-- 
+        Fileset for the sources of the Doctrine Common package.
+    -->
+    <fileset id="common-sources" dir="./lib">
+        <include name="Doctrine/Common/**"/>
+    </fileset>
+
+    <!--
+        Builds Common package, preparing it for distribution.
+    -->
+    <target name="copy-files" depends="prepare">
+        <copy todir="${build.dir}/${project.name}-${version}">
+            <fileset refid="shared-artifacts"/>
+        </copy>
+        <copy todir="${build.dir}/${project.name}-${version}">
+            <fileset refid="common-sources"/>
+        </copy>
+    </target>
+
+    <!-- 
+        Builds distributable PEAR packages.
+    -->
+    <target name="define-pear-package" depends="copy-files">
+        <d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}">
+           <name>DoctrineCommon</name>
+           <summary>Doctrine Common PHP Extensions</summary>
+           <channel>pear.doctrine-project.org</channel>
+           <description>The Doctrine Common package contains shared code between the other packages.</description>
+           <lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
+           <lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
+           <lead user="romanb" name="Roman Borschel" email="roman@code-factory.org" />
+           <lead user="beberlei" name="Benjamin Eberlei" email="kontakt@beberlei.de" />
+           <license>LGPL</license>
+           <version release="${pear.version}" api="${pear.version}" />
+           <stability release="${pear.stability}" api="${pear.stability}" />
+           <notes>-</notes>
+           <dependencies>
+               <php minimum_version="5.3.0" />
+               <pear minimum_version="1.6.0" recommended_version="1.6.1" />
+           </dependencies>
+        </d51pearpkg2>
+    </target>
+</project>

+ 26 - 0
vendor/doctrine/common/composer.json

@@ -0,0 +1,26 @@
+{
+    "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"
+    },
+    "autoload": {
+        "psr-0": { "Doctrine\\Common\\": "lib/" }
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "2.4.x-dev"
+        }
+    }
+}

+ 79 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php

@@ -0,0 +1,79 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Annotations class
+ *
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+class Annotation
+{
+    /**
+     * Value property. Common among all derived classes.
+     *
+     * @var string
+     */
+    public $value;
+
+    /**
+     * Constructor
+     *
+     * @param array $data Key-value for properties to be defined in this class
+     */
+    public final function __construct(array $data)
+    {
+        foreach ($data as $key => $value) {
+            $this->$key = $value;
+        }
+    }
+
+    /**
+     * Error handler for unknown property accessor in Annotation class.
+     *
+     * @param string $name Unknown property name
+     *
+     * @throws \BadMethodCallException
+     */
+    public function __get($name)
+    {
+        throw new \BadMethodCallException(
+            sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
+        );
+    }
+
+    /**
+     * Error handler for unknown property mutator in Annotation class.
+     *
+     * @param string $name Unkown property name
+     * @param mixed $value Property value
+     *
+     * @throws \BadMethodCallException
+     */
+    public function __set($name, $value)
+    {
+        throw new \BadMethodCallException(
+            sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
+        );
+    }
+}

+ 47 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php

@@ -0,0 +1,47 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check the attribute type during the parsing process.
+ *
+ * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
+ *
+ * @Annotation
+ */
+final class Attribute
+{
+    /**
+     * @var string
+     */
+    public $name;
+
+    /**
+     * @var string
+     */
+    public $type;
+
+    /**
+     * @var boolean
+     */
+    public $required = false;
+}

+ 37 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php

@@ -0,0 +1,37 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check the types of all declared attributes during the parsing process.
+ *
+ * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
+ *
+ * @Annotation
+ */
+final class Attributes
+{
+    /**
+     * @var array<Doctrine\Common\Annotations\Annotation\Attribute>
+     */
+    public $value;
+}

+ 85 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Enum.php

@@ -0,0 +1,85 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check the available values during the parsing process.
+ *
+ * @since  2.4
+ * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
+ *
+ * @Annotation
+ * @Attributes({
+ *    @Attribute("value",   required = true,  type = "array"),
+ *    @Attribute("literal", required = false, type = "array")
+ * })
+ */
+final class Enum
+{
+    /**
+     * @var array
+     */
+    public $value;
+
+    /**
+     * Literal target declaration.
+     *
+     * @var array
+     */
+    public $literal;
+
+    /**
+     * Annotation construct
+     *
+     * @param array $values
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function __construct(array $values)
+    {
+        if ( ! isset($values['literal'])) {
+            $values['literal'] = array();
+        }
+
+        foreach ($values['value'] as $var) {
+            if( ! is_scalar($var)) {
+                throw new \InvalidArgumentException(sprintf(
+                    '@Enum supports only scalar values "%s" given.',
+                    is_object($var) ? get_class($var) : gettype($var)
+                ));
+            }
+        }
+
+        foreach ($values['literal'] as $key => $var) {
+            if( ! in_array($key, $values['value'])) {
+                throw new \InvalidArgumentException(sprintf(
+                    'Undefined enumerator value "%s" for literal "%s".',
+                    $key , $var
+                ));
+            }
+        }
+
+        $this->value    = $values['value'];
+        $this->literal  = $values['literal'];
+    }
+
+}

+ 54 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php

@@ -0,0 +1,54 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser to ignore specific
+ * annotations during the parsing process.
+ *
+ * @Annotation
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+final class IgnoreAnnotation
+{
+    /**
+     * @var array
+     */
+    public $names;
+
+    /**
+     * Constructor
+     *
+     * @param array $values
+     *
+     * @throws \RuntimeException
+     */
+    public function __construct(array $values)
+    {
+        if (is_string($values['value'])) {
+            $values['value'] = array($values['value']);
+        }
+        if (!is_array($values['value'])) {
+            throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value'])));
+        }
+
+        $this->names = $values['value'];
+    }
+}

+ 33 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php

@@ -0,0 +1,33 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check if that attribute is required during the parsing process.
+ *
+ * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
+ *
+ * @Annotation
+ */
+final class Required
+{
+}

+ 107 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php

@@ -0,0 +1,107 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations\Annotation;
+
+/**
+ * Annotation that can be used to signal to the parser
+ * to check the annotation target during the parsing process.
+ *
+ * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
+ *
+ * @Annotation
+ */
+final class Target
+{
+    const TARGET_CLASS              = 1;
+    const TARGET_METHOD             = 2;
+    const TARGET_PROPERTY           = 4;
+    const TARGET_ANNOTATION         = 8;
+    const TARGET_ALL                = 15;
+
+    /**
+     * @var array
+     */
+    private static $map = array(
+        'ALL'         => self::TARGET_ALL,
+        'CLASS'       => self::TARGET_CLASS,
+        'METHOD'      => self::TARGET_METHOD,
+        'PROPERTY'    => self::TARGET_PROPERTY,
+        'ANNOTATION'  => self::TARGET_ANNOTATION,
+    );
+
+    /**
+     * @var array
+     */
+    public $value;
+
+    /**
+     * Targets as bitmask.
+     *
+     * @var integer
+     */
+    public $targets;
+
+    /**
+     * Literal target declaration.
+     *
+     * @var integer
+     */
+    public $literal;
+
+    /**
+     * Annotation construct
+     *
+     * @param array $values
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function __construct(array $values)
+    {
+        if (!isset($values['value'])){
+            $values['value'] = null;
+        }
+        if (is_string($values['value'])){
+            $values['value'] = array($values['value']);
+        }
+        if (!is_array($values['value'])){
+            throw new \InvalidArgumentException(
+                sprintf('@Target expects either a string value, or an array of strings, "%s" given.',
+                    is_object($values['value']) ? get_class($values['value']) : gettype($values['value'])
+                )
+            );
+        }
+
+        $bitmask = 0;
+        foreach ($values['value'] as $literal) {
+            if(!isset(self::$map[$literal])){
+                throw new \InvalidArgumentException(
+                    sprintf('Invalid Target "%s". Available targets: [%s]',
+                            $literal,  implode(', ', array_keys(self::$map)))
+                );
+            }
+            $bitmask += self::$map[$literal];
+        }
+
+        $this->targets  = $bitmask;
+        $this->value    = $values['value'];
+        $this->literal  = implode(', ', $this->value);
+    }
+}

+ 150 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php

@@ -0,0 +1,150 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Description of AnnotationException
+ *
+ * @since   2.0
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+class AnnotationException extends \Exception
+{
+    /**
+     * Creates a new AnnotationException describing a Syntax error.
+     *
+     * @param string $message Exception message
+     * @return AnnotationException
+     */
+    public static function syntaxError($message)
+    {
+        return new self('[Syntax Error] ' . $message);
+    }
+
+    /**
+     * Creates a new AnnotationException describing a Semantical error.
+     *
+     * @param string $message Exception message
+     * @return AnnotationException
+     */
+    public static function semanticalError($message)
+    {
+        return new self('[Semantical Error] ' . $message);
+    }
+
+    /**
+     * Creates a new AnnotationException describing a constant semantical error.
+     *
+     * @since 2.3
+     * @param string $identifier
+     * @param string $context
+     * @return AnnotationException
+     */
+    public static function semanticalErrorConstants($identifier, $context = null)
+    {
+        return self::semanticalError(sprintf(
+            "Couldn't find constant %s%s", $identifier,
+            $context ? ", $context." : "."
+        ));
+    }
+
+    /**
+     * Creates a new AnnotationException describing an error which occurred during
+     * the creation of the annotation.
+     *
+     * @since 2.2
+     * @param string $message
+     * @return AnnotationException
+     */
+    public static function creationError($message)
+    {
+        return new self('[Creation Error] ' . $message);
+    }
+
+    /**
+     * Creates a new AnnotationException describing an type error of an attribute.
+     *
+     * @since 2.2
+     * @param string $attributeName
+     * @param string $annotationName
+     * @param string $context
+     * @param string $expected
+     * @param mixed $actual
+     * @return AnnotationException
+     */
+    public static function typeError($attributeName, $annotationName, $context, $expected, $actual)
+    {
+        return new self(sprintf(
+            '[Type Error] Attribute "%s" of @%s declared on %s expects %s, but got %s.',
+            $attributeName,
+            $annotationName,
+            $context,
+            $expected,
+            is_object($actual) ? 'an instance of '.get_class($actual) : gettype($actual)
+        ));
+    }
+
+    /**
+     * Creates a new AnnotationException describing an required error of an attribute.
+     *
+     * @since 2.2
+     * @param string $attributeName
+     * @param string $annotationName
+     * @param string $context
+     * @param string $expected
+     * @return AnnotationException
+     */
+    public static function requiredError($attributeName, $annotationName, $context, $expected)
+    {
+        return new self(sprintf(
+            '[Type Error] Attribute "%s" of @%s declared on %s expects %s. This value should not be null.',
+            $attributeName,
+            $annotationName,
+            $context,
+            $expected
+        ));
+    }
+
+    /**
+     * Creates a new AnnotationException describing a invalid enummerator.
+     *
+     * @since 2.4
+     * @param string $attributeName
+     * @param string $annotationName
+     * @param string $context
+     * @param array  $available
+     * @param mixed  $given
+     * @return AnnotationException
+     */
+    public static function enumeratorError($attributeName, $annotationName, $context, $available, $given)
+    {
+        throw new self(sprintf(
+            '[Enum Error] Attribute "%s" of @%s declared on %s accept only [%s], but got %s.',
+            $attributeName, 
+            $annotationName,
+            $context,
+            implode(', ', $available),
+            is_object($given) ? get_class($given) : $given
+        ));
+    }
+}

+ 310 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php

@@ -0,0 +1,310 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation;
+use Doctrine\Common\Annotations\Annotation\Target;
+use Closure;
+use ReflectionClass;
+use ReflectionMethod;
+use ReflectionProperty;
+
+/**
+ * A reader for docblock annotations.
+ *
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+class AnnotationReader implements Reader
+{
+    /**
+     * Global map for imports.
+     *
+     * @var array
+     */
+    private static $globalImports = array(
+        'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation',
+    );
+
+    /**
+     * A list with annotations that are not causing exceptions when not resolved to an annotation class.
+     *
+     * The names are case sensitive.
+     *
+     * @var array
+     */
+    private static $globalIgnoredNames = array(
+        'access'=> true, 'author'=> true, 'copyright'=> true, 'deprecated'=> true,
+        'example'=> true, 'ignore'=> true, 'internal'=> true, 'link'=> true, 'see'=> true,
+        'since'=> true, 'tutorial'=> true, 'version'=> true, 'package'=> true,
+        'subpackage'=> true, 'name'=> true, 'global'=> true, 'param'=> true,
+        'return'=> true, 'staticvar'=> true, 'category'=> true, 'staticVar'=> true,
+        'static'=> true, 'var'=> true, 'throws'=> true, 'inheritdoc'=> true,
+        'inheritDoc'=> true, 'license'=> true, 'todo'=> true, 'TODO'=> true,
+        'deprec'=> true, 'property' => true, 'method' => true,
+        'abstract'=> true, 'exception'=> true, 'magic' => true, 'api' => true,
+        'final'=> true, 'filesource'=> true, 'throw' => true, 'uses' => true,
+        'usedby'=> true, 'private' => true, 'Annotation' => true, 'override' => true,
+        'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true,
+        'Required' => true, 'Attribute' => true, 'Attributes' => true,
+        'Target' => true, 'SuppressWarnings' => true,
+        'ingroup' => true, 'code' => true, 'endcode' => true,
+        'package_version' => true, 'fixme' => true
+    );
+
+    /**
+     * Add a new annotation to the globally ignored annotation names with regard to exception handling.
+     *
+     * @param string $name
+     */
+    static public function addGlobalIgnoredName($name)
+    {
+        self::$globalIgnoredNames[$name] = true;
+    }
+
+    /**
+     * Annotations Parser
+     *
+     * @var \Doctrine\Common\Annotations\DocParser
+     */
+    private $parser;
+
+    /**
+     * Annotations Parser used to collect parsing metadata
+     *
+     * @var \Doctrine\Common\Annotations\DocParser
+     */
+    private $preParser;
+
+    /**
+     * PHP Parser used to collect imports.
+     *
+     * @var \Doctrine\Common\Annotations\PhpParser
+     */
+    private $phpParser;
+
+    /**
+     * In-memory cache mechanism to store imported annotations per class.
+     *
+     * @var array
+     */
+    private $imports = array();
+
+    /**
+     * In-memory cache mechanism to store ignored annotations per class.
+     *
+     * @var array
+     */
+    private $ignoredAnnotationNames = array();
+
+    /**
+     * Constructor.
+     *
+     * Initializes a new AnnotationReader.
+     */
+    public function __construct()
+    {
+        AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php');
+
+        $this->parser = new DocParser;
+
+        $this->preParser = new DocParser;
+        $this->preParser->setImports(self::$globalImports);
+        $this->preParser->setIgnoreNotImportedAnnotations(true);
+
+        $this->phpParser = new PhpParser;
+    }
+
+    /**
+     * Gets the annotations applied to a class.
+     *
+     * @param ReflectionClass $class The ReflectionClass of the class from which
+     *                               the class annotations should be read.
+     * @return array An array of Annotations.
+     */
+    public function getClassAnnotations(ReflectionClass $class)
+    {
+        $this->parser->setTarget(Target::TARGET_CLASS);
+        $this->parser->setImports($this->getImports($class));
+        $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
+
+        return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());
+    }
+
+    /**
+     * Gets a class annotation.
+     *
+     * @param ReflectionClass $class The ReflectionClass of the class from which
+     *                               the class annotations should be read.
+     * @param string $annotationName The name of the annotation.
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getClassAnnotation(ReflectionClass $class, $annotationName)
+    {
+        $annotations = $this->getClassAnnotations($class);
+
+        foreach ($annotations as $annotation) {
+            if ($annotation instanceof $annotationName) {
+                return $annotation;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Gets the annotations applied to a property.
+     *
+     * @param ReflectionProperty $property The ReflectionProperty of the property
+     *                                     from which the annotations should be read.
+     * @return array An array of Annotations.
+     */
+    public function getPropertyAnnotations(ReflectionProperty $property)
+    {
+        $class = $property->getDeclaringClass();
+        $context = 'property ' . $class->getName() . "::\$" . $property->getName();
+        $this->parser->setTarget(Target::TARGET_PROPERTY);
+        $this->parser->setImports($this->getImports($class));
+        $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
+
+        return $this->parser->parse($property->getDocComment(), $context);
+    }
+
+    /**
+     * Gets a property annotation.
+     *
+     * @param ReflectionProperty $property
+     * @param string $annotationName The name of the annotation.
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getPropertyAnnotation(ReflectionProperty $property, $annotationName)
+    {
+        $annotations = $this->getPropertyAnnotations($property);
+
+        foreach ($annotations as $annotation) {
+            if ($annotation instanceof $annotationName) {
+                return $annotation;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Gets the annotations applied to a method.
+     *
+     * @param \ReflectionMethod $method The ReflectionMethod of the method from which
+     *                                   the annotations should be read.
+     *
+     * @return array An array of Annotations.
+     */
+    public function getMethodAnnotations(ReflectionMethod $method)
+    {
+        $class = $method->getDeclaringClass();
+        $context = 'method ' . $class->getName() . '::' . $method->getName() . '()';
+        $this->parser->setTarget(Target::TARGET_METHOD);
+        $this->parser->setImports($this->getImports($class));
+        $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
+
+        return $this->parser->parse($method->getDocComment(), $context);
+    }
+
+    /**
+     * Gets a method annotation.
+     *
+     * @param ReflectionMethod $method
+     * @param string $annotationName The name of the annotation.
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getMethodAnnotation(ReflectionMethod $method, $annotationName)
+    {
+        $annotations = $this->getMethodAnnotations($method);
+
+        foreach ($annotations as $annotation) {
+            if ($annotation instanceof $annotationName) {
+                return $annotation;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns the ignored annotations for the given class.
+     *
+     * @param ReflectionClass $class
+     * @return array
+     */
+    private function getIgnoredAnnotationNames(ReflectionClass $class)
+    {
+        if (isset($this->ignoredAnnotationNames[$name = $class->getName()])) {
+            return $this->ignoredAnnotationNames[$name];
+        }
+        $this->collectParsingMetadata($class);
+
+        return $this->ignoredAnnotationNames[$name];
+    }
+
+    /**
+     * Retrieve imports
+     *
+     * @param \ReflectionClass $class
+     * @return array
+     */
+    private function getImports(ReflectionClass $class)
+    {
+        if (isset($this->imports[$name = $class->getName()])) {
+            return $this->imports[$name];
+        }
+        $this->collectParsingMetadata($class);
+
+        return $this->imports[$name];
+    }
+
+    /**
+     * Collects parsing metadata for a given class
+     *
+     * @param ReflectionClass $class
+     */
+    private function collectParsingMetadata(ReflectionClass $class)
+    {
+        $ignoredAnnotationNames = self::$globalIgnoredNames;
+
+        $annotations = $this->preParser->parse($class->getDocComment(), 'class '.$class->name);
+        foreach ($annotations as $annotation) {
+            if ($annotation instanceof IgnoreAnnotation) {
+                foreach ($annotation->names AS $annot) {
+                    $ignoredAnnotationNames[$annot] = true;
+                }
+            }
+        }
+
+        $name = $class->getName();
+        $this->imports[$name] = array_merge(
+            self::$globalImports,
+            $this->phpParser->parseClass($class),
+            array('__NAMESPACE__' => $class->getNamespaceName())
+        );
+        $this->ignoredAnnotationNames[$name] = $ignoredAnnotationNames;
+    }
+}

+ 139 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php

@@ -0,0 +1,139 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * AnnotationRegistry
+ */
+final class AnnotationRegistry
+{
+    /**
+     * A map of namespaces to use for autoloading purposes based on a PSR-0 convention.
+     *
+     * Contains the namespace as key and an array of directories as value. If the value is NULL
+     * the include path is used for checking for the corresponding file.
+     *
+     * This autoloading mechanism does not utilize the PHP autoloading but implements autoloading on its own.
+     *
+     * @var array
+     */
+    static private $autoloadNamespaces = array();
+
+    /**
+     * A map of autoloader callables.
+     *
+     * @var array
+     */
+    static private $loaders = array();
+
+    static public function reset()
+    {
+        self::$autoloadNamespaces = array();
+        self::$loaders = array();
+    }
+
+    /**
+     * Register file
+     *
+     * @param string $file
+     */
+    static public function registerFile($file)
+    {
+        require_once $file;
+    }
+
+    /**
+     * Add a namespace with one or many directories to look for files or null for the include path.
+     *
+     * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm.
+     *
+     * @param string $namespace
+     * @param string|array|null $dirs
+     */
+    static public function registerAutoloadNamespace($namespace, $dirs = null)
+    {
+        self::$autoloadNamespaces[$namespace] = $dirs;
+    }
+
+    /**
+     * Register multiple namespaces
+     *
+     * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm.
+     *
+     * @param array $namespaces
+     */
+    static public function registerAutoloadNamespaces(array $namespaces)
+    {
+        self::$autoloadNamespaces = array_merge(self::$autoloadNamespaces, $namespaces);
+    }
+
+    /**
+     * Register an autoloading callable for annotations, much like spl_autoload_register().
+     *
+     * NOTE: These class loaders HAVE to be silent when a class was not found!
+     * IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class.
+     *
+     * @param callable $callable
+     *
+     * @throws \InvalidArgumentException
+     */
+    static public function registerLoader($callable)
+    {
+        if (!is_callable($callable)) {
+            throw new \InvalidArgumentException("A callable is expected in AnnotationRegistry::registerLoader().");
+        }
+        self::$loaders[] = $callable;
+    }
+
+    /**
+     * Autoload an annotation class silently.
+     *
+     * @param string $class
+     * @return boolean
+     */
+    static public function loadAnnotationClass($class)
+    {
+        foreach (self::$autoloadNamespaces AS $namespace => $dirs) {
+            if (strpos($class, $namespace) === 0) {
+                $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php";
+                if ($dirs === null) {
+                    if ($path = stream_resolve_include_path($file)) {
+                        require $path;
+                        return true;
+                    }
+                } else {
+                    foreach((array)$dirs AS $dir) {
+                        if (is_file($dir . DIRECTORY_SEPARATOR . $file)) {
+                            require $dir . DIRECTORY_SEPARATOR . $file;
+                            return true;
+                        }
+                    }
+                }
+            }
+        }
+
+        foreach (self::$loaders AS $loader) {
+            if (call_user_func($loader, $class) === true) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

+ 250 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php

@@ -0,0 +1,250 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Cache\Cache;
+
+/**
+ * A cache aware annotation reader.
+ *
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ */
+final class CachedReader implements Reader
+{
+    /**
+     * @var string
+     */
+    private static $CACHE_SALT = '@[Annot]';
+
+    /**
+     * @var Reader
+     */
+    private $delegate;
+
+    /**
+     * @var Cache
+     */
+    private $cache;
+
+    /**
+     * @var boolean
+     */
+    private $debug;
+
+    /**
+     * @var array
+     */
+    private $loadedAnnotations;
+
+    /**
+     * Constructor
+     *
+     * @param Reader $reader
+     * @param Cache $cache
+     * @param bool $debug
+     */
+    public function __construct(Reader $reader, Cache $cache, $debug = false)
+    {
+        $this->delegate = $reader;
+        $this->cache = $cache;
+        $this->debug = (Boolean) $debug;
+    }
+
+    /**
+     * Get annotations for class
+     *
+     * @param \ReflectionClass $class
+     * @return array
+     */
+    public function getClassAnnotations(\ReflectionClass $class)
+    {
+        $cacheKey = $class->getName();
+
+        if (isset($this->loadedAnnotations[$cacheKey])) {
+            return $this->loadedAnnotations[$cacheKey];
+        }
+
+        if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
+            $annots = $this->delegate->getClassAnnotations($class);
+            $this->saveToCache($cacheKey, $annots);
+        }
+
+        return $this->loadedAnnotations[$cacheKey] = $annots;
+    }
+
+    /**
+     * Get selected annotation for class
+     *
+     * @param \ReflectionClass $class
+     * @param string $annotationName
+     * @return null
+     */
+    public function getClassAnnotation(\ReflectionClass $class, $annotationName)
+    {
+        foreach ($this->getClassAnnotations($class) as $annot) {
+            if ($annot instanceof $annotationName) {
+                return $annot;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Get annotations for property
+     *
+     * @param \ReflectionProperty $property
+     * @return array
+     */
+    public function getPropertyAnnotations(\ReflectionProperty $property)
+    {
+        $class = $property->getDeclaringClass();
+        $cacheKey = $class->getName().'$'.$property->getName();
+
+        if (isset($this->loadedAnnotations[$cacheKey])) {
+            return $this->loadedAnnotations[$cacheKey];
+        }
+
+        if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
+            $annots = $this->delegate->getPropertyAnnotations($property);
+            $this->saveToCache($cacheKey, $annots);
+        }
+
+        return $this->loadedAnnotations[$cacheKey] = $annots;
+    }
+
+    /**
+     * Get selected annotation for property
+     *
+     * @param \ReflectionProperty $property
+     * @param string $annotationName
+     * @return null
+     */
+    public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
+    {
+        foreach ($this->getPropertyAnnotations($property) as $annot) {
+            if ($annot instanceof $annotationName) {
+                return $annot;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Get method annotations
+     *
+     * @param \ReflectionMethod $method
+     * @return array
+     */
+    public function getMethodAnnotations(\ReflectionMethod $method)
+    {
+        $class = $method->getDeclaringClass();
+        $cacheKey = $class->getName().'#'.$method->getName();
+
+        if (isset($this->loadedAnnotations[$cacheKey])) {
+            return $this->loadedAnnotations[$cacheKey];
+        }
+
+        if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
+            $annots = $this->delegate->getMethodAnnotations($method);
+            $this->saveToCache($cacheKey, $annots);
+        }
+
+        return $this->loadedAnnotations[$cacheKey] = $annots;
+    }
+
+    /**
+     * Get selected method annotation
+     *
+     * @param \ReflectionMethod $method
+     * @param string $annotationName
+     * @return null
+     */
+    public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
+    {
+        foreach ($this->getMethodAnnotations($method) as $annot) {
+            if ($annot instanceof $annotationName) {
+                return $annot;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Clear loaded annotations
+     */
+    public function clearLoadedAnnotations()
+    {
+        $this->loadedAnnotations = array();
+    }
+
+    /**
+     * Fetches a value from the cache.
+     *
+     * @param string           $rawCacheKey The cache key.
+     * @param \ReflectionClass $class       The related class.
+     * @return mixed|boolean The cached value or false when the value is not in cache.
+     */
+    private function fetchFromCache($rawCacheKey, \ReflectionClass $class)
+    {
+        $cacheKey = $rawCacheKey . self::$CACHE_SALT;
+        if (($data = $this->cache->fetch($cacheKey)) !== false) {
+            if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) {
+                return $data;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Saves a value to the cache
+     *
+     * @param string $rawCacheKey The cache key.
+     * @param mixed  $value       The value.
+     */
+    private function saveToCache($rawCacheKey, $value)
+    {
+        $cacheKey = $rawCacheKey . self::$CACHE_SALT;
+        $this->cache->save($cacheKey, $value);
+        if ($this->debug) {
+            $this->cache->save('[C]'.$cacheKey, time());
+        }
+    }
+
+    /**
+     * Check if cache is fresh
+     *
+     * @param string $cacheKey
+     * @param \ReflectionClass $class
+     * @return bool
+     */
+    private function isCacheFresh($cacheKey, \ReflectionClass $class)
+    {
+        if (false === $filename = $class->getFilename()) {
+            return true;
+        }
+
+        return $this->cache->fetch('[C]'.$cacheKey) >= filemtime($filename);
+    }
+}

+ 132 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php

@@ -0,0 +1,132 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Lexer;
+
+/**
+ * Simple lexer for docblock annotations.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+final class DocLexer extends Lexer
+{
+    const T_NONE                = 1;
+    const T_INTEGER             = 2;
+    const T_STRING              = 3;
+    const T_FLOAT               = 4;
+
+    // All tokens that are also identifiers should be >= 100
+    const T_IDENTIFIER          = 100;
+    const T_AT                  = 101;
+    const T_CLOSE_CURLY_BRACES  = 102;
+    const T_CLOSE_PARENTHESIS   = 103;
+    const T_COMMA               = 104;
+    const T_EQUALS              = 105;
+    const T_FALSE               = 106;
+    const T_NAMESPACE_SEPARATOR = 107;
+    const T_OPEN_CURLY_BRACES   = 108;
+    const T_OPEN_PARENTHESIS    = 109;
+    const T_TRUE                = 110;
+    const T_NULL                = 111;
+    const T_COLON               = 112;
+
+    protected $noCase = array(
+        '@'  => self::T_AT,
+        ','  => self::T_COMMA,
+        '('  => self::T_OPEN_PARENTHESIS,
+        ')'  => self::T_CLOSE_PARENTHESIS,
+        '{'  => self::T_OPEN_CURLY_BRACES,
+        '}'  => self::T_CLOSE_CURLY_BRACES,
+        '='  => self::T_EQUALS,
+        ':'  => self::T_COLON,
+        '\\' => self::T_NAMESPACE_SEPARATOR
+    );
+
+    protected $withCase = array(
+        'true'  => self::T_TRUE,
+        'false' => self::T_FALSE,
+        'null'  => self::T_NULL
+    );
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function getCatchablePatterns()
+    {
+        return array(
+            '[a-z_\\\][a-z0-9_\:\\\]*[a-z]{1}',
+            '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?',
+            '"(?:[^"]|"")*"',
+        );
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function getNonCatchablePatterns()
+    {
+        return array('\s+', '\*+', '(.)');
+    }
+
+    /**
+     * {@inheritdoc}
+     *
+     * @param string $value
+     *
+     * @return int
+     */
+    protected function getType(&$value)
+    {
+        $type = self::T_NONE;
+
+        if ($value[0] === '"') {
+            $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2));
+
+            return self::T_STRING;
+        }
+
+        if (isset($this->noCase[$value])) {
+            return $this->noCase[$value];
+        }
+
+        if ($value[0] === '_' || $value[0] === '\\' || ctype_alpha($value[0])) {
+            return self::T_IDENTIFIER;
+        }
+
+        $lowerValue = strtolower($value);
+
+        if (isset($this->withCase[$lowerValue])) {
+            return $this->withCase[$lowerValue];
+        }
+
+        // Checking numeric value
+        if (is_numeric($value)) {
+            return (strpos($value, '.') !== false || stripos($value, 'e') !== false)
+                ? self::T_FLOAT : self::T_INTEGER;
+        }
+
+        return $type;
+    }
+}

+ 1041 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php

@@ -0,0 +1,1041 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Closure;
+use ReflectionClass;
+use Doctrine\Common\Annotations\Annotation\Enum;
+use Doctrine\Common\Annotations\Annotation\Target;
+use Doctrine\Common\Annotations\Annotation\Attribute;
+use Doctrine\Common\Annotations\Annotation\Attributes;
+
+/**
+ * A parser for docblock annotations.
+ *
+ * It is strongly discouraged to change the default annotation parsing process.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
+ */
+final class DocParser
+{
+    /**
+     * An array of all valid tokens for a class name.
+     *
+     * @var array
+     */
+    private static $classIdentifiers = array(DocLexer::T_IDENTIFIER, DocLexer::T_TRUE, DocLexer::T_FALSE, DocLexer::T_NULL);
+
+    /**
+     * The lexer.
+     *
+     * @var \Doctrine\Common\Annotations\DocLexer
+     */
+    private $lexer;
+
+    /**
+     * Current target context
+     *
+     * @var string
+     */
+    private $target;
+
+    /**
+     * Doc Parser used to collect annotation target
+     *
+     * @var \Doctrine\Common\Annotations\DocParser
+     */
+    private static $metadataParser;
+
+    /**
+     * Flag to control if the current annotation is nested or not.
+     *
+     * @var boolean
+     */
+    private $isNestedAnnotation = false;
+
+    /**
+     * Hashmap containing all use-statements that are to be used when parsing
+     * the given doc block.
+     *
+     * @var array
+     */
+    private $imports = array();
+
+    /**
+     * This hashmap is used internally to cache results of class_exists()
+     * look-ups.
+     *
+     * @var array
+     */
+    private $classExists = array();
+
+    /**
+     * Whether annotations that have not been imported should be ignored.
+     *
+     * @var boolean
+     */
+    private $ignoreNotImportedAnnotations = false;
+
+    /**
+     * An array of default namespaces if operating in simple mode.
+     *
+     * @var array
+     */
+    private $namespaces = array();
+
+    /**
+     * A list with annotations that are not causing exceptions when not resolved to an annotation class.
+     *
+     * The names must be the raw names as used in the class, not the fully qualified
+     * class names.
+     *
+     * @var array
+     */
+    private $ignoredAnnotationNames = array();
+
+    /**
+     * @var string
+     */
+    private $context = '';
+
+    /**
+     * Hash-map for caching annotation metadata
+     * @var array
+     */
+    private static $annotationMetadata = array(
+        'Doctrine\Common\Annotations\Annotation\Target' => array(
+            'is_annotation'    => true,
+            'has_constructor'  => true,
+            'properties'       => array(),
+            'targets_literal'  => 'ANNOTATION_CLASS',
+            'targets'          => Target::TARGET_CLASS,
+            'default_property' => 'value',
+            'attribute_types'  => array(
+                'value'  => array(
+                    'required'  => false,
+                    'type'      =>'array',
+                    'array_type'=>'string',
+                    'value'     =>'array<string>'
+                )
+             ),
+        ),
+        'Doctrine\Common\Annotations\Annotation\Attribute' => array(
+            'is_annotation'    => true,
+            'has_constructor'  => false,
+            'targets_literal'  => 'ANNOTATION_ANNOTATION',
+            'targets'          => Target::TARGET_ANNOTATION,
+            'default_property' => 'name',
+            'properties'       => array(
+                'name'      => 'name',
+                'type'      => 'type',
+                'required'  => 'required'
+            ),
+            'attribute_types'  => array(
+                'value'  => array(
+                    'required'  => true,
+                    'type'      =>'string',
+                    'value'     =>'string'
+                ),
+                'type'  => array(
+                    'required'  =>true,
+                    'type'      =>'string',
+                    'value'     =>'string'
+                ),
+                'required'  => array(
+                    'required'  =>false,
+                    'type'      =>'boolean',
+                    'value'     =>'boolean'
+                )
+             ),
+        ),
+        'Doctrine\Common\Annotations\Annotation\Attributes' => array(
+            'is_annotation'    => true,
+            'has_constructor'  => false,
+            'targets_literal'  => 'ANNOTATION_CLASS',
+            'targets'          => Target::TARGET_CLASS,
+            'default_property' => 'value',
+            'properties'       => array(
+                'value' => 'value'
+            ),
+            'attribute_types'  => array(
+                'value' => array(
+                    'type'      =>'array',
+                    'required'  =>true,
+                    'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute',
+                    'value'     =>'array<Doctrine\Common\Annotations\Annotation\Attribute>'
+                )
+             ),
+        ),
+        'Doctrine\Common\Annotations\Annotation\Enum' => array(
+            'is_annotation'    => true,
+            'has_constructor'  => true,
+            'targets_literal'  => 'ANNOTATION_PROPERTY',
+            'targets'          => Target::TARGET_PROPERTY,
+            'default_property' => 'value',
+            'properties'       => array(
+                'value' => 'value'
+            ),
+            'attribute_types'  => array(
+                'value' => array(
+                    'type'      => 'array',
+                    'required'  => true,
+                ),
+                'literal' => array(
+                    'type'      => 'array',
+                    'required'  => false,
+                ),
+             ),
+        ),
+    );
+
+    /**
+     * Hash-map for handle types declaration
+     *
+     * @var array
+     */
+    private static $typeMap = array(
+        'float'     => 'double',
+        'bool'      => 'boolean',
+        // allow uppercase Boolean in honor of George Boole
+        'Boolean'   => 'boolean',
+        'int'       => 'integer',
+    );
+
+    /**
+     * Constructs a new DocParser.
+     */
+    public function __construct()
+    {
+        $this->lexer = new DocLexer;
+    }
+
+    /**
+     * Sets the annotation names that are ignored during the parsing process.
+     *
+     * The names are supposed to be the raw names as used in the class, not the
+     * fully qualified class names.
+     *
+     * @param array $names
+     */
+    public function setIgnoredAnnotationNames(array $names)
+    {
+        $this->ignoredAnnotationNames = $names;
+    }
+
+    /**
+     * Sets ignore on not-imported annotations
+     *
+     * @param $bool
+     */
+    public function setIgnoreNotImportedAnnotations($bool)
+    {
+        $this->ignoreNotImportedAnnotations = (Boolean) $bool;
+    }
+
+    /**
+     * Sets the default namespaces.
+     *
+     * @param array $namespace
+     *
+     * @throws \RuntimeException
+     */
+    public function addNamespace($namespace)
+    {
+        if ($this->imports) {
+            throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.');
+        }
+        $this->namespaces[] = $namespace;
+    }
+
+    /**
+     * Sets the imports
+     *
+     * @param array $imports
+     * @throws \RuntimeException
+     */
+    public function setImports(array $imports)
+    {
+        if ($this->namespaces) {
+            throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.');
+        }
+        $this->imports = $imports;
+    }
+
+     /**
+     * Sets current target context as bitmask.
+     *
+     * @param integer $target
+     */
+    public function setTarget($target)
+    {
+        $this->target = $target;
+    }
+
+    /**
+     * Parses the given docblock string for annotations.
+     *
+     * @param string $input The docblock string to parse.
+     * @param string $context The parsing context.
+     * @return array Array of annotations. If no annotations are found, an empty array is returned.
+     */
+    public function parse($input, $context = '')
+    {
+        if (false === $pos = strpos($input, '@')) {
+            return array();
+        }
+
+        // also parse whatever character is before the @
+        if ($pos > 0) {
+            $pos -= 1;
+        }
+
+        $this->context = $context;
+        $this->lexer->setInput(trim(substr($input, $pos), '* /'));
+        $this->lexer->moveNext();
+
+        return $this->Annotations();
+    }
+
+    /**
+     * Attempts to match the given token with the current lookahead token.
+     * If they match, updates the lookahead token; otherwise raises a syntax error.
+     *
+     * @param int $token type of Token.
+     * @return bool True if tokens match; false otherwise.
+     */
+    private function match($token)
+    {
+        if ( ! $this->lexer->isNextToken($token) ) {
+            $this->syntaxError($this->lexer->getLiteral($token));
+        }
+
+        return $this->lexer->moveNext();
+    }
+
+    /**
+     * Attempts to match the current lookahead token with any of the given tokens.
+     *
+     * If any of them matches, this method updates the lookahead token; otherwise
+     * a syntax error is raised.
+     *
+     * @param array $tokens
+     * @return bool
+     */
+    private function matchAny(array $tokens)
+    {
+        if ( ! $this->lexer->isNextTokenAny($tokens)) {
+            $this->syntaxError(implode(' or ', array_map(array($this->lexer, 'getLiteral'), $tokens)));
+        }
+
+        return $this->lexer->moveNext();
+    }
+
+    /**
+     * Generates a new syntax error.
+     *
+     * @param string $expected Expected string.
+     * @param array $token Optional token.
+     *
+     * @throws AnnotationException
+     */
+    private function syntaxError($expected, $token = null)
+    {
+        if ($token === null) {
+            $token = $this->lexer->lookahead;
+        }
+
+        $message =  "Expected {$expected}, got ";
+
+        if ($this->lexer->lookahead === null) {
+            $message .= 'end of string';
+        } else {
+            $message .= "'{$token['value']}' at position {$token['position']}";
+        }
+
+        if (strlen($this->context)) {
+            $message .= ' in ' . $this->context;
+        }
+
+        $message .= '.';
+
+        throw AnnotationException::syntaxError($message);
+    }
+
+    /**
+     * Attempt to check if a class exists or not. This never goes through the PHP autoloading mechanism
+     * but uses the {@link AnnotationRegistry} to load classes.
+     *
+     * @param string $fqcn
+     * @return boolean
+     */
+    private function classExists($fqcn)
+    {
+        if (isset($this->classExists[$fqcn])) {
+            return $this->classExists[$fqcn];
+        }
+
+        // first check if the class already exists, maybe loaded through another AnnotationReader
+        if (class_exists($fqcn, false)) {
+            return $this->classExists[$fqcn] = true;
+        }
+
+        // final check, does this class exist?
+        return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn);
+    }
+
+    /**
+     * Collects parsing metadata for a given annotation class
+     *
+     * @param string $name The annotation name
+     */
+    private function collectAnnotationMetadata($name)
+    {
+        if (self::$metadataParser == null){
+            self::$metadataParser = new self();
+            self::$metadataParser->setIgnoreNotImportedAnnotations(true);
+            self::$metadataParser->setIgnoredAnnotationNames($this->ignoredAnnotationNames);
+            self::$metadataParser->setImports(array(
+                'enum'          => 'Doctrine\Common\Annotations\Annotation\Enum',
+                'target'        => 'Doctrine\Common\Annotations\Annotation\Target',
+                'attribute'     => 'Doctrine\Common\Annotations\Annotation\Attribute',
+                'attributes'    => 'Doctrine\Common\Annotations\Annotation\Attributes'
+            ));
+            AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Enum.php');
+            AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Target.php');
+            AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attribute.php');
+            AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attributes.php');
+        }
+
+        $class      = new \ReflectionClass($name);
+        $docComment = $class->getDocComment();
+
+        // Sets default values for annotation metadata
+        $metadata = array(
+            'default_property' => null,
+            'has_constructor'  => (null !== $constructor = $class->getConstructor()) && $constructor->getNumberOfParameters() > 0,
+            'properties'       => array(),
+            'property_types'   => array(),
+            'attribute_types'  => array(),
+            'targets_literal'  => null,
+            'targets'          => Target::TARGET_ALL,
+            'is_annotation'    => false !== strpos($docComment, '@Annotation'),
+        );
+
+        // verify that the class is really meant to be an annotation
+        if ($metadata['is_annotation']) {
+
+            self::$metadataParser->setTarget(Target::TARGET_CLASS);
+
+            foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) {
+                if ($annotation instanceof Target) {
+                    $metadata['targets']         = $annotation->targets;
+                    $metadata['targets_literal'] = $annotation->literal;
+
+                } elseif ($annotation instanceof Attributes) {
+                    foreach ($annotation->value as $attrib) {
+                        // handle internal type declaration
+                        $type = isset(self::$typeMap[$attrib->type]) ? self::$typeMap[$attrib->type] : $attrib->type;
+
+                        // handle the case if the property type is mixed
+                        if ('mixed' !== $type) {
+                            // Checks if the property has array<type>
+                            if (false !== $pos = strpos($type, '<')) {
+                                $arrayType  = substr($type, $pos+1, -1);
+                                $type       = 'array';
+
+                                if (isset(self::$typeMap[$arrayType])) {
+                                    $arrayType = self::$typeMap[$arrayType];
+                                }
+
+                                $metadata['attribute_types'][$attrib->name]['array_type'] = $arrayType;
+                            }
+
+                            $metadata['attribute_types'][$attrib->name]['type']     = $type;
+                            $metadata['attribute_types'][$attrib->name]['value']    = $attrib->type;
+                            $metadata['attribute_types'][$attrib->name]['required'] = $attrib->required;
+                        }
+                    }
+                }
+            }
+
+            // if not has a constructor will inject values into public properties
+            if (false === $metadata['has_constructor']) {
+                // collect all public properties
+                foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
+                    $metadata['properties'][$property->name] = $property->name;
+                    
+                    if(false === ($propertyComment = $property->getDocComment())) {
+                        continue;
+                    }
+
+                    // checks if the property has @var annotation
+                    if (false !== strpos($propertyComment, '@var')
+                        && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) {
+                        // literal type declaration
+                        $value = $matches[1];
+
+                        // handle internal type declaration
+                        $type = isset(self::$typeMap[$value]) ? self::$typeMap[$value] : $value;
+
+                        // handle the case if the property type is mixed
+                        if ('mixed' !== $type) {
+                            // Checks if the property has @var array<type> annotation
+                            if (false !== $pos = strpos($type, '<')) {
+                                $arrayType = substr($type, $pos+1, -1);
+                                $type = 'array';
+
+                                if (isset(self::$typeMap[$arrayType])) {
+                                    $arrayType = self::$typeMap[$arrayType];
+                                }
+
+                                $metadata['attribute_types'][$property->name]['array_type'] = $arrayType;
+                            }
+
+                            $metadata['attribute_types'][$property->name]['type']       = $type;
+                            $metadata['attribute_types'][$property->name]['value']      = $value;
+                            $metadata['attribute_types'][$property->name]['required']   = false !== strpos($propertyComment, '@Required');
+                        }
+                    }
+
+                    // checks if the property has @Enum
+                    if (false !== strpos($propertyComment, '@Enum')){
+
+                        $context = 'property ' . $class->name . "::\$" . $property->name;
+                        self::$metadataParser->setTarget(Target::TARGET_PROPERTY);
+
+                        foreach (self::$metadataParser->parse($propertyComment, $context) as $annotation) {
+                            if($annotation instanceof Enum) {
+                                $metadata['enum'][$property->name]['value']   = $annotation->value;
+                                $metadata['enum'][$property->name]['literal'] = ! empty($annotation->literal) ? $annotation->literal : $annotation->value;
+                            }
+                        }
+                    }
+                }
+
+                // choose the first property as default property
+                $metadata['default_property'] = reset($metadata['properties']);
+            }
+        }
+
+        self::$annotationMetadata[$name] = $metadata;
+    }
+
+    /**
+     * Annotations ::= Annotation {[ "*" ]* [Annotation]}*
+     *
+     * @return array
+     */
+    private function Annotations()
+    {
+        $annotations = array();
+
+        while (null !== $this->lexer->lookahead) {
+            if (DocLexer::T_AT !== $this->lexer->lookahead['type']) {
+                $this->lexer->moveNext();
+                continue;
+            }
+
+            // make sure the @ is preceded by non-catchable pattern
+            if (null !== $this->lexer->token && $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value'])) {
+                $this->lexer->moveNext();
+                continue;
+            }
+
+            // make sure the @ is followed by either a namespace separator, or
+            // an identifier token
+            if ((null === $peek = $this->lexer->glimpse())
+                || (DocLexer::T_NAMESPACE_SEPARATOR !== $peek['type'] && !in_array($peek['type'], self::$classIdentifiers, true))
+                || $peek['position'] !== $this->lexer->lookahead['position'] + 1) {
+                $this->lexer->moveNext();
+                continue;
+            }
+
+            $this->isNestedAnnotation = false;
+            if (false !== $annot = $this->Annotation()) {
+                $annotations[] = $annot;
+            }
+        }
+
+        return $annotations;
+    }
+
+    /**
+     * Annotation     ::= "@" AnnotationName ["(" [Values] ")"]
+     * AnnotationName ::= QualifiedName | SimpleName
+     * QualifiedName  ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName
+     * NameSpacePart  ::= identifier | null | false | true
+     * SimpleName     ::= identifier | null | false | true
+     *
+     * @throws AnnotationException
+     * @return mixed False if it is not a valid annotation.
+     */
+    private function Annotation()
+    {
+        $this->match(DocLexer::T_AT);
+
+        // check if we have an annotation
+        $name = $this->Identifier();
+
+        // only process names which are not fully qualified, yet
+        // fully qualified names must start with a \
+        $originalName = $name;
+        if ('\\' !== $name[0]) {
+            $alias = (false === $pos = strpos($name, '\\'))? $name : substr($name, 0, $pos);
+
+            $found = false;
+            if ($this->namespaces) {
+                foreach ($this->namespaces as $namespace) {
+                    if ($this->classExists($namespace.'\\'.$name)) {
+                        $name = $namespace.'\\'.$name;
+                        $found = true;
+                        break;
+                    }
+                }
+            } elseif (isset($this->imports[$loweredAlias = strtolower($alias)])) {
+                if (false !== $pos) {
+                    $name = $this->imports[$loweredAlias].substr($name, $pos);
+                } else {
+                    $name = $this->imports[$loweredAlias];
+                }
+                $found = true;
+            } elseif (isset($this->imports['__NAMESPACE__']) && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name)) {
+                 $name = $this->imports['__NAMESPACE__'].'\\'.$name;
+                 $found = true;
+            } elseif ($this->classExists($name)) {
+                $found = true;
+            }
+
+            if (!$found) {
+                if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) {
+                    return false;
+                }
+
+                throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s was never imported. Did you maybe forget to add a "use" statement for this annotation?', $name, $this->context));
+            }
+        }
+
+        if (!$this->classExists($name)) {
+            throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context));
+        }
+
+        // at this point, $name contains the fully qualified class name of the
+        // annotation, and it is also guaranteed that this class exists, and
+        // that it is loaded
+
+
+        // collects the metadata annotation only if there is not yet
+        if (!isset(self::$annotationMetadata[$name])) {
+            $this->collectAnnotationMetadata($name);
+        }
+
+        // verify that the class is really meant to be an annotation and not just any ordinary class
+        if (self::$annotationMetadata[$name]['is_annotation'] === false) {
+            if (isset($this->ignoredAnnotationNames[$originalName])) {
+                return false;
+            }
+
+            throw AnnotationException::semanticalError(sprintf('The class "%s" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "%s". If it is indeed no annotation, then you need to add @IgnoreAnnotation("%s") to the _class_ doc comment of %s.', $name, $name, $originalName, $this->context));
+        }
+
+        //if target is nested annotation
+        $target = $this->isNestedAnnotation ? Target::TARGET_ANNOTATION : $this->target;
+
+        // Next will be nested
+        $this->isNestedAnnotation = true;
+
+        //if annotation does not support current target
+        if (0 === (self::$annotationMetadata[$name]['targets'] & $target) && $target) {
+            throw AnnotationException::semanticalError(
+                sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.',
+                     $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal'])
+            );
+        }
+
+        $values = array();
+        if ($this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) {
+            $this->match(DocLexer::T_OPEN_PARENTHESIS);
+
+            if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) {
+                $values = $this->Values();
+            }
+
+            $this->match(DocLexer::T_CLOSE_PARENTHESIS);
+        }
+
+        if (isset(self::$annotationMetadata[$name]['enum'])) {
+            // checks all declared attributes
+            foreach (self::$annotationMetadata[$name]['enum'] as $property => $enum) {
+                // checks if the attribute is a valid enumerator
+                if (isset($values[$property]) && ! in_array($values[$property], $enum['value'])) {
+                    throw AnnotationException::enumeratorError($property, $name, $this->context, $enum['literal'], $values[$property]);
+                }
+            }
+        }
+
+        // checks all declared attributes
+        foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) {
+            if ($property === self::$annotationMetadata[$name]['default_property']
+                && !isset($values[$property]) && isset($values['value'])) {
+                $property = 'value';
+            }
+
+            // handle a not given attribute or null value
+            if (!isset($values[$property])) {
+                if ($type['required']) {
+                    throw AnnotationException::requiredError($property, $originalName, $this->context, 'a(n) '.$type['value']);
+                }
+
+                continue;
+            }
+
+            if ($type['type'] === 'array') {
+                // handle the case of a single value
+                if ( ! is_array($values[$property])) {
+                    $values[$property] = array($values[$property]);
+                }
+
+                // checks if the attribute has array type declaration, such as "array<string>"
+                if (isset($type['array_type'])) {
+                    foreach ($values[$property] as $item) {
+                        if (gettype($item) !== $type['array_type'] && !$item instanceof $type['array_type']) {
+                            throw AnnotationException::typeError($property, $originalName, $this->context, 'either a(n) '.$type['array_type'].', or an array of '.$type['array_type'].'s', $item);
+                        }
+                    }
+                }
+            } elseif (gettype($values[$property]) !== $type['type'] && !$values[$property] instanceof $type['type']) {
+                throw AnnotationException::typeError($property, $originalName, $this->context, 'a(n) '.$type['value'], $values[$property]);
+            }
+        }
+
+        // check if the annotation expects values via the constructor,
+        // or directly injected into public properties
+        if (self::$annotationMetadata[$name]['has_constructor'] === true) {
+            return new $name($values);
+        }
+
+        $instance = new $name();
+        foreach ($values as $property => $value) {
+            if (!isset(self::$annotationMetadata[$name]['properties'][$property])) {
+                if ('value' !== $property) {
+                    throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not have a property named "%s". Available properties: %s', $originalName, $this->context, $property, implode(', ', self::$annotationMetadata[$name]['properties'])));
+                }
+
+                // handle the case if the property has no annotations
+                if (!$property = self::$annotationMetadata[$name]['default_property']) {
+                    throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not accept any values, but got %s.', $originalName, $this->context, json_encode($values)));
+                }
+            }
+
+            $instance->{$property} = $value;
+        }
+
+        return $instance;
+    }
+
+    /**
+     * Values ::= Array | Value {"," Value}*
+     *
+     * @return array
+     */
+    private function Values()
+    {
+        $values = array();
+
+        // Handle the case of a single array as value, i.e. @Foo({....})
+        if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) {
+            $values['value'] = $this->Value();
+            return $values;
+        }
+
+        $values[] = $this->Value();
+
+        while ($this->lexer->isNextToken(DocLexer::T_COMMA)) {
+            $this->match(DocLexer::T_COMMA);
+            $token = $this->lexer->lookahead;
+            $value = $this->Value();
+
+            if ( ! is_object($value) && ! is_array($value)) {
+                $this->syntaxError('Value', $token);
+            }
+
+            $values[] = $value;
+        }
+
+        foreach ($values as $k => $value) {
+            if (is_object($value) && $value instanceof \stdClass) {
+                $values[$value->name] = $value->value;
+            } else if ( ! isset($values['value'])){
+                $values['value'] = $value;
+            } else {
+                if ( ! is_array($values['value'])) {
+                    $values['value'] = array($values['value']);
+                }
+
+                $values['value'][] = $value;
+            }
+
+            unset($values[$k]);
+        }
+
+        return $values;
+    }
+
+    /**
+     * Constant ::= integer | string | float | boolean
+     *
+     * @throws AnnotationException
+     * @return mixed
+     */
+    private function Constant()
+    {
+        $identifier = $this->Identifier();
+
+        if (!defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) {
+
+            list($className, $const) = explode('::', $identifier);
+            $alias = (false === $pos = strpos($className, '\\'))? $className : substr($className, 0, $pos);
+
+            $found = false;
+            switch (true) {
+                case !empty ($this->namespaces):
+                    foreach ($this->namespaces as $ns) {
+                        if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) {
+                             $className = $ns.'\\'.$className;
+                             $found = true;
+                             break;
+                        }
+                    }
+                    break;
+
+                case isset($this->imports[$loweredAlias = strtolower($alias)]):
+                    $found = true;
+                    if (false !== $pos) {
+                        $className = $this->imports[$loweredAlias].substr($className, $pos);
+                    } else {
+                        $className = $this->imports[$loweredAlias];
+                    }
+                    break;
+
+                default:
+                    if(isset($this->imports['__NAMESPACE__'])) {
+                        $ns = $this->imports['__NAMESPACE__'];
+                        if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) {
+                             $className = $ns.'\\'.$className;
+                             $found = true;
+                        }
+                    }
+                    break;
+            }
+
+            if ($found) {
+                 $identifier = $className . '::' . $const;
+            }
+        }
+
+        if (!defined($identifier)) {
+            throw AnnotationException::semanticalErrorConstants($identifier, $this->context);
+        }
+
+        return constant($identifier);
+    }
+
+    /**
+     * Identifier ::= string
+     *
+     * @return string
+     */
+    private function Identifier()
+    {
+        // check if we have an annotation
+        if ($this->lexer->isNextTokenAny(self::$classIdentifiers)) {
+            $this->lexer->moveNext();
+            $className = $this->lexer->token['value'];
+        } else {
+            $this->syntaxError('namespace separator or identifier');
+        }
+
+        while ($this->lexer->lookahead['position'] === ($this->lexer->token['position'] + strlen($this->lexer->token['value']))
+                && $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) {
+
+            $this->match(DocLexer::T_NAMESPACE_SEPARATOR);
+            $this->matchAny(self::$classIdentifiers);
+            $className .= '\\' . $this->lexer->token['value'];
+        }
+
+        return $className;
+    }
+
+    /**
+     * Value ::= PlainValue | FieldAssignment
+     *
+     * @return mixed
+     */
+    private function Value()
+    {
+        $peek = $this->lexer->glimpse();
+
+        if (DocLexer::T_EQUALS === $peek['type']) {
+            return $this->FieldAssignment();
+        }
+
+        return $this->PlainValue();
+    }
+
+    /**
+     * PlainValue ::= integer | string | float | boolean | Array | Annotation
+     *
+     * @return mixed
+     */
+    private function PlainValue()
+    {
+        if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) {
+            return $this->Arrayx();
+        }
+
+        if ($this->lexer->isNextToken(DocLexer::T_AT)) {
+            return $this->Annotation();
+        }
+
+        if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
+            return $this->Constant();
+        }
+
+        switch ($this->lexer->lookahead['type']) {
+            case DocLexer::T_STRING:
+                $this->match(DocLexer::T_STRING);
+                return $this->lexer->token['value'];
+
+            case DocLexer::T_INTEGER:
+                $this->match(DocLexer::T_INTEGER);
+                return (int)$this->lexer->token['value'];
+
+            case DocLexer::T_FLOAT:
+                $this->match(DocLexer::T_FLOAT);
+                return (float)$this->lexer->token['value'];
+
+            case DocLexer::T_TRUE:
+                $this->match(DocLexer::T_TRUE);
+                return true;
+
+            case DocLexer::T_FALSE:
+                $this->match(DocLexer::T_FALSE);
+                return false;
+
+            case DocLexer::T_NULL:
+                $this->match(DocLexer::T_NULL);
+                return null;
+
+            default:
+                $this->syntaxError('PlainValue');
+        }
+    }
+
+    /**
+     * FieldAssignment ::= FieldName "=" PlainValue
+     * FieldName ::= identifier
+     *
+     * @return array
+     */
+    private function FieldAssignment()
+    {
+        $this->match(DocLexer::T_IDENTIFIER);
+        $fieldName = $this->lexer->token['value'];
+
+        $this->match(DocLexer::T_EQUALS);
+
+        $item = new \stdClass();
+        $item->name  = $fieldName;
+        $item->value = $this->PlainValue();
+
+        return $item;
+    }
+
+    /**
+     * Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}"
+     *
+     * @return array
+     */
+    private function Arrayx()
+    {
+        $array = $values = array();
+
+        $this->match(DocLexer::T_OPEN_CURLY_BRACES);
+        $values[] = $this->ArrayEntry();
+
+        while ($this->lexer->isNextToken(DocLexer::T_COMMA)) {
+            $this->match(DocLexer::T_COMMA);
+
+            // optional trailing comma
+            if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) {
+                break;
+            }
+
+            $values[] = $this->ArrayEntry();
+        }
+
+        $this->match(DocLexer::T_CLOSE_CURLY_BRACES);
+
+        foreach ($values as $value) {
+            list ($key, $val) = $value;
+
+            if ($key !== null) {
+                $array[$key] = $val;
+            } else {
+                $array[] = $val;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * ArrayEntry ::= Value | KeyValuePair
+     * KeyValuePair ::= Key ("=" | ":") PlainValue | Constant
+     * Key ::= string | integer | Constant
+     *
+     * @return array
+     */
+    private function ArrayEntry()
+    {
+        $peek = $this->lexer->glimpse();
+
+        if (DocLexer::T_EQUALS === $peek['type']
+                || DocLexer::T_COLON === $peek['type']) {
+
+            if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
+                $key = $this->Constant();
+            } else {
+                $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING));
+                $key = $this->lexer->token['value'];
+            }
+
+            $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON));
+
+            return array($key, $this->PlainValue());
+        }
+
+        return array(null, $this->Value());
+    }
+}

+ 269 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php

@@ -0,0 +1,269 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+
+/**
+ * File cache reader for annotations.
+ *
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ */
+class FileCacheReader implements Reader
+{
+    /**
+     * @var Reader
+     */
+    private $reader;
+
+    /**
+     * @var string
+     */
+    private $dir;
+
+    /**
+     * @var bool
+     */
+    private $debug;
+
+    /**
+     * @var array
+     */
+    private $loadedAnnotations = array();
+
+    private $classNameHashes = array();
+
+    /**
+     * Constructor
+     *
+     * @param Reader $reader
+     * @param string $cacheDir
+     * @param bool $debug
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function __construct(Reader $reader, $cacheDir, $debug = false)
+    {
+        $this->reader = $reader;
+        if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true)) {
+            throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $cacheDir));
+        }
+        if (!is_writable($cacheDir)) {
+            throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support this, check out the acl package.', $cacheDir));
+        }
+
+        $this->dir   = rtrim($cacheDir, '\\/');
+        $this->debug = $debug;
+    }
+
+    /**
+     * Retrieve annotations for class
+     *
+     * @param \ReflectionClass $class
+     * @return array
+     */
+    public function getClassAnnotations(\ReflectionClass $class)
+    {
+        if ( ! isset($this->classNameHashes[$class->name])) {
+            $this->classNameHashes[$class->name] = sha1($class->name);
+        }
+        $key = $this->classNameHashes[$class->name];
+
+        if (isset($this->loadedAnnotations[$key])) {
+            return $this->loadedAnnotations[$key];
+        }
+
+        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
+        if (!is_file($path)) {
+            $annot = $this->reader->getClassAnnotations($class);
+            $this->saveCacheFile($path, $annot);
+            return $this->loadedAnnotations[$key] = $annot;
+        }
+
+        if ($this->debug
+            && (false !== $filename = $class->getFilename())
+            && filemtime($path) < filemtime($filename)) {
+            @unlink($path);
+
+            $annot = $this->reader->getClassAnnotations($class);
+            $this->saveCacheFile($path, $annot);
+            return $this->loadedAnnotations[$key] = $annot;
+        }
+
+        return $this->loadedAnnotations[$key] = include $path;
+    }
+
+    /**
+     * Get annotations for property
+     *
+     * @param \ReflectionProperty $property
+     * @return array
+     */
+    public function getPropertyAnnotations(\ReflectionProperty $property)
+    {
+        $class = $property->getDeclaringClass();
+        if ( ! isset($this->classNameHashes[$class->name])) {
+            $this->classNameHashes[$class->name] = sha1($class->name);
+        }
+        $key = $this->classNameHashes[$class->name].'$'.$property->getName();
+
+        if (isset($this->loadedAnnotations[$key])) {
+            return $this->loadedAnnotations[$key];
+        }
+
+        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
+        if (!is_file($path)) {
+            $annot = $this->reader->getPropertyAnnotations($property);
+            $this->saveCacheFile($path, $annot);
+            return $this->loadedAnnotations[$key] = $annot;
+        }
+
+        if ($this->debug
+            && (false !== $filename = $class->getFilename())
+            && filemtime($path) < filemtime($filename)) {
+            @unlink($path);
+
+            $annot = $this->reader->getPropertyAnnotations($property);
+            $this->saveCacheFile($path, $annot);
+            return $this->loadedAnnotations[$key] = $annot;
+        }
+
+        return $this->loadedAnnotations[$key] = include $path;
+    }
+
+    /**
+     * Retrieve annotations for method
+     *
+     * @param \ReflectionMethod $method
+     * @return array
+     */
+    public function getMethodAnnotations(\ReflectionMethod $method)
+    {
+        $class = $method->getDeclaringClass();
+        if ( ! isset($this->classNameHashes[$class->name])) {
+            $this->classNameHashes[$class->name] = sha1($class->name);
+        }
+        $key = $this->classNameHashes[$class->name].'#'.$method->getName();
+
+        if (isset($this->loadedAnnotations[$key])) {
+            return $this->loadedAnnotations[$key];
+        }
+
+        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
+        if (!is_file($path)) {
+            $annot = $this->reader->getMethodAnnotations($method);
+            $this->saveCacheFile($path, $annot);
+            return $this->loadedAnnotations[$key] = $annot;
+        }
+
+        if ($this->debug
+            && (false !== $filename = $class->getFilename())
+            && filemtime($path) < filemtime($filename)) {
+            @unlink($path);
+
+            $annot = $this->reader->getMethodAnnotations($method);
+            $this->saveCacheFile($path, $annot);
+            return $this->loadedAnnotations[$key] = $annot;
+        }
+
+        return $this->loadedAnnotations[$key] = include $path;
+    }
+
+    /**
+     * Save cache file
+     *
+     * @param string $path
+     * @param mixed $data
+     */
+    private function saveCacheFile($path, $data)
+    {
+        file_put_contents($path, '<?php return unserialize('.var_export(serialize($data), true).');');
+    }
+
+    /**
+     * Gets a class annotation.
+     *
+     * @param \ReflectionClass $class The ReflectionClass of the class from which
+     *                               the class annotations should be read.
+     * @param string $annotationName The name of the annotation.
+     *
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getClassAnnotation(\ReflectionClass $class, $annotationName)
+    {
+        $annotations = $this->getClassAnnotations($class);
+
+        foreach ($annotations as $annotation) {
+            if ($annotation instanceof $annotationName) {
+                return $annotation;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Gets a method annotation.
+     *
+     * @param \ReflectionMethod $method
+     * @param string $annotationName The name of the annotation.
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
+    {
+        $annotations = $this->getMethodAnnotations($method);
+
+        foreach ($annotations as $annotation) {
+            if ($annotation instanceof $annotationName) {
+                return $annotation;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Gets a property annotation.
+     *
+     * @param \ReflectionProperty $property
+     * @param string $annotationName The name of the annotation.
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
+    {
+        $annotations = $this->getPropertyAnnotations($property);
+
+        foreach ($annotations as $annotation) {
+            if ($annotation instanceof $annotationName) {
+                return $annotation;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Clear stores annotations
+     */
+    public function clearLoadedAnnotations()
+    {
+        $this->loadedAnnotations = array();
+    }
+}

+ 141 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php

@@ -0,0 +1,141 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Annotations\Reader;
+
+/**
+ * Allows the reader to be used in-place of Doctrine's reader.
+ *
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+class IndexedReader implements Reader
+{
+    /**
+     * @var Reader
+     */
+    private $delegate;
+
+    /**
+     * Constructor
+     *
+     * @param Reader $reader
+     */
+    public function __construct(Reader $reader)
+    {
+        $this->delegate = $reader;
+    }
+
+    /**
+     * Get Annotations for class
+     *
+     * @param \ReflectionClass $class
+     * @return array
+     */
+    public function getClassAnnotations(\ReflectionClass $class)
+    {
+        $annotations = array();
+        foreach ($this->delegate->getClassAnnotations($class) as $annot) {
+            $annotations[get_class($annot)] = $annot;
+        }
+
+        return $annotations;
+    }
+
+    /**
+     * Get selected annotation for class
+     *
+     * @param \ReflectionClass $class
+     * @param string $annotation
+     * @return mixed
+     */
+    public function getClassAnnotation(\ReflectionClass $class, $annotation)
+    {
+        return $this->delegate->getClassAnnotation($class, $annotation);
+    }
+
+    /**
+     * Get Annotations for method
+     *
+     * @param \ReflectionMethod $method
+     * @return array
+     */
+    public function getMethodAnnotations(\ReflectionMethod $method)
+    {
+        $annotations = array();
+        foreach ($this->delegate->getMethodAnnotations($method) as $annot) {
+            $annotations[get_class($annot)] = $annot;
+        }
+
+        return $annotations;
+    }
+
+    /**
+     * Get selected annotation for method
+     *
+     * @param \ReflectionMethod $method
+     * @param string $annotation
+     * @return mixed
+     */
+    public function getMethodAnnotation(\ReflectionMethod $method, $annotation)
+    {
+        return $this->delegate->getMethodAnnotation($method, $annotation);
+    }
+
+    /**
+     * Get annotations for property
+     *
+     * @param \ReflectionProperty $property
+     * @return array
+     */
+    public function getPropertyAnnotations(\ReflectionProperty $property)
+    {
+        $annotations = array();
+        foreach ($this->delegate->getPropertyAnnotations($property) as $annot) {
+            $annotations[get_class($annot)] = $annot;
+        }
+
+        return $annotations;
+    }
+
+    /**
+     * Get selected annotation for property
+     *
+     * @param \ReflectionProperty $property
+     * @param string $annotation
+     * @return mixed
+     */
+    public function getPropertyAnnotation(\ReflectionProperty $property, $annotation)
+    {
+        return $this->delegate->getPropertyAnnotation($property, $annotation);
+    }
+
+    /**
+     * Proxy all methods to the delegate.
+     *
+     * @param string $method
+     * @param array $args
+     * @return mixed
+     */
+    public function __call($method, $args)
+    {
+        return call_user_func_array(array($this->delegate, $method), $args);
+    }
+}

+ 89 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php

@@ -0,0 +1,89 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use SplFileObject;
+
+/**
+ * Parses a file for namespaces/use/class declarations.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Christian Kaps <christian.kaps@mohiva.com>
+ */
+final class PhpParser
+{
+    /**
+     * Parses a class.
+     *
+     * @param  \ReflectionClass $class A <code>ReflectionClass</code> object.
+     * @return array            A list with use statements in the form (Alias => FQN).
+     */
+    public function parseClass(\ReflectionClass $class)
+    {
+        if (method_exists($class, 'getUseStatements')) {
+            return $class->getUseStatements();
+        }
+
+        if (false === $filename = $class->getFilename()) {
+            return array();
+        }
+
+        $content = $this->getFileContent($filename, $class->getStartLine());
+
+        if (null === $content) {
+            return array();
+        }
+
+        $namespace = preg_quote($class->getNamespaceName());
+        $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content);
+        $tokenizer = new TokenParser('<?php ' . $content);
+
+        $statements = $tokenizer->parseUseStatements($class->getNamespaceName());
+
+        return $statements;
+    }
+
+    /**
+     * Get the content of the file right up to the given line number.
+     *
+     * @param  string $filename   The name of the file to load.
+     * @param  int    $lineNumber The number of lines to read from file.
+     * @return string The content of the file.
+     */
+    private function getFileContent($filename, $lineNumber)
+    {
+        if ( ! is_file($filename)) {
+            return null;
+        }
+
+        $content = '';
+        $lineCnt = 0;
+        $file = new SplFileObject($filename);
+        while (!$file->eof()) {
+            if ($lineCnt++ == $lineNumber) {
+                break;
+            }
+
+            $content .= $file->fgets();
+        }
+
+        return $content;
+    }
+}

+ 67 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php

@@ -0,0 +1,67 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Interface for annotation readers.
+ *
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+interface Reader
+{
+    /**
+     * @param \ReflectionClass $class
+     * @return mixed
+     */
+    function getClassAnnotations(\ReflectionClass $class);
+
+    /**
+     * @param \ReflectionClass $class
+     * @param string $annotationName
+     * @return mixed
+     */
+    function getClassAnnotation(\ReflectionClass $class, $annotationName);
+
+    /**
+     * @param \ReflectionMethod $method
+     * @return mixed
+     */
+    function getMethodAnnotations(\ReflectionMethod $method);
+
+    /**
+     * @param \ReflectionMethod $method
+     * @param string $annotationName
+     * @return mixed
+     */
+    function getMethodAnnotation(\ReflectionMethod $method, $annotationName);
+
+    /**
+     * @param \ReflectionProperty $property
+     * @return mixed
+     */
+    function getPropertyAnnotations(\ReflectionProperty $property);
+
+    /**
+     * @param \ReflectionProperty $property
+     * @param string $annotationName
+     * @return mixed
+     */
+    function getPropertyAnnotation(\ReflectionProperty $property, $annotationName);
+}

+ 157 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php

@@ -0,0 +1,157 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+use Doctrine\Common\Annotations\Annotation\Target;
+
+/**
+ * Simple Annotation Reader.
+ *
+ * This annotation reader is intended to be used in projects where you have
+ * full-control over all annotations that are available.
+ *
+ * @since  2.2
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
+ */
+class SimpleAnnotationReader implements Reader
+{
+    /**
+     * @var DocParser
+     */
+    private $parser;
+
+    /**
+     * Constructor.
+     *
+     * Initializes a new SimpleAnnotationReader.
+     */
+    public function __construct()
+    {
+        $this->parser = new DocParser();
+        $this->parser->setIgnoreNotImportedAnnotations(true);
+    }
+
+    /**
+     * Adds a namespace in which we will look for annotations.
+     *
+     * @param string $namespace
+     */
+    public function addNamespace($namespace)
+    {
+        $this->parser->addNamespace($namespace);
+    }
+
+    /**
+     * Gets the annotations applied to a class.
+     *
+     * @param \ReflectionClass $class The ReflectionClass of the class from which
+     *                               the class annotations should be read.
+     *
+     * @return array An array of Annotations.
+     */
+    public function getClassAnnotations(\ReflectionClass $class)
+    {
+        return $this->parser->parse($class->getDocComment(), 'class '.$class->getName());
+    }
+
+    /**
+     * Gets the annotations applied to a method.
+     *
+     * @param \ReflectionMethod $method The ReflectionMethod of the method from which
+     *                                   the annotations should be read.
+     *
+     * @return array An array of Annotations.
+     */
+    public function getMethodAnnotations(\ReflectionMethod $method)
+    {
+        return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()');
+    }
+
+    /**
+     * Gets the annotations applied to a property.
+     *
+     * @param \ReflectionProperty $property The ReflectionProperty of the property
+     *                                     from which the annotations should be read.
+     *
+     * @return array An array of Annotations.
+     */
+    public function getPropertyAnnotations(\ReflectionProperty $property)
+    {
+        return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName());
+    }
+
+    /**
+     * Gets a class annotation.
+     *
+     * @param \ReflectionClass $class The ReflectionClass of the class from which
+     *                               the class annotations should be read.
+     * @param string $annotationName The name of the annotation.
+     *
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getClassAnnotation(\ReflectionClass $class, $annotationName)
+    {
+        foreach ($this->getClassAnnotations($class) as $annot) {
+            if ($annot instanceof $annotationName) {
+                return $annot;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Gets a method annotation.
+     *
+     * @param \ReflectionMethod $method
+     * @param string $annotationName The name of the annotation.
+     *
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
+    {
+        foreach ($this->getMethodAnnotations($method) as $annot) {
+            if ($annot instanceof $annotationName) {
+                return $annot;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Gets a property annotation.
+     *
+     * @param \ReflectionProperty $property
+     * @param string $annotationName The name of the annotation.
+     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
+     */
+    public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
+    {
+        foreach ($this->getPropertyAnnotations($property) as $annot) {
+            if ($annot instanceof $annotationName) {
+                return $annot;
+            }
+        }
+
+        return null;
+    }
+}

+ 175 - 0
vendor/doctrine/common/lib/Doctrine/Common/Annotations/TokenParser.php

@@ -0,0 +1,175 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Annotations;
+
+/**
+ * Parses a file for namespaces/use/class declarations.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Christian Kaps <christian.kaps@mohiva.com>
+ */
+class TokenParser
+{
+    /**
+     * The token list.
+     *
+     * @var array
+     */
+    private $tokens;
+
+    /**
+     * The number of tokens.
+     *
+     * @var int
+     */
+    private $numTokens = 0;
+
+    /**
+     * The current array pointer.
+     *
+     * @var int
+     */
+    private $pointer = 0;
+
+    public function __construct($contents)
+    {
+        $this->tokens = token_get_all($contents);
+        $this->numTokens = count($this->tokens);
+        $this->pointer = 0;
+    }
+
+    /**
+     * Gets the next non whitespace and non comment token.
+     *
+     * @param $docCommentIsComment
+     *     If TRUE then a doc comment is considered a comment and skipped.
+     *     If FALSE then only whitespace and normal comments are skipped.
+     *
+     * @return array The token if exists, null otherwise.
+     */
+    public function next($docCommentIsComment = TRUE)
+    {
+        for ($i = $this->pointer; $i < $this->numTokens; $i++) {
+            $this->pointer++;
+            if ($this->tokens[$i][0] === T_WHITESPACE ||
+                $this->tokens[$i][0] === T_COMMENT ||
+                ($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT)) {
+
+                continue;
+            }
+
+            return $this->tokens[$i];
+        }
+
+        return null;
+    }
+
+    /**
+     * Parse a single use statement.
+     *
+     * @return array A list with all found class names for a use statement.
+     */
+    public function parseUseStatement()
+    {
+        $class = '';
+        $alias = '';
+        $statements = array();
+        $explicitAlias = false;
+        while (($token = $this->next())) {
+            $isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR;
+            if (!$explicitAlias && $isNameToken) {
+                $class .= $token[1];
+                $alias = $token[1];
+            } else if ($explicitAlias && $isNameToken) {
+                $alias .= $token[1];
+            } else if ($token[0] === T_AS) {
+                $explicitAlias = true;
+                $alias = '';
+            } else if ($token === ',') {
+                $statements[strtolower($alias)] = $class;
+                $class = '';
+                $alias = '';
+                $explicitAlias = false;
+            } else if ($token === ';') {
+                $statements[strtolower($alias)] = $class;
+                break;
+            } else {
+                break;
+            }
+        }
+
+        return $statements;
+    }
+
+    /**
+     * Get all use statements.
+     *
+     * @param string $namespaceName The namespace name of the reflected class.
+     * @return array A list with all found use statements.
+     */
+    public function parseUseStatements($namespaceName)
+    {
+        $statements = array();
+        while (($token = $this->next())) {
+            if ($token[0] === T_USE) {
+                $statements = array_merge($statements, $this->parseUseStatement());
+                continue;
+            }
+            if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $namespaceName) {
+                continue;
+            }
+
+            // Get fresh array for new namespace. This is to prevent the parser to collect the use statements
+            // for a previous namespace with the same name. This is the case if a namespace is defined twice
+            // or if a namespace with the same name is commented out.
+            $statements = array();
+        }
+
+        return $statements;
+    }
+
+    /**
+     * Get the namespace.
+     *
+     * @return string The found namespace.
+     */
+    public function parseNamespace()
+    {
+        $name = '';
+        while (($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR)) {
+            $name .= $token[1];
+        }
+
+        return $name;
+    }
+
+    /**
+     * Get the class name.
+     *
+     * @return string The foundclass name.
+     */
+    public function parseClass()
+    {
+        // Namespaces and class names are tokenized the same: T_STRINGs
+        // separated by T_NS_SEPARATOR so we can use one function to provide
+        // both.
+        return $this->parseNamespace();
+    }
+}

+ 93 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php

@@ -0,0 +1,93 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  David Abdemoulaie <dave@hobodave.com>
+ */
+class ApcCache extends CacheProvider
+{
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        return apc_fetch($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        return apc_exists($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        return (bool) apc_store($id, $data, (int) $lifeTime);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        return apc_delete($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        return apc_clear_cache() && apc_clear_cache('user');
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        $info = apc_cache_info();
+        $sma  = apc_sma_info();
+
+        return array(
+            Cache::STATS_HITS              => $info['num_hits'],
+            Cache::STATS_MISSES            => $info['num_misses'],
+            Cache::STATS_UPTIME            => $info['start_time'],
+            Cache::STATS_MEMORY_USAGE      => $info['mem_size'],
+            Cache::STATS_MEMORY_AVAILIABLE => $sma['avail_mem'],
+        );
+    }
+}

+ 96 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php

@@ -0,0 +1,96 @@
+<?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
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  David Abdemoulaie <dave@hobodave.com>
+ */
+class ArrayCache extends CacheProvider
+{
+    /**
+     * @var array $data
+     */
+    private $data = array();
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        return (isset($this->data[$id])) ? $this->data[$id] : false;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        return isset($this->data[$id]);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        $this->data[$id] = $data;
+
+        return true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        unset($this->data[$id]);
+
+        return true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        $this->data = array();
+
+        return true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        return null;
+    }
+}

+ 102 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php

@@ -0,0 +1,102 @@
+<?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
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
+ */
+interface Cache
+{
+    const STATS_HITS    = 'hits';
+    const STATS_MISSES  = 'misses';
+    const STATS_UPTIME  = 'uptime';
+    const STATS_MEMORY_USAGE        = 'memory_usage';
+    const STATS_MEMORY_AVAILIABLE   = 'memory_available';
+
+    /**
+     * Fetches an entry from the cache.
+     *
+     * @param string $id cache 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.
+     *
+     * @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);
+
+    /**
+     * Puts data into the 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).
+     * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
+     */
+    function save($id, $data, $lifeTime = 0);
+
+    /**
+     * Deletes a cache entry.
+     *
+     * @param string $id cache id
+     * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
+     */
+    function delete($id);
+
+    /**
+     * Retrieves cached information from data store
+     *
+     * The server's statistics array has the following values:
+     *
+     * - <b>hits</b>
+     * Number of keys that have been requested and found present.
+     *
+     * - <b>misses</b>
+     * Number of items that have been requested and not found.
+     *
+     * - <b>uptime</b>
+     * Time that the server is running.
+     *
+     * - <b>memory_usage</b>
+     * Memory used by this server to store items.
+     *
+     * - <b>memory_available</b>
+     * Memory allowed to use for storage.
+     *
+     * @since   2.2
+     * @var     array Associative array with server's statistics if available, NULL otherwise.
+     */
+    function getStats();
+}

+ 231 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php

@@ -0,0 +1,231 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Base class for cache provider implementations.
+ *
+ * @since   2.2
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
+ */
+abstract class CacheProvider implements Cache
+{
+    const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]';
+
+    /**
+     * @var string The namespace to prefix all cache ids with
+     */
+    private $namespace = '';
+
+    /**
+     * @var string The namespace version
+     */
+    private $namespaceVersion;
+
+    /**
+     * Set the namespace to prefix all cache ids with.
+     *
+     * @param string $namespace
+     * @return void
+     */
+    public function setNamespace($namespace)
+    {
+        $this->namespace = (string) $namespace;
+    }
+
+    /**
+     * Retrieve the namespace that prefixes all cache ids.
+     *
+     * @return string
+     */
+    public function getNamespace()
+    {
+        return $this->namespace;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function fetch($id)
+    {
+        return $this->doFetch($this->getNamespacedId($id));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function contains($id)
+    {
+        return $this->doContains($this->getNamespacedId($id));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function save($id, $data, $lifeTime = 0)
+    {
+        return $this->doSave($this->getNamespacedId($id), $data, $lifeTime);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function delete($id)
+    {
+        return $this->doDelete($this->getNamespacedId($id));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getStats()
+    {
+        return $this->doGetStats();
+    }
+
+    /**
+     * Deletes all cache entries.
+     *
+     * @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise.
+     */
+    public function flushAll()
+    {
+        return $this->doFlush();
+    }
+
+    /**
+     * Delete all cache entries.
+     *
+     * @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise.
+     */
+    public function deleteAll()
+    {
+        $namespaceCacheKey = $this->getNamespaceCacheKey();
+        $namespaceVersion  = $this->getNamespaceVersion() + 1;
+
+        $this->namespaceVersion = $namespaceVersion;
+
+        return $this->doSave($namespaceCacheKey, $namespaceVersion);
+    }
+
+    /**
+     * Prefix the passed id with the configured namespace value
+     *
+     * @param string $id  The id to namespace
+     * @return string $id The namespaced id
+     */
+    private function getNamespacedId($id)
+    {
+        $namespaceVersion  = $this->getNamespaceVersion();
+
+        return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion);
+    }
+
+    /**
+     * Namespace cache key
+     *
+     * @return string $namespaceCacheKey
+     */
+    private function getNamespaceCacheKey()
+    {
+        return sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace);
+    }
+
+    /**
+     * Namespace version
+     *
+     * @return string $namespaceVersion
+     */
+    private function getNamespaceVersion()
+    {
+        if (null !== $this->namespaceVersion) {
+            return $this->namespaceVersion;
+        }
+
+        $namespaceCacheKey = $this->getNamespaceCacheKey();
+        $namespaceVersion = $this->doFetch($namespaceCacheKey);
+
+        if (false === $namespaceVersion) {
+            $namespaceVersion = 1;
+
+            $this->doSave($namespaceCacheKey, $namespaceVersion);
+        }
+
+        $this->namespaceVersion = $namespaceVersion;
+
+        return $this->namespaceVersion;
+    }
+
+    /**
+     * 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.
+     */
+    abstract protected function doFetch($id);
+
+    /**
+     * Test if an entry exists in the cache.
+     *
+     * @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);
+
+    /**
+     * Puts data into the 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).
+     *
+     * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
+     */
+    abstract protected function doSave($id, $data, $lifeTime = false);
+
+    /**
+     * Deletes a cache entry.
+     *
+     * @param string $id cache id
+     * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
+     */
+    abstract protected function doDelete($id);
+
+    /**
+     * Deletes 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
+     *
+     * @since   2.2
+     * @return  array An associative array with server's statistics if available, NULL otherwise.
+     */
+    abstract protected function doGetStats();
+}

+ 132 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/FileCache.php

@@ -0,0 +1,132 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Base file cache driver.
+ *
+ * @since   2.3
+ * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
+ */
+abstract class FileCache extends CacheProvider
+{
+    /**
+     * @var string Cache directory.
+     */
+    protected $directory;
+
+    /**
+     * @var string Cache file extension.
+     */
+    protected $extension;
+
+    /**
+     * Constructor
+     *
+     * @param string $directory Cache directory.
+     * @param string $directory Cache file extension.
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function __construct($directory, $extension = null)
+    {
+        if ( ! is_dir($directory) && ! @mkdir($directory, 0777, true)) {
+            throw new \InvalidArgumentException(sprintf(
+                'The directory "%s" does not exist and could not be created.',
+                $directory
+            ));
+        }
+
+        if ( ! is_writable($directory)) {
+            throw new \InvalidArgumentException(sprintf(
+                'The directory "%s" is not writable.',
+                $directory
+            ));
+        }
+
+        $this->directory = realpath($directory);
+        $this->extension = $extension ?: $this->extension;
+    }
+
+    /**
+     * Gets the cache directory.
+     * 
+     * @return string
+     */
+    public function getDirectory()
+    {
+        return $this->directory;
+    }
+
+    /**
+     * Gets the cache file extension.
+     * 
+     * @return string
+     */
+    public function getExtension()
+    {
+        return $this->extension;
+    }
+
+    /**
+     * @return string
+     */
+    protected function getFilename($id)
+    {
+        $path = implode(str_split(md5($id), 12), DIRECTORY_SEPARATOR);
+        $path = $this->directory . DIRECTORY_SEPARATOR . $path;
+
+        return $path . DIRECTORY_SEPARATOR . $id . $this->extension;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        return @unlink($this->getFilename($id));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        $pattern  = '/^.+\\' . $this->extension . '$/i';
+        $iterator = new \RecursiveDirectoryIterator($this->directory);
+        $iterator = new \RecursiveIteratorIterator($iterator);
+        $iterator = new \RegexIterator($iterator, $pattern);
+
+        foreach ($iterator as $name => $file) {
+            @unlink($name);
+        }
+
+        return true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        return null;
+    }
+}

+ 114 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/FilesystemCache.php

@@ -0,0 +1,114 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Filesystem cache driver.
+ *
+ * @since   2.3
+ * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
+ */
+class FilesystemCache extends FileCache
+{
+    const EXTENSION = '.doctrinecache.data';
+
+    /**
+     * {@inheritdoc}
+     */
+    protected $extension = self::EXTENSION;
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        $data     = '';
+        $lifetime = -1;
+        $filename = $this->getFilename($id);
+
+        if ( ! is_file($filename)) {
+            return false;
+        }
+
+        $resource = fopen($filename, "r");
+
+        if (false !== ($line = fgets($resource))) {
+            $lifetime = (integer) $line;
+        }
+
+        if ($lifetime !== 0 && $lifetime < time()) {
+            fclose($resource);
+
+            return false;
+        }
+
+        while (false !== ($line = fgets($resource))) {
+            $data .= $line;
+        }
+
+        fclose($resource);
+
+        return unserialize($data);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        $lifetime = -1;
+        $filename = $this->getFilename($id);
+
+        if ( ! is_file($filename)) {
+            return false;
+        }
+
+        $resource = fopen($filename, "r");
+
+        if (false !== ($line = fgets($resource))) {
+            $lifetime = (integer) $line;
+        }
+
+        fclose($resource);
+
+        return $lifetime === 0 || $lifetime > time();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        if ($lifeTime > 0) {
+            $lifeTime = time() + $lifeTime;
+        }
+
+        $data       = serialize($data);
+        $filename   = $this->getFilename($id);
+        $filepath   = pathinfo($filename, PATHINFO_DIRNAME);
+
+        if ( ! is_dir($filepath)) {
+            mkdir($filepath, 0777, true);
+        }
+
+        return file_put_contents($filename, $lifeTime . PHP_EOL . $data);
+    }
+}

+ 121 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php

@@ -0,0 +1,121 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Cache;
+
+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>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  David Abdemoulaie <dave@hobodave.com>
+ */
+class MemcacheCache extends CacheProvider
+{
+    /**
+     * @var Memcache
+     */
+    private $memcache;
+
+    /**
+     * Sets the memcache instance to use.
+     *
+     * @param Memcache $memcache
+     */
+    public function setMemcache(Memcache $memcache)
+    {
+        $this->memcache = $memcache;
+    }
+
+    /**
+     * Gets the memcache instance used by the cache.
+     *
+     * @return Memcache
+     */
+    public function getMemcache()
+    {
+        return $this->memcache;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        return $this->memcache->get($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        return (bool) $this->memcache->get($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        if ($lifeTime > 30 * 24 * 3600) {
+            $lifeTime = time() + $lifeTime;
+        }
+        return $this->memcache->set($id, $data, 0, (int) $lifeTime);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        return $this->memcache->delete($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        return $this->memcache->flush();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        $stats = $this->memcache->getStats();
+        return array(
+            Cache::STATS_HITS   => $stats['get_hits'],
+            Cache::STATS_MISSES => $stats['get_misses'],
+            Cache::STATS_UPTIME => $stats['uptime'],
+            Cache::STATS_MEMORY_USAGE       => $stats['bytes'],
+            Cache::STATS_MEMORY_AVAILIABLE  => $stats['limit_maxbytes'],
+        );
+    }
+}

+ 124 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php

@@ -0,0 +1,124 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Cache;
+
+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>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  David Abdemoulaie <dave@hobodave.com>
+ */
+class MemcachedCache extends CacheProvider
+{
+    /**
+     * @var Memcached
+     */
+    private $memcached;
+
+    /**
+     * Sets the memcache instance to use.
+     *
+     * @param Memcached $memcached
+     */
+    public function setMemcached(Memcached $memcached)
+    {
+        $this->memcached = $memcached;
+    }
+
+    /**
+     * Gets the memcached instance used by the cache.
+     *
+     * @return Memcached
+     */
+    public function getMemcached()
+    {
+        return $this->memcached;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        return $this->memcached->get($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        return (false !== $this->memcached->get($id));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        if ($lifeTime > 30 * 24 * 3600) {
+            $lifeTime = time() + $lifeTime;
+        }
+        return $this->memcached->set($id, $data, (int) $lifeTime);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        return $this->memcached->delete($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        return $this->memcached->flush();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        $stats   = $this->memcached->getStats();
+        $servers = $this->memcached->getServerList();
+        $key     = $servers[0]['host'] . ':' . $servers[0]['port'];
+        $stats   = $stats[$key];
+        return array(
+            Cache::STATS_HITS   => $stats['get_hits'],
+            Cache::STATS_MISSES => $stats['get_misses'],
+            Cache::STATS_UPTIME => $stats['uptime'],
+            Cache::STATS_MEMORY_USAGE       => $stats['bytes'],
+            Cache::STATS_MEMORY_AVAILIABLE  => $stats['limit_maxbytes'],
+        );
+    }
+}

+ 108 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/PhpFileCache.php

@@ -0,0 +1,108 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Cache;
+
+/**
+ * Php file cache driver.
+ *
+ * @since   2.3
+ * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
+ */
+class PhpFileCache extends FileCache
+{
+    const EXTENSION = '.doctrinecache.php';
+
+     /**
+     * {@inheritdoc}
+     */
+    protected $extension = self::EXTENSION;
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        $filename = $this->getFilename($id);
+
+        if ( ! is_file($filename)) {
+            return false;
+        }
+
+        $value = include $filename;
+
+        if ($value['lifetime'] !== 0 && $value['lifetime'] < time()) {
+            return false;
+        }
+
+        return $value['data'];
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        $filename = $this->getFilename($id);
+
+        if ( ! is_file($filename)) {
+            return false;
+        }
+
+        $value = include $filename;
+
+        return $value['lifetime'] === 0 || $value['lifetime'] > time();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        if ($lifeTime > 0) {
+            $lifeTime = time() + $lifeTime;
+        }
+
+        if (is_object($data) && ! method_exists($data, '__set_state')) {
+            throw new \InvalidArgumentException(
+                "Invalid argument given, PhpFileCache only allows objects that implement __set_state() " .
+                "and fully support var_export(). You can use the FilesystemCache to save arbitrary object " .
+                "graphs using serialize()/deserialize()."
+            );
+        }
+
+        $filename   = $this->getFilename($id);
+        $filepath   = pathinfo($filename, PATHINFO_DIRNAME);
+
+        if ( ! is_dir($filepath)) {
+            mkdir($filepath, 0777, true);
+        }
+
+        $value = array(
+            'lifetime'  => $lifeTime,
+            'data'      => $data
+        );
+
+        $value  = var_export($value, true);
+        $code   = sprintf('<?php return %s;', $value);
+
+        return file_put_contents($filename, $code);
+    }
+}

+ 119 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/RedisCache.php

@@ -0,0 +1,119 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Cache;
+
+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>
+ */
+class RedisCache extends CacheProvider
+{
+    /**
+     * @var Redis
+     */
+    private $redis;
+
+    /**
+     * Sets the redis instance to use.
+     *
+     * @param Redis $redis
+     */
+    public function setRedis(Redis $redis)
+    {
+        $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY);
+        $this->redis = $redis;
+    }
+
+    /**
+     * Gets the redis instance used by the cache.
+     *
+     * @return Redis
+     */
+    public function getRedis()
+    {
+        return $this->redis;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        return $this->redis->get($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        return $this->redis->exists($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        $result = $this->redis->set($id, $data);
+        if ($lifeTime > 0) {
+            $this->redis->expire($id, $lifeTime);        
+        }
+        return $result;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        return $this->redis->delete($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        return $this->redis->flushDB();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        $info = $this->redis->info();
+        return array(
+            Cache::STATS_HITS   => false,
+            Cache::STATS_MISSES => false,
+            Cache::STATS_UPTIME => $info['uptime_in_seconds'],
+            Cache::STATS_MEMORY_USAGE       => $info['used_memory'],
+            Cache::STATS_MEMORY_AVAILIABLE  => false
+        );
+    }
+}

+ 93 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php

@@ -0,0 +1,93 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  David Abdemoulaie <dave@hobodave.com>
+ */
+class WinCacheCache extends CacheProvider
+{
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        return wincache_ucache_get($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        return wincache_ucache_exists($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        return (bool) wincache_ucache_set($id, $data, (int) $lifeTime);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        return wincache_ucache_delete($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        return wincache_ucache_clear();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        $info    = wincache_ucache_info();
+        $meminfo = wincache_ucache_meminfo();
+
+        return array(
+            Cache::STATS_HITS              => $info['total_hit_count'],
+            Cache::STATS_MISSES            => $info['total_miss_count'],
+            Cache::STATS_UPTIME            => $info['total_cache_uptime'],
+            Cache::STATS_MEMORY_USAGE      => $meminfo['memory_total'],
+            Cache::STATS_MEMORY_AVAILIABLE => $meminfo['memory_free'],
+        );
+    }
+}

+ 110 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php

@@ -0,0 +1,110 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @author  David Abdemoulaie <dave@hobodave.com>
+ */
+class XcacheCache extends CacheProvider
+{
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        return $this->doContains($id) ? unserialize(xcache_get($id)) : false;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        return xcache_isset($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        return xcache_set($id, serialize($data), (int) $lifeTime);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        return xcache_unset($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        $this->checkAuthorization();
+
+        xcache_clear_cache(XC_TYPE_VAR, 0);
+
+        return true;
+    }
+
+    /**
+     * Checks that xcache.admin.enable_auth is Off
+     *
+     * @throws \BadMethodCallException When xcache.admin.enable_auth is On
+     * @return void
+     */
+    protected function checkAuthorization()
+    {
+        if (ini_get('xcache.admin.enable_auth')) {
+            throw new \BadMethodCallException('To use all features of \Doctrine\Common\Cache\XcacheCache, you must set "xcache.admin.enable_auth" to "Off" in your php.ini.');
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        $this->checkAuthorization();
+
+        $info = xcache_info(XC_TYPE_VAR, 0);
+        return array(
+            Cache::STATS_HITS   => $info['hits'],
+            Cache::STATS_MISSES => $info['misses'],
+            Cache::STATS_UPTIME => null,
+            Cache::STATS_MEMORY_USAGE       => $info['size'],
+            Cache::STATS_MEMORY_AVAILIABLE  => $info['avail'],
+        );
+    }
+}

+ 84 - 0
vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php

@@ -0,0 +1,84 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ */
+class ZendDataCache extends CacheProvider
+{
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFetch($id)
+    {
+        return zend_shm_cache_fetch($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doContains($id)
+    {
+        return (false !== zend_shm_cache_fetch($id));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doSave($id, $data, $lifeTime = 0)
+    {
+        return zend_shm_cache_store($id, $data, $lifeTime);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doDelete($id)
+    {
+        return zend_shm_cache_delete($id);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doFlush()
+    {
+        $namespace = $this->getNamespace();
+        if (empty($namespace)) {
+            return zend_shm_cache_clear();
+        }
+        return zend_shm_cache_clear($namespace);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function doGetStats()
+    {
+        return null;
+    }
+}

+ 262 - 0
vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php

@@ -0,0 +1,262 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * A <tt>ClassLoader</tt> 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 <code>include_path</code>.
+ *
+ * @author Roman Borschel <roman@code-factory.org>
+ * @since 2.0
+ */
+class ClassLoader
+{
+    /**
+     * @var string PHP file extension
+     */
+    protected $fileExtension = '.php';
+
+    /**
+     * @var string Current namespace
+     */
+    protected $namespace;
+
+    /**
+     * @var string Current include path
+     */
+    protected $includePath;
+
+    /**
+     * @var string PHP namespace separator
+     */
+    protected $namespaceSeparator = '\\';
+
+    /**
+     * Creates a new <tt>ClassLoader</tt> 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 $ns The namespace of the classes to load.
+     * @param string $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.
+     */
+    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 $includePath
+     */
+    public function setIncludePath($includePath)
+    {
+        $this->includePath = $includePath;
+    }
+
+    /**
+     * Gets the base include path for all class files in the namespace of this ClassLoader.
+     *
+     * @return string
+     */
+    public function getIncludePath()
+    {
+        return $this->includePath;
+    }
+
+    /**
+     * Sets the file extension of class files in the namespace of this ClassLoader.
+     *
+     * @param string $fileExtension
+     */
+    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.
+     */
+    public function register()
+    {
+        spl_autoload_register(array($this, 'loadClass'));
+    }
+
+    /**
+     * Removes this ClassLoader from the SPL autoload stack.
+     */
+    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 <tt>ClassLoader</tt>, {@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 <tt>ClassLoader</tt>, 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;
+            }
+        }
+
+        return class_exists($className, false) || interface_exists($className, false);
+    }
+
+    /**
+     * Gets the <tt>ClassLoader</tt> 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 <tt>ClassLoader</tt> for the class or NULL if no such <tt>ClassLoader</tt> 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;
+    }
+}

+ 500 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php

@@ -0,0 +1,500 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use Closure, ArrayIterator;
+use Doctrine\Common\Collections\Expr\Expression;
+use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor;
+
+/**
+ * An ArrayCollection is a Collection implementation that wraps a regular PHP array.
+ *
+ * @since   2.0
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+class ArrayCollection implements Collection, Selectable
+{
+    /**
+     * An array containing the entries of this collection.
+     *
+     * @var array
+     */
+    private $_elements;
+
+    /**
+     * Initializes a new ArrayCollection.
+     *
+     * @param array $elements
+     */
+    public function __construct(array $elements = array())
+    {
+        $this->_elements = $elements;
+    }
+
+    /**
+     * Gets the PHP array representation of this collection.
+     *
+     * @return array The PHP array representation of this collection.
+     */
+    public function toArray()
+    {
+        return $this->_elements;
+    }
+
+    /**
+     * Sets the internal iterator to the first element in the collection and
+     * returns this element.
+     *
+     * @return mixed
+     */
+    public function first()
+    {
+        return reset($this->_elements);
+    }
+
+    /**
+     * Sets the internal iterator to the last element in the collection and
+     * returns this element.
+     *
+     * @return mixed
+     */
+    public function last()
+    {
+        return end($this->_elements);
+    }
+
+    /**
+     * Gets the current key/index at the current internal iterator position.
+     *
+     * @return mixed
+     */
+    public function key()
+    {
+        return key($this->_elements);
+    }
+
+    /**
+     * Moves the internal iterator position to the next element.
+     *
+     * @return mixed
+     */
+    public function next()
+    {
+        return next($this->_elements);
+    }
+
+    /**
+     * Gets the element of the collection at the current internal iterator position.
+     *
+     * @return mixed
+     */
+    public function current()
+    {
+        return current($this->_elements);
+    }
+
+    /**
+     * 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.
+     */
+    public function remove($key)
+    {
+        if (array_key_exists($key, $this->_elements)) {
+            $removed = $this->_elements[$key];
+            unset($this->_elements[$key]);
+
+            return $removed;
+        }
+
+        return null;
+    }
+
+    /**
+     * Removes the specified element from the collection, if it is found.
+     *
+     * @param mixed $element The element to remove.
+     * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
+     */
+    public function removeElement($element)
+    {
+        $key = array_search($element, $this->_elements, true);
+
+        if ($key !== false) {
+            unset($this->_elements[$key]);
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * ArrayAccess implementation of offsetExists()
+     *
+     * @see containsKey()
+     *
+     * @param mixed $offset
+     * @return bool
+     */
+    public function offsetExists($offset)
+    {
+        return $this->containsKey($offset);
+    }
+
+    /**
+     * ArrayAccess implementation of offsetGet()
+     *
+     * @see get()
+     *
+     * @param mixed $offset
+     * @return mixed
+     */
+    public function offsetGet($offset)
+    {
+        return $this->get($offset);
+    }
+
+    /**
+     * ArrayAccess implementation of offsetSet()
+     *
+     * @see add()
+     * @see set()
+     *
+     * @param mixed $offset
+     * @param mixed $value
+     * @return bool
+     */
+    public function offsetSet($offset, $value)
+    {
+        if ( ! isset($offset)) {
+            return $this->add($value);
+        }
+        return $this->set($offset, $value);
+    }
+
+    /**
+     * ArrayAccess implementation of offsetUnset()
+     *
+     * @see remove()
+     *
+     * @param mixed $offset
+     * @return mixed
+     */
+    public function offsetUnset($offset)
+    {
+        return $this->remove($offset);
+    }
+
+    /**
+     * 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.
+     */
+    public function containsKey($key)
+    {
+        return array_key_exists($key, $this->_elements);
+    }
+
+    /**
+     * 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.
+     */
+    public function contains($element)
+    {
+        foreach ($this->_elements as $collectionElement) {
+            if ($element === $collectionElement) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Tests for the existence of an element that satisfies the given predicate.
+     *
+     * @param Closure $p The predicate.
+     * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
+     */
+    public function exists(Closure $p)
+    {
+        foreach ($this->_elements as $key => $element) {
+            if ($p($key, $element)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 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.
+     */
+    public function indexOf($element)
+    {
+        return array_search($element, $this->_elements, true);
+    }
+
+    /**
+     * 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.
+     */
+    public function get($key)
+    {
+        if (isset($this->_elements[$key])) {
+            return $this->_elements[$key];
+        }
+        return null;
+    }
+
+    /**
+     * Gets all keys/indexes of the collection elements.
+     *
+     * @return array
+     */
+    public function getKeys()
+    {
+        return array_keys($this->_elements);
+    }
+
+    /**
+     * Gets all elements.
+     *
+     * @return array
+     */
+    public function getValues()
+    {
+        return array_values($this->_elements);
+    }
+
+    /**
+     * Returns the number of elements in the collection.
+     *
+     * Implementation of the Countable interface.
+     *
+     * @return integer The number of elements in the collection.
+     */
+    public function count()
+    {
+        return count($this->_elements);
+    }
+
+    /**
+     * 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
+     */
+    public function set($key, $value)
+    {
+        $this->_elements[$key] = $value;
+    }
+
+    /**
+     * Adds an element to the collection.
+     *
+     * @param mixed $value
+     * @return boolean Always TRUE.
+     */
+    public function add($value)
+    {
+        $this->_elements[] = $value;
+        return true;
+    }
+
+    /**
+     * Checks whether the collection is empty.
+     *
+     * Note: This is preferable over count() == 0.
+     *
+     * @return boolean TRUE if the collection is empty, FALSE otherwise.
+     */
+    public function isEmpty()
+    {
+        return ! $this->_elements;
+    }
+
+    /**
+     * Gets an iterator for iterating over the elements in the collection.
+     *
+     * @return ArrayIterator
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->_elements);
+    }
+
+    /**
+     * Applies the given function to each element in the collection and returns
+     * a new collection with the elements returned by the function.
+     *
+     * @param Closure $func
+     * @return Collection
+     */
+    public function map(Closure $func)
+    {
+        return new static(array_map($func, $this->_elements));
+    }
+
+    /**
+     * Returns all the elements of this collection that satisfy the predicate p.
+     * The order of the elements is preserved.
+     *
+     * @param Closure $p The predicate used for filtering.
+     * @return Collection A collection with the results of the filter operation.
+     */
+    public function filter(Closure $p)
+    {
+        return new static(array_filter($this->_elements, $p));
+    }
+
+    /**
+     * 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.
+     */
+    public function forAll(Closure $p)
+    {
+        foreach ($this->_elements as $key => $element) {
+            if ( ! $p($key, $element)) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Partitions this collection in two collections according to a predicate.
+     * Keys are preserved in the resulting collections.
+     *
+     * @param Closure $p The predicate on which to partition.
+     * @return array An array with two elements. The first element contains the collection
+     *               of elements where the predicate returned TRUE, the second element
+     *               contains the collection of elements where the predicate returned FALSE.
+     */
+    public function partition(Closure $p)
+    {
+        $coll1 = $coll2 = array();
+        foreach ($this->_elements as $key => $element) {
+            if ($p($key, $element)) {
+                $coll1[$key] = $element;
+            } else {
+                $coll2[$key] = $element;
+            }
+        }
+        return array(new static($coll1), new static($coll2));
+    }
+
+    /**
+     * Returns a string representation of this object.
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return __CLASS__ . '@' . spl_object_hash($this);
+    }
+
+    /**
+     * Clears the collection.
+     */
+    public function clear()
+    {
+        $this->_elements = array();
+    }
+
+    /**
+     * 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
+     */
+    public function slice($offset, $length = null)
+    {
+        return array_slice($this->_elements, $offset, $length, true);
+    }
+
+    /**
+     * Select all elements from a selectable that match the criteria and
+     * return a new collection containing these elements.
+     *
+     * @param  Criteria $criteria
+     * @return Collection
+     */
+    public function matching(Criteria $criteria)
+    {
+        $expr     = $criteria->getWhereExpression();
+        $filtered = $this->_elements;
+
+        if ($expr) {
+            $visitor  = new ClosureExpressionVisitor();
+            $filter   = $visitor->dispatch($expr);
+            $filtered = array_filter($filtered, $filter);
+        }
+
+        if ($orderings = $criteria->getOrderings()) {
+            $next = null;
+            foreach (array_reverse($orderings) as $field => $ordering) {
+                $next = ClosureExpressionVisitor::sortByField($field, $ordering == 'DESC' ? -1 : 1, $next);
+            }
+
+            usort($filtered, $next);
+        }
+
+        $offset = $criteria->getFirstResult();
+        $length = $criteria->getMaxResults();
+
+        if ($offset || $length) {
+            $filtered = array_slice($filtered, (int)$offset, $length);
+        }
+
+        return new static($filtered);
+    }
+}
+

+ 243 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php

@@ -0,0 +1,243 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use Closure, Countable, IteratorAggregate, ArrayAccess;
+
+/**
+ * The missing (SPL) Collection/Array/OrderedMap interface.
+ *
+ * A Collection resembles the nature of a regular PHP array. That is,
+ * it is essentially an <b>ordered map</b> that can also be used
+ * like a list.
+ *
+ * A Collection has an internal iterator just like a PHP array. In addition,
+ * a Collection can be iterated with external iterators, which is preferrable.
+ * To use an external iterator simply use the foreach language construct to
+ * iterate over the collection (which calls {@link getIterator()} internally) or
+ * explicitly retrieve an iterator though {@link getIterator()} which can then be
+ * used to iterate over the collection.
+ * You can not rely on the internal iterator of the collection being at a certain
+ * position unless you explicitly positioned it before. Prefer iteration with
+ * external iterators.
+ *
+ * @since   2.0
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+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.
+     */
+    function clear();
+
+    /**
+     * Checks whether an element is contained in the collection.
+     * This is an O(n) operation, where n is the size of the collection.
+     *
+     * @param mixed $element The element to search for.
+     * @return boolean TRUE if the collection contains the element, FALSE otherwise.
+     */
+    function contains($element);
+
+    /**
+     * Checks whether the collection is empty (contains no elements).
+     *
+     * @return boolean TRUE if the collection is empty, FALSE otherwise.
+     */
+    function isEmpty();
+
+    /**
+     * Removes the element at the specified index from the collection.
+     *
+     * @param string|integer $key The kex/index of the element to remove.
+     * @return mixed The removed element or NULL, if the collection did not contain the element.
+     */
+    function remove($key);
+
+    /**
+     * Removes the specified element from the collection, if it is found.
+     *
+     * @param mixed $element The element to remove.
+     * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
+     */
+    function removeElement($element);
+
+    /**
+     * Checks whether the collection contains an element with the specified key/index.
+     *
+     * @param string|integer $key The key/index to check for.
+     * @return boolean TRUE if the collection contains an element with the specified key/index,
+     *          FALSE otherwise.
+     */
+    function containsKey($key);
+
+    /**
+     * Gets the element at the specified key/index.
+     *
+     * @param string|integer $key The key/index of the element to retrieve.
+     * @return mixed
+     */
+    function get($key);
+
+    /**
+     * Gets all keys/indices of the collection.
+     *
+     * @return array The keys/indices of the collection, in the order of the corresponding
+     *          elements in the collection.
+     */
+    function getKeys();
+
+    /**
+     * Gets all values of the collection.
+     *
+     * @return array The values of all elements in the collection, in the order they
+     *          appear in the collection.
+     */
+    function getValues();
+
+    /**
+     * Sets an element in the collection at the specified key/index.
+     *
+     * @param string|integer $key The key/index of the element to set.
+     * @param mixed $value The element to set.
+     */
+    function set($key, $value);
+
+    /**
+     * Gets a native PHP array representation of the collection.
+     *
+     * @return array
+     */
+    function toArray();
+
+    /**
+     * 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.
+     *
+     * @return mixed
+     */
+    function last();
+
+    /**
+     * Gets the key/index of the element at the current iterator position.
+     *
+     */
+    function key();
+
+    /**
+     * Gets the element of the collection at the current iterator position.
+     *
+     */
+    function current();
+
+    /**
+     * Moves the internal iterator position to the next element.
+     *
+     */
+    function next();
+
+    /**
+     * Tests for the existence of an element that satisfies the given predicate.
+     *
+     * @param Closure $p The predicate.
+     * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
+     */
+    function exists(Closure $p);
+
+    /**
+     * Returns all the elements of this collection that satisfy the predicate p.
+     * The order of the elements is preserved.
+     *
+     * @param Closure $p The predicate used for filtering.
+     * @return Collection A collection with the results of the filter operation.
+     */
+    function filter(Closure $p);
+
+    /**
+     * 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.
+     */
+    function forAll(Closure $p);
+
+    /**
+     * Applies the given function to each element in the collection and returns
+     * a new collection with the elements returned by the function.
+     *
+     * @param Closure $func
+     * @return Collection
+     */
+    function map(Closure $func);
+
+    /**
+     * Partitions this collection in two collections according to a predicate.
+     * Keys are preserved in the resulting collections.
+     *
+     * @param Closure $p The predicate on which to partition.
+     * @return array An array with two elements. The first element contains the collection
+     *               of elements where the predicate returned TRUE, the second element
+     *               contains the collection of elements where the predicate returned FALSE.
+     */
+    function partition(Closure $p);
+
+    /**
+     * Gets the index/key of a given element. The comparison of two elements is strict,
+     * that means not only the value but also the type must match.
+     * For objects this means reference equality.
+     *
+     * @param mixed $element The element to search for.
+     * @return mixed 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.
+     *
+     * 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
+     */
+    function slice($offset, $length = null);
+}

+ 240 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Criteria.php

@@ -0,0 +1,240 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use Doctrine\Common\Collections\Expr\Expression;
+use Doctrine\Common\Collections\Expr\CompositeExpression;
+
+/**
+ * Criteria for filtering Selectable collections.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @since 2.3
+ */
+class Criteria
+{
+    /**
+     * @var string
+     */
+    const ASC  = 'ASC';
+
+    /**
+     * @var string
+     */
+    const DESC = 'DESC';
+
+    /**
+     * @var \Doctrine\Common\Collections\ExpressionBuilder
+     */
+    private static $expressionBuilder;
+
+    /**
+     * @var \Doctrine\Common\Collections\Expr\Expression
+     */
+    private $expression;
+
+    /**
+     * @var array|null
+     */
+    private $orderings;
+
+    /**
+     * @var int
+     */
+    private $firstResult;
+
+    /**
+     * @var int
+     */
+    private $maxResults;
+
+    /**
+     * Creates an instance of the class.
+     *
+     * @return Criteria
+     */
+    public static function create()
+    {
+        return new static();
+    }
+
+    /**
+     * Return the expression builder.
+     *
+     * @return \Doctrine\Common\Collections\ExpressionBuilder
+     */
+    public static function expr()
+    {
+        if (self::$expressionBuilder === null) {
+            self::$expressionBuilder = new ExpressionBuilder();
+        }
+        return self::$expressionBuilder;
+    }
+
+    /**
+     * Construct new criteria
+     *
+     * @param Expression $expression
+     * @param array $orderings
+     * @param int $firstResult
+     * @param int $maxResults
+     */
+    public function __construct(Expression $expression = null, array $orderings = null, $firstResult = null, $maxResults = null)
+    {
+        $this->expression  = $expression;
+        $this->orderings   = $orderings;
+        $this->firstResult = $firstResult;
+        $this->maxResults  = $maxResults;
+    }
+
+    /**
+     * Set the where expression to evaluate when this criteria is searched for.
+     *
+     * @param Expression
+     * @return Criteria
+     */
+    public function where(Expression $expression)
+    {
+        $this->expression = $expression;
+        return $this;
+    }
+
+    /**
+     * Append the where expression to evaluate when this criteria is searched for
+     * using an AND with previous expression.
+     *
+     * @param Expression
+     * @return Criteria
+     */
+    public function andWhere(Expression $expression)
+    {
+        if ($this->expression === null) {
+            return $this->where($expression);
+        }
+
+        $this->expression = new CompositeExpression(CompositeExpression::TYPE_AND, array(
+            $this->expression, $expression
+        ));
+
+        return $this;
+    }
+
+    /**
+     * Append the where expression to evaluate when this criteria is searched for
+     * using an OR with previous expression.
+     *
+     * @param Expression
+     * @return Criteria
+     */
+    public function orWhere(Expression $expression)
+    {
+        if ($this->expression === null) {
+            return $this->where($expression);
+        }
+
+        $this->expression = new CompositeExpression(CompositeExpression::TYPE_OR, array(
+            $this->expression, $expression
+        ));
+
+        return $this;
+    }
+
+    /**
+     * Get the expression attached to this criteria.
+     *
+     * @return Expression|null
+     */
+    public function getWhereExpression()
+    {
+        return $this->expression;
+    }
+
+    /**
+     * Get current orderings of this Criteria
+     *
+     * @return array
+     */
+    public function getOrderings()
+    {
+        return $this->orderings;
+    }
+
+    /**
+     * Set 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
+     * @return Criteria
+     */
+    public function orderBy(array $orderings)
+    {
+        $this->orderings = $orderings;
+        return $this;
+    }
+
+    /**
+     * Get current first result option of the critera.
+     *
+     * @return firstResult.
+     */
+    public function getFirstResult()
+    {
+        return $this->firstResult;
+    }
+
+    /**
+     * Set number of first result that this criteria should return.
+     *
+     * @param firstResult the value to set.
+     * @return Criteria
+     */
+    public function setFirstResult($firstResult)
+    {
+        $this->firstResult = $firstResult;
+        return $this;
+    }
+
+    /**
+     * Get maxResults.
+     *
+     * @return maxResults.
+     */
+    public function getMaxResults()
+    {
+        return $this->maxResults;
+    }
+
+    /**
+     * Set maxResults.
+     *
+     * @param maxResults the value to set.
+     * @return Criteria
+     */
+    public function setMaxResults($maxResults)
+    {
+        $this->maxResults = $maxResults;
+        return $this;
+    }
+}
+

+ 195 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php

@@ -0,0 +1,195 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * Walks an expression graph and turns it into a PHP closure.
+ *
+ * This closure can be used with {@Collection#filter()} and is used internally
+ * by {@ArrayCollection#select()}.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @since 2.3
+ */
+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).
+     *
+     * is*() is not supported.
+     *
+     * @return mixed
+     */
+    static public function getObjectFieldValue($object, $field)
+    {
+        $accessor = "get" . $field;
+
+        if (method_exists($object, $accessor) || method_exists($object, '__call')) {
+            return $object->$accessor();
+        }
+
+        if ($object instanceof \ArrayAccess) {
+            return $object[$field];
+        }
+
+        return $object->$field;
+    }
+
+    /**
+     * Helper for sorting arrays of objects based on multiple fields +
+     * orientations.
+     *
+     * @param string $name
+     * @param int $orientation
+     * @param Closure $next
+     * @return Closure
+     */
+    static public function sortByField($name, $orientation = 1, \Closure $next = null)
+    {
+        if (!$next) {
+            $next = function() {
+                return 0;
+            };
+        }
+
+        return function ($a, $b) use ($name, $next, $orientation) {
+            $aValue = ClosureExpressionVisitor::getObjectFieldValue($a, $name);
+            $bValue = ClosureExpressionVisitor::getObjectFieldValue($b, $name);
+
+            if ($aValue === $bValue) {
+                return $next($a, $b);
+            }
+
+            return (($aValue > $bValue) ? 1 : -1) * $orientation;
+        };
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function walkComparison(Comparison $comparison)
+    {
+        $field = $comparison->getField();
+        $value = $comparison->getValue()->getValue(); // shortcut for walkValue()
+
+        switch ($comparison->getOperator()) {
+            case Comparison::EQ:
+            case Comparison::IS:
+                return function ($object) use ($field, $value) {
+                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) === $value;
+                };
+
+            case Comparison::NEQ:
+                return function ($object) use ($field, $value) {
+                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) !== $value;
+                };
+
+            case Comparison::LT:
+                return function ($object) use ($field, $value) {
+                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) < $value;
+                };
+
+            case Comparison::LTE:
+                return function ($object) use ($field, $value) {
+                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) <= $value;
+                };
+
+            case Comparison::GT:
+                return function ($object) use ($field, $value) {
+                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) > $value;
+                };
+
+            case Comparison::GTE:
+                return function ($object) use ($field, $value) {
+                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) >= $value;
+                };
+
+            case Comparison::IN:
+                return function ($object) use ($field, $value) {
+                    return in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
+                };
+
+            case Comparison::NIN:
+                return function ($object) use ($field, $value) {
+                    return ! in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
+                };
+
+            default:
+                throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator());
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function walkValue(Value $value)
+    {
+        return $value->getValue();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function walkCompositeExpression(CompositeExpression $expr)
+    {
+        $expressionList = array();
+
+        foreach ($expr->getExpressionList() as $child) {
+            $expressionList[] = $this->dispatch($child);
+        }
+
+        switch($expr->getType()) {
+            case CompositeExpression::TYPE_AND:
+                return $this->andExpressions($expressionList);
+
+            case CompositeExpression::TYPE_OR:
+                return $this->orExpressions($expressionList);
+
+            default:
+                throw new \RuntimeException("Unknown composite " . $expr->getType());
+        }
+    }
+
+    private function andExpressions($expressions)
+    {
+        return function ($object) use ($expressions) {
+            foreach ($expressions as $expression) {
+                if ( ! $expression($object)) {
+                    return false;
+                }
+            }
+            return true;
+        };
+    }
+
+    private function orExpressions($expressions)
+    {
+        return function ($object) use ($expressions) {
+            foreach ($expressions as $expression) {
+                if ($expression($object)) {
+                    return true;
+                }
+            }
+            return false;
+        };
+    }
+}
+

+ 75 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php

@@ -0,0 +1,75 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * Comparison of a field with a value by the given operator.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @since 2.3
+ */
+class Comparison implements Expression
+{
+    const EQ   = '=';
+    const NEQ  = '<>';
+    const LT   = '<';
+    const LTE  = '<=';
+    const GT   = '>';
+    const GTE  = '>=';
+    const IS   = 'IS';
+    const IN   = 'IN';
+    const NIN  = 'NIN';
+
+    private $field;
+    private $op;
+    private $value;
+
+    public function __construct($field, $operator, $value)
+    {
+        if ( ! ($value instanceof Value)) {
+            $value = new Value($value);
+        }
+
+        $this->field = $field;
+        $this->op = $operator;
+        $this->value = $value;
+    }
+
+    public function getField()
+    {
+        return $this->field;
+    }
+
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    public function getOperator()
+    {
+        return $this->op;
+    }
+
+    public function visit(ExpressionVisitor $visitor)
+    {
+        return $visitor->walkComparison($this);
+    }
+}
+

+ 72 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php

@@ -0,0 +1,72 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * Expression of Expressions combined by AND or OR operation.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @since 2.3
+ */
+class CompositeExpression implements Expression
+{
+    const TYPE_AND = 'AND';
+    const TYPE_OR = 'OR';
+
+    private $type;
+    private $expressions = array();
+
+    public function __construct($type, array $expressions)
+    {
+        $this->type = $type;
+
+        foreach ($expressions as $expr) {
+            if ($expr instanceof Value) {
+                throw new \RuntimeException("Values are not supported expressions as children of and/or expressions.");
+            }
+            if ( ! ($expr instanceof Expression)) {
+                throw new \RuntimeException("No expression given to CompositeExpression.");
+            }
+
+            $this->expressions[] = $expr;
+        }
+    }
+
+    /**
+     * Return the list of expressions nested in this composite.
+     *
+     * @return Expression[]
+     */
+    public function getExpressionList()
+    {
+        return $this->expressions;
+    }
+
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    public function visit(ExpressionVisitor $visitor)
+    {
+        return $visitor->walkCompositeExpression($this);
+    }
+}
+

+ 31 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Expression.php

@@ -0,0 +1,31 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * Expression for the {@link Selectable} interface.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ */
+interface Expression
+{
+    public function visit(ExpressionVisitor $visitor);
+}
+

+ 81 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php

@@ -0,0 +1,81 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+/**
+ * An Expression visitor walks a graph of expressions and turns them into a
+ * query for the underlying implementation.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ */
+abstract class ExpressionVisitor
+{
+    /**
+     * Convert a comparison expression into the target query language output
+     *
+     * @param Comparison $comparison
+     *
+     * @return mixed
+     */
+    abstract public function walkComparison(Comparison $comparison);
+
+    /**
+     * Convert a value expression into the target query language part.
+     *
+     * @param Value $value
+     *
+     * @return mixed
+     */
+    abstract public function walkValue(Value $value);
+
+    /**
+     * Convert a composite expression into the target query language output
+     *
+     * @param CompositeExpression $expr
+     *
+     * @return mixed
+     */
+    abstract public function walkCompositeExpression(CompositeExpression $expr);
+
+    /**
+     * Dispatch walking an expression to the appropriate handler.
+     *
+     * @param Expression
+     *
+     * @return mixed
+     */
+    public function dispatch(Expression $expr)
+    {
+        switch (true) {
+            case ($expr instanceof Comparison):
+                return $this->walkComparison($expr);
+
+            case ($expr instanceof Value):
+                return $this->walkValue($expr);
+
+            case ($expr instanceof CompositeExpression):
+                return $this->walkCompositeExpression($expr);
+
+            default:
+                throw new \RuntimeException("Unknown Expression " . get_class($expr));
+        }
+    }
+}
+

+ 41 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Value.php

@@ -0,0 +1,41 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections\Expr;
+
+class Value implements Expression
+{
+    private $value;
+
+    public function __construct($value)
+    {
+        $this->value = $value;
+    }
+
+    public function getValue()
+    {
+        return $this->value;
+    }
+
+    public function visit(ExpressionVisitor $visitor)
+    {
+        return $visitor->walkValue($this);
+    }
+}
+

+ 149 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/ExpressionBuilder.php

@@ -0,0 +1,149 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYvalue 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
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections;
+
+use Doctrine\Common\Collections\Expr\Comparison;
+use Doctrine\Common\Collections\Expr\CompositeExpression;
+use Doctrine\Common\Collections\Expr\Value;
+
+/**
+ * Builder for Expressions in the {@link Selectable} interface.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @since 2.3
+ */
+class ExpressionBuilder
+{
+    /**
+     * @return CompositeExpression
+     */
+    public function andX($x = null)
+    {
+        return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args());
+    }
+
+    /**
+     * @return CompositeExpression
+     */
+    public function orX($x = null)
+    {
+        return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args());
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function eq($field, $value)
+    {
+        return new Comparison($field, Comparison::EQ, new Value($value));
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function gt($field, $value)
+    {
+        return new Comparison($field, Comparison::GT, new Value($value));
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function lt($field, $value)
+    {
+        return new Comparison($field, Comparison::LT, new Value($value));
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function gte($field, $value)
+    {
+        return new Comparison($field, Comparison::GTE, new Value($value));
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function lte($field, $value)
+    {
+        return new Comparison($field, Comparison::LTE, new Value($value));
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function neq($field, $value)
+    {
+        return new Comparison($field, Comparison::NEQ, new Value($value));
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function isNull($field)
+    {
+        return new Comparison($field, Comparison::IS, new Value(null));
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function in($field, array $values)
+    {
+        return new Comparison($field, Comparison::IN, new Value($values));
+    }
+
+    /**
+     * @param string $field
+     * @param mixed $value
+     *
+     * @return Comparison
+     */
+    public function notIn($field, array $values)
+    {
+        return new Comparison($field, Comparison::NIN, new Value($values));
+    }
+}
+

+ 48 - 0
vendor/doctrine/common/lib/Doctrine/Common/Collections/Selectable.php

@@ -0,0 +1,48 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Collections;
+
+/**
+ * Interface for collections that allow efficient filtering with an expression API.
+ *
+ * Goal of this interface is a backend independent method to fetch elements
+ * from a collections. {@link Expression} is crafted in a way that you can
+ * implement queries from both in-memory and database-backed collections.
+ *
+ * For database backed collections this allows very efficient access by
+ * utilizing the query APIs, for example SQL in the ORM. Applications using
+ * this API can implement efficient database access without having to ask the
+ * EntityManager or Repositories.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @since 2.3
+ */
+interface Selectable
+{
+    /**
+     * Select all elements from a selectable that match the expression and
+     * return a new collection containing these elements.
+     *
+     * @param Criteria $criteria
+     * @return Collection
+     */
+    function matching(Criteria $criteria);
+}
+

+ 28 - 0
vendor/doctrine/common/lib/Doctrine/Common/CommonException.php

@@ -0,0 +1,28 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * Base exception class for package Doctrine\Common
+ * @author heinrich
+ *
+ */
+class CommonException extends \Exception {
+}

+ 49 - 0
vendor/doctrine/common/lib/Doctrine/Common/Comparable.php

@@ -0,0 +1,49 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+
+namespace Doctrine\Common;
+
+/**
+ * Comparable interface that allows to compare two value objects to each other for similarity.
+ *
+ * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link        www.doctrine-project.com
+ * @since       2.2
+ * @author      Benjamin Eberlei <kontakt@beberlei.de>
+ * @author      Guilherme Blanco <guilhermeblanco@hotmail.com>
+ */
+interface Comparable
+{
+    /**
+     * Compare 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);
+}
+

+ 67 - 0
vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php

@@ -0,0 +1,67 @@
+<?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
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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}.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.0
+ * @version $Revision: 3938 $
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+class EventArgs
+{
+    /**
+     * @var EventArgs Single instance of 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;
+    }
+}

+ 147 - 0
vendor/doctrine/common/lib/Doctrine/Common/EventManager.php

@@ -0,0 +1,147 @@
+<?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
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.0
+ * @version $Revision: 3938 $
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+class EventManager
+{
+    /**
+     * Map of registered listeners.
+     * <event> => <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 $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 $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.
+     */
+    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
+     */
+    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 he is
+     * interested in and added as a listener for these events.
+     *
+     * @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
+     */
+    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.
+     */
+    public function removeEventSubscriber(EventSubscriber $subscriber)
+    {
+        $this->removeEventListener($subscriber->getSubscribedEvents(), $subscriber);
+    }
+}

+ 45 - 0
vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php

@@ -0,0 +1,45 @@
+<?php
+/*
+ *  $Id: EventListener.php 4653 2008-07-10 17:17:58Z romanb $
+ *
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.0
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+interface EventSubscriber
+{
+    /**
+     * Returns an array of events this subscriber wants to listen to.
+     *
+     * @return array
+     */
+    function getSubscribedEvents();
+}

+ 266 - 0
vendor/doctrine/common/lib/Doctrine/Common/Lexer.php

@@ -0,0 +1,266 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * Base class for writing simple lexers, i.e. for creating small DSLs.
+ *
+ * @since   2.0
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ * @todo Rename: AbstractLexer
+ */
+abstract class Lexer
+{
+    /**
+     * @var array Array of scanned tokens
+     */
+    private $tokens = array();
+
+    /**
+     * @var integer Current lexer position in input string
+     */
+    private $position = 0;
+
+    /**
+     * @var integer Current peek of current lexer position
+     */
+    private $peek = 0;
+
+    /**
+     * @var array The next token in the input.
+     */
+    public $lookahead;
+
+    /**
+     * @var array The last matched/seen token.
+     */
+    public $token;
+
+    /**
+     * Sets the input data to be tokenized.
+     *
+     * The Lexer is immediately reset and the new input tokenized.
+     * Any unprocessed tokens from any previous input are lost.
+     *
+     * @param string $input The input to be tokenized.
+     */
+    public function setInput($input)
+    {
+        $this->tokens = array();
+        $this->reset();
+        $this->scan($input);
+    }
+
+    /**
+     * Resets the lexer.
+     */
+    public function reset()
+    {
+        $this->lookahead = null;
+        $this->token = null;
+        $this->peek = 0;
+        $this->position = 0;
+    }
+
+    /**
+     * Resets the peek pointer to 0.
+     */
+    public function resetPeek()
+    {
+        $this->peek = 0;
+    }
+
+    /**
+     * Resets the lexer position on the input to the given position.
+     *
+     * @param integer $position Position to place the lexical scanner
+     */
+    public function resetPosition($position = 0)
+    {
+        $this->position = $position;
+    }
+
+    /**
+     * Checks whether a given token matches the current lookahead.
+     *
+     * @param integer|string $token
+     * @return boolean
+     */
+    public function isNextToken($token)
+    {
+        return null !== $this->lookahead && $this->lookahead['type'] === $token;
+    }
+
+    /**
+     * Checks whether any of the given tokens matches the current lookahead
+     *
+     * @param array $tokens
+     * @return boolean
+     */
+    public function isNextTokenAny(array $tokens)
+    {
+        return null !== $this->lookahead && in_array($this->lookahead['type'], $tokens, true);
+    }
+
+    /**
+     * Moves to the next token in the input string.
+     *
+     * A token is an associative array containing three items:
+     *  - 'value'    : the string value of the token in the input string
+     *  - 'type'     : the type of the token (identifier, numeric, string, input
+     *                 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
+     */
+    public function moveNext()
+    {
+        $this->peek = 0;
+        $this->token = $this->lookahead;
+        $this->lookahead = (isset($this->tokens[$this->position]))
+            ? $this->tokens[$this->position++] : null;
+
+        return $this->lookahead !== null;
+    }
+
+    /**
+     * 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.
+     */
+    public function skipUntil($type)
+    {
+        while ($this->lookahead !== null && $this->lookahead['type'] !== $type) {
+            $this->moveNext();
+        }
+    }
+
+    /**
+     * Checks if given value is identical to the given token
+     *
+     * @param mixed $value
+     * @param integer $token
+     * @return boolean
+     */
+    public function isA($value, $token)
+    {
+        return $this->getType($value) === $token;
+    }
+
+    /**
+     * Moves the lookahead token forward.
+     *
+     * @return array | null The next token or NULL if there are no more tokens ahead.
+     */
+    public function peek()
+    {
+        if (isset($this->tokens[$this->position + $this->peek])) {
+            return $this->tokens[$this->position + $this->peek++];
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Peeks at the next token, returns it and immediately resets the peek.
+     *
+     * @return array|null The next token or NULL if there are no more tokens ahead.
+     */
+    public function glimpse()
+    {
+        $peek = $this->peek();
+        $this->peek = 0;
+        return $peek;
+    }
+
+    /**
+     * Scans the input string for tokens.
+     *
+     * @param string $input a query string
+     */
+    protected function scan($input)
+    {
+        static $regex;
+
+        if ( ! isset($regex)) {
+            $regex = '/(' . implode(')|(', $this->getCatchablePatterns()) . ')|'
+                   . implode('|', $this->getNonCatchablePatterns()) . '/i';
+        }
+
+        $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE;
+        $matches = preg_split($regex, $input, -1, $flags);
+
+        foreach ($matches as $match) {
+            // Must remain before 'value' assignment since it can change content
+            $type = $this->getType($match[0]);
+
+            $this->tokens[] = array(
+                'value' => $match[0],
+                'type'  => $type,
+                'position' => $match[1],
+            );
+        }
+    }
+
+    /**
+     * Gets the literal for a given token.
+     *
+     * @param integer $token
+     * @return string
+     */
+    public function getLiteral($token)
+    {
+        $className = get_class($this);
+        $reflClass = new \ReflectionClass($className);
+        $constants = $reflClass->getConstants();
+
+        foreach ($constants as $name => $value) {
+            if ($value === $token) {
+                return $className . '::' . $name;
+            }
+        }
+
+        return $token;
+    }
+
+    /**
+     * Lexical catchable patterns.
+     *
+     * @return array
+     */
+    abstract protected function getCatchablePatterns();
+
+    /**
+     * Lexical non-catchable patterns.
+     *
+     * @return array
+     */
+    abstract protected function getNonCatchablePatterns();
+
+    /**
+     * Retrieve token type. Also processes the token value if necessary.
+     *
+     * @param string $value
+     * @return integer
+     */
+    abstract protected function getType(&$value);
+}

+ 45 - 0
vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php

@@ -0,0 +1,45 @@
+<?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
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common;
+
+/**
+ * Contract for classes that provide the service of notifying listeners of
+ * changes to their properties.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.0
+ * @version $Revision: 3938 $
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+interface NotifyPropertyChanged
+{
+    /**
+     * Adds a listener that wants to be notified about property changes.
+     *
+     * @param PropertyChangedListener $listener
+     */
+    function addPropertyChangedListener(PropertyChangedListener $listener);
+}
+

+ 259 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php

@@ -0,0 +1,259 @@
+<?php
+
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+use Doctrine\Common\Persistence\ManagerRegistry;
+
+/**
+ * Abstract implementation of the ManagerRegistry contract.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.2
+ * @author  Fabien Potencier <fabien@symfony.com>
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Lukas Kahwe Smith <smith@pooteeweet.org>
+ */
+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 name of the service
+     * @return object 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 name of the service
+     * @return void
+     */
+    abstract protected function resetService($name);
+
+    /**
+     * Get 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]);
+    }
+}

+ 63 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php

@@ -0,0 +1,63 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Contract covering connection for a Doctrine persistence layer ManagerRegistry class to implement.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.2
+ * @author  Fabien Potencier <fabien@symfony.com>
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Lukas Kahwe Smith <smith@pooteeweet.org>
+ */
+interface ConnectionRegistry
+{
+    /**
+     * Gets the default connection name.
+     *
+     * @return string The default connection name
+     */
+    function getDefaultConnectionName();
+
+    /**
+     * Gets the named connection.
+     *
+     * @param string $name The connection name (null for the default one)
+     *
+     * @return object
+     */
+    function getConnection($name = null);
+
+    /**
+     * Gets an array of all registered connections
+     *
+     * @return array An array of Connection instances
+     */
+    function getConnections();
+
+    /**
+     * Gets all connection names.
+     *
+     * @return array An array of connection names
+     */
+    function getConnectionNames();
+}

+ 88 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php

@@ -0,0 +1,88 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+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 <roman@code-factory.de>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ */
+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;
+    }
+
+    /**
+     * Retrieve associated entity.
+     * @deprecated
+     *
+     * @return object
+     */
+    public function getEntity()
+    {
+        return $this->object;
+    }
+
+    /**
+     * Retrieve associated object.
+     *
+     * @return object
+     */
+    public function getObject()
+    {
+        return $this->object;
+    }
+
+    /**
+     * Retrieve associated ObjectManager.
+     *
+     * @return ObjectManager
+     */
+    public function getObjectManager()
+    {
+        return $this->objectManager;
+    }
+}

+ 76 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php

@@ -0,0 +1,76 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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 <jonwage@gmail.com>
+ * @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;
+    }
+
+    /**
+     * Retrieve associated ClassMetadata.
+     *
+     * @return ClassMetadata
+     */
+    public function getClassMetadata()
+    {
+        return $this->classMetadata;
+    }
+
+    /**
+     * Retrieve associated ObjectManager.
+     *
+     * @return ObjectManager
+     */
+    public function getObjectManager()
+    {
+        return $this->objectManager;
+    }
+}
+

+ 59 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php

@@ -0,0 +1,59 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\Common\Persistence\Event;
+
+use Doctrine\Common\Persistence\ObjectManager;
+
+/**
+ * Provides event arguments for the preFlush event.
+ *
+ * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link        www.doctrine-project.org
+ * @since       2.2
+ * @author      Roman Borschel <roman@code-factory.de>
+ * @author      Benjamin Eberlei <kontakt@beberlei.de>
+ */
+class ManagerEventArgs extends \Doctrine\Common\EventArgs
+{
+    /**
+     * @var ObjectManager
+     */
+    private $objectManager;
+
+    /**
+     * Constructor.
+     *
+     * @param ObjectManager $objectManager
+     */
+    public function __construct(ObjectManager $objectManager)
+    {
+        $this->objectManager = $objectManager;
+    }
+
+    /**
+     * Retrieve associated ObjectManager.
+     *
+     * @return ObjectManager
+     */
+    public function getObjectManager()
+    {
+        return $this->objectManager;
+    }
+}

+ 84 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php

@@ -0,0 +1,84 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Event;
+
+/**
+ * Provides event arguments for the onClear event.
+ *
+ * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link        www.doctrine-project.org
+ * @since       2.2
+ * @author      Roman Borschel <roman@code-factory.de>
+ * @author      Benjamin Eberlei <kontakt@beberlei.de>
+ */
+class OnClearEventArgs extends \Doctrine\Common\EventArgs
+{
+    /**
+     * @var \Doctrine\Common\Persistence\ObjectManager
+     */
+    private $objectManager;
+
+    /**
+     * @var string
+     */
+    private $entityClass;
+
+    /**
+     * Constructor.
+     *
+     * @param \Doctrine\Common\Persistence\ObjectManager $objectManager
+     * @param string $entityClass Optional entity class
+     */
+    public function __construct($objectManager, $entityClass = null)
+    {
+        $this->objectManager = $objectManager;
+        $this->entityClass = $entityClass;
+    }
+
+    /**
+     * Retrieve associated ObjectManager.
+     *
+     * @return \Doctrine\Common\Persistence\ObjectManager
+     */
+    public function getObjectManager()
+    {
+        return $this->objectManager;
+    }
+
+    /**
+     * Name of the entity class that is cleared, or empty if all are cleared.
+     *
+     * @return string
+     */
+    public function getEntityClass()
+    {
+        return $this->entityClass;
+    }
+
+    /**
+     * Check if event clears all entities.
+     *
+     * @return bool
+     */
+    public function clearsAllEntities()
+    {
+        return ($this->entityClass === null);
+    }
+}

+ 133 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php

@@ -0,0 +1,133 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Event;
+
+use Doctrine\Common\EventArgs,
+    Doctrine\Common\Persistence\ObjectManager;
+
+/**
+ * Class that holds event arguments for a preUpdate event.
+ *
+ * @author Guilherme Blanco <guilehrmeblanco@hotmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @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;
+    }
+
+    /**
+     * Retrieve entity changeset.
+     *
+     * @return array
+     */
+    public function getEntityChangeSet()
+    {
+        return $this->entityChangeSet;
+    }
+
+    /**
+     * Check if field has a changeset.
+     *
+     * @param string $field
+     *
+     * @return boolean
+     */
+    public function hasChangedField($field)
+    {
+        return isset($this->entityChangeSet[$field]);
+    }
+
+    /**
+     * Get 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];
+    }
+
+    /**
+     * Get 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];
+    }
+
+    /**
+     * Set the new value of this field.
+     *
+     * @param string $field
+     * @param mixed $value
+     */
+    public function setNewValue($field, $value)
+    {
+        $this->assertValidField($field);
+
+        $this->entityChangeSet[$field][1] = $value;
+    }
+
+    /**
+     * Assert the field exists in changeset.
+     *
+     * @param string $field
+     *
+     * @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())
+            ));
+        }
+    }
+}
+

+ 112 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php

@@ -0,0 +1,112 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.2
+ * @author  Fabien Potencier <fabien@symfony.com>
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Lukas Kahwe Smith <smith@pooteeweet.org>
+ */
+interface ManagerRegistry extends ConnectionRegistry
+{
+    /**
+     * Gets the default object manager name.
+     *
+     * @return string The default object manager name
+     */
+    function getDefaultManagerName();
+
+    /**
+     * Gets a named object manager.
+     *
+     * @param string $name The object manager name (null for the default one)
+     *
+     * @return \Doctrine\Common\Persistence\ObjectManager
+     */
+    function getManager($name = null);
+
+    /**
+     * Gets an array of all registered object managers
+     *
+     * @return \Doctrine\Common\Persistence\ObjectManager[] An array of ObjectManager instances
+     */
+    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 $name The object manager name (null for the default one)
+     *
+     * @return \Doctrine\Common\Persistence\ObjectManager
+     */
+    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
+     */
+    function getAliasNamespace($alias);
+
+    /**
+     * Gets all connection names.
+     *
+     * @return array An array of connection names
+     */
+    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
+     */
+    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
+     */
+    function getManagerForClass($class);
+}

+ 383 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php

@@ -0,0 +1,383 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+use Doctrine\Common\Cache\Cache,
+    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 <kontakt@beberlei.de>
+ * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ * @author  Roman Borschel <roman@code-factory.org>
+ */
+abstract class AbstractClassMetadataFactory implements ClassMetadataFactory
+{
+    /**
+     * Salt used by specific Object Manager implementation.
+     *
+     * @var string
+     */
+    protected $cacheSalt = "\$CLASSMETADATA";
+
+    /**
+     * @var \Doctrine\Common\Cache\Cache
+     */
+    private $cacheDriver;
+
+    /**
+     * @var array
+     */
+    private $loadedMetadata = array();
+
+    /**
+     * @var bool
+     */
+    protected $initialized = false;
+
+    /**
+     * @var ReflectionService
+     */
+    private $reflectionService;
+
+    /**
+     * Sets the cache driver used by the factory to cache ClassMetadata instances.
+     *
+     * @param Doctrine\Common\Cache\Cache $cacheDriver
+     */
+    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
+     */
+    public function getCacheDriver()
+    {
+        return $this->cacheDriver;
+    }
+
+    /**
+     * Return 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();
+
+    /**
+     * Get the fully qualified class-name from the namespace alias.
+     *
+     * @param string $namespaceAlias
+     * @param string $simpleClassName
+     * @return string
+     */
+    abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName);
+
+    /**
+     * Return the mapping driver implementation.
+     *
+     * @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
+     */
+    abstract protected function getDriver();
+
+    /**
+     * Wakeup reflection after ClassMetadata gets unserialized from cache.
+     *
+     * @param ClassMetadata $class
+     * @param ReflectionService $reflService
+     * @return void
+     */
+    abstract protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService);
+
+    /**
+     * Initialize 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 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
+     */
+    public function setMetadataFor($className, $class)
+    {
+        $this->loadedMetadata[$className] = $class;
+    }
+
+    /**
+     * Get array of parent classes for the given entity class
+     *
+     * @param string $name
+     * @return array $parentClasses
+     */
+    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.
+     *
+     * @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 load the metadata from the underlying metadata
+     *
+     * @param ClassMetadata $class
+     * @param ClassMetadata|null $parent
+     * @param bool $rootEntityFound
+     * @param array $nonSuperclassParents classnames all parent classes 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);
+
+    /**
+     * Check if this class is mapped by this Object Manager + ClassMetadata configuration
+     *
+     * @param $class
+     * @return bool
+     */
+    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);
+    }
+
+    /**
+     * Set reflectionService.
+     *
+     * @param ReflectionService $reflectionService
+     */
+    public function setReflectionService(ReflectionService $reflectionService)
+    {
+        $this->reflectionService = $reflectionService;
+    }
+
+    /**
+     * Get the reflection service associated with this metadata factory.
+     *
+     * @return ReflectionService
+     */
+    public function getReflectionService()
+    {
+        if ($this->reflectionService === null) {
+            $this->reflectionService = new RuntimeReflectionService();
+        }
+        return $this->reflectionService;
+    }
+}

+ 165 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php

@@ -0,0 +1,165 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+/**
+ * Contract for a Doctrine persistence layer ClassMetadata class to implement.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.1
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ */
+interface ClassMetadata
+{
+    /**
+     * Get fully-qualified class name of this persistent class.
+     *
+     * @return string
+     */
+    function getName();
+
+    /**
+     * Gets the mapped identifier field name.
+     *
+     * The returned structure is an array of the identifier field names.
+     *
+     * @return array
+     */
+    function getIdentifier();
+
+    /**
+     * Gets the ReflectionClass instance for this mapped class.
+     *
+     * @return \ReflectionClass
+     */
+    function getReflectionClass();
+
+    /**
+     * Checks if the given field name is a mapped identifier for this class.
+     *
+     * @param string $fieldName
+     * @return boolean
+     */
+    function isIdentifier($fieldName);
+
+    /**
+     * Checks if the given field is a mapped property for this class.
+     *
+     * @param string $fieldName
+     * @return boolean
+     */
+    function hasField($fieldName);
+
+    /**
+     * Checks if the given field is a mapped association for this class.
+     *
+     * @param string $fieldName
+     * @return boolean
+     */
+    function hasAssociation($fieldName);
+
+    /**
+     * Checks if the given field is a mapped single valued association for this class.
+     *
+     * @param string $fieldName
+     * @return boolean
+     */
+    function isSingleValuedAssociation($fieldName);
+
+    /**
+     * Checks if the given field is a mapped collection valued association for this class.
+     *
+     * @param string $fieldName
+     * @return boolean
+     */
+    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
+     */
+    function getFieldNames();
+
+    /**
+     * Returns an array of identifier field names numerically indexed.
+     *
+     * @return array
+     */
+    function getIdentifierFieldNames();
+
+    /**
+     * A numerically indexed list of association names of this persistent class.
+     *
+     * This array includes identifier associations if present on this class.
+     *
+     * @return array
+     */
+    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
+     */
+    function getTypeOfField($fieldName);
+
+    /**
+     * Returns the target class name of the given association.
+     *
+     * @param string $assocName
+     * @return string
+     */
+    function getAssociationTargetClass($assocName);
+
+    /**
+     * Checks if the association is the inverse side of a bidirectional association
+     *
+     * @param string $assocName
+     * @return boolean
+     */
+    function isAssociationInverseSide($assocName);
+
+    /**
+     * Returns the target field of the owning side of the association
+     *
+     * @param string $assocName
+     * @return string
+     */
+    function getAssociationMappedByTargetField($assocName);
+
+    /**
+     * Return 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
+     */
+    function getIdentifierValues($object);
+}

+ 74 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php

@@ -0,0 +1,74 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+/**
+ * Contract for a Doctrine persistence layer ClassMetadata class to implement.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.1
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ */
+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.
+     */
+    function getAllMetadata();
+
+    /**
+     * Gets the class metadata descriptor for a class.
+     *
+     * @param string $className The name of the class.
+     * @return ClassMetadata
+     */
+    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.
+     */
+    function hasMetadataFor($className);
+
+    /**
+     * Sets the metadata descriptor for a specific class.
+     *
+     * @param string $className
+     * @param ClassMetadata $class
+     */
+    function setMetadataFor($className, $class);
+
+    /**
+     * 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
+     */
+    function isTransient($className);
+}

+ 214 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php

@@ -0,0 +1,214 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Cache\ArrayCache,
+    Doctrine\Common\Annotations\AnnotationReader,
+    Doctrine\Common\Annotations\AnnotationRegistry,
+    Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * The AnnotationDriver reads the mapping metadata from docblock annotations.
+ *
+ * @since 2.2
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
+ */
+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
+     */
+    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 $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);
+        }
+    }
+
+    /**
+     * Append lookup paths to metadata driver.
+     *
+     * @param array $paths
+     */
+    public function addPaths(array $paths)
+    {
+        $this->paths = array_unique(array_merge($this->paths, $paths));
+    }
+
+    /**
+     * Retrieve the defined metadata lookup paths.
+     *
+     * @return array
+     */
+    public function getPaths()
+    {
+        return $this->paths;
+    }
+
+    /**
+     * Retrieve the current annotation reader
+     *
+     * @return AnnotationReader
+     */
+    public function getReader()
+    {
+        return $this->reader;
+    }
+
+    /**
+     * Get the file extension used to look for mapping files under
+     *
+     * @return string
+     */
+    public function getFileExtension()
+    {
+        return $this->fileExtension;
+    }
+
+    /**
+     * Set 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;
+    }
+
+    /**
+     * 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;
+    }
+}

+ 170 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php

@@ -0,0 +1,170 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * Locate the file that contains the metadata information for a given class name.
+ *
+ * This behavior is inpependent of the actual content of the file. It just detects
+ * the file which is responsible for the given class name.
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+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
+     */
+    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
+     */
+    public function __construct($paths, $fileExtension = null)
+    {
+        $this->addPaths((array) $paths);
+        $this->fileExtension = $fileExtension;
+    }
+
+    /**
+     * Append lookup paths to metadata driver.
+     *
+     * @param array $paths
+     */
+    public function addPaths(array $paths)
+    {
+        $this->paths = array_unique(array_merge($this->paths, $paths));
+    }
+
+    /**
+     * Retrieve the defined metadata lookup paths.
+     *
+     * @return array
+     */
+    public function getPaths()
+    {
+        return $this->paths;
+    }
+
+    /**
+     * Get the file extension used to look for mapping files under
+     *
+     * @return string
+     */
+    public function getFileExtension()
+    {
+        return $this->fileExtension;
+    }
+
+    /**
+     * Set 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 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;
+    }
+}

+ 214 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php

@@ -0,0 +1,214 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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 '.'.
+ *
+ * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link        www.doctrine-project.com
+ * @since       2.2
+ * @author      Benjamin Eberlei <kontakt@beberlei.de>
+ * @author      Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author      Jonathan H. Wage <jonwage@gmail.com>
+ * @author      Roman Borschel <roman@code-factory.org>
+ */
+abstract class FileDriver implements MappingDriver
+{
+    /**
+     * @var FileLocator
+     */
+    protected $locator;
+
+    /**
+     * @var array
+     */
+    protected $classCache;
+
+    /**
+     * @var string
+     */
+    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 $fileExtension
+     */
+    public function __construct($locator, $fileExtension = null)
+    {
+        if ($locator instanceof FileLocator) {
+            $this->locator = $locator;
+        } else {
+            $this->locator = new DefaultFileLocator((array)$locator, $fileExtension);
+        }
+    }
+
+    /**
+     * Set global basename
+     *
+     * @param string $file
+     */
+    public function setGlobalBasename($file)
+    {
+        $this->globalBasename = $file;
+    }
+
+    /**
+     * Retrieve global basename
+     *
+     * @return string
+     */
+    public function getGlobalBasename()
+    {
+        return $this->globalBasename;
+    }
+
+    /**
+     * Get 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
+     *
+     * @throws MappingException
+     * @return array The element of schema meta data
+     */
+    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];
+    }
+
+    /**
+     * 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)
+    {
+        if ($this->classCache === null) {
+            $this->initialize();
+        }
+
+        if (isset($this->classCache[$className])) {
+            return false;
+        }
+
+        return !$this->locator->fileExists($className);
+    }
+
+    /**
+     * 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()
+    {
+        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);
+
+    /**
+     * Initialize 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)
+                    );
+                }
+            }
+        }
+    }
+
+    /**
+     * Retrieve the locator used to discover mapping files by className
+     *
+     * @return FileLocator
+     */
+    public function getLocator()
+    {
+        return $this->locator;
+    }
+
+    /**
+     * Set the locator used to discover mapping files by className
+     *
+     * @param FileLocator $locator
+     */
+    public function setLocator(FileLocator $locator)
+    {
+        $this->locator = $locator;
+    }
+}

+ 71 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php

@@ -0,0 +1,71 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+/**
+ * Locate 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 <kontakt@beberlei.de>
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
+ */
+interface FileLocator
+{
+    /**
+     * Locate mapping file for the given class name.
+     *
+     * @param string $className
+     * @return string
+     */
+    function findMappingFile($className);
+
+    /**
+     * Get all class names that are found with this file locator.
+     *
+     * @param string $globalBasename Passed to allow excluding the basename
+     * @return array
+     */
+    function getAllClassNames($globalBasename);
+
+    /**
+     * Check if a file can be found for this class name.
+     *
+     * @param string $className
+     *
+     * @return bool
+     */
+    function fileExists($className);
+
+    /**
+     * Get all the paths that this file locator looks for mapping files.
+     *
+     * @return array
+     */
+    function getPaths();
+
+    /**
+     * Get the file extension that mapping files are suffixed with.
+     *
+     * @return string
+     */
+    function getFileExtension();
+}

+ 56 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php

@@ -0,0 +1,56 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+
+/**
+ * Contract for metadata drivers.
+ *
+ * @since 2.2
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ */
+interface MappingDriver
+{
+    /**
+     * Loads the metadata for the specified class into the provided container.
+     *
+     * @param string $className
+     * @param ClassMetadata $metadata
+     */
+    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.
+     */
+    function getAllClassNames();
+
+    /**
+     * 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
+     */
+    function isTransient($className);
+}

+ 168 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php

@@ -0,0 +1,168 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping\Driver;
+
+use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver,
+    Doctrine\Common\Persistence\Mapping\ClassMetadata,
+    Doctrine\Common\Persistence\Mapping\MappingException;
+
+/**
+ * The DriverChain allows you to add multiple other mapping drivers for
+ * certain namespaces
+ *
+ * @since  2.2
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author Jonathan H. Wage <jonwage@gmail.com>
+ * @author Roman Borschel <roman@code-factory.org>
+ */
+class MappingDriverChain implements MappingDriver
+{
+    /**
+     * The default driver
+     *
+     * @var MappingDriver
+     */
+    private $defaultDriver;
+
+    /**
+     * @var array
+     */
+    private $drivers = array();
+
+    /**
+     * Get the default driver.
+     *
+     * @return MappingDriver|null
+     */
+    public function getDefaultDriver()
+    {
+        return $this->defaultDriver;
+    }
+
+    /**
+     * Set the default driver.
+     *
+     * @param MappingDriver $driver
+     */
+    public function setDefaultDriver(MappingDriver $driver)
+    {
+        $this->defaultDriver = $driver;
+    }
+
+    /**
+     * Add a nested driver.
+     *
+     * @param MappingDriver $nestedDriver
+     * @param string $namespace
+     */
+    public function addDriver(MappingDriver $nestedDriver, $namespace)
+    {
+        $this->drivers[$namespace] = $nestedDriver;
+    }
+
+    /**
+     * Get the array of nested drivers.
+     *
+     * @return array $drivers
+     */
+    public function getDrivers()
+    {
+        return $this->drivers;
+    }
+
+    /**
+     * Loads the metadata for the specified class into the provided container.
+     *
+     * @param string $className
+     * @param ClassMetadata $metadata
+     *
+     * @throws MappingException
+     */
+    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));
+    }
+
+    /**
+     * 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()
+    {
+        $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;
+                }
+            }
+        }
+
+        return array_keys($classNames);
+    }
+
+    /**
+     * Whether the class with the specified name should have its metadata loaded.
+     *
+     * This is only the case for non-transient classes either mapped as an Entity or MappedSuperclass.
+     *
+     * @param string $className
+     * @return boolean
+     */
+    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;
+    }
+}

+ 72 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php

@@ -0,0 +1,72 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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
+ *
+ * @license 	http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    	www.doctrine-project.org
+ * @since   	2.0
+ * @version     $Revision$
+ * @author      Benjamin Eberlei <kontakt@beberlei.de>
+ * @author      Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author      Jonathan H. Wage <jonwage@gmail.com>
+ * @author      Roman Borschel <roman@code-factory.org>
+ */
+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);
+    }
+}

+ 141 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php

@@ -0,0 +1,141 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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.
+ *
+ * @license 	http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    	www.doctrine-project.org
+ * @since   	2.2
+ * @author      Benjamin Eberlei <kontakt@beberlei.de>
+ * @author      Guilherme Blanco <guilhermeblanco@hotmail.com>
+ * @author      Jonathan H. Wage <jonwage@gmail.com>
+ * @author      Roman Borschel <roman@code-factory.org>
+ */
+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);
+    }
+
+    /**
+     * Add paths
+     *
+     * @param array $paths
+     */
+    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');
+    }
+}

+ 214 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php

@@ -0,0 +1,214 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+*/
+
+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 <fabien@symfony.com>
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ * @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
+     */
+    protected $fileExtension;
+
+    /**
+     * Constructor
+     *
+     * @param array $prefixes
+     * @param string|null $fileExtension
+     */
+    public function __construct(array $prefixes, $fileExtension = null)
+    {
+        $this->addNamespacePrefixes($prefixes);
+        $this->fileExtension = $fileExtension;
+    }
+
+    /**
+     * Add Namespace Prefixes
+     *
+     * @param array $prefixes
+     */
+    public function addNamespacePrefixes(array $prefixes)
+    {
+        $this->prefixes = array_merge($this->prefixes, $prefixes);
+        $this->paths = array_merge($this->paths, array_keys($prefixes));
+    }
+
+    /**
+     * Get Namespace Prefixes
+     *
+     * @return array
+     */
+    public function getNamespacePrefixes()
+    {
+        return $this->prefixes;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getPaths()
+    {
+        return $this->paths;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getFileExtension()
+    {
+        return $this->fileExtension;
+    }
+
+    /**
+     * Set 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);
+    }
+}

+ 86 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php

@@ -0,0 +1,86 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.phpdoctrine.org>.
+ */
+
+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'.");
+    }
+}

+ 80 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php

@@ -0,0 +1,80 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+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 <kontakt@beberlei.de>
+ */
+interface ReflectionService
+{
+    /**
+     * Return an array of the parent classes (not interfaces) for the given class.
+     *
+     * @param string $class
+     * @return array
+     */
+    function getParentClasses($class);
+
+    /**
+     * Return the shortname of a class.
+     *
+     * @param string $class
+     * @return string
+     */
+    function getClassShortName($class);
+
+    /**
+     * @param string $class
+     * @return string
+     */
+    function getClassNamespace($class);
+
+    /**
+     * Return a reflection class instance or null
+     *
+     * @param string $class
+     * @return \ReflectionClass|null
+     */
+    function getClass($class);
+
+    /**
+     * Return an accessible property (setAccessible(true)) or null.
+     *
+     * @param string $class
+     * @param string $property
+     * @return \ReflectionProperty|null
+     */
+    function getAccessibleProperty($class, $property);
+
+    /**
+     * Check if the class have a public method with the given name.
+     *
+     * @param mixed $class
+     * @param mixed $method
+     * @return bool
+     */
+    function hasPublicMethod($class, $method);
+}
+

+ 102 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php

@@ -0,0 +1,102 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+use ReflectionClass;
+use ReflectionProperty;
+
+/**
+ * PHP Runtime Reflection Service
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ */
+class RuntimeReflectionService implements ReflectionService
+{
+    /**
+     * Return an array of the parent classes (not interfaces) for the given class.
+     *
+     * @param string $class
+     * @return array
+     */
+    public function getParentClasses($class)
+    {
+        return class_parents($class);
+    }
+
+    /**
+     * Return the shortname of a class.
+     *
+     * @param string $class
+     * @return string
+     */
+    public function getClassShortName($class)
+    {
+        $r = new ReflectionClass($class);
+        return $r->getShortName();
+    }
+
+    /**
+     * @param string $class
+     * @return string
+     */
+    public function getClassNamespace($class)
+    {
+        $r = new ReflectionClass($class);
+        return $r->getNamespaceName();
+    }
+
+    /**
+     * Return a reflection class instance or null
+     *
+     * @param string $class
+     * @return ReflectionClass|null
+     */
+    public function getClass($class)
+    {
+        return new ReflectionClass($class);
+    }
+
+    /**
+     * Return an accessible property (setAccessible(true)) or null.
+     *
+     * @param string $class
+     * @param string $property
+     * @return ReflectionProperty|null
+     */
+    public function getAccessibleProperty($class, $property)
+    {
+        $property = new ReflectionProperty($class, $property);
+        $property->setAccessible(true);
+        return $property;
+    }
+
+    /**
+     * Check if the class have a public method with the given name.
+     *
+     * @param mixed $class
+     * @param mixed $method
+     * @return bool
+     */
+    public function hasPublicMethod($class, $method)
+    {
+        return method_exists($class, $method) && is_callable(array($class, $method));
+    }
+}
+

+ 107 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php

@@ -0,0 +1,107 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence\Mapping;
+
+use ReflectionClass;
+use ReflectionProperty;
+
+/**
+ * PHP Runtime Reflection Service
+ *
+ * @author Benjamin Eberlei <kontakt@beberlei.de>
+ */
+class StaticReflectionService implements ReflectionService
+{
+    /**
+     * Return an array of the parent classes (not interfaces) for the given class.
+     *
+     * @param string $class
+     * @return array
+     */
+    public function getParentClasses($class)
+    {
+        return array();
+    }
+
+    /**
+     * Return the shortname of a class.
+     *
+     * @param string $className
+     * @return string
+     */
+    public function getClassShortName($className)
+    {
+        if (strpos($className, '\\') !== false) {
+            $className = substr($className, strrpos($className, "\\")+1);
+        }
+        return $className;
+    }
+
+    /**
+     * Return the namespace of a class.
+     *
+     * @param string $className
+     * @return string
+     */
+    public function getClassNamespace($className)
+    {
+        $namespace = '';
+        if (strpos($className, '\\') !== false) {
+            $namespace = strrev(substr( strrev($className), strpos(strrev($className), '\\')+1 ));
+        }
+        return $namespace;
+    }
+
+    /**
+     * Return a reflection class instance or null
+     *
+     * @param string $class
+     * @return ReflectionClass|null
+     */
+    public function getClass($class)
+    {
+        return null;
+    }
+
+    /**
+     * Return an accessible property (setAccessible(true)) or null.
+     *
+     * @param string $class
+     * @param string $property
+     * @return ReflectionProperty|null
+     */
+    public function getAccessibleProperty($class, $property)
+    {
+        return null;
+    }
+
+    /**
+     * Check if the class have a public method with the given name.
+     *
+     * @param mixed $class
+     * @param mixed $method
+     * @return bool
+     */
+    public function hasPublicMethod($class, $method)
+    {
+        return method_exists($class, $method) && is_callable(array($class, $method));
+    }
+}
+

+ 152 - 0
vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php

@@ -0,0 +1,152 @@
+<?php
+/*
+ * 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.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Common\Persistence;
+
+/**
+ * Contract for a Doctrine persistence layer ObjectManager class to implement.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link    www.doctrine-project.org
+ * @since   2.1
+ * @author  Benjamin Eberlei <kontakt@beberlei.de>
+ * @author  Jonathan Wage <jonwage@gmail.com>
+ */
+interface ObjectManager
+{
+    /**
+     * Finds a object by its identifier.
+     *
+     * This is just a convenient shortcut for getRepository($className)->find($id).
+     *
+     * @param string
+     * @param mixed
+     * @return object
+     */
+    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.
+     */
+    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.
+     */
+    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
+     */
+    function merge($object);
+
+    /**
+     * Clears the ObjectManager. All objects that are currently managed
+     * by this ObjectManager become detached.
+     *
+     * @param string $objectName if given, only objects of this type will get detached
+     */
+    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.
+     */
+    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.
+     */
+    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.
+     */
+    function flush();
+
+    /**
+     * Gets the repository for a class.
+     *
+     * @param string $className
+     * @return \Doctrine\Common\Persistence\ObjectRepository
+     */
+    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
+     */
+    function getClassMetadata($className);
+
+    /**
+     * Gets the metadata factory used to gather the metadata of classes.
+     *
+     * @return \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
+     */
+    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
+     */
+    function initializeObject($obj);
+
+    /**
+     * Check if the object is part of the current UnitOfWork and therefore
+     * managed.
+     *
+     * @param object $object
+     * @return bool
+     */
+    function contains($object);
+}

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff