Browse Source

remove vendor from git track

Bastien Sevajol 12 years ago
parent
commit
079bf0c496
100 changed files with 0 additions and 14144 deletions
  1. 0 7
      vendor/autoload.php
  2. 0 1
      vendor/bin/doctrine
  3. 0 1
      vendor/bin/doctrine.php
  4. 0 1
      vendor/cedriclombardot/admingenerator-generator-bundle/Admingenerator/GeneratorBundle
  5. 0 1
      vendor/cedriclombardot/twig-generator
  6. 0 240
      vendor/composer/ClassLoader.php
  7. 0 10
      vendor/composer/autoload_classmap.php
  8. 0 49
      vendor/composer/autoload_namespaces.php
  9. 0 46
      vendor/composer/autoload_real.php
  10. 0 2371
      vendor/composer/installed.json
  11. 0 4
      vendor/doctrine/common/.gitignore
  12. 0 3
      vendor/doctrine/common/.gitmodules
  13. 0 10
      vendor/doctrine/common/.travis.yml
  14. 0 12
      vendor/doctrine/common/README.md
  15. 0 39
      vendor/doctrine/common/UPGRADE_TO_2_1
  16. 0 61
      vendor/doctrine/common/UPGRADE_TO_2_2
  17. 0 141
      vendor/doctrine/common/bin/travis-setup.php
  18. 0 6
      vendor/doctrine/common/build.properties
  19. 0 59
      vendor/doctrine/common/build.xml
  20. 0 26
      vendor/doctrine/common/composer.json
  21. 0 79
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php
  22. 0 47
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php
  23. 0 37
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php
  24. 0 54
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
  25. 0 33
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php
  26. 0 107
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php
  27. 0 127
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php
  28. 0 310
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php
  29. 0 139
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php
  30. 0 250
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php
  31. 0 132
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php
  32. 0 988
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
  33. 0 258
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php
  34. 0 141
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php
  35. 0 80
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php
  36. 0 67
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php
  37. 0 157
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php
  38. 0 175
      vendor/doctrine/common/lib/Doctrine/Common/Annotations/TokenParser.php
  39. 0 93
      vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php
  40. 0 96
      vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php
  41. 0 102
      vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php
  42. 0 231
      vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php
  43. 0 132
      vendor/doctrine/common/lib/Doctrine/Common/Cache/FileCache.php
  44. 0 114
      vendor/doctrine/common/lib/Doctrine/Common/Cache/FilesystemCache.php
  45. 0 121
      vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php
  46. 0 124
      vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php
  47. 0 108
      vendor/doctrine/common/lib/Doctrine/Common/Cache/PhpFileCache.php
  48. 0 119
      vendor/doctrine/common/lib/Doctrine/Common/Cache/RedisCache.php
  49. 0 93
      vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php
  50. 0 110
      vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php
  51. 0 84
      vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php
  52. 0 263
      vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php
  53. 0 500
      vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php
  54. 0 243
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php
  55. 0 240
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Criteria.php
  56. 0 195
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php
  57. 0 75
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php
  58. 0 72
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php
  59. 0 31
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Expression.php
  60. 0 81
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php
  61. 0 41
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Value.php
  62. 0 149
      vendor/doctrine/common/lib/Doctrine/Common/Collections/ExpressionBuilder.php
  63. 0 48
      vendor/doctrine/common/lib/Doctrine/Common/Collections/Selectable.php
  64. 0 28
      vendor/doctrine/common/lib/Doctrine/Common/CommonException.php
  65. 0 49
      vendor/doctrine/common/lib/Doctrine/Common/Comparable.php
  66. 0 67
      vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php
  67. 0 147
      vendor/doctrine/common/lib/Doctrine/Common/EventManager.php
  68. 0 45
      vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php
  69. 0 266
      vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
  70. 0 45
      vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php
  71. 0 259
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
  72. 0 63
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php
  73. 0 77
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
  74. 0 76
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
  75. 0 59
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
  76. 0 84
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
  77. 0 133
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
  78. 0 112
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php
  79. 0 383
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
  80. 0 165
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
  81. 0 74
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
  82. 0 214
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
  83. 0 170
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
  84. 0 214
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
  85. 0 71
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
  86. 0 56
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
  87. 0 168
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
  88. 0 72
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php
  89. 0 141
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php
  90. 0 214
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php
  91. 0 86
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php
  92. 0 80
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php
  93. 0 102
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
  94. 0 107
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php
  95. 0 152
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php
  96. 0 49
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php
  97. 0 78
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php
  98. 0 244
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php
  99. 0 60
      vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php
  100. 0 0
      vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php

+ 0 - 7
vendor/autoload.php View File

@@ -1,7 +0,0 @@
1
-<?php
2
-
3
-// autoload.php generated by Composer
4
-
5
-require_once __DIR__ . '/composer' . '/autoload_real.php';
6
-
7
-return ComposerAutoloaderInitc9b19a18ee3786b65d05efbb2e260c14::getLoader();

+ 0 - 1
vendor/bin/doctrine View File

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

+ 0 - 1
vendor/bin/doctrine.php View File

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

+ 0 - 1
vendor/cedriclombardot/admingenerator-generator-bundle/Admingenerator/GeneratorBundle

@@ -1 +0,0 @@
1
-Subproject commit dbcbd469aec90551e48730075f310d9bf6d92cb6

+ 0 - 1
vendor/cedriclombardot/twig-generator

@@ -1 +0,0 @@
1
-Subproject commit b4a846956d330ed464070f6276801d16c92ae5c5

+ 0 - 240
vendor/composer/ClassLoader.php View File

@@ -1,240 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * This file is part of Composer.
5
- *
6
- * (c) Nils Adermann <naderman@naderman.de>
7
- *     Jordi Boggiano <j.boggiano@seld.be>
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
-namespace Composer\Autoload;
14
-
15
-/**
16
- * ClassLoader implements a PSR-0 class loader
17
- *
18
- * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
19
- *
20
- *     $loader = new \Composer\Autoload\ClassLoader();
21
- *
22
- *     // register classes with namespaces
23
- *     $loader->add('Symfony\Component', __DIR__.'/component');
24
- *     $loader->add('Symfony',           __DIR__.'/framework');
25
- *
26
- *     // activate the autoloader
27
- *     $loader->register();
28
- *
29
- *     // to enable searching the include path (eg. for PEAR packages)
30
- *     $loader->setUseIncludePath(true);
31
- *
32
- * In this example, if you try to use a class in the Symfony\Component
33
- * namespace or one of its children (Symfony\Component\Console for instance),
34
- * the autoloader will first look for the class under the component/
35
- * directory, and it will then fallback to the framework/ directory if not
36
- * found before giving up.
37
- *
38
- * This class is loosely based on the Symfony UniversalClassLoader.
39
- *
40
- * @author Fabien Potencier <fabien@symfony.com>
41
- * @author Jordi Boggiano <j.boggiano@seld.be>
42
- */
43
-class ClassLoader
44
-{
45
-    private $prefixes = array();
46
-    private $fallbackDirs = array();
47
-    private $useIncludePath = false;
48
-    private $classMap = array();
49
-
50
-    public function getPrefixes()
51
-    {
52
-        return $this->prefixes;
53
-    }
54
-
55
-    public function getFallbackDirs()
56
-    {
57
-        return $this->fallbackDirs;
58
-    }
59
-
60
-    public function getClassMap()
61
-    {
62
-        return $this->classMap;
63
-    }
64
-
65
-    /**
66
-     * @param array $classMap Class to filename map
67
-     */
68
-    public function addClassMap(array $classMap)
69
-    {
70
-        if ($this->classMap) {
71
-            $this->classMap = array_merge($this->classMap, $classMap);
72
-        } else {
73
-            $this->classMap = $classMap;
74
-        }
75
-    }
76
-
77
-    /**
78
-     * Registers a set of classes, merging with any others previously set.
79
-     *
80
-     * @param string       $prefix  The classes prefix
81
-     * @param array|string $paths   The location(s) of the classes
82
-     * @param bool         $prepend Prepend the location(s)
83
-     */
84
-    public function add($prefix, $paths, $prepend = false)
85
-    {
86
-        if (!$prefix) {
87
-            if ($prepend) {
88
-                $this->fallbackDirs = array_merge(
89
-                    (array) $paths,
90
-                    $this->fallbackDirs
91
-                );
92
-            } else {
93
-                $this->fallbackDirs = array_merge(
94
-                    $this->fallbackDirs,
95
-                    (array) $paths
96
-                );
97
-            }
98
-
99
-            return;
100
-        }
101
-        if (!isset($this->prefixes[$prefix])) {
102
-            $this->prefixes[$prefix] = (array) $paths;
103
-
104
-            return;
105
-        }
106
-        if ($prepend) {
107
-            $this->prefixes[$prefix] = array_merge(
108
-                (array) $paths,
109
-                $this->prefixes[$prefix]
110
-            );
111
-        } else {
112
-            $this->prefixes[$prefix] = array_merge(
113
-                $this->prefixes[$prefix],
114
-                (array) $paths
115
-            );
116
-        }
117
-    }
118
-
119
-    /**
120
-     * Registers a set of classes, replacing any others previously set.
121
-     *
122
-     * @param string       $prefix  The classes prefix
123
-     * @param array|string $paths   The location(s) of the classes
124
-     */
125
-    public function set($prefix, $paths)
126
-    {
127
-        if (!$prefix) {
128
-            $this->fallbackDirs = (array) $paths;
129
-
130
-            return;
131
-        }
132
-        $this->prefixes[$prefix] = (array) $paths;
133
-    }
134
-
135
-    /**
136
-     * Turns on searching the include path for class files.
137
-     *
138
-     * @param bool $useIncludePath
139
-     */
140
-    public function setUseIncludePath($useIncludePath)
141
-    {
142
-        $this->useIncludePath = $useIncludePath;
143
-    }
144
-
145
-    /**
146
-     * Can be used to check if the autoloader uses the include path to check
147
-     * for classes.
148
-     *
149
-     * @return bool
150
-     */
151
-    public function getUseIncludePath()
152
-    {
153
-        return $this->useIncludePath;
154
-    }
155
-
156
-    /**
157
-     * Registers this instance as an autoloader.
158
-     *
159
-     * @param bool $prepend Whether to prepend the autoloader or not
160
-     */
161
-    public function register($prepend = false)
162
-    {
163
-        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
164
-    }
165
-
166
-    /**
167
-     * Unregisters this instance as an autoloader.
168
-     */
169
-    public function unregister()
170
-    {
171
-        spl_autoload_unregister(array($this, 'loadClass'));
172
-    }
173
-
174
-    /**
175
-     * Loads the given class or interface.
176
-     *
177
-     * @param  string    $class The name of the class
178
-     * @return bool|null True, if loaded
179
-     */
180
-    public function loadClass($class)
181
-    {
182
-        if ($file = $this->findFile($class)) {
183
-            include $file;
184
-
185
-            return true;
186
-        }
187
-    }
188
-
189
-    /**
190
-     * Finds the path to the file where the class is defined.
191
-     *
192
-     * @param string $class The name of the class
193
-     *
194
-     * @return string|null The path, if found
195
-     */
196
-    public function findFile($class)
197
-    {
198
-        if ('\\' == $class[0]) {
199
-            $class = substr($class, 1);
200
-        }
201
-
202
-        if (isset($this->classMap[$class])) {
203
-            return $this->classMap[$class];
204
-        }
205
-
206
-        if (false !== $pos = strrpos($class, '\\')) {
207
-            // namespaced class name
208
-            $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR;
209
-            $className = substr($class, $pos + 1);
210
-        } else {
211
-            // PEAR-like class name
212
-            $classPath = null;
213
-            $className = $class;
214
-        }
215
-
216
-        $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
217
-
218
-        foreach ($this->prefixes as $prefix => $dirs) {
219
-            if (0 === strpos($class, $prefix)) {
220
-                foreach ($dirs as $dir) {
221
-                    if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
222
-                        return $dir . DIRECTORY_SEPARATOR . $classPath;
223
-                    }
224
-                }
225
-            }
226
-        }
227
-
228
-        foreach ($this->fallbackDirs as $dir) {
229
-            if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
230
-                return $dir . DIRECTORY_SEPARATOR . $classPath;
231
-            }
232
-        }
233
-
234
-        if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) {
235
-            return $file;
236
-        }
237
-
238
-        return $this->classMap[$class] = false;
239
-    }
240
-}

+ 0 - 10
vendor/composer/autoload_classmap.php View File

@@ -1,10 +0,0 @@
1
-<?php
2
-
3
-// autoload_classmap.php generated by Composer
4
-
5
-$vendorDir = dirname(__DIR__);
6
-$baseDir = dirname($vendorDir);
7
-
8
-return array(
9
-    'SqlFormatter' => $baseDir . '/vendor/jdorn/sql-formatter/lib/SqlFormatter.php',
10
-);

+ 0 - 49
vendor/composer/autoload_namespaces.php View File

@@ -1,49 +0,0 @@
1
-<?php
2
-
3
-// autoload_namespaces.php generated by Composer
4
-
5
-$vendorDir = dirname(__DIR__);
6
-$baseDir = dirname($vendorDir);
7
-
8
-return array(
9
-    'WhiteOctober\\PagerfantaBundle' => $vendorDir . '/white-october/pagerfanta-bundle/',
10
-    'Twig_Extensions_' => $vendorDir . '/twig/extensions/lib/',
11
-    'Twig_' => $vendorDir . '/twig/twig/lib/',
12
-    'TwigGenerator' => $vendorDir . '/cedriclombardot/twig-generator/src/',
13
-    'Symfony\\Bundle\\SwiftmailerBundle' => $vendorDir . '/symfony/swiftmailer-bundle/',
14
-    'Symfony\\Bundle\\MonologBundle' => $vendorDir . '/symfony/monolog-bundle/',
15
-    'Symfony\\Bundle\\AsseticBundle' => $vendorDir . '/symfony/assetic-bundle/',
16
-    'Symfony' => $vendorDir . '/symfony/symfony/src/',
17
-    'Stof\\DoctrineExtensionsBundle' => $vendorDir . '/stof/doctrine-extensions-bundle/',
18
-    'Sonata\\jQueryBundle' => $vendorDir . '/sonata-project/jquery-bundle/',
19
-    'Sonata\\DoctrineORMAdminBundle' => $vendorDir . '/sonata-project/doctrine-orm-admin-bundle/',
20
-    'Sonata\\BlockBundle' => $vendorDir . '/sonata-project/block-bundle/',
21
-    'Sonata\\AdminBundle' => $vendorDir . '/sonata-project/admin-bundle/',
22
-    'Shtumi\\UsefulBundle' => $vendorDir . '/shtumi/useful-bundle/',
23
-    'SessionHandlerInterface' => $vendorDir . '/symfony/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs',
24
-    'Sensio\\Bundle\\GeneratorBundle' => $vendorDir . '/sensio/generator-bundle/',
25
-    'Sensio\\Bundle\\FrameworkExtraBundle' => $vendorDir . '/sensio/framework-extra-bundle/',
26
-    'Sensio\\Bundle\\DistributionBundle' => $vendorDir . '/sensio/distribution-bundle/',
27
-    'Pagerfanta\\' => $vendorDir . '/pagerfanta/pagerfanta/src/',
28
-    'Monolog' => $vendorDir . '/monolog/monolog/src/',
29
-    'Metadata\\' => $vendorDir . '/jms/metadata/src/',
30
-    'Knp\\Menu\\' => $vendorDir . '/knplabs/knp-menu/src/',
31
-    'Knp\\Bundle\\MenuBundle' => $vendorDir . '/knplabs/knp-menu-bundle/',
32
-    'JMS\\SecurityExtraBundle' => $vendorDir . '/jms/security-extra-bundle/',
33
-    'JMS\\DiExtraBundle' => $vendorDir . '/jms/di-extra-bundle/',
34
-    'JMS\\AopBundle' => $vendorDir . '/jms/aop-bundle/',
35
-    'Gregwar\\ImageBundle' => $vendorDir . '/gregwar/image-bundle/',
36
-    'Gedmo' => $vendorDir . '/gedmo/doctrine-extensions/lib/',
37
-    'FOS\\UserBundle' => $vendorDir . '/friendsofsymfony/user-bundle/',
38
-    'Exporter' => $vendorDir . '/sonata-project/exporter/lib/',
39
-    'Doctrine\\ORM' => $vendorDir . '/doctrine/orm/lib/',
40
-    'Doctrine\\DBAL' => $vendorDir . '/doctrine/dbal/lib/',
41
-    'Doctrine\\Common\\DataFixtures' => $vendorDir . '/doctrine/data-fixtures/lib/',
42
-    'Doctrine\\Common' => $vendorDir . '/doctrine/common/lib/',
43
-    'Doctrine\\Bundle\\FixturesBundle' => $vendorDir . '/doctrine/doctrine-fixtures-bundle/',
44
-    'Doctrine\\Bundle\\DoctrineBundle' => $vendorDir . '/doctrine/doctrine-bundle/',
45
-    'CG\\' => $vendorDir . '/jms/cg/src/',
46
-    'Assetic' => $vendorDir . '/kriswallsmith/assetic/src/',
47
-    'Admingenerator\\GeneratorBundle' => $vendorDir . '/cedriclombardot/admingenerator-generator-bundle/',
48
-    '' => $baseDir . '/src/',
49
-);

+ 0 - 46
vendor/composer/autoload_real.php View File

@@ -1,46 +0,0 @@
1
-<?php
2
-
3
-// autoload_real.php generated by Composer
4
-
5
-class ComposerAutoloaderInitc9b19a18ee3786b65d05efbb2e260c14
6
-{
7
-    private static $loader;
8
-
9
-    public static function loadClassLoader($class)
10
-    {
11
-        if ('Composer\Autoload\ClassLoader' === $class) {
12
-            require __DIR__ . '/ClassLoader.php';
13
-        }
14
-    }
15
-
16
-    public static function getLoader()
17
-    {
18
-        if (null !== self::$loader) {
19
-            return self::$loader;
20
-        }
21
-
22
-        spl_autoload_register(array('ComposerAutoloaderInitc9b19a18ee3786b65d05efbb2e260c14', 'loadClassLoader'));
23
-        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
-        spl_autoload_unregister(array('ComposerAutoloaderInitc9b19a18ee3786b65d05efbb2e260c14', 'loadClassLoader'));
25
-
26
-        $vendorDir = dirname(__DIR__);
27
-        $baseDir = dirname($vendorDir);
28
-
29
-        $map = require __DIR__ . '/autoload_namespaces.php';
30
-        foreach ($map as $namespace => $path) {
31
-            $loader->add($namespace, $path);
32
-        }
33
-
34
-        $classMap = require __DIR__ . '/autoload_classmap.php';
35
-        if ($classMap) {
36
-            $loader->addClassMap($classMap);
37
-        }
38
-
39
-        $loader->register(true);
40
-
41
-        require $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php';
42
-        require $vendorDir . '/kriswallsmith/assetic/src/functions.php';
43
-
44
-        return $loader;
45
-    }
46
-}

File diff suppressed because it is too large
+ 0 - 2371
vendor/composer/installed.json


+ 0 - 4
vendor/doctrine/common/.gitignore View File

@@ -1,4 +0,0 @@
1
-build/
2
-logs/
3
-reports/
4
-dist/

+ 0 - 3
vendor/doctrine/common/.gitmodules View File

@@ -1,3 +0,0 @@
1
-[submodule "lib/vendor/doctrine-build-common"]
2
-	path = lib/vendor/doctrine-build-common
3
-	url = git://github.com/doctrine/doctrine-build-common.git

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

@@ -1,10 +0,0 @@
1
-language: php
2
-
3
-env:
4
-  - OPCODE_CACHE=apc
5
-
6
-php:
7
-  - 5.3
8
-  - 5.4
9
-
10
-before_script: php ./bin/travis-setup.php $OPCODE_CACHE

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

@@ -1,12 +0,0 @@
1
-# Doctrine Common
2
-
3
-[![Build Status](https://secure.travis-ci.org/doctrine/common.png)](http://travis-ci.org/doctrine/common)
4
-
5
-The Doctrine Common project is a library that provides extensions to core PHP functionality.
6
-
7
-## More resources:
8
-
9
-* [Website](http://www.doctrine-project.org)
10
-* [Documentation](http://www.doctrine-project.org/projects/common/current/docs/en)
11
-* [Issue Tracker](http://www.doctrine-project.org/jira/browse/DCOM)
12
-* [Downloads](http://github.com/doctrine/common/downloads)

+ 0 - 39
vendor/doctrine/common/UPGRADE_TO_2_1 View File

@@ -1,39 +0,0 @@
1
-This document details all the possible changes that you should investigate when updating
2
-your project from Doctrine Common 2.0.x to 2.1
3
-
4
-## AnnotationReader changes
5
-
6
-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:
7
-
8
-    $reader = new \Doctrine\Common\Annotations\AnnotationReader();
9
-    $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
10
-    // new code necessary starting here
11
-    $reader->setIgnoreNotImportedAnnotations(true);
12
-    $reader->setEnableParsePhpImports(false);
13
-    $reader = new \Doctrine\Common\Annotations\CachedReader(
14
-        new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache()
15
-    );
16
-
17
-## Annotation Base class or @Annotation
18
-
19
-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.
20
-
21
-## Removed methods on AnnotationReader
22
-
23
-* AnnotationReader::setAutoloadAnnotations()
24
-* AnnotationReader::getAutoloadAnnotations()
25
-* AnnotationReader::isAutoloadAnnotations()
26
-
27
-## AnnotationRegistry
28
-
29
-Autoloading through the PHP autoloader is removed from the 2.1 AnnotationReader. Instead you have to use the global AnnotationRegistry for loading purposes:
30
-
31
-    \Doctrine\Common\Annotations\AnnotationRegistry::registerFile($fileWithAnnotations);
32
-    \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace($namespace, $dirs = null);
33
-    \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespaces($namespaces);
34
-    \Doctrine\Common\Annotations\AnnotationRegistry::registerLoader($callable);
35
-
36
-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.
37
-The registerAutoloadNamespace function registers a PSR-0 compatible silent autoloader for all classes with the given namespace in the given directories.
38
-If null is passed as directory the include path will be used.
39
-

+ 0 - 61
vendor/doctrine/common/UPGRADE_TO_2_2 View File

@@ -1,61 +0,0 @@
1
-This document details all the possible changes that you should investigate when 
2
-updating your project from Doctrine Common 2.1 to 2.2:
3
-
4
-## Annotation Changes
5
-
6
-- AnnotationReader::setIgnoreNotImportedAnnotations has been removed, you need to 
7
-  add ignore annotation names which are supposed to be ignored via
8
-  AnnotationReader::addGlobalIgnoredName
9
-  
10
-- AnnotationReader::setAutoloadAnnotations was deprecated by the AnnotationRegistry
11
-  in 2.1 and has been removed in 2.2
12
-
13
-- AnnotationReader::setEnableParsePhpImports was added to ease transition to the new
14
-  annotation mechanism in 2.1 and is removed in 2.2
15
-
16
-- AnnotationReader::isParsePhpImportsEnabled is removed (see above)
17
-
18
-- AnnotationReader::setDefaultAnnotationNamespace was deprecated in favor of explicit
19
-  configuration in 2.1 and will be removed in 2.2 (for isolated projects where you
20
-  have full-control over _all_ available annotations, we offer a dedicated reader
21
-  class ``SimpleAnnotationReader``)
22
-
23
-- AnnotationReader::setAnnotationCreationFunction was deprecated in 2.1 and will be
24
-  removed in 2.2. We only offer two creation mechanisms which cannot be changed
25
-  anymore to allow the same reader instance to work with all annotations regardless
26
-  of which library they are coming from.
27
-  
28
-- AnnotationReader::setAnnotationNamespaceAlias was deprecated in 2.1 and will be
29
-  removed in 2.2 (see setDefaultAnnotationNamespace)
30
-
31
-- If you use a class as annotation which has not the @Annotation marker in it's 
32
-  class block, we will now throw an exception instead of silently ignoring it. You
33
-  can however still achieve the previous behavior using the @IgnoreAnnotation, or
34
-  AnnotationReader::addGlobalIgnoredName (the exception message will contain detailed
35
-  instructions when you run into this problem).
36
-
37
-## Cache Changes
38
-  
39
-- Renamed old AbstractCache to CacheProvider
40
-
41
-- Dropped the support to the following functions of all cache providers:
42
-
43
- - CacheProvider::deleteByWildcard
44
-
45
- - CacheProvider::deleteByRegEx
46
-
47
- - CacheProvider::deleteByPrefix
48
-
49
- - CacheProvider::deleteBySuffix
50
-
51
-- CacheProvider::deleteAll will not remove ALL entries, it will only mark them as invalid
52
-
53
-- CacheProvider::flushAll will remove ALL entries, namespaced or not
54
-
55
-- Added support to MemcachedCache
56
-
57
-- Added support to WincacheCache
58
-
59
-## ClassLoader Changes
60
-
61
-- ClassLoader::fileExistsInIncludePath() no longer exists. Use the native stream_resolve_include_path() PHP function

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

@@ -1,141 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the LGPL. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-/**
21
- * Install PHP extensions required for testing by Travis CI.
22
- *
23
- * @author Victor Berchet <victor@suumit.com>
24
- * @since 2.2
25
- */
26
-$installer = new PhpExtensions();
27
-
28
-if (isset($argv[1]) && 'APC' === strtoupper($argv[1])) {
29
-    $installer->install('apc');
30
-} else {
31
-    $installer->install('xcache');
32
-}
33
-
34
-$installer->install('memcache');
35
-$installer->install('memcached');
36
-
37
-class PhpExtensions
38
-{
39
-    protected $extensions;
40
-    protected $phpVersion;
41
-    protected $iniPath;
42
-
43
-    public function __construct()
44
-    {
45
-        $this->phpVersion = phpversion();
46
-        $this->iniPath = php_ini_loaded_file();
47
-        $this->extensions = array(
48
-        'memcache' => array(
49
-            'url'        => 'http://pecl.php.net/get/memcache-2.2.6.tgz',
50
-            'php_version' => array(),
51
-            'cfg'         => array('--enable-memcache'),
52
-            'ini'         => array('extension=memcache.so'),
53
-        ),
54
-        'memcached' => array(
55
-            'url'        => 'http://pecl.php.net/get/memcached-1.0.2.tgz',
56
-            'php_version' => array(
57
-                // memcached 1.0.2 does not build on PHP 5.4
58
-                array('<', '5.4'),
59
-            ),
60
-            'cfg'         => array(),
61
-            'ini'         => array('extension=memcached.so'),
62
-        ),
63
-        'apc' => array(
64
-            'url'        => 'http://pecl.php.net/get/APC-3.1.9.tgz',
65
-            'php_version' => array(
66
-                // apc 3.1.9 causes a segfault on PHP 5.4
67
-                array('<', '5.4'),
68
-            ),
69
-            'cfg'         => array(),
70
-            'ini'         => array(
71
-                'extension=apc.so',
72
-                'apc.enabled=1',
73
-                'apc.enable_cli=1'
74
-            ),
75
-        ),
76
-        'xcache' => array(
77
-            'url'        => 'http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz',
78
-            'php_version' => array(
79
-                // xcache does not build with Travis CI (as of 2012-01-09)
80
-                array('<', '5'),
81
-            ),
82
-            'cfg'         => array('--enable-xcache'),
83
-            'ini'         => array(
84
-                'extension=xcache.so',
85
-                'xcache.cacher=false',
86
-                'xcache.admin.enable_auth=0',
87
-                'xcache.var_size=1M',
88
-            ),
89
-        ),
90
-    );
91
-    }
92
-
93
-    public function install($name)
94
-    {
95
-        if (array_key_exists($name, $this->extensions)) {
96
-            $extension = $this->extensions[$name];
97
-
98
-
99
-            echo "== extension: $name ==\n";
100
-
101
-            foreach ($extension['php_version'] as $version) {
102
-                if (!version_compare($this->phpVersion, $version[1], $version[0])) {
103
-                    printf(
104
-                        "=> not installed, requires a PHP version %s %s (%s installed)\n",
105
-                        $version[0],
106
-                        $version[1],
107
-                        $this->phpVersion
108
-                    );
109
-
110
-                    return;
111
-                }
112
-            }
113
-
114
-            $this->system(sprintf("wget %s > /dev/null 2>&1", $extension['url']));
115
-            $file = basename($extension['url']);
116
-            $this->system(sprintf("tar -xzf %s > /dev/null 2>&1", $file));
117
-            $folder = basename($file, ".tgz");
118
-            $folder = basename($folder, ".tar.gz");
119
-            $this->system(sprintf(
120
-                'sh -c "cd %s && phpize && ./configure %s && make && sudo make install" > /dev/null 2>&1',
121
-                $folder,
122
-                implode(' ', $extension['cfg'])
123
-            ));
124
-            foreach ($extension['ini'] as $ini) {
125
-                $this->system(sprintf("echo %s >> %s", $ini, $this->iniPath));
126
-            }
127
-            printf("=> installed (%s)\n", $folder);
128
-        }
129
-    }
130
-
131
-    private function system($cmd)
132
-    {
133
-        $ret = 0;
134
-        system($cmd, $ret);
135
-        if (0 !== $ret) {
136
-            printf("=> Command '%s' failed !", $cmd);
137
-            
138
-            exit($ret);
139
-        }
140
-    }
141
-}

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

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

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

@@ -1,59 +0,0 @@
1
-<?xml version="1.0"?>
2
-<project name="Doctrine2" default="build" basedir=".">
3
-    <taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
4
-    <import file="${project.basedir}/lib/vendor/doctrine-build-common/packaging.xml" />
5
-
6
-    <property file="build.properties" />
7
-    
8
-    <!-- 
9
-        Fileset for artifacts shared across all distributed packages.
10
-    -->
11
-    <fileset id="shared-artifacts" dir=".">
12
-        <include name="LICENSE"/>
13
-        <include name="COPYRIGHT"/>
14
-        <include name="CHANGELOG"/>
15
-    </fileset>
16
-
17
-    <!-- 
18
-        Fileset for the sources of the Doctrine Common package.
19
-    -->
20
-    <fileset id="common-sources" dir="./lib">
21
-        <include name="Doctrine/Common/**"/>
22
-    </fileset>
23
-
24
-    <!--
25
-        Builds Common package, preparing it for distribution.
26
-    -->
27
-    <target name="copy-files" depends="prepare">
28
-        <copy todir="${build.dir}/${project.name}-${version}">
29
-            <fileset refid="shared-artifacts"/>
30
-        </copy>
31
-        <copy todir="${build.dir}/${project.name}-${version}">
32
-            <fileset refid="common-sources"/>
33
-        </copy>
34
-    </target>
35
-
36
-    <!-- 
37
-        Builds distributable PEAR packages.
38
-    -->
39
-    <target name="define-pear-package" depends="copy-files">
40
-        <d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}">
41
-           <name>DoctrineCommon</name>
42
-           <summary>Doctrine Common PHP Extensions</summary>
43
-           <channel>pear.doctrine-project.org</channel>
44
-           <description>The Doctrine Common package contains shared code between the other packages.</description>
45
-           <lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
46
-           <lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
47
-           <lead user="romanb" name="Roman Borschel" email="roman@code-factory.org" />
48
-           <lead user="beberlei" name="Benjamin Eberlei" email="kontakt@beberlei.de" />
49
-           <license>LGPL</license>
50
-           <version release="${pear.version}" api="${pear.version}" />
51
-           <stability release="${pear.stability}" api="${pear.stability}" />
52
-           <notes>-</notes>
53
-           <dependencies>
54
-               <php minimum_version="5.3.0" />
55
-               <pear minimum_version="1.6.0" recommended_version="1.6.1" />
56
-           </dependencies>
57
-        </d51pearpkg2>
58
-    </target>
59
-</project>

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

@@ -1,26 +0,0 @@
1
-{
2
-    "name": "doctrine/common",
3
-    "type": "library",
4
-    "description": "Common Library for Doctrine projects",
5
-    "keywords": ["collections", "spl", "eventmanager", "annotations", "persistence"],
6
-    "homepage": "http://www.doctrine-project.org",
7
-    "license": "MIT",
8
-    "authors": [
9
-        {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
10
-        {"name": "Roman Borschel", "email": "roman@code-factory.org"},
11
-        {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
12
-        {"name": "Jonathan Wage", "email": "jonwage@gmail.com"},
13
-        {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}
14
-    ],
15
-    "require": {
16
-        "php": ">=5.3.2"
17
-    },
18
-    "autoload": {
19
-        "psr-0": { "Doctrine\\Common": "lib/" }
20
-    },
21
-    "extra": {
22
-        "branch-alias": {
23
-            "dev-master": "2.3.x-dev"
24
-        }
25
-    }
26
-}

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

@@ -1,79 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-/**
23
- * Annotations class
24
- *
25
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
26
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
27
- * @author  Jonathan Wage <jonwage@gmail.com>
28
- * @author  Roman Borschel <roman@code-factory.org>
29
- */
30
-class Annotation
31
-{
32
-    /**
33
-     * Value property. Common among all derived classes.
34
-     *
35
-     * @var string
36
-     */
37
-    public $value;
38
-
39
-    /**
40
-     * Constructor
41
-     *
42
-     * @param array $data Key-value for properties to be defined in this class
43
-     */
44
-    public final function __construct(array $data)
45
-    {
46
-        foreach ($data as $key => $value) {
47
-            $this->$key = $value;
48
-        }
49
-    }
50
-
51
-    /**
52
-     * Error handler for unknown property accessor in Annotation class.
53
-     *
54
-     * @param string $name Unknown property name
55
-     *
56
-     * @throws \BadMethodCallException
57
-     */
58
-    public function __get($name)
59
-    {
60
-        throw new \BadMethodCallException(
61
-            sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
62
-        );
63
-    }
64
-
65
-    /**
66
-     * Error handler for unknown property mutator in Annotation class.
67
-     *
68
-     * @param string $name Unkown property name
69
-     * @param mixed $value Property value
70
-     *
71
-     * @throws \BadMethodCallException
72
-     */
73
-    public function __set($name, $value)
74
-    {
75
-        throw new \BadMethodCallException(
76
-            sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
77
-        );
78
-    }
79
-}

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

@@ -1,47 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Annotations\Annotation;
22
-
23
-/**
24
- * Annotation that can be used to signal to the parser
25
- * to check the attribute type during the parsing process.
26
- *
27
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
28
- *
29
- * @Annotation
30
- */
31
-final class Attribute
32
-{
33
-    /**
34
-     * @var string
35
-     */
36
-    public $name;
37
-
38
-    /**
39
-     * @var string
40
-     */
41
-    public $type;
42
-
43
-    /**
44
-     * @var boolean
45
-     */
46
-    public $required = false;
47
-}

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

@@ -1,37 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Annotations\Annotation;
22
-
23
-/**
24
- * Annotation that can be used to signal to the parser
25
- * to check the types of all declared attributes during the parsing process.
26
- *
27
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
28
- *
29
- * @Annotation
30
- */
31
-final class Attributes
32
-{
33
-    /**
34
-     * @var array<Doctrine\Common\Annotations\Annotation\Attribute>
35
-     */
36
-    public $value;
37
-}

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

@@ -1,54 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations\Annotation;
21
-
22
-/**
23
- * Annotation that can be used to signal to the parser to ignore specific
24
- * annotations during the parsing process.
25
- *
26
- * @Annotation
27
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
28
- */
29
-final class IgnoreAnnotation
30
-{
31
-    /**
32
-     * @var array
33
-     */
34
-    public $names;
35
-
36
-    /**
37
-     * Constructor
38
-     *
39
-     * @param array $values
40
-     *
41
-     * @throws \RuntimeException
42
-     */
43
-    public function __construct(array $values)
44
-    {
45
-        if (is_string($values['value'])) {
46
-            $values['value'] = array($values['value']);
47
-        }
48
-        if (!is_array($values['value'])) {
49
-            throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value'])));
50
-        }
51
-
52
-        $this->names = $values['value'];
53
-    }
54
-}

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

@@ -1,33 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Annotations\Annotation;
22
-
23
-/**
24
- * Annotation that can be used to signal to the parser
25
- * to check if that attribute is required during the parsing process.
26
- *
27
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
28
- *
29
- * @Annotation
30
- */
31
-final class Required
32
-{
33
-}

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

@@ -1,107 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Annotations\Annotation;
22
-
23
-/**
24
- * Annotation that can be used to signal to the parser
25
- * to check the annotation target during the parsing process.
26
- *
27
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
28
- *
29
- * @Annotation
30
- */
31
-final class Target
32
-{
33
-    const TARGET_CLASS              = 1;
34
-    const TARGET_METHOD             = 2;
35
-    const TARGET_PROPERTY           = 4;
36
-    const TARGET_ANNOTATION         = 8;
37
-    const TARGET_ALL                = 15;
38
-
39
-    /**
40
-     * @var array
41
-     */
42
-    private static $map = array(
43
-        'ALL'         => self::TARGET_ALL,
44
-        'CLASS'       => self::TARGET_CLASS,
45
-        'METHOD'      => self::TARGET_METHOD,
46
-        'PROPERTY'    => self::TARGET_PROPERTY,
47
-        'ANNOTATION'  => self::TARGET_ANNOTATION,
48
-    );
49
-
50
-    /**
51
-     * @var array
52
-     */
53
-    public $value;
54
-
55
-    /**
56
-     * Targets as bitmask.
57
-     *
58
-     * @var integer
59
-     */
60
-    public $targets;
61
-
62
-    /**
63
-     * Literal target declaration.
64
-     *
65
-     * @var integer
66
-     */
67
-    public $literal;
68
-
69
-    /**
70
-     * Annotation construct
71
-     *
72
-     * @param array $values
73
-     *
74
-     * @throws \InvalidArgumentException
75
-     */
76
-    public function __construct(array $values)
77
-    {
78
-        if (!isset($values['value'])){
79
-            $values['value'] = null;
80
-        }
81
-        if (is_string($values['value'])){
82
-            $values['value'] = array($values['value']);
83
-        }
84
-        if (!is_array($values['value'])){
85
-            throw new \InvalidArgumentException(
86
-                sprintf('@Target expects either a string value, or an array of strings, "%s" given.',
87
-                    is_object($values['value']) ? get_class($values['value']) : gettype($values['value'])
88
-                )
89
-            );
90
-        }
91
-
92
-        $bitmask = 0;
93
-        foreach ($values['value'] as $literal) {
94
-            if(!isset(self::$map[$literal])){
95
-                throw new \InvalidArgumentException(
96
-                    sprintf('Invalid Target "%s". Available targets: [%s]',
97
-                            $literal,  implode(', ', array_keys(self::$map)))
98
-                );
99
-            }
100
-            $bitmask += self::$map[$literal];
101
-        }
102
-
103
-        $this->targets  = $bitmask;
104
-        $this->value    = $values['value'];
105
-        $this->literal  = implode(', ', $this->value);
106
-    }
107
-}

+ 0 - 127
vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php View File

@@ -1,127 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-/**
23
- * Description of AnnotationException
24
- *
25
- * @since   2.0
26
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
27
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
28
- * @author  Jonathan Wage <jonwage@gmail.com>
29
- * @author  Roman Borschel <roman@code-factory.org>
30
- */
31
-class AnnotationException extends \Exception
32
-{
33
-    /**
34
-     * Creates a new AnnotationException describing a Syntax error.
35
-     *
36
-     * @param string $message Exception message
37
-     * @return AnnotationException
38
-     */
39
-    public static function syntaxError($message)
40
-    {
41
-        return new self('[Syntax Error] ' . $message);
42
-    }
43
-
44
-    /**
45
-     * Creates a new AnnotationException describing a Semantical error.
46
-     *
47
-     * @param string $message Exception message
48
-     * @return AnnotationException
49
-     */
50
-    public static function semanticalError($message)
51
-    {
52
-        return new self('[Semantical Error] ' . $message);
53
-    }
54
-
55
-    /**
56
-     * Creates a new AnnotationException describing a constant semantical error.
57
-     *
58
-     * @since 2.3
59
-     * @param string $identifier
60
-     * @param string $context
61
-     * @return AnnotationException
62
-     */
63
-    public static function semanticalErrorConstants($identifier, $context = null)
64
-    {
65
-        return self::semanticalError(sprintf(
66
-            "Couldn't find constant %s%s", $identifier,
67
-            $context ? ", $context." : "."
68
-        ));
69
-    }
70
-
71
-    /**
72
-     * Creates a new AnnotationException describing an error which occurred during
73
-     * the creation of the annotation.
74
-     *
75
-     * @since 2.2
76
-     * @param string $message
77
-     * @return AnnotationException
78
-     */
79
-    public static function creationError($message)
80
-    {
81
-        return new self('[Creation Error] ' . $message);
82
-    }
83
-
84
-    /**
85
-     * Creates a new AnnotationException describing an type error of an attribute.
86
-     *
87
-     * @since 2.2
88
-     * @param string $attributeName
89
-     * @param string $annotationName
90
-     * @param string $context
91
-     * @param string $expected
92
-     * @param mixed $actual
93
-     * @return AnnotationException
94
-     */
95
-    public static function typeError($attributeName, $annotationName, $context, $expected, $actual)
96
-    {
97
-        return new self(sprintf(
98
-            '[Type Error] Attribute "%s" of @%s declared on %s expects %s, but got %s.',
99
-            $attributeName,
100
-            $annotationName,
101
-            $context,
102
-            $expected,
103
-            is_object($actual) ? 'an instance of '.get_class($actual) : gettype($actual)
104
-        ));
105
-    }
106
-
107
-    /**
108
-     * Creates a new AnnotationException describing an required error of an attribute.
109
-     *
110
-     * @since 2.2
111
-     * @param string $attributeName
112
-     * @param string $annotationName
113
-     * @param string $context
114
-     * @param string $expected
115
-     * @return AnnotationException
116
-     */
117
-    public static function requiredError($attributeName, $annotationName, $context, $expected)
118
-    {
119
-        return new self(sprintf(
120
-            '[Type Error] Attribute "%s" of @%s declared on %s expects %s. This value should not be null.',
121
-            $attributeName,
122
-            $annotationName,
123
-            $context,
124
-            $expected
125
-        ));
126
-    }
127
-}

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

@@ -1,310 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation;
23
-use Doctrine\Common\Annotations\Annotation\Target;
24
-use Closure;
25
-use ReflectionClass;
26
-use ReflectionMethod;
27
-use ReflectionProperty;
28
-
29
-/**
30
- * A reader for docblock annotations.
31
- *
32
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
33
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
34
- * @author  Jonathan Wage <jonwage@gmail.com>
35
- * @author  Roman Borschel <roman@code-factory.org>
36
- * @author  Johannes M. Schmitt <schmittjoh@gmail.com>
37
- */
38
-class AnnotationReader implements Reader
39
-{
40
-    /**
41
-     * Global map for imports.
42
-     *
43
-     * @var array
44
-     */
45
-    private static $globalImports = array(
46
-        'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation',
47
-    );
48
-
49
-    /**
50
-     * A list with annotations that are not causing exceptions when not resolved to an annotation class.
51
-     *
52
-     * The names are case sensitive.
53
-     *
54
-     * @var array
55
-     */
56
-    private static $globalIgnoredNames = array(
57
-        'access'=> true, 'author'=> true, 'copyright'=> true, 'deprecated'=> true,
58
-        'example'=> true, 'ignore'=> true, 'internal'=> true, 'link'=> true, 'see'=> true,
59
-        'since'=> true, 'tutorial'=> true, 'version'=> true, 'package'=> true,
60
-        'subpackage'=> true, 'name'=> true, 'global'=> true, 'param'=> true,
61
-        'return'=> true, 'staticvar'=> true, 'category'=> true, 'staticVar'=> true,
62
-        'static'=> true, 'var'=> true, 'throws'=> true, 'inheritdoc'=> true,
63
-        'inheritDoc'=> true, 'license'=> true, 'todo'=> true,
64
-        'deprec'=> true, 'property' => true, 'method' => true,
65
-        'abstract'=> true, 'exception'=> true, 'magic' => true, 'api' => true,
66
-        'final'=> true, 'filesource'=> true, 'throw' => true, 'uses' => true,
67
-        'usedby'=> true, 'private' => true, 'Annotation' => true, 'override' => true,
68
-        'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true,
69
-        'Required' => true, 'Attribute' => true, 'Attributes' => true,
70
-        'Target' => true, 'SuppressWarnings' => true,
71
-        'ingroup' => true, 'code' => true, 'endcode' => true,
72
-        'package_version' => true,
73
-    );
74
-
75
-    /**
76
-     * Add a new annotation to the globally ignored annotation names with regard to exception handling.
77
-     *
78
-     * @param string $name
79
-     */
80
-    static public function addGlobalIgnoredName($name)
81
-    {
82
-        self::$globalIgnoredNames[$name] = true;
83
-    }
84
-
85
-    /**
86
-     * Annotations Parser
87
-     *
88
-     * @var \Doctrine\Common\Annotations\DocParser
89
-     */
90
-    private $parser;
91
-
92
-    /**
93
-     * Annotations Parser used to collect parsing metadata
94
-     *
95
-     * @var \Doctrine\Common\Annotations\DocParser
96
-     */
97
-    private $preParser;
98
-
99
-    /**
100
-     * PHP Parser used to collect imports.
101
-     *
102
-     * @var \Doctrine\Common\Annotations\PhpParser
103
-     */
104
-    private $phpParser;
105
-
106
-    /**
107
-     * In-memory cache mechanism to store imported annotations per class.
108
-     *
109
-     * @var array
110
-     */
111
-    private $imports = array();
112
-
113
-    /**
114
-     * In-memory cache mechanism to store ignored annotations per class.
115
-     *
116
-     * @var array
117
-     */
118
-    private $ignoredAnnotationNames = array();
119
-
120
-    /**
121
-     * Constructor.
122
-     *
123
-     * Initializes a new AnnotationReader.
124
-     */
125
-    public function __construct()
126
-    {
127
-        AnnotationRegistry::registerFile(__DIR__ . '/Annotation/IgnoreAnnotation.php');
128
-
129
-        $this->parser = new DocParser;
130
-
131
-        $this->preParser = new DocParser;
132
-        $this->preParser->setImports(self::$globalImports);
133
-        $this->preParser->setIgnoreNotImportedAnnotations(true);
134
-
135
-        $this->phpParser = new PhpParser;
136
-    }
137
-
138
-    /**
139
-     * Gets the annotations applied to a class.
140
-     *
141
-     * @param ReflectionClass $class The ReflectionClass of the class from which
142
-     *                               the class annotations should be read.
143
-     * @return array An array of Annotations.
144
-     */
145
-    public function getClassAnnotations(ReflectionClass $class)
146
-    {
147
-        $this->parser->setTarget(Target::TARGET_CLASS);
148
-        $this->parser->setImports($this->getImports($class));
149
-        $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
150
-
151
-        return $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());
152
-    }
153
-
154
-    /**
155
-     * Gets a class annotation.
156
-     *
157
-     * @param ReflectionClass $class The ReflectionClass of the class from which
158
-     *                               the class annotations should be read.
159
-     * @param string $annotationName The name of the annotation.
160
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
161
-     */
162
-    public function getClassAnnotation(ReflectionClass $class, $annotationName)
163
-    {
164
-        $annotations = $this->getClassAnnotations($class);
165
-
166
-        foreach ($annotations as $annotation) {
167
-            if ($annotation instanceof $annotationName) {
168
-                return $annotation;
169
-            }
170
-        }
171
-
172
-        return null;
173
-    }
174
-
175
-    /**
176
-     * Gets the annotations applied to a property.
177
-     *
178
-     * @param ReflectionProperty $property The ReflectionProperty of the property
179
-     *                                     from which the annotations should be read.
180
-     * @return array An array of Annotations.
181
-     */
182
-    public function getPropertyAnnotations(ReflectionProperty $property)
183
-    {
184
-        $class = $property->getDeclaringClass();
185
-        $context = 'property ' . $class->getName() . "::\$" . $property->getName();
186
-        $this->parser->setTarget(Target::TARGET_PROPERTY);
187
-        $this->parser->setImports($this->getImports($class));
188
-        $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
189
-
190
-        return $this->parser->parse($property->getDocComment(), $context);
191
-    }
192
-
193
-    /**
194
-     * Gets a property annotation.
195
-     *
196
-     * @param ReflectionProperty $property
197
-     * @param string $annotationName The name of the annotation.
198
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
199
-     */
200
-    public function getPropertyAnnotation(ReflectionProperty $property, $annotationName)
201
-    {
202
-        $annotations = $this->getPropertyAnnotations($property);
203
-
204
-        foreach ($annotations as $annotation) {
205
-            if ($annotation instanceof $annotationName) {
206
-                return $annotation;
207
-            }
208
-        }
209
-
210
-        return null;
211
-    }
212
-
213
-    /**
214
-     * Gets the annotations applied to a method.
215
-     *
216
-     * @param \ReflectionMethod $method The ReflectionMethod of the method from which
217
-     *                                   the annotations should be read.
218
-     *
219
-     * @return array An array of Annotations.
220
-     */
221
-    public function getMethodAnnotations(ReflectionMethod $method)
222
-    {
223
-        $class = $method->getDeclaringClass();
224
-        $context = 'method ' . $class->getName() . '::' . $method->getName() . '()';
225
-        $this->parser->setTarget(Target::TARGET_METHOD);
226
-        $this->parser->setImports($this->getImports($class));
227
-        $this->parser->setIgnoredAnnotationNames($this->getIgnoredAnnotationNames($class));
228
-
229
-        return $this->parser->parse($method->getDocComment(), $context);
230
-    }
231
-
232
-    /**
233
-     * Gets a method annotation.
234
-     *
235
-     * @param ReflectionMethod $method
236
-     * @param string $annotationName The name of the annotation.
237
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
238
-     */
239
-    public function getMethodAnnotation(ReflectionMethod $method, $annotationName)
240
-    {
241
-        $annotations = $this->getMethodAnnotations($method);
242
-
243
-        foreach ($annotations as $annotation) {
244
-            if ($annotation instanceof $annotationName) {
245
-                return $annotation;
246
-            }
247
-        }
248
-
249
-        return null;
250
-    }
251
-
252
-    /**
253
-     * Returns the ignored annotations for the given class.
254
-     *
255
-     * @param ReflectionClass $class
256
-     * @return array
257
-     */
258
-    private function getIgnoredAnnotationNames(ReflectionClass $class)
259
-    {
260
-        if (isset($this->ignoredAnnotationNames[$name = $class->getName()])) {
261
-            return $this->ignoredAnnotationNames[$name];
262
-        }
263
-        $this->collectParsingMetadata($class);
264
-
265
-        return $this->ignoredAnnotationNames[$name];
266
-    }
267
-
268
-    /**
269
-     * Retrieve imports
270
-     *
271
-     * @param \ReflectionClass $class
272
-     * @return array
273
-     */
274
-    private function getImports(ReflectionClass $class)
275
-    {
276
-        if (isset($this->imports[$name = $class->getName()])) {
277
-            return $this->imports[$name];
278
-        }
279
-        $this->collectParsingMetadata($class);
280
-
281
-        return $this->imports[$name];
282
-    }
283
-
284
-    /**
285
-     * Collects parsing metadata for a given class
286
-     *
287
-     * @param ReflectionClass $class
288
-     */
289
-    private function collectParsingMetadata(ReflectionClass $class)
290
-    {
291
-        $ignoredAnnotationNames = self::$globalIgnoredNames;
292
-
293
-        $annotations = $this->preParser->parse($class->getDocComment(), 'class '.$class->name);
294
-        foreach ($annotations as $annotation) {
295
-            if ($annotation instanceof IgnoreAnnotation) {
296
-                foreach ($annotation->names AS $annot) {
297
-                    $ignoredAnnotationNames[$annot] = true;
298
-                }
299
-            }
300
-        }
301
-
302
-        $name = $class->getName();
303
-        $this->imports[$name] = array_merge(
304
-            self::$globalImports,
305
-            $this->phpParser->parseClass($class),
306
-            array('__NAMESPACE__' => $class->getNamespaceName())
307
-        );
308
-        $this->ignoredAnnotationNames[$name] = $ignoredAnnotationNames;
309
-    }
310
-}

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

@@ -1,139 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-/**
23
- * AnnotationRegistry
24
- */
25
-final class AnnotationRegistry
26
-{
27
-    /**
28
-     * A map of namespaces to use for autoloading purposes based on a PSR-0 convention.
29
-     *
30
-     * Contains the namespace as key and an array of directories as value. If the value is NULL
31
-     * the include path is used for checking for the corresponding file.
32
-     *
33
-     * This autoloading mechanism does not utilize the PHP autoloading but implements autoloading on its own.
34
-     *
35
-     * @var array
36
-     */
37
-    static private $autoloadNamespaces = array();
38
-
39
-    /**
40
-     * A map of autoloader callables.
41
-     *
42
-     * @var array
43
-     */
44
-    static private $loaders = array();
45
-
46
-    static public function reset()
47
-    {
48
-        self::$autoloadNamespaces = array();
49
-        self::$loaders = array();
50
-    }
51
-
52
-    /**
53
-     * Register file
54
-     *
55
-     * @param string $file
56
-     */
57
-    static public function registerFile($file)
58
-    {
59
-        require_once $file;
60
-    }
61
-
62
-    /**
63
-     * Add a namespace with one or many directories to look for files or null for the include path.
64
-     *
65
-     * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm.
66
-     *
67
-     * @param string $namespace
68
-     * @param string|array|null $dirs
69
-     */
70
-    static public function registerAutoloadNamespace($namespace, $dirs = null)
71
-    {
72
-        self::$autoloadNamespaces[$namespace] = $dirs;
73
-    }
74
-
75
-    /**
76
-     * Register multiple namespaces
77
-     *
78
-     * Loading of this namespaces will be done with a PSR-0 namespace loading algorithm.
79
-     *
80
-     * @param array $namespaces
81
-     */
82
-    static public function registerAutoloadNamespaces(array $namespaces)
83
-    {
84
-        self::$autoloadNamespaces = array_merge(self::$autoloadNamespaces, $namespaces);
85
-    }
86
-
87
-    /**
88
-     * Register an autoloading callable for annotations, much like spl_autoload_register().
89
-     *
90
-     * NOTE: These class loaders HAVE to be silent when a class was not found!
91
-     * IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class.
92
-     *
93
-     * @param callable $callable
94
-     *
95
-     * @throws \InvalidArgumentException
96
-     */
97
-    static public function registerLoader($callable)
98
-    {
99
-        if (!is_callable($callable)) {
100
-            throw new \InvalidArgumentException("A callable is expected in AnnotationRegistry::registerLoader().");
101
-        }
102
-        self::$loaders[] = $callable;
103
-    }
104
-
105
-    /**
106
-     * Autoload an annotation class silently.
107
-     *
108
-     * @param string $class
109
-     * @return boolean
110
-     */
111
-    static public function loadAnnotationClass($class)
112
-    {
113
-        foreach (self::$autoloadNamespaces AS $namespace => $dirs) {
114
-            if (strpos($class, $namespace) === 0) {
115
-                $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php";
116
-                if ($dirs === null) {
117
-                    if ($path = stream_resolve_include_path($file)) {
118
-                        require $path;
119
-                        return true;
120
-                    }
121
-                } else {
122
-                    foreach((array)$dirs AS $dir) {
123
-                        if (file_exists($dir . DIRECTORY_SEPARATOR . $file)) {
124
-                            require $dir . DIRECTORY_SEPARATOR . $file;
125
-                            return true;
126
-                        }
127
-                    }
128
-                }
129
-            }
130
-        }
131
-
132
-        foreach (self::$loaders AS $loader) {
133
-            if (call_user_func($loader, $class) === true) {
134
-                return true;
135
-            }
136
-        }
137
-        return false;
138
-    }
139
-}

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

@@ -1,250 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-use Doctrine\Common\Cache\Cache;
23
-
24
-/**
25
- * A cache aware annotation reader.
26
- *
27
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
28
- * @author Benjamin Eberlei <kontakt@beberlei.de>
29
- */
30
-final class CachedReader implements Reader
31
-{
32
-    /**
33
-     * @var string
34
-     */
35
-    private static $CACHE_SALT = '@[Annot]';
36
-
37
-    /**
38
-     * @var Reader
39
-     */
40
-    private $delegate;
41
-
42
-    /**
43
-     * @var Cache
44
-     */
45
-    private $cache;
46
-
47
-    /**
48
-     * @var boolean
49
-     */
50
-    private $debug;
51
-
52
-    /**
53
-     * @var array
54
-     */
55
-    private $loadedAnnotations;
56
-
57
-    /**
58
-     * Constructor
59
-     *
60
-     * @param Reader $reader
61
-     * @param Cache $cache
62
-     * @param bool $debug
63
-     */
64
-    public function __construct(Reader $reader, Cache $cache, $debug = false)
65
-    {
66
-        $this->delegate = $reader;
67
-        $this->cache = $cache;
68
-        $this->debug = (Boolean) $debug;
69
-    }
70
-
71
-    /**
72
-     * Get annotations for class
73
-     *
74
-     * @param \ReflectionClass $class
75
-     * @return array
76
-     */
77
-    public function getClassAnnotations(\ReflectionClass $class)
78
-    {
79
-        $cacheKey = $class->getName();
80
-
81
-        if (isset($this->loadedAnnotations[$cacheKey])) {
82
-            return $this->loadedAnnotations[$cacheKey];
83
-        }
84
-
85
-        if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
86
-            $annots = $this->delegate->getClassAnnotations($class);
87
-            $this->saveToCache($cacheKey, $annots);
88
-        }
89
-
90
-        return $this->loadedAnnotations[$cacheKey] = $annots;
91
-    }
92
-
93
-    /**
94
-     * Get selected annotation for class
95
-     *
96
-     * @param \ReflectionClass $class
97
-     * @param string $annotationName
98
-     * @return null
99
-     */
100
-    public function getClassAnnotation(\ReflectionClass $class, $annotationName)
101
-    {
102
-        foreach ($this->getClassAnnotations($class) as $annot) {
103
-            if ($annot instanceof $annotationName) {
104
-                return $annot;
105
-            }
106
-        }
107
-
108
-        return null;
109
-    }
110
-
111
-    /**
112
-     * Get annotations for property
113
-     *
114
-     * @param \ReflectionProperty $property
115
-     * @return array
116
-     */
117
-    public function getPropertyAnnotations(\ReflectionProperty $property)
118
-    {
119
-        $class = $property->getDeclaringClass();
120
-        $cacheKey = $class->getName().'$'.$property->getName();
121
-
122
-        if (isset($this->loadedAnnotations[$cacheKey])) {
123
-            return $this->loadedAnnotations[$cacheKey];
124
-        }
125
-
126
-        if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
127
-            $annots = $this->delegate->getPropertyAnnotations($property);
128
-            $this->saveToCache($cacheKey, $annots);
129
-        }
130
-
131
-        return $this->loadedAnnotations[$cacheKey] = $annots;
132
-    }
133
-
134
-    /**
135
-     * Get selected annotation for property
136
-     *
137
-     * @param \ReflectionProperty $property
138
-     * @param string $annotationName
139
-     * @return null
140
-     */
141
-    public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
142
-    {
143
-        foreach ($this->getPropertyAnnotations($property) as $annot) {
144
-            if ($annot instanceof $annotationName) {
145
-                return $annot;
146
-            }
147
-        }
148
-
149
-        return null;
150
-    }
151
-
152
-    /**
153
-     * Get method annotations
154
-     *
155
-     * @param \ReflectionMethod $method
156
-     * @return array
157
-     */
158
-    public function getMethodAnnotations(\ReflectionMethod $method)
159
-    {
160
-        $class = $method->getDeclaringClass();
161
-        $cacheKey = $class->getName().'#'.$method->getName();
162
-
163
-        if (isset($this->loadedAnnotations[$cacheKey])) {
164
-            return $this->loadedAnnotations[$cacheKey];
165
-        }
166
-
167
-        if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
168
-            $annots = $this->delegate->getMethodAnnotations($method);
169
-            $this->saveToCache($cacheKey, $annots);
170
-        }
171
-
172
-        return $this->loadedAnnotations[$cacheKey] = $annots;
173
-    }
174
-
175
-    /**
176
-     * Get selected method annotation
177
-     *
178
-     * @param \ReflectionMethod $method
179
-     * @param string $annotationName
180
-     * @return null
181
-     */
182
-    public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
183
-    {
184
-        foreach ($this->getMethodAnnotations($method) as $annot) {
185
-            if ($annot instanceof $annotationName) {
186
-                return $annot;
187
-            }
188
-        }
189
-
190
-        return null;
191
-    }
192
-
193
-    /**
194
-     * Clear loaded annotations
195
-     */
196
-    public function clearLoadedAnnotations()
197
-    {
198
-        $this->loadedAnnotations = array();
199
-    }
200
-
201
-    /**
202
-     * Fetches a value from the cache.
203
-     *
204
-     * @param string           $rawCacheKey The cache key.
205
-     * @param \ReflectionClass $class       The related class.
206
-     * @return mixed|boolean The cached value or false when the value is not in cache.
207
-     */
208
-    private function fetchFromCache($rawCacheKey, \ReflectionClass $class)
209
-    {
210
-        $cacheKey = $rawCacheKey . self::$CACHE_SALT;
211
-        if (($data = $this->cache->fetch($cacheKey)) !== false) {
212
-            if (!$this->debug || $this->isCacheFresh($cacheKey, $class)) {
213
-                return $data;
214
-            }
215
-        }
216
-
217
-        return false;
218
-    }
219
-
220
-    /**
221
-     * Saves a value to the cache
222
-     *
223
-     * @param string $rawCacheKey The cache key.
224
-     * @param mixed  $value       The value.
225
-     */
226
-    private function saveToCache($rawCacheKey, $value)
227
-    {
228
-        $cacheKey = $rawCacheKey . self::$CACHE_SALT;
229
-        $this->cache->save($cacheKey, $value);
230
-        if ($this->debug) {
231
-            $this->cache->save('[C]'.$cacheKey, time());
232
-        }
233
-    }
234
-
235
-    /**
236
-     * Check if cache is fresh
237
-     *
238
-     * @param string $cacheKey
239
-     * @param \ReflectionClass $class
240
-     * @return bool
241
-     */
242
-    private function isCacheFresh($cacheKey, \ReflectionClass $class)
243
-    {
244
-        if (false === $filename = $class->getFilename()) {
245
-            return true;
246
-        }
247
-
248
-        return $this->cache->fetch('[C]'.$cacheKey) >= filemtime($filename);
249
-    }
250
-}

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

@@ -1,132 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-use Doctrine\Common\Lexer;
23
-
24
-/**
25
- * Simple lexer for docblock annotations.
26
- *
27
- * @author Benjamin Eberlei <kontakt@beberlei.de>
28
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
29
- * @author Jonathan Wage <jonwage@gmail.com>
30
- * @author Roman Borschel <roman@code-factory.org>
31
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
32
- */
33
-final class DocLexer extends Lexer
34
-{
35
-    const T_NONE                = 1;
36
-    const T_INTEGER             = 2;
37
-    const T_STRING              = 3;
38
-    const T_FLOAT               = 4;
39
-
40
-    // All tokens that are also identifiers should be >= 100
41
-    const T_IDENTIFIER          = 100;
42
-    const T_AT                  = 101;
43
-    const T_CLOSE_CURLY_BRACES  = 102;
44
-    const T_CLOSE_PARENTHESIS   = 103;
45
-    const T_COMMA               = 104;
46
-    const T_EQUALS              = 105;
47
-    const T_FALSE               = 106;
48
-    const T_NAMESPACE_SEPARATOR = 107;
49
-    const T_OPEN_CURLY_BRACES   = 108;
50
-    const T_OPEN_PARENTHESIS    = 109;
51
-    const T_TRUE                = 110;
52
-    const T_NULL                = 111;
53
-    const T_COLON               = 112;
54
-
55
-    protected $noCase = array(
56
-        '@'  => self::T_AT,
57
-        ','  => self::T_COMMA,
58
-        '('  => self::T_OPEN_PARENTHESIS,
59
-        ')'  => self::T_CLOSE_PARENTHESIS,
60
-        '{'  => self::T_OPEN_CURLY_BRACES,
61
-        '}'  => self::T_CLOSE_CURLY_BRACES,
62
-        '='  => self::T_EQUALS,
63
-        ':'  => self::T_COLON,
64
-        '\\' => self::T_NAMESPACE_SEPARATOR
65
-    );
66
-
67
-    protected $withCase = array(
68
-        'true'  => self::T_TRUE,
69
-        'false' => self::T_FALSE,
70
-        'null'  => self::T_NULL
71
-    );
72
-
73
-    /**
74
-     * {@inheritdoc}
75
-     */
76
-    protected function getCatchablePatterns()
77
-    {
78
-        return array(
79
-            '[a-z_\\\][a-z0-9_\:\\\]*[a-z]{1}',
80
-            '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?',
81
-            '"(?:[^"]|"")*"',
82
-        );
83
-    }
84
-
85
-    /**
86
-     * {@inheritdoc}
87
-     */
88
-    protected function getNonCatchablePatterns()
89
-    {
90
-        return array('\s+', '\*+', '(.)');
91
-    }
92
-
93
-    /**
94
-     * {@inheritdoc}
95
-     *
96
-     * @param string $value
97
-     *
98
-     * @return int
99
-     */
100
-    protected function getType(&$value)
101
-    {
102
-        $type = self::T_NONE;
103
-
104
-        if ($value[0] === '"') {
105
-            $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2));
106
-
107
-            return self::T_STRING;
108
-        }
109
-
110
-        if (isset($this->noCase[$value])) {
111
-            return $this->noCase[$value];
112
-        }
113
-
114
-        if ($value[0] === '_' || $value[0] === '\\' || ctype_alpha($value[0])) {
115
-            return self::T_IDENTIFIER;
116
-        }
117
-
118
-        $lowerValue = strtolower($value);
119
-
120
-        if (isset($this->withCase[$lowerValue])) {
121
-            return $this->withCase[$lowerValue];
122
-        }
123
-
124
-        // Checking numeric value
125
-        if (is_numeric($value)) {
126
-            return (strpos($value, '.') !== false || stripos($value, 'e') !== false)
127
-                ? self::T_FLOAT : self::T_INTEGER;
128
-        }
129
-
130
-        return $type;
131
-    }
132
-}

+ 0 - 988
vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php View File

@@ -1,988 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-use Closure;
23
-use ReflectionClass;
24
-use Doctrine\Common\Annotations\Annotation\Target;
25
-use Doctrine\Common\Annotations\Annotation\Attribute;
26
-use Doctrine\Common\Annotations\Annotation\Attributes;
27
-
28
-/**
29
- * A parser for docblock annotations.
30
- *
31
- * It is strongly discouraged to change the default annotation parsing process.
32
- *
33
- * @author Benjamin Eberlei <kontakt@beberlei.de>
34
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
35
- * @author Jonathan Wage <jonwage@gmail.com>
36
- * @author Roman Borschel <roman@code-factory.org>
37
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
38
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
39
- */
40
-final class DocParser
41
-{
42
-    /**
43
-     * An array of all valid tokens for a class name.
44
-     *
45
-     * @var array
46
-     */
47
-    private static $classIdentifiers = array(DocLexer::T_IDENTIFIER, DocLexer::T_TRUE, DocLexer::T_FALSE, DocLexer::T_NULL);
48
-
49
-    /**
50
-     * The lexer.
51
-     *
52
-     * @var \Doctrine\Common\Annotations\DocLexer
53
-     */
54
-    private $lexer;
55
-
56
-    /**
57
-     * Current target context
58
-     *
59
-     * @var string
60
-     */
61
-    private $target;
62
-
63
-    /**
64
-     * Doc Parser used to collect annotation target
65
-     *
66
-     * @var \Doctrine\Common\Annotations\DocParser
67
-     */
68
-    private static $metadataParser;
69
-
70
-    /**
71
-     * Flag to control if the current annotation is nested or not.
72
-     *
73
-     * @var boolean
74
-     */
75
-    private $isNestedAnnotation = false;
76
-
77
-    /**
78
-     * Hashmap containing all use-statements that are to be used when parsing
79
-     * the given doc block.
80
-     *
81
-     * @var array
82
-     */
83
-    private $imports = array();
84
-
85
-    /**
86
-     * This hashmap is used internally to cache results of class_exists()
87
-     * look-ups.
88
-     *
89
-     * @var array
90
-     */
91
-    private $classExists = array();
92
-
93
-    /**
94
-     * Whether annotations that have not been imported should be ignored.
95
-     *
96
-     * @var boolean
97
-     */
98
-    private $ignoreNotImportedAnnotations = false;
99
-
100
-    /**
101
-     * An array of default namespaces if operating in simple mode.
102
-     *
103
-     * @var array
104
-     */
105
-    private $namespaces = array();
106
-
107
-    /**
108
-     * A list with annotations that are not causing exceptions when not resolved to an annotation class.
109
-     *
110
-     * The names must be the raw names as used in the class, not the fully qualified
111
-     * class names.
112
-     *
113
-     * @var array
114
-     */
115
-    private $ignoredAnnotationNames = array();
116
-
117
-    /**
118
-     * @var string
119
-     */
120
-    private $context = '';
121
-
122
-    /**
123
-     * Hash-map for caching annotation metadata
124
-     * @var array
125
-     */
126
-    private static $annotationMetadata = array(
127
-        'Doctrine\Common\Annotations\Annotation\Target' => array(
128
-            'is_annotation'    => true,
129
-            'has_constructor'  => true,
130
-            'properties'       => array(),
131
-            'targets_literal'  => 'ANNOTATION_CLASS',
132
-            'targets'          => Target::TARGET_CLASS,
133
-            'default_property' => 'value',
134
-            'attribute_types'  => array(
135
-                'value'  => array(
136
-                    'required'  => false,
137
-                    'type'      =>'array',
138
-                    'array_type'=>'string',
139
-                    'value'     =>'array<string>'
140
-                )
141
-             ),
142
-        ),
143
-        'Doctrine\Common\Annotations\Annotation\Attribute' => array(
144
-            'is_annotation'    => true,
145
-            'has_constructor'  => false,
146
-            'targets_literal'  => 'ANNOTATION_ANNOTATION',
147
-            'targets'          => Target::TARGET_ANNOTATION,
148
-            'default_property' => 'name',
149
-            'properties'       => array(
150
-                'name'      => 'name',
151
-                'type'      => 'type',
152
-                'required'  => 'required'
153
-            ),
154
-            'attribute_types'  => array(
155
-                'value'  => array(
156
-                    'required'  => true,
157
-                    'type'      =>'string',
158
-                    'value'     =>'string'
159
-                ),
160
-                'type'  => array(
161
-                    'required'  =>true,
162
-                    'type'      =>'string',
163
-                    'value'     =>'string'
164
-                ),
165
-                'required'  => array(
166
-                    'required'  =>false,
167
-                    'type'      =>'boolean',
168
-                    'value'     =>'boolean'
169
-                )
170
-             ),
171
-        ),
172
-        'Doctrine\Common\Annotations\Annotation\Attributes' => array(
173
-            'is_annotation'    => true,
174
-            'has_constructor'  => false,
175
-            'targets_literal'  => 'ANNOTATION_CLASS',
176
-            'targets'          => Target::TARGET_CLASS,
177
-            'default_property' => 'value',
178
-            'properties'       => array(
179
-                'value' => 'value'
180
-            ),
181
-            'attribute_types'  => array(
182
-                'value' => array(
183
-                    'type'      =>'array',
184
-                    'required'  =>true,
185
-                    'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute',
186
-                    'value'     =>'array<Doctrine\Common\Annotations\Annotation\Attribute>'
187
-                )
188
-             ),
189
-        ),
190
-    );
191
-
192
-    /**
193
-     * Hash-map for handle types declaration
194
-     *
195
-     * @var array
196
-     */
197
-    private static $typeMap = array(
198
-        'float'     => 'double',
199
-        'bool'      => 'boolean',
200
-        // allow uppercase Boolean in honor of George Boole
201
-        'Boolean'   => 'boolean',
202
-        'int'       => 'integer',
203
-    );
204
-
205
-    /**
206
-     * Constructs a new DocParser.
207
-     */
208
-    public function __construct()
209
-    {
210
-        $this->lexer = new DocLexer;
211
-    }
212
-
213
-    /**
214
-     * Sets the annotation names that are ignored during the parsing process.
215
-     *
216
-     * The names are supposed to be the raw names as used in the class, not the
217
-     * fully qualified class names.
218
-     *
219
-     * @param array $names
220
-     */
221
-    public function setIgnoredAnnotationNames(array $names)
222
-    {
223
-        $this->ignoredAnnotationNames = $names;
224
-    }
225
-
226
-    /**
227
-     * Sets ignore on not-imported annotations
228
-     *
229
-     * @param $bool
230
-     */
231
-    public function setIgnoreNotImportedAnnotations($bool)
232
-    {
233
-        $this->ignoreNotImportedAnnotations = (Boolean) $bool;
234
-    }
235
-
236
-    /**
237
-     * Sets the default namespaces.
238
-     *
239
-     * @param array $namespace
240
-     *
241
-     * @throws \RuntimeException
242
-     */
243
-    public function addNamespace($namespace)
244
-    {
245
-        if ($this->imports) {
246
-            throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.');
247
-        }
248
-        $this->namespaces[] = $namespace;
249
-    }
250
-
251
-    /**
252
-     * Sets the imports
253
-     *
254
-     * @param array $imports
255
-     * @throws \RuntimeException
256
-     */
257
-    public function setImports(array $imports)
258
-    {
259
-        if ($this->namespaces) {
260
-            throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.');
261
-        }
262
-        $this->imports = $imports;
263
-    }
264
-
265
-     /**
266
-     * Sets current target context as bitmask.
267
-     *
268
-     * @param integer $target
269
-     */
270
-    public function setTarget($target)
271
-    {
272
-        $this->target = $target;
273
-    }
274
-
275
-    /**
276
-     * Parses the given docblock string for annotations.
277
-     *
278
-     * @param string $input The docblock string to parse.
279
-     * @param string $context The parsing context.
280
-     * @return array Array of annotations. If no annotations are found, an empty array is returned.
281
-     */
282
-    public function parse($input, $context = '')
283
-    {
284
-        if (false === $pos = strpos($input, '@')) {
285
-            return array();
286
-        }
287
-
288
-        // also parse whatever character is before the @
289
-        if ($pos > 0) {
290
-            $pos -= 1;
291
-        }
292
-
293
-        $this->context = $context;
294
-        $this->lexer->setInput(trim(substr($input, $pos), '* /'));
295
-        $this->lexer->moveNext();
296
-
297
-        return $this->Annotations();
298
-    }
299
-
300
-    /**
301
-     * Attempts to match the given token with the current lookahead token.
302
-     * If they match, updates the lookahead token; otherwise raises a syntax error.
303
-     *
304
-     * @param int $token type of Token.
305
-     * @return bool True if tokens match; false otherwise.
306
-     */
307
-    private function match($token)
308
-    {
309
-        if ( ! $this->lexer->isNextToken($token) ) {
310
-            $this->syntaxError($this->lexer->getLiteral($token));
311
-        }
312
-
313
-        return $this->lexer->moveNext();
314
-    }
315
-
316
-    /**
317
-     * Attempts to match the current lookahead token with any of the given tokens.
318
-     *
319
-     * If any of them matches, this method updates the lookahead token; otherwise
320
-     * a syntax error is raised.
321
-     *
322
-     * @param array $tokens
323
-     * @return bool
324
-     */
325
-    private function matchAny(array $tokens)
326
-    {
327
-        if ( ! $this->lexer->isNextTokenAny($tokens)) {
328
-            $this->syntaxError(implode(' or ', array_map(array($this->lexer, 'getLiteral'), $tokens)));
329
-        }
330
-
331
-        return $this->lexer->moveNext();
332
-    }
333
-
334
-    /**
335
-     * Generates a new syntax error.
336
-     *
337
-     * @param string $expected Expected string.
338
-     * @param array $token Optional token.
339
-     *
340
-     * @throws AnnotationException
341
-     */
342
-    private function syntaxError($expected, $token = null)
343
-    {
344
-        if ($token === null) {
345
-            $token = $this->lexer->lookahead;
346
-        }
347
-
348
-        $message =  "Expected {$expected}, got ";
349
-
350
-        if ($this->lexer->lookahead === null) {
351
-            $message .= 'end of string';
352
-        } else {
353
-            $message .= "'{$token['value']}' at position {$token['position']}";
354
-        }
355
-
356
-        if (strlen($this->context)) {
357
-            $message .= ' in ' . $this->context;
358
-        }
359
-
360
-        $message .= '.';
361
-
362
-        throw AnnotationException::syntaxError($message);
363
-    }
364
-
365
-    /**
366
-     * Attempt to check if a class exists or not. This never goes through the PHP autoloading mechanism
367
-     * but uses the {@link AnnotationRegistry} to load classes.
368
-     *
369
-     * @param string $fqcn
370
-     * @return boolean
371
-     */
372
-    private function classExists($fqcn)
373
-    {
374
-        if (isset($this->classExists[$fqcn])) {
375
-            return $this->classExists[$fqcn];
376
-        }
377
-
378
-        // first check if the class already exists, maybe loaded through another AnnotationReader
379
-        if (class_exists($fqcn, false)) {
380
-            return $this->classExists[$fqcn] = true;
381
-        }
382
-
383
-        // final check, does this class exist?
384
-        return $this->classExists[$fqcn] = AnnotationRegistry::loadAnnotationClass($fqcn);
385
-    }
386
-
387
-    /**
388
-     * Collects parsing metadata for a given annotation class
389
-     *
390
-     * @param string $name The annotation name
391
-     */
392
-    private function collectAnnotationMetadata($name)
393
-    {
394
-        if (self::$metadataParser == null){
395
-            self::$metadataParser = new self();
396
-            self::$metadataParser->setTarget(Target::TARGET_CLASS);
397
-            self::$metadataParser->setIgnoreNotImportedAnnotations(true);
398
-            self::$metadataParser->setImports(array(
399
-                'target'        => 'Doctrine\Common\Annotations\Annotation\Target',
400
-                'attribute'     => 'Doctrine\Common\Annotations\Annotation\Attribute',
401
-                'attributes'    => 'Doctrine\Common\Annotations\Annotation\Attributes'
402
-            ));
403
-            AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Target.php');
404
-            AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attribute.php');
405
-            AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attributes.php');
406
-        }
407
-
408
-        $class      = new \ReflectionClass($name);
409
-        $docComment = $class->getDocComment();
410
-
411
-        // Sets default values for annotation metadata
412
-        $metadata = array(
413
-            'default_property' => null,
414
-            'has_constructor'  => (null !== $constructor = $class->getConstructor()) && $constructor->getNumberOfParameters() > 0,
415
-            'properties'       => array(),
416
-            'property_types'   => array(),
417
-            'attribute_types'  => array(),
418
-            'targets_literal'  => null,
419
-            'targets'          => Target::TARGET_ALL,
420
-            'is_annotation'    => false !== strpos($docComment, '@Annotation'),
421
-        );
422
-
423
-        // verify that the class is really meant to be an annotation
424
-        if ($metadata['is_annotation']) {
425
-            foreach (self::$metadataParser->parse($docComment, 'class @' . $name) as $annotation) {
426
-                if ($annotation instanceof Target) {
427
-                    $metadata['targets']         = $annotation->targets;
428
-                    $metadata['targets_literal'] = $annotation->literal;
429
-
430
-                } elseif ($annotation instanceof Attributes) {
431
-                    foreach ($annotation->value as $attrib) {
432
-                        // handle internal type declaration
433
-                        $type = isset(self::$typeMap[$attrib->type]) ? self::$typeMap[$attrib->type] : $attrib->type;
434
-
435
-                        // handle the case if the property type is mixed
436
-                        if ('mixed' !== $type) {
437
-                            // Checks if the property has array<type>
438
-                            if (false !== $pos = strpos($type, '<')) {
439
-                                $arrayType  = substr($type, $pos+1, -1);
440
-                                $type       = 'array';
441
-
442
-                                if (isset(self::$typeMap[$arrayType])) {
443
-                                    $arrayType = self::$typeMap[$arrayType];
444
-                                }
445
-
446
-                                $metadata['attribute_types'][$attrib->name]['array_type'] = $arrayType;
447
-                            }
448
-
449
-                            $metadata['attribute_types'][$attrib->name]['type']     = $type;
450
-                            $metadata['attribute_types'][$attrib->name]['value']    = $attrib->type;
451
-                            $metadata['attribute_types'][$attrib->name]['required'] = $attrib->required;
452
-                        }
453
-                    }
454
-                }
455
-            }
456
-
457
-            // if not has a constructor will inject values into public properties
458
-            if (false === $metadata['has_constructor']) {
459
-                // collect all public properties
460
-                foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
461
-                    $metadata['properties'][$property->name] = $property->name;
462
-
463
-                    // checks if the property has @var annotation
464
-                    if ((false !== $propertyComment = $property->getDocComment())
465
-                        && false !== strpos($propertyComment, '@var')
466
-                        && preg_match('/@var\s+([^\s]+)/',$propertyComment, $matches)) {
467
-                        // literal type declaration
468
-                        $value = $matches[1];
469
-
470
-                        // handle internal type declaration
471
-                        $type = isset(self::$typeMap[$value]) ? self::$typeMap[$value] : $value;
472
-
473
-                        // handle the case if the property type is mixed
474
-                        if ('mixed' !== $type) {
475
-                            // Checks if the property has @var array<type> annotation
476
-                            if (false !== $pos = strpos($type, '<')) {
477
-                                $arrayType = substr($type, $pos+1, -1);
478
-                                $type = 'array';
479
-
480
-                                if (isset(self::$typeMap[$arrayType])) {
481
-                                    $arrayType = self::$typeMap[$arrayType];
482
-                                }
483
-
484
-                                $metadata['attribute_types'][$property->name]['array_type'] = $arrayType;
485
-                            }
486
-
487
-                            $metadata['attribute_types'][$property->name]['type']       = $type;
488
-                            $metadata['attribute_types'][$property->name]['value']      = $value;
489
-                            $metadata['attribute_types'][$property->name]['required']   = false !== strpos($propertyComment, '@Required');
490
-                        }
491
-                    }
492
-                }
493
-
494
-                // choose the first property as default property
495
-                $metadata['default_property'] = reset($metadata['properties']);
496
-            }
497
-        }
498
-
499
-        self::$annotationMetadata[$name] = $metadata;
500
-    }
501
-
502
-    /**
503
-     * Annotations ::= Annotation {[ "*" ]* [Annotation]}*
504
-     *
505
-     * @return array
506
-     */
507
-    private function Annotations()
508
-    {
509
-        $annotations = array();
510
-
511
-        while (null !== $this->lexer->lookahead) {
512
-            if (DocLexer::T_AT !== $this->lexer->lookahead['type']) {
513
-                $this->lexer->moveNext();
514
-                continue;
515
-            }
516
-
517
-            // make sure the @ is preceded by non-catchable pattern
518
-            if (null !== $this->lexer->token && $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value'])) {
519
-                $this->lexer->moveNext();
520
-                continue;
521
-            }
522
-
523
-            // make sure the @ is followed by either a namespace separator, or
524
-            // an identifier token
525
-            if ((null === $peek = $this->lexer->glimpse())
526
-                || (DocLexer::T_NAMESPACE_SEPARATOR !== $peek['type'] && !in_array($peek['type'], self::$classIdentifiers, true))
527
-                || $peek['position'] !== $this->lexer->lookahead['position'] + 1) {
528
-                $this->lexer->moveNext();
529
-                continue;
530
-            }
531
-
532
-            $this->isNestedAnnotation = false;
533
-            if (false !== $annot = $this->Annotation()) {
534
-                $annotations[] = $annot;
535
-            }
536
-        }
537
-
538
-        return $annotations;
539
-    }
540
-
541
-    /**
542
-     * Annotation     ::= "@" AnnotationName ["(" [Values] ")"]
543
-     * AnnotationName ::= QualifiedName | SimpleName
544
-     * QualifiedName  ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName
545
-     * NameSpacePart  ::= identifier | null | false | true
546
-     * SimpleName     ::= identifier | null | false | true
547
-     *
548
-     * @throws AnnotationException
549
-     * @return mixed False if it is not a valid annotation.
550
-     */
551
-    private function Annotation()
552
-    {
553
-        $this->match(DocLexer::T_AT);
554
-
555
-        // check if we have an annotation
556
-        $name = $this->Identifier();
557
-
558
-        // only process names which are not fully qualified, yet
559
-        // fully qualified names must start with a \
560
-        $originalName = $name;
561
-        if ('\\' !== $name[0]) {
562
-            $alias = (false === $pos = strpos($name, '\\'))? $name : substr($name, 0, $pos);
563
-
564
-            $found = false;
565
-            if ($this->namespaces) {
566
-                foreach ($this->namespaces as $namespace) {
567
-                    if ($this->classExists($namespace.'\\'.$name)) {
568
-                        $name = $namespace.'\\'.$name;
569
-                        $found = true;
570
-                        break;
571
-                    }
572
-                }
573
-            } elseif (isset($this->imports[$loweredAlias = strtolower($alias)])) {
574
-                if (false !== $pos) {
575
-                    $name = $this->imports[$loweredAlias].substr($name, $pos);
576
-                } else {
577
-                    $name = $this->imports[$loweredAlias];
578
-                }
579
-                $found = true;
580
-            } elseif (isset($this->imports['__NAMESPACE__']) && $this->classExists($this->imports['__NAMESPACE__'].'\\'.$name)) {
581
-                 $name = $this->imports['__NAMESPACE__'].'\\'.$name;
582
-                 $found = true;
583
-            } elseif ($this->classExists($name)) {
584
-                $found = true;
585
-            }
586
-
587
-            if (!$found) {
588
-                if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) {
589
-                    return false;
590
-                }
591
-
592
-                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));
593
-            }
594
-        }
595
-
596
-        if (!$this->classExists($name)) {
597
-            throw AnnotationException::semanticalError(sprintf('The annotation "@%s" in %s does not exist, or could not be auto-loaded.', $name, $this->context));
598
-        }
599
-
600
-        // at this point, $name contains the fully qualified class name of the
601
-        // annotation, and it is also guaranteed that this class exists, and
602
-        // that it is loaded
603
-
604
-
605
-        // collects the metadata annotation only if there is not yet
606
-        if (!isset(self::$annotationMetadata[$name])) {
607
-            $this->collectAnnotationMetadata($name);
608
-        }
609
-
610
-        // verify that the class is really meant to be an annotation and not just any ordinary class
611
-        if (self::$annotationMetadata[$name]['is_annotation'] === false) {
612
-            if (isset($this->ignoredAnnotationNames[$originalName])) {
613
-                return false;
614
-            }
615
-
616
-            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));
617
-        }
618
-
619
-        //if target is nested annotation
620
-        $target = $this->isNestedAnnotation ? Target::TARGET_ANNOTATION : $this->target;
621
-
622
-        // Next will be nested
623
-        $this->isNestedAnnotation = true;
624
-
625
-        //if annotation does not support current target
626
-        if (0 === (self::$annotationMetadata[$name]['targets'] & $target) && $target) {
627
-            throw AnnotationException::semanticalError(
628
-                sprintf('Annotation @%s is not allowed to be declared on %s. You may only use this annotation on these code elements: %s.',
629
-                     $originalName, $this->context, self::$annotationMetadata[$name]['targets_literal'])
630
-            );
631
-        }
632
-
633
-        $values = array();
634
-        if ($this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) {
635
-            $this->match(DocLexer::T_OPEN_PARENTHESIS);
636
-
637
-            if ( ! $this->lexer->isNextToken(DocLexer::T_CLOSE_PARENTHESIS)) {
638
-                $values = $this->Values();
639
-            }
640
-
641
-            $this->match(DocLexer::T_CLOSE_PARENTHESIS);
642
-        }
643
-
644
-        // checks all declared attributes
645
-        foreach (self::$annotationMetadata[$name]['attribute_types'] as $property => $type) {
646
-            if ($property === self::$annotationMetadata[$name]['default_property']
647
-                && !isset($values[$property]) && isset($values['value'])) {
648
-                $property = 'value';
649
-            }
650
-
651
-            // handle a not given attribute or null value
652
-            if (!isset($values[$property])) {
653
-                if ($type['required']) {
654
-                    throw AnnotationException::requiredError($property, $originalName, $this->context, 'a(n) '.$type['value']);
655
-                }
656
-
657
-                continue;
658
-            }
659
-
660
-            if ($type['type'] === 'array') {
661
-                // handle the case of a single value
662
-                if (!is_array($values[$property])) {
663
-                    $values[$property] = array($values[$property]);
664
-                }
665
-
666
-                // checks if the attribute has array type declaration, such as "array<string>"
667
-                if (isset($type['array_type'])) {
668
-                    foreach ($values[$property] as $item) {
669
-                        if (gettype($item) !== $type['array_type'] && !$item instanceof $type['array_type']) {
670
-                            throw AnnotationException::typeError($property, $originalName, $this->context, 'either a(n) '.$type['array_type'].', or an array of '.$type['array_type'].'s', $item);
671
-                        }
672
-                    }
673
-                }
674
-            } elseif (gettype($values[$property]) !== $type['type'] && !$values[$property] instanceof $type['type']) {
675
-                throw AnnotationException::typeError($property, $originalName, $this->context, 'a(n) '.$type['value'], $values[$property]);
676
-            }
677
-        }
678
-
679
-        // check if the annotation expects values via the constructor,
680
-        // or directly injected into public properties
681
-        if (self::$annotationMetadata[$name]['has_constructor'] === true) {
682
-            return new $name($values);
683
-        }
684
-
685
-        $instance = new $name();
686
-        foreach ($values as $property => $value) {
687
-            if (!isset(self::$annotationMetadata[$name]['properties'][$property])) {
688
-                if ('value' !== $property) {
689
-                    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'])));
690
-                }
691
-
692
-                // handle the case if the property has no annotations
693
-                if (!$property = self::$annotationMetadata[$name]['default_property']) {
694
-                    throw AnnotationException::creationError(sprintf('The annotation @%s declared on %s does not accept any values, but got %s.', $originalName, $this->context, json_encode($values)));
695
-                }
696
-            }
697
-
698
-            $instance->{$property} = $value;
699
-        }
700
-
701
-        return $instance;
702
-    }
703
-
704
-    /**
705
-     * Values ::= Array | Value {"," Value}*
706
-     *
707
-     * @return array
708
-     */
709
-    private function Values()
710
-    {
711
-        $values = array();
712
-
713
-        // Handle the case of a single array as value, i.e. @Foo({....})
714
-        if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) {
715
-            $values['value'] = $this->Value();
716
-            return $values;
717
-        }
718
-
719
-        $values[] = $this->Value();
720
-
721
-        while ($this->lexer->isNextToken(DocLexer::T_COMMA)) {
722
-            $this->match(DocLexer::T_COMMA);
723
-            $token = $this->lexer->lookahead;
724
-            $value = $this->Value();
725
-
726
-            if ( ! is_object($value) && ! is_array($value)) {
727
-                $this->syntaxError('Value', $token);
728
-            }
729
-
730
-            $values[] = $value;
731
-        }
732
-
733
-        foreach ($values as $k => $value) {
734
-            if (is_object($value) && $value instanceof \stdClass) {
735
-                $values[$value->name] = $value->value;
736
-            } else if ( ! isset($values['value'])){
737
-                $values['value'] = $value;
738
-            } else {
739
-                if ( ! is_array($values['value'])) {
740
-                    $values['value'] = array($values['value']);
741
-                }
742
-
743
-                $values['value'][] = $value;
744
-            }
745
-
746
-            unset($values[$k]);
747
-        }
748
-
749
-        return $values;
750
-    }
751
-
752
-    /**
753
-     * Constant ::= integer | string | float | boolean
754
-     *
755
-     * @throws AnnotationException
756
-     * @return mixed
757
-     */
758
-    private function Constant()
759
-    {
760
-        $identifier = $this->Identifier();
761
-
762
-        if (!defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) {
763
-
764
-            list($className, $const) = explode('::', $identifier);
765
-            $alias = (false === $pos = strpos($className, '\\'))? $className : substr($className, 0, $pos);
766
-
767
-            $found = false;
768
-            switch (true) {
769
-                case !empty ($this->namespaces):
770
-                    foreach ($this->namespaces as $ns) {
771
-                        if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) {
772
-                             $className = $ns.'\\'.$className;
773
-                             $found = true;
774
-                             break;
775
-                        }
776
-                    }
777
-                    break;
778
-
779
-                case isset($this->imports[$loweredAlias = strtolower($alias)]):
780
-                    $found = true;
781
-                    if (false !== $pos) {
782
-                        $className = $this->imports[$loweredAlias].substr($className, $pos);
783
-                    } else {
784
-                        $className = $this->imports[$loweredAlias];
785
-                    }
786
-                    break;
787
-
788
-                default:
789
-                    if(isset($this->imports['__NAMESPACE__'])) {
790
-                        $ns = $this->imports['__NAMESPACE__'];
791
-                        if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) {
792
-                             $className = $ns.'\\'.$className;
793
-                             $found = true;
794
-                        }
795
-                    }
796
-                    break;
797
-            }
798
-
799
-            if ($found) {
800
-                 $identifier = $className . '::' . $const;
801
-            }
802
-        }
803
-
804
-        if (!defined($identifier)) {
805
-            throw AnnotationException::semanticalErrorConstants($identifier, $this->context);
806
-        }
807
-
808
-        return constant($identifier);
809
-    }
810
-
811
-    /**
812
-     * Identifier ::= string
813
-     *
814
-     * @return string
815
-     */
816
-    private function Identifier()
817
-    {
818
-        // check if we have an annotation
819
-        if ($this->lexer->isNextTokenAny(self::$classIdentifiers)) {
820
-            $this->lexer->moveNext();
821
-            $className = $this->lexer->token['value'];
822
-        } else {
823
-            $this->syntaxError('namespace separator or identifier');
824
-        }
825
-
826
-        while ($this->lexer->lookahead['position'] === ($this->lexer->token['position'] + strlen($this->lexer->token['value']))
827
-                && $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) {
828
-
829
-            $this->match(DocLexer::T_NAMESPACE_SEPARATOR);
830
-            $this->matchAny(self::$classIdentifiers);
831
-            $className .= '\\' . $this->lexer->token['value'];
832
-        }
833
-
834
-        return $className;
835
-    }
836
-
837
-    /**
838
-     * Value ::= PlainValue | FieldAssignment
839
-     *
840
-     * @return mixed
841
-     */
842
-    private function Value()
843
-    {
844
-        $peek = $this->lexer->glimpse();
845
-
846
-        if (DocLexer::T_EQUALS === $peek['type']) {
847
-            return $this->FieldAssignment();
848
-        }
849
-
850
-        return $this->PlainValue();
851
-    }
852
-
853
-    /**
854
-     * PlainValue ::= integer | string | float | boolean | Array | Annotation
855
-     *
856
-     * @return mixed
857
-     */
858
-    private function PlainValue()
859
-    {
860
-        if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) {
861
-            return $this->Arrayx();
862
-        }
863
-
864
-        if ($this->lexer->isNextToken(DocLexer::T_AT)) {
865
-            return $this->Annotation();
866
-        }
867
-
868
-        if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
869
-            return $this->Constant();
870
-        }
871
-
872
-        switch ($this->lexer->lookahead['type']) {
873
-            case DocLexer::T_STRING:
874
-                $this->match(DocLexer::T_STRING);
875
-                return $this->lexer->token['value'];
876
-
877
-            case DocLexer::T_INTEGER:
878
-                $this->match(DocLexer::T_INTEGER);
879
-                return (int)$this->lexer->token['value'];
880
-
881
-            case DocLexer::T_FLOAT:
882
-                $this->match(DocLexer::T_FLOAT);
883
-                return (float)$this->lexer->token['value'];
884
-
885
-            case DocLexer::T_TRUE:
886
-                $this->match(DocLexer::T_TRUE);
887
-                return true;
888
-
889
-            case DocLexer::T_FALSE:
890
-                $this->match(DocLexer::T_FALSE);
891
-                return false;
892
-
893
-            case DocLexer::T_NULL:
894
-                $this->match(DocLexer::T_NULL);
895
-                return null;
896
-
897
-            default:
898
-                $this->syntaxError('PlainValue');
899
-        }
900
-    }
901
-
902
-    /**
903
-     * FieldAssignment ::= FieldName "=" PlainValue
904
-     * FieldName ::= identifier
905
-     *
906
-     * @return array
907
-     */
908
-    private function FieldAssignment()
909
-    {
910
-        $this->match(DocLexer::T_IDENTIFIER);
911
-        $fieldName = $this->lexer->token['value'];
912
-
913
-        $this->match(DocLexer::T_EQUALS);
914
-
915
-        $item = new \stdClass();
916
-        $item->name  = $fieldName;
917
-        $item->value = $this->PlainValue();
918
-
919
-        return $item;
920
-    }
921
-
922
-    /**
923
-     * Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}"
924
-     *
925
-     * @return array
926
-     */
927
-    private function Arrayx()
928
-    {
929
-        $array = $values = array();
930
-
931
-        $this->match(DocLexer::T_OPEN_CURLY_BRACES);
932
-        $values[] = $this->ArrayEntry();
933
-
934
-        while ($this->lexer->isNextToken(DocLexer::T_COMMA)) {
935
-            $this->match(DocLexer::T_COMMA);
936
-
937
-            // optional trailing comma
938
-            if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) {
939
-                break;
940
-            }
941
-
942
-            $values[] = $this->ArrayEntry();
943
-        }
944
-
945
-        $this->match(DocLexer::T_CLOSE_CURLY_BRACES);
946
-
947
-        foreach ($values as $value) {
948
-            list ($key, $val) = $value;
949
-
950
-            if ($key !== null) {
951
-                $array[$key] = $val;
952
-            } else {
953
-                $array[] = $val;
954
-            }
955
-        }
956
-
957
-        return $array;
958
-    }
959
-
960
-    /**
961
-     * ArrayEntry ::= Value | KeyValuePair
962
-     * KeyValuePair ::= Key ("=" | ":") PlainValue | Constant
963
-     * Key ::= string | integer | Constant
964
-     *
965
-     * @return array
966
-     */
967
-    private function ArrayEntry()
968
-    {
969
-        $peek = $this->lexer->glimpse();
970
-
971
-        if (DocLexer::T_EQUALS === $peek['type']
972
-                || DocLexer::T_COLON === $peek['type']) {
973
-
974
-            if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
975
-                $key = $this->Constant();
976
-            } else {
977
-                $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING));
978
-                $key = $this->lexer->token['value'];
979
-            }
980
-
981
-            $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON));
982
-
983
-            return array($key, $this->PlainValue());
984
-        }
985
-
986
-        return array(null, $this->Value());
987
-    }
988
-}

+ 0 - 258
vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php View File

@@ -1,258 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-
23
-/**
24
- * File cache reader for annotations.
25
- *
26
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
27
- * @author Benjamin Eberlei <kontakt@beberlei.de>
28
- */
29
-class FileCacheReader implements Reader
30
-{
31
-    /**
32
-     * @var Reader
33
-     */
34
-    private $reader;
35
-
36
-    /**
37
-     * @var string
38
-     */
39
-    private $dir;
40
-
41
-    /**
42
-     * @var bool
43
-     */
44
-    private $debug;
45
-
46
-    /**
47
-     * @var array
48
-     */
49
-    private $loadedAnnotations = array();
50
-
51
-    /**
52
-     * Constructor
53
-     *
54
-     * @param Reader $reader
55
-     * @param string $cacheDir
56
-     * @param bool $debug
57
-     *
58
-     * @throws \InvalidArgumentException
59
-     */
60
-    public function __construct(Reader $reader, $cacheDir, $debug = false)
61
-    {
62
-        $this->reader = $reader;
63
-        if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true)) {
64
-            throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist and could not be created.', $cacheDir));
65
-        }
66
-        if (!is_writable($cacheDir)) {
67
-            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));
68
-        }
69
-
70
-        $this->dir   = rtrim($cacheDir, '\\/');
71
-        $this->debug = $debug;
72
-    }
73
-
74
-    /**
75
-     * Retrieve annotations for class
76
-     *
77
-     * @param \ReflectionClass $class
78
-     * @return array
79
-     */
80
-    public function getClassAnnotations(\ReflectionClass $class)
81
-    {
82
-        $key = $class->getName();
83
-
84
-        if (isset($this->loadedAnnotations[$key])) {
85
-            return $this->loadedAnnotations[$key];
86
-        }
87
-
88
-        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
89
-        if (!file_exists($path)) {
90
-            $annot = $this->reader->getClassAnnotations($class);
91
-            $this->saveCacheFile($path, $annot);
92
-            return $this->loadedAnnotations[$key] = $annot;
93
-        }
94
-
95
-        if ($this->debug
96
-            && (false !== $filename = $class->getFilename())
97
-            && filemtime($path) < filemtime($filename)) {
98
-            @unlink($path);
99
-
100
-            $annot = $this->reader->getClassAnnotations($class);
101
-            $this->saveCacheFile($path, $annot);
102
-            return $this->loadedAnnotations[$key] = $annot;
103
-        }
104
-
105
-        return $this->loadedAnnotations[$key] = include $path;
106
-    }
107
-
108
-    /**
109
-     * Get annotations for property
110
-     *
111
-     * @param \ReflectionProperty $property
112
-     * @return array
113
-     */
114
-    public function getPropertyAnnotations(\ReflectionProperty $property)
115
-    {
116
-        $class = $property->getDeclaringClass();
117
-        $key = $class->getName().'$'.$property->getName();
118
-
119
-        if (isset($this->loadedAnnotations[$key])) {
120
-            return $this->loadedAnnotations[$key];
121
-        }
122
-
123
-        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
124
-        if (!file_exists($path)) {
125
-            $annot = $this->reader->getPropertyAnnotations($property);
126
-            $this->saveCacheFile($path, $annot);
127
-            return $this->loadedAnnotations[$key] = $annot;
128
-        }
129
-
130
-        if ($this->debug
131
-            && (false !== $filename = $class->getFilename())
132
-            && filemtime($path) < filemtime($filename)) {
133
-            unlink($path);
134
-
135
-            $annot = $this->reader->getPropertyAnnotations($property);
136
-            $this->saveCacheFile($path, $annot);
137
-            return $this->loadedAnnotations[$key] = $annot;
138
-        }
139
-
140
-        return $this->loadedAnnotations[$key] = include $path;
141
-    }
142
-
143
-    /**
144
-     * Retrieve annotations for method
145
-     *
146
-     * @param \ReflectionMethod $method
147
-     * @return array
148
-     */
149
-    public function getMethodAnnotations(\ReflectionMethod $method)
150
-    {
151
-        $class = $method->getDeclaringClass();
152
-        $key = $class->getName().'#'.$method->getName();
153
-
154
-        if (isset($this->loadedAnnotations[$key])) {
155
-            return $this->loadedAnnotations[$key];
156
-        }
157
-
158
-        $path = $this->dir.'/'.strtr($key, '\\', '-').'.cache.php';
159
-        if (!file_exists($path)) {
160
-            $annot = $this->reader->getMethodAnnotations($method);
161
-            $this->saveCacheFile($path, $annot);
162
-            return $this->loadedAnnotations[$key] = $annot;
163
-        }
164
-
165
-        if ($this->debug
166
-            && (false !== $filename = $class->getFilename())
167
-            && filemtime($path) < filemtime($filename)) {
168
-            unlink($path);
169
-
170
-            $annot = $this->reader->getMethodAnnotations($method);
171
-            $this->saveCacheFile($path, $annot);
172
-            return $this->loadedAnnotations[$key] = $annot;
173
-        }
174
-
175
-        return $this->loadedAnnotations[$key] = include $path;
176
-    }
177
-
178
-    /**
179
-     * Save cache file
180
-     *
181
-     * @param string $path
182
-     * @param mixed $data
183
-     */
184
-    private function saveCacheFile($path, $data)
185
-    {
186
-        file_put_contents($path, '<?php return unserialize('.var_export(serialize($data), true).');');
187
-    }
188
-
189
-    /**
190
-     * Gets a class annotation.
191
-     *
192
-     * @param \ReflectionClass $class The ReflectionClass of the class from which
193
-     *                               the class annotations should be read.
194
-     * @param string $annotationName The name of the annotation.
195
-     *
196
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
197
-     */
198
-    public function getClassAnnotation(\ReflectionClass $class, $annotationName)
199
-    {
200
-        $annotations = $this->getClassAnnotations($class);
201
-
202
-        foreach ($annotations as $annotation) {
203
-            if ($annotation instanceof $annotationName) {
204
-                return $annotation;
205
-            }
206
-        }
207
-
208
-        return null;
209
-    }
210
-
211
-    /**
212
-     * Gets a method annotation.
213
-     *
214
-     * @param \ReflectionMethod $method
215
-     * @param string $annotationName The name of the annotation.
216
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
217
-     */
218
-    public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
219
-    {
220
-        $annotations = $this->getMethodAnnotations($method);
221
-
222
-        foreach ($annotations as $annotation) {
223
-            if ($annotation instanceof $annotationName) {
224
-                return $annotation;
225
-            }
226
-        }
227
-
228
-        return null;
229
-    }
230
-
231
-    /**
232
-     * Gets a property annotation.
233
-     *
234
-     * @param \ReflectionProperty $property
235
-     * @param string $annotationName The name of the annotation.
236
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
237
-     */
238
-    public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
239
-    {
240
-        $annotations = $this->getPropertyAnnotations($property);
241
-
242
-        foreach ($annotations as $annotation) {
243
-            if ($annotation instanceof $annotationName) {
244
-                return $annotation;
245
-            }
246
-        }
247
-
248
-        return null;
249
-    }
250
-
251
-    /**
252
-     * Clear stores annotations
253
-     */
254
-    public function clearLoadedAnnotations()
255
-    {
256
-        $this->loadedAnnotations = array();
257
-    }
258
-}

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

@@ -1,141 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-use Doctrine\Common\Annotations\Reader;
23
-
24
-/**
25
- * Allows the reader to be used in-place of Doctrine's reader.
26
- *
27
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
28
- */
29
-class IndexedReader implements Reader
30
-{
31
-    /**
32
-     * @var Reader
33
-     */
34
-    private $delegate;
35
-
36
-    /**
37
-     * Constructor
38
-     *
39
-     * @param Reader $reader
40
-     */
41
-    public function __construct(Reader $reader)
42
-    {
43
-        $this->delegate = $reader;
44
-    }
45
-
46
-    /**
47
-     * Get Annotations for class
48
-     *
49
-     * @param \ReflectionClass $class
50
-     * @return array
51
-     */
52
-    public function getClassAnnotations(\ReflectionClass $class)
53
-    {
54
-        $annotations = array();
55
-        foreach ($this->delegate->getClassAnnotations($class) as $annot) {
56
-            $annotations[get_class($annot)] = $annot;
57
-        }
58
-
59
-        return $annotations;
60
-    }
61
-
62
-    /**
63
-     * Get selected annotation for class
64
-     *
65
-     * @param \ReflectionClass $class
66
-     * @param string $annotation
67
-     * @return mixed
68
-     */
69
-    public function getClassAnnotation(\ReflectionClass $class, $annotation)
70
-    {
71
-        return $this->delegate->getClassAnnotation($class, $annotation);
72
-    }
73
-
74
-    /**
75
-     * Get Annotations for method
76
-     *
77
-     * @param \ReflectionMethod $method
78
-     * @return array
79
-     */
80
-    public function getMethodAnnotations(\ReflectionMethod $method)
81
-    {
82
-        $annotations = array();
83
-        foreach ($this->delegate->getMethodAnnotations($method) as $annot) {
84
-            $annotations[get_class($annot)] = $annot;
85
-        }
86
-
87
-        return $annotations;
88
-    }
89
-
90
-    /**
91
-     * Get selected annotation for method
92
-     *
93
-     * @param \ReflectionMethod $method
94
-     * @param string $annotation
95
-     * @return mixed
96
-     */
97
-    public function getMethodAnnotation(\ReflectionMethod $method, $annotation)
98
-    {
99
-        return $this->delegate->getMethodAnnotation($method, $annotation);
100
-    }
101
-
102
-    /**
103
-     * Get annotations for property
104
-     *
105
-     * @param \ReflectionProperty $property
106
-     * @return array
107
-     */
108
-    public function getPropertyAnnotations(\ReflectionProperty $property)
109
-    {
110
-        $annotations = array();
111
-        foreach ($this->delegate->getPropertyAnnotations($property) as $annot) {
112
-            $annotations[get_class($annot)] = $annot;
113
-        }
114
-
115
-        return $annotations;
116
-    }
117
-
118
-    /**
119
-     * Get selected annotation for property
120
-     *
121
-     * @param \ReflectionProperty $property
122
-     * @param string $annotation
123
-     * @return mixed
124
-     */
125
-    public function getPropertyAnnotation(\ReflectionProperty $property, $annotation)
126
-    {
127
-        return $this->delegate->getPropertyAnnotation($property, $annotation);
128
-    }
129
-
130
-    /**
131
-     * Proxy all methods to the delegate.
132
-     *
133
-     * @param string $method
134
-     * @param array $args
135
-     * @return mixed
136
-     */
137
-    public function __call($method, $args)
138
-    {
139
-        return call_user_func_array(array($this->delegate, $method), $args);
140
-    }
141
-}

+ 0 - 80
vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php View File

@@ -1,80 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-use SplFileObject;
23
-
24
-/**
25
- * Parses a file for namespaces/use/class declarations.
26
- *
27
- * @author Fabien Potencier <fabien@symfony.com>
28
- * @author Christian Kaps <christian.kaps@mohiva.com>
29
- */
30
-final class PhpParser
31
-{
32
-    /**
33
-     * Parses a class.
34
-     *
35
-     * @param  \ReflectionClass $class A <code>ReflectionClass</code> object.
36
-     * @return array            A list with use statements in the form (Alias => FQN).
37
-     */
38
-    public function parseClass(\ReflectionClass $class)
39
-    {
40
-        if (method_exists($class, 'getUseStatements')) {
41
-            return $class->getUseStatements();
42
-        }
43
-
44
-        if (false === $filename = $class->getFilename()) {
45
-            return array();
46
-        }
47
-
48
-        $content = $this->getFileContent($filename, $class->getStartLine());
49
-        $namespace = str_replace('\\', '\\\\', $class->getNamespaceName());
50
-        $content = preg_replace('/^.*?(\bnamespace\s+' . $namespace . '\s*[;{].*)$/s', '\\1', $content);
51
-        $tokenizer = new TokenParser('<?php ' . $content);
52
-
53
-        $statements = $tokenizer->parseUseStatements($class->getNamespaceName());
54
-
55
-        return $statements;
56
-    }
57
-
58
-    /**
59
-     * Get the content of the file right up to the given line number.
60
-     *
61
-     * @param  string $filename   The name of the file to load.
62
-     * @param  int    $lineNumber The number of lines to read from file.
63
-     * @return string The content of the file.
64
-     */
65
-    private function getFileContent($filename, $lineNumber)
66
-    {
67
-        $content = '';
68
-        $lineCnt = 0;
69
-        $file = new SplFileObject($filename);
70
-        while (!$file->eof()) {
71
-            if ($lineCnt++ == $lineNumber) {
72
-                break;
73
-            }
74
-
75
-            $content .= $file->fgets();
76
-        }
77
-
78
-        return $content;
79
-    }
80
-}

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

@@ -1,67 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-/**
23
- * Interface for annotation readers.
24
- *
25
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
26
- */
27
-interface Reader
28
-{
29
-    /**
30
-     * @param \ReflectionClass $class
31
-     * @return mixed
32
-     */
33
-    function getClassAnnotations(\ReflectionClass $class);
34
-
35
-    /**
36
-     * @param \ReflectionClass $class
37
-     * @param string $annotationName
38
-     * @return mixed
39
-     */
40
-    function getClassAnnotation(\ReflectionClass $class, $annotationName);
41
-
42
-    /**
43
-     * @param \ReflectionMethod $method
44
-     * @return mixed
45
-     */
46
-    function getMethodAnnotations(\ReflectionMethod $method);
47
-
48
-    /**
49
-     * @param \ReflectionMethod $method
50
-     * @param string $annotationName
51
-     * @return mixed
52
-     */
53
-    function getMethodAnnotation(\ReflectionMethod $method, $annotationName);
54
-
55
-    /**
56
-     * @param \ReflectionProperty $property
57
-     * @return mixed
58
-     */
59
-    function getPropertyAnnotations(\ReflectionProperty $property);
60
-
61
-    /**
62
-     * @param \ReflectionProperty $property
63
-     * @param string $annotationName
64
-     * @return mixed
65
-     */
66
-    function getPropertyAnnotation(\ReflectionProperty $property, $annotationName);
67
-}

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

@@ -1,157 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-use Doctrine\Common\Annotations\Annotation\Target;
23
-
24
-/**
25
- * Simple Annotation Reader.
26
- *
27
- * This annotation reader is intended to be used in projects where you have
28
- * full-control over all annotations that are available.
29
- *
30
- * @since  2.2
31
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
32
- * @author Fabio B. Silva <fabio.bat.silva@gmail.com>
33
- */
34
-class SimpleAnnotationReader implements Reader
35
-{
36
-    /**
37
-     * @var DocParser
38
-     */
39
-    private $parser;
40
-
41
-    /**
42
-     * Constructor.
43
-     *
44
-     * Initializes a new SimpleAnnotationReader.
45
-     */
46
-    public function __construct()
47
-    {
48
-        $this->parser = new DocParser();
49
-        $this->parser->setIgnoreNotImportedAnnotations(true);
50
-    }
51
-
52
-    /**
53
-     * Adds a namespace in which we will look for annotations.
54
-     *
55
-     * @param string $namespace
56
-     */
57
-    public function addNamespace($namespace)
58
-    {
59
-        $this->parser->addNamespace($namespace);
60
-    }
61
-
62
-    /**
63
-     * Gets the annotations applied to a class.
64
-     *
65
-     * @param \ReflectionClass $class The ReflectionClass of the class from which
66
-     *                               the class annotations should be read.
67
-     *
68
-     * @return array An array of Annotations.
69
-     */
70
-    public function getClassAnnotations(\ReflectionClass $class)
71
-    {
72
-        return $this->parser->parse($class->getDocComment(), 'class '.$class->getName());
73
-    }
74
-
75
-    /**
76
-     * Gets the annotations applied to a method.
77
-     *
78
-     * @param \ReflectionMethod $method The ReflectionMethod of the method from which
79
-     *                                   the annotations should be read.
80
-     *
81
-     * @return array An array of Annotations.
82
-     */
83
-    public function getMethodAnnotations(\ReflectionMethod $method)
84
-    {
85
-        return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()');
86
-    }
87
-
88
-    /**
89
-     * Gets the annotations applied to a property.
90
-     *
91
-     * @param \ReflectionProperty $property The ReflectionProperty of the property
92
-     *                                     from which the annotations should be read.
93
-     *
94
-     * @return array An array of Annotations.
95
-     */
96
-    public function getPropertyAnnotations(\ReflectionProperty $property)
97
-    {
98
-        return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName());
99
-    }
100
-
101
-    /**
102
-     * Gets a class annotation.
103
-     *
104
-     * @param \ReflectionClass $class The ReflectionClass of the class from which
105
-     *                               the class annotations should be read.
106
-     * @param string $annotationName The name of the annotation.
107
-     *
108
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
109
-     */
110
-    public function getClassAnnotation(\ReflectionClass $class, $annotationName)
111
-    {
112
-        foreach ($this->getClassAnnotations($class) as $annot) {
113
-            if ($annot instanceof $annotationName) {
114
-                return $annot;
115
-            }
116
-        }
117
-
118
-        return null;
119
-    }
120
-
121
-    /**
122
-     * Gets a method annotation.
123
-     *
124
-     * @param \ReflectionMethod $method
125
-     * @param string $annotationName The name of the annotation.
126
-     *
127
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
128
-     */
129
-    public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
130
-    {
131
-        foreach ($this->getMethodAnnotations($method) as $annot) {
132
-            if ($annot instanceof $annotationName) {
133
-                return $annot;
134
-            }
135
-        }
136
-
137
-        return null;
138
-    }
139
-
140
-    /**
141
-     * Gets a property annotation.
142
-     *
143
-     * @param \ReflectionProperty $property
144
-     * @param string $annotationName The name of the annotation.
145
-     * @return mixed The Annotation or NULL, if the requested annotation does not exist.
146
-     */
147
-    public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
148
-    {
149
-        foreach ($this->getPropertyAnnotations($property) as $annot) {
150
-            if ($annot instanceof $annotationName) {
151
-                return $annot;
152
-            }
153
-        }
154
-
155
-        return null;
156
-    }
157
-}

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

@@ -1,175 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Annotations;
21
-
22
-/**
23
- * Parses a file for namespaces/use/class declarations.
24
- *
25
- * @author Fabien Potencier <fabien@symfony.com>
26
- * @author Christian Kaps <christian.kaps@mohiva.com>
27
- */
28
-class TokenParser
29
-{
30
-    /**
31
-     * The token list.
32
-     *
33
-     * @var array
34
-     */
35
-    private $tokens;
36
-
37
-    /**
38
-     * The number of tokens.
39
-     *
40
-     * @var int
41
-     */
42
-    private $numTokens = 0;
43
-
44
-    /**
45
-     * The current array pointer.
46
-     *
47
-     * @var int
48
-     */
49
-    private $pointer = 0;
50
-
51
-    public function __construct($contents)
52
-    {
53
-        $this->tokens = token_get_all($contents);
54
-        $this->numTokens = count($this->tokens);
55
-        $this->pointer = 0;
56
-    }
57
-
58
-    /**
59
-     * Gets the next non whitespace and non comment token.
60
-     *
61
-     * @param $docCommentIsComment
62
-     *     If TRUE then a doc comment is considered a comment and skipped.
63
-     *     If FALSE then only whitespace and normal comments are skipped.
64
-     *
65
-     * @return array The token if exists, null otherwise.
66
-     */
67
-    public function next($docCommentIsComment = TRUE)
68
-    {
69
-        for ($i = $this->pointer; $i < $this->numTokens; $i++) {
70
-            $this->pointer++;
71
-            if ($this->tokens[$i][0] === T_WHITESPACE ||
72
-                $this->tokens[$i][0] === T_COMMENT ||
73
-                ($docCommentIsComment && $this->tokens[$i][0] === T_DOC_COMMENT)) {
74
-
75
-                continue;
76
-            }
77
-
78
-            return $this->tokens[$i];
79
-        }
80
-
81
-        return null;
82
-    }
83
-
84
-    /**
85
-     * Parse a single use statement.
86
-     *
87
-     * @return array A list with all found class names for a use statement.
88
-     */
89
-    public function parseUseStatement()
90
-    {
91
-        $class = '';
92
-        $alias = '';
93
-        $statements = array();
94
-        $explicitAlias = false;
95
-        while (($token = $this->next())) {
96
-            $isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR;
97
-            if (!$explicitAlias && $isNameToken) {
98
-                $class .= $token[1];
99
-                $alias = $token[1];
100
-            } else if ($explicitAlias && $isNameToken) {
101
-                $alias .= $token[1];
102
-            } else if ($token[0] === T_AS) {
103
-                $explicitAlias = true;
104
-                $alias = '';
105
-            } else if ($token === ',') {
106
-                $statements[strtolower($alias)] = $class;
107
-                $class = '';
108
-                $alias = '';
109
-                $explicitAlias = false;
110
-            } else if ($token === ';') {
111
-                $statements[strtolower($alias)] = $class;
112
-                break;
113
-            } else {
114
-                break;
115
-            }
116
-        }
117
-
118
-        return $statements;
119
-    }
120
-
121
-    /**
122
-     * Get all use statements.
123
-     *
124
-     * @param string $namespaceName The namespace name of the reflected class.
125
-     * @return array A list with all found use statements.
126
-     */
127
-    public function parseUseStatements($namespaceName)
128
-    {
129
-        $statements = array();
130
-        while (($token = $this->next())) {
131
-            if ($token[0] === T_USE) {
132
-                $statements = array_merge($statements, $this->parseUseStatement());
133
-                continue;
134
-            }
135
-            if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $namespaceName) {
136
-                continue;
137
-            }
138
-
139
-            // Get fresh array for new namespace. This is to prevent the parser to collect the use statements
140
-            // for a previous namespace with the same name. This is the case if a namespace is defined twice
141
-            // or if a namespace with the same name is commented out.
142
-            $statements = array();
143
-        }
144
-
145
-        return $statements;
146
-    }
147
-
148
-    /**
149
-     * Get the namespace.
150
-     *
151
-     * @return string The found namespace.
152
-     */
153
-    public function parseNamespace()
154
-    {
155
-        $name = '';
156
-        while (($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR)) {
157
-            $name .= $token[1];
158
-        }
159
-
160
-        return $name;
161
-    }
162
-
163
-    /**
164
-     * Get the class name.
165
-     *
166
-     * @return string The foundclass name.
167
-     */
168
-    public function parseClass()
169
-    {
170
-        // Namespaces and class names are tokenized the same: T_STRINGs
171
-        // separated by T_NS_SEPARATOR so we can use one function to provide
172
-        // both.
173
-        return $this->parseNamespace();
174
-    }
175
-}

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

@@ -1,93 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-/**
24
- * APC cache provider.
25
- *
26
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
27
- * @link    www.doctrine-project.org
28
- * @since   2.0
29
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
30
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
31
- * @author  Jonathan Wage <jonwage@gmail.com>
32
- * @author  Roman Borschel <roman@code-factory.org>
33
- * @author  David Abdemoulaie <dave@hobodave.com>
34
- */
35
-class ApcCache extends CacheProvider
36
-{
37
-    /**
38
-     * {@inheritdoc}
39
-     */
40
-    protected function doFetch($id)
41
-    {
42
-        return apc_fetch($id);
43
-    }
44
-
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    protected function doContains($id)
49
-    {
50
-        return apc_exists($id);
51
-    }
52
-
53
-    /**
54
-     * {@inheritdoc}
55
-     */
56
-    protected function doSave($id, $data, $lifeTime = 0)
57
-    {
58
-        return (bool) apc_store($id, $data, (int) $lifeTime);
59
-    }
60
-
61
-    /**
62
-     * {@inheritdoc}
63
-     */
64
-    protected function doDelete($id)
65
-    {
66
-        return apc_delete($id);
67
-    }
68
-
69
-    /**
70
-     * {@inheritdoc}
71
-     */
72
-    protected function doFlush()
73
-    {
74
-        return apc_clear_cache() && apc_clear_cache('user');
75
-    }
76
-
77
-    /**
78
-     * {@inheritdoc}
79
-     */
80
-    protected function doGetStats()
81
-    {
82
-        $info = apc_cache_info();
83
-        $sma  = apc_sma_info();
84
-
85
-        return array(
86
-            Cache::STATS_HITS              => $info['num_hits'],
87
-            Cache::STATS_MISSES            => $info['num_misses'],
88
-            Cache::STATS_UPTIME            => $info['start_time'],
89
-            Cache::STATS_MEMORY_USAGE      => $info['mem_size'],
90
-            Cache::STATS_MEMORY_AVAILIABLE => $sma['avail_mem'],
91
-        );
92
-    }
93
-}

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

@@ -1,96 +0,0 @@
1
-<?php
2
-/*
3
- *  $Id$
4
- *
5
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
- *
17
- * This software consists of voluntary contributions made by many individuals
18
- * and is licensed under the MIT license. For more information, see
19
- * <http://www.doctrine-project.org>.
20
- */
21
-
22
-namespace Doctrine\Common\Cache;
23
-
24
-/**
25
- * Array cache driver.
26
- *
27
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
28
- * @link    www.doctrine-project.org
29
- * @since   2.0
30
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
31
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
32
- * @author  Jonathan Wage <jonwage@gmail.com>
33
- * @author  Roman Borschel <roman@code-factory.org>
34
- * @author  David Abdemoulaie <dave@hobodave.com>
35
- */
36
-class ArrayCache extends CacheProvider
37
-{
38
-    /**
39
-     * @var array $data
40
-     */
41
-    private $data = array();
42
-
43
-    /**
44
-     * {@inheritdoc}
45
-     */
46
-    protected function doFetch($id)
47
-    {
48
-        return (isset($this->data[$id])) ? $this->data[$id] : false;
49
-    }
50
-
51
-    /**
52
-     * {@inheritdoc}
53
-     */
54
-    protected function doContains($id)
55
-    {
56
-        return isset($this->data[$id]);
57
-    }
58
-
59
-    /**
60
-     * {@inheritdoc}
61
-     */
62
-    protected function doSave($id, $data, $lifeTime = 0)
63
-    {
64
-        $this->data[$id] = $data;
65
-
66
-        return true;
67
-    }
68
-
69
-    /**
70
-     * {@inheritdoc}
71
-     */
72
-    protected function doDelete($id)
73
-    {
74
-        unset($this->data[$id]);
75
-
76
-        return true;
77
-    }
78
-
79
-    /**
80
-     * {@inheritdoc}
81
-     */
82
-    protected function doFlush()
83
-    {
84
-        $this->data = array();
85
-
86
-        return true;
87
-    }
88
-
89
-    /**
90
-     * {@inheritdoc}
91
-     */
92
-    protected function doGetStats()
93
-    {
94
-        return null;
95
-    }
96
-}

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

@@ -1,102 +0,0 @@
1
-<?php
2
-/*
3
- *  $Id$
4
- *
5
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
- *
17
- * This software consists of voluntary contributions made by many individuals
18
- * and is licensed under the MIT license. For more information, see
19
- * <http://www.doctrine-project.org>.
20
- */
21
-
22
-namespace Doctrine\Common\Cache;
23
-
24
-/**
25
- * Interface for cache drivers.
26
- *
27
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
28
- * @link    www.doctrine-project.org
29
- * @since   2.0
30
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
31
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
32
- * @author  Jonathan Wage <jonwage@gmail.com>
33
- * @author  Roman Borschel <roman@code-factory.org>
34
- * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
35
- */
36
-interface Cache
37
-{
38
-    const STATS_HITS    = 'hits';
39
-    const STATS_MISSES  = 'misses';
40
-    const STATS_UPTIME  = 'uptime';
41
-    const STATS_MEMORY_USAGE        = 'memory_usage';
42
-    const STATS_MEMORY_AVAILIABLE   = 'memory_available';
43
-
44
-    /**
45
-     * Fetches an entry from the cache.
46
-     *
47
-     * @param string $id cache id The id of the cache entry to fetch.
48
-     * @return mixed The cached data or FALSE, if no cache entry exists for the given id.
49
-     */
50
-    function fetch($id);
51
-
52
-    /**
53
-     * Test if an entry exists in the cache.
54
-     *
55
-     * @param string $id cache id The cache id of the entry to check for.
56
-     * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.
57
-     */
58
-    function contains($id);
59
-
60
-    /**
61
-     * Puts data into the cache.
62
-     *
63
-     * @param string $id The cache id.
64
-     * @param mixed $data The cache entry/data.
65
-     * @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
66
-     * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
67
-     */
68
-    function save($id, $data, $lifeTime = 0);
69
-
70
-    /**
71
-     * Deletes a cache entry.
72
-     *
73
-     * @param string $id cache id
74
-     * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
75
-     */
76
-    function delete($id);
77
-
78
-    /**
79
-     * Retrieves cached information from data store
80
-     *
81
-     * The server's statistics array has the following values:
82
-     *
83
-     * - <b>hits</b>
84
-     * Number of keys that have been requested and found present.
85
-     *
86
-     * - <b>misses</b>
87
-     * Number of items that have been requested and not found.
88
-     *
89
-     * - <b>uptime</b>
90
-     * Time that the server is running.
91
-     *
92
-     * - <b>memory_usage</b>
93
-     * Memory used by this server to store items.
94
-     *
95
-     * - <b>memory_available</b>
96
-     * Memory allowed to use for storage.
97
-     *
98
-     * @since   2.2
99
-     * @var     array Associative array with server's statistics if available, NULL otherwise.
100
-     */
101
-    function getStats();
102
-}

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

@@ -1,231 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-/**
24
- * Base class for cache provider implementations.
25
- *
26
- * @since   2.2
27
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
28
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
29
- * @author  Jonathan Wage <jonwage@gmail.com>
30
- * @author  Roman Borschel <roman@code-factory.org>
31
- * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
32
- */
33
-abstract class CacheProvider implements Cache
34
-{
35
-    const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]';
36
-
37
-    /**
38
-     * @var string The namespace to prefix all cache ids with
39
-     */
40
-    private $namespace = '';
41
-
42
-    /**
43
-     * @var string The namespace version
44
-     */
45
-    private $namespaceVersion;
46
-
47
-    /**
48
-     * Set the namespace to prefix all cache ids with.
49
-     *
50
-     * @param string $namespace
51
-     * @return void
52
-     */
53
-    public function setNamespace($namespace)
54
-    {
55
-        $this->namespace = (string) $namespace;
56
-    }
57
-
58
-    /**
59
-     * Retrieve the namespace that prefixes all cache ids.
60
-     *
61
-     * @return string
62
-     */
63
-    public function getNamespace()
64
-    {
65
-        return $this->namespace;
66
-    }
67
-
68
-    /**
69
-     * {@inheritdoc}
70
-     */
71
-    public function fetch($id)
72
-    {
73
-        return $this->doFetch($this->getNamespacedId($id));
74
-    }
75
-
76
-    /**
77
-     * {@inheritdoc}
78
-     */
79
-    public function contains($id)
80
-    {
81
-        return $this->doContains($this->getNamespacedId($id));
82
-    }
83
-
84
-    /**
85
-     * {@inheritdoc}
86
-     */
87
-    public function save($id, $data, $lifeTime = 0)
88
-    {
89
-        return $this->doSave($this->getNamespacedId($id), $data, $lifeTime);
90
-    }
91
-
92
-    /**
93
-     * {@inheritdoc}
94
-     */
95
-    public function delete($id)
96
-    {
97
-        return $this->doDelete($this->getNamespacedId($id));
98
-    }
99
-
100
-    /**
101
-     * {@inheritdoc}
102
-     */
103
-    public function getStats()
104
-    {
105
-        return $this->doGetStats();
106
-    }
107
-
108
-    /**
109
-     * Deletes all cache entries.
110
-     *
111
-     * @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise.
112
-     */
113
-    public function flushAll()
114
-    {
115
-        return $this->doFlush();
116
-    }
117
-
118
-    /**
119
-     * Delete all cache entries.
120
-     *
121
-     * @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise.
122
-     */
123
-    public function deleteAll()
124
-    {
125
-        $namespaceCacheKey = $this->getNamespaceCacheKey();
126
-        $namespaceVersion  = $this->getNamespaceVersion() + 1;
127
-
128
-        $this->namespaceVersion = $namespaceVersion;
129
-
130
-        return $this->doSave($namespaceCacheKey, $namespaceVersion);
131
-    }
132
-
133
-    /**
134
-     * Prefix the passed id with the configured namespace value
135
-     *
136
-     * @param string $id  The id to namespace
137
-     * @return string $id The namespaced id
138
-     */
139
-    private function getNamespacedId($id)
140
-    {
141
-        $namespaceVersion  = $this->getNamespaceVersion();
142
-
143
-        return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion);
144
-    }
145
-
146
-    /**
147
-     * Namespace cache key
148
-     *
149
-     * @return string $namespaceCacheKey
150
-     */
151
-    private function getNamespaceCacheKey()
152
-    {
153
-        return sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace);
154
-    }
155
-
156
-    /**
157
-     * Namespace version
158
-     *
159
-     * @return string $namespaceVersion
160
-     */
161
-    private function getNamespaceVersion()
162
-    {
163
-        if (null !== $this->namespaceVersion) {
164
-            return $this->namespaceVersion;
165
-        }
166
-
167
-        $namespaceCacheKey = $this->getNamespaceCacheKey();
168
-        $namespaceVersion = $this->doFetch($namespaceCacheKey);
169
-
170
-        if (false === $namespaceVersion) {
171
-            $namespaceVersion = 1;
172
-
173
-            $this->doSave($namespaceCacheKey, $namespaceVersion);
174
-        }
175
-
176
-        $this->namespaceVersion = $namespaceVersion;
177
-
178
-        return $this->namespaceVersion;
179
-    }
180
-
181
-    /**
182
-     * Fetches an entry from the cache.
183
-     *
184
-     * @param string $id cache id The id of the cache entry to fetch.
185
-     * @return string The cached data or FALSE, if no cache entry exists for the given id.
186
-     */
187
-    abstract protected function doFetch($id);
188
-
189
-    /**
190
-     * Test if an entry exists in the cache.
191
-     *
192
-     * @param string $id cache id The cache id of the entry to check for.
193
-     * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.
194
-     */
195
-    abstract protected function doContains($id);
196
-
197
-    /**
198
-     * Puts data into the cache.
199
-     *
200
-     * @param string $id The cache id.
201
-     * @param string $data The cache entry/data.
202
-     * @param bool|int $lifeTime The lifetime. If != false, sets a specific lifetime for this
203
-     *                           cache entry (null => infinite lifeTime).
204
-     *
205
-     * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
206
-     */
207
-    abstract protected function doSave($id, $data, $lifeTime = false);
208
-
209
-    /**
210
-     * Deletes a cache entry.
211
-     *
212
-     * @param string $id cache id
213
-     * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
214
-     */
215
-    abstract protected function doDelete($id);
216
-
217
-    /**
218
-     * Deletes all cache entries.
219
-     *
220
-     * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
221
-     */
222
-    abstract protected function doFlush();
223
-
224
-     /**
225
-     * Retrieves cached information from data store
226
-     *
227
-     * @since   2.2
228
-     * @return  array An associative array with server's statistics if available, NULL otherwise.
229
-     */
230
-    abstract protected function doGetStats();
231
-}

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

@@ -1,132 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-/**
24
- * Base file cache driver.
25
- *
26
- * @since   2.3
27
- * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
28
- */
29
-abstract class FileCache extends CacheProvider
30
-{
31
-    /**
32
-     * @var string Cache directory.
33
-     */
34
-    protected $directory;
35
-
36
-    /**
37
-     * @var string Cache file extension.
38
-     */
39
-    protected $extension;
40
-
41
-    /**
42
-     * Constructor
43
-     *
44
-     * @param string $directory Cache directory.
45
-     * @param string $directory Cache file extension.
46
-     *
47
-     * @throws \InvalidArgumentException
48
-     */
49
-    public function __construct($directory, $extension = null)
50
-    {
51
-        if ( ! is_dir($directory) && ! @mkdir($directory, 0777, true)) {
52
-            throw new \InvalidArgumentException(sprintf(
53
-                'The directory "%s" does not exist and could not be created.',
54
-                $directory
55
-            ));
56
-        }
57
-
58
-        if ( ! is_writable($directory)) {
59
-            throw new \InvalidArgumentException(sprintf(
60
-                'The directory "%s" is not writable.',
61
-                $directory
62
-            ));
63
-        }
64
-
65
-        $this->directory = realpath($directory);
66
-        $this->extension = $extension ?: $this->extension;
67
-    }
68
-
69
-    /**
70
-     * Gets the cache directory.
71
-     * 
72
-     * @return string
73
-     */
74
-    public function getDirectory()
75
-    {
76
-        return $this->directory;
77
-    }
78
-
79
-    /**
80
-     * Gets the cache file extension.
81
-     * 
82
-     * @return string
83
-     */
84
-    public function getExtension()
85
-    {
86
-        return $this->extension;
87
-    }
88
-
89
-    /**
90
-     * @return string
91
-     */
92
-    protected function getFilename($id)
93
-    {
94
-        $path = implode(str_split(md5($id), 12), DIRECTORY_SEPARATOR);
95
-        $path = $this->directory . DIRECTORY_SEPARATOR . $path;
96
-
97
-        return $path . DIRECTORY_SEPARATOR . $id . $this->extension;
98
-    }
99
-
100
-    /**
101
-     * {@inheritdoc}
102
-     */
103
-    protected function doDelete($id)
104
-    {
105
-        return @unlink($this->getFilename($id));
106
-    }
107
-
108
-    /**
109
-     * {@inheritdoc}
110
-     */
111
-    protected function doFlush()
112
-    {
113
-        $pattern  = '/^.+\\' . $this->extension . '$/i';
114
-        $iterator = new \RecursiveDirectoryIterator($this->directory);
115
-        $iterator = new \RecursiveIteratorIterator($iterator);
116
-        $iterator = new \RegexIterator($iterator, $pattern);
117
-
118
-        foreach ($iterator as $name => $file) {
119
-            @unlink($name);
120
-        }
121
-
122
-        return true;
123
-    }
124
-
125
-    /**
126
-     * {@inheritdoc}
127
-     */
128
-    protected function doGetStats()
129
-    {
130
-        return null;
131
-    }
132
-}

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

@@ -1,114 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-/**
24
- * Filesystem cache driver.
25
- *
26
- * @since   2.3
27
- * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
28
- */
29
-class FilesystemCache extends FileCache
30
-{
31
-    const EXTENSION = '.doctrinecache.data';
32
-
33
-    /**
34
-     * {@inheritdoc}
35
-     */
36
-    protected $extension = self::EXTENSION;
37
-
38
-    /**
39
-     * {@inheritdoc}
40
-     */
41
-    protected function doFetch($id)
42
-    {
43
-        $data     = '';
44
-        $lifetime = -1;
45
-        $filename = $this->getFilename($id);
46
-
47
-        if ( ! file_exists($filename)) {
48
-            return false;
49
-        }
50
-
51
-        $resource = fopen($filename, "r");
52
-
53
-        if (false !== ($line = fgets($resource))) {
54
-            $lifetime = (integer) $line;
55
-        }
56
-
57
-        if ($lifetime !== 0 && $lifetime < time()) {
58
-            fclose($resource);
59
-
60
-            return false;
61
-        }
62
-
63
-        while (false !== ($line = fgets($resource))) {
64
-            $data .= $line;
65
-        }
66
-
67
-        fclose($resource);
68
-
69
-        return unserialize($data);
70
-    }
71
-
72
-    /**
73
-     * {@inheritdoc}
74
-     */
75
-    protected function doContains($id)
76
-    {
77
-        $lifetime = -1;
78
-        $filename = $this->getFilename($id);
79
-
80
-        if ( ! file_exists($filename)) {
81
-            return false;
82
-        }
83
-
84
-        $resource = fopen($filename, "r");
85
-
86
-        if (false !== ($line = fgets($resource))) {
87
-            $lifetime = (integer) $line;
88
-        }
89
-
90
-        fclose($resource);
91
-
92
-        return $lifetime === 0 || $lifetime > time();
93
-    }
94
-
95
-    /**
96
-     * {@inheritdoc}
97
-     */
98
-    protected function doSave($id, $data, $lifeTime = 0)
99
-    {
100
-        if ($lifeTime > 0) {
101
-            $lifeTime = time() + $lifeTime;
102
-        }
103
-
104
-        $data       = serialize($data);
105
-        $filename   = $this->getFilename($id);
106
-        $filepath   = pathinfo($filename, PATHINFO_DIRNAME);
107
-
108
-        if ( ! is_dir($filepath)) {
109
-            mkdir($filepath, 0777, true);
110
-        }
111
-
112
-        return file_put_contents($filename, $lifeTime . PHP_EOL . $data);
113
-    }
114
-}

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

@@ -1,121 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-use \Memcache;
24
-
25
-/**
26
- * Memcache cache provider.
27
- *
28
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
29
- * @link    www.doctrine-project.org
30
- * @since   2.0
31
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
32
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
33
- * @author  Jonathan Wage <jonwage@gmail.com>
34
- * @author  Roman Borschel <roman@code-factory.org>
35
- * @author  David Abdemoulaie <dave@hobodave.com>
36
- */
37
-class MemcacheCache extends CacheProvider
38
-{
39
-    /**
40
-     * @var Memcache
41
-     */
42
-    private $memcache;
43
-
44
-    /**
45
-     * Sets the memcache instance to use.
46
-     *
47
-     * @param Memcache $memcache
48
-     */
49
-    public function setMemcache(Memcache $memcache)
50
-    {
51
-        $this->memcache = $memcache;
52
-    }
53
-
54
-    /**
55
-     * Gets the memcache instance used by the cache.
56
-     *
57
-     * @return Memcache
58
-     */
59
-    public function getMemcache()
60
-    {
61
-        return $this->memcache;
62
-    }
63
-
64
-    /**
65
-     * {@inheritdoc}
66
-     */
67
-    protected function doFetch($id)
68
-    {
69
-        return $this->memcache->get($id);
70
-    }
71
-
72
-    /**
73
-     * {@inheritdoc}
74
-     */
75
-    protected function doContains($id)
76
-    {
77
-        return (bool) $this->memcache->get($id);
78
-    }
79
-
80
-    /**
81
-     * {@inheritdoc}
82
-     */
83
-    protected function doSave($id, $data, $lifeTime = 0)
84
-    {
85
-        if ($lifeTime > 30 * 24 * 3600) {
86
-            $lifeTime = time() + $lifeTime;
87
-        }
88
-        return $this->memcache->set($id, $data, 0, (int) $lifeTime);
89
-    }
90
-
91
-    /**
92
-     * {@inheritdoc}
93
-     */
94
-    protected function doDelete($id)
95
-    {
96
-        return $this->memcache->delete($id);
97
-    }
98
-
99
-    /**
100
-     * {@inheritdoc}
101
-     */
102
-    protected function doFlush()
103
-    {
104
-        return $this->memcache->flush();
105
-    }
106
-
107
-    /**
108
-     * {@inheritdoc}
109
-     */
110
-    protected function doGetStats()
111
-    {
112
-        $stats = $this->memcache->getStats();
113
-        return array(
114
-            Cache::STATS_HITS   => $stats['get_hits'],
115
-            Cache::STATS_MISSES => $stats['get_misses'],
116
-            Cache::STATS_UPTIME => $stats['uptime'],
117
-            Cache::STATS_MEMORY_USAGE       => $stats['bytes'],
118
-            Cache::STATS_MEMORY_AVAILIABLE  => $stats['limit_maxbytes'],
119
-        );
120
-    }
121
-}

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

@@ -1,124 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-use \Memcached;
24
-
25
-/**
26
- * Memcached cache provider.
27
- *
28
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
29
- * @link    www.doctrine-project.org
30
- * @since   2.2
31
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
32
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
33
- * @author  Jonathan Wage <jonwage@gmail.com>
34
- * @author  Roman Borschel <roman@code-factory.org>
35
- * @author  David Abdemoulaie <dave@hobodave.com>
36
- */
37
-class MemcachedCache extends CacheProvider
38
-{
39
-    /**
40
-     * @var Memcached
41
-     */
42
-    private $memcached;
43
-
44
-    /**
45
-     * Sets the memcache instance to use.
46
-     *
47
-     * @param Memcached $memcached
48
-     */
49
-    public function setMemcached(Memcached $memcached)
50
-    {
51
-        $this->memcached = $memcached;
52
-    }
53
-
54
-    /**
55
-     * Gets the memcached instance used by the cache.
56
-     *
57
-     * @return Memcached
58
-     */
59
-    public function getMemcached()
60
-    {
61
-        return $this->memcached;
62
-    }
63
-
64
-    /**
65
-     * {@inheritdoc}
66
-     */
67
-    protected function doFetch($id)
68
-    {
69
-        return $this->memcached->get($id);
70
-    }
71
-
72
-    /**
73
-     * {@inheritdoc}
74
-     */
75
-    protected function doContains($id)
76
-    {
77
-        return (false !== $this->memcached->get($id));
78
-    }
79
-
80
-    /**
81
-     * {@inheritdoc}
82
-     */
83
-    protected function doSave($id, $data, $lifeTime = 0)
84
-    {
85
-        if ($lifeTime > 30 * 24 * 3600) {
86
-            $lifeTime = time() + $lifeTime;
87
-        }
88
-        return $this->memcached->set($id, $data, (int) $lifeTime);
89
-    }
90
-
91
-    /**
92
-     * {@inheritdoc}
93
-     */
94
-    protected function doDelete($id)
95
-    {
96
-        return $this->memcached->delete($id);
97
-    }
98
-
99
-    /**
100
-     * {@inheritdoc}
101
-     */
102
-    protected function doFlush()
103
-    {
104
-        return $this->memcached->flush();
105
-    }
106
-
107
-    /**
108
-     * {@inheritdoc}
109
-     */
110
-    protected function doGetStats()
111
-    {
112
-        $stats   = $this->memcached->getStats();
113
-        $servers = $this->memcached->getServerList();
114
-        $key     = $servers[0]['host'] . ':' . $servers[0]['port'];
115
-        $stats   = $stats[$key];
116
-        return array(
117
-            Cache::STATS_HITS   => $stats['get_hits'],
118
-            Cache::STATS_MISSES => $stats['get_misses'],
119
-            Cache::STATS_UPTIME => $stats['uptime'],
120
-            Cache::STATS_MEMORY_USAGE       => $stats['bytes'],
121
-            Cache::STATS_MEMORY_AVAILIABLE  => $stats['limit_maxbytes'],
122
-        );
123
-    }
124
-}

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

@@ -1,108 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-/**
24
- * Php file cache driver.
25
- *
26
- * @since   2.3
27
- * @author  Fabio B. Silva <fabio.bat.silva@gmail.com>
28
- */
29
-class PhpFileCache extends FileCache
30
-{
31
-    const EXTENSION = '.doctrinecache.php';
32
-
33
-     /**
34
-     * {@inheritdoc}
35
-     */
36
-    protected $extension = self::EXTENSION;
37
-
38
-    /**
39
-     * {@inheritdoc}
40
-     */
41
-    protected function doFetch($id)
42
-    {
43
-        $filename = $this->getFilename($id);
44
-
45
-        if ( ! file_exists($filename)) {
46
-            return false;
47
-        }
48
-
49
-        $value = include $filename;
50
-
51
-        if ($value['lifetime'] !== 0 && $value['lifetime'] < time()) {
52
-            return false;
53
-        }
54
-
55
-        return $value['data'];
56
-    }
57
-
58
-    /**
59
-     * {@inheritdoc}
60
-     */
61
-    protected function doContains($id)
62
-    {
63
-        $filename = $this->getFilename($id);
64
-
65
-        if ( ! file_exists($filename)) {
66
-            return false;
67
-        }
68
-
69
-        $value = include $filename;
70
-
71
-        return $value['lifetime'] === 0 || $value['lifetime'] > time();
72
-    }
73
-
74
-    /**
75
-     * {@inheritdoc}
76
-     */
77
-    protected function doSave($id, $data, $lifeTime = 0)
78
-    {
79
-        if ($lifeTime > 0) {
80
-            $lifeTime = time() + $lifeTime;
81
-        }
82
-
83
-        if (is_object($data) && ! method_exists($data, '__set_state')) {
84
-            throw new \InvalidArgumentException(
85
-                "Invalid argument given, PhpFileCache only allows objects that implement __set_state() " .
86
-                "and fully support var_export(). You can use the FilesystemCache to save arbitrary object " .
87
-                "graphs using serialize()/deserialize()."
88
-            );
89
-        }
90
-
91
-        $filename   = $this->getFilename($id);
92
-        $filepath   = pathinfo($filename, PATHINFO_DIRNAME);
93
-
94
-        if ( ! is_dir($filepath)) {
95
-            mkdir($filepath, 0777, true);
96
-        }
97
-
98
-        $value = array(
99
-            'lifetime'  => $lifeTime,
100
-            'data'      => $data
101
-        );
102
-
103
-        $value  = var_export($value, true);
104
-        $code   = sprintf('<?php return %s;', $value);
105
-
106
-        return file_put_contents($filename, $code);
107
-    }
108
-}

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

@@ -1,119 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-use Redis;
24
-
25
-/**
26
- * Redis cache provider.
27
- *
28
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
29
- * @link    www.doctrine-project.org
30
- * @since   2.2
31
- * @author  Osman Ungur <osmanungur@gmail.com>
32
- */
33
-class RedisCache extends CacheProvider
34
-{
35
-    /**
36
-     * @var Redis
37
-     */
38
-    private $redis;
39
-
40
-    /**
41
-     * Sets the redis instance to use.
42
-     *
43
-     * @param Redis $redis
44
-     */
45
-    public function setRedis(Redis $redis)
46
-    {
47
-        $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY);
48
-        $this->redis = $redis;
49
-    }
50
-
51
-    /**
52
-     * Gets the redis instance used by the cache.
53
-     *
54
-     * @return Redis
55
-     */
56
-    public function getRedis()
57
-    {
58
-        return $this->redis;
59
-    }
60
-
61
-    /**
62
-     * {@inheritdoc}
63
-     */
64
-    protected function doFetch($id)
65
-    {
66
-        return $this->redis->get($id);
67
-    }
68
-
69
-    /**
70
-     * {@inheritdoc}
71
-     */
72
-    protected function doContains($id)
73
-    {
74
-        return $this->redis->exists($id);
75
-    }
76
-
77
-    /**
78
-     * {@inheritdoc}
79
-     */
80
-    protected function doSave($id, $data, $lifeTime = 0)
81
-    {
82
-        $result = $this->redis->set($id, $data);
83
-        if ($lifeTime > 0) {
84
-            $this->redis->expire($id, $lifeTime);        
85
-        }
86
-        return $result;
87
-    }
88
-
89
-    /**
90
-     * {@inheritdoc}
91
-     */
92
-    protected function doDelete($id)
93
-    {
94
-        return $this->redis->delete($id);
95
-    }
96
-
97
-    /**
98
-     * {@inheritdoc}
99
-     */
100
-    protected function doFlush()
101
-    {
102
-        return $this->redis->flushDB();
103
-    }
104
-
105
-    /**
106
-     * {@inheritdoc}
107
-     */
108
-    protected function doGetStats()
109
-    {
110
-        $info = $this->redis->info();
111
-        return array(
112
-            Cache::STATS_HITS   => false,
113
-            Cache::STATS_MISSES => false,
114
-            Cache::STATS_UPTIME => $info['uptime_in_seconds'],
115
-            Cache::STATS_MEMORY_USAGE       => $info['used_memory'],
116
-            Cache::STATS_MEMORY_AVAILIABLE  => false
117
-        );
118
-    }
119
-}

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

@@ -1,93 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-/**
24
- * WinCache cache provider.
25
- *
26
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
27
- * @link    www.doctrine-project.org
28
- * @since   2.2
29
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
30
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
31
- * @author  Jonathan Wage <jonwage@gmail.com>
32
- * @author  Roman Borschel <roman@code-factory.org>
33
- * @author  David Abdemoulaie <dave@hobodave.com>
34
- */
35
-class WinCacheCache extends CacheProvider
36
-{
37
-    /**
38
-     * {@inheritdoc}
39
-     */
40
-    protected function doFetch($id)
41
-    {
42
-        return wincache_ucache_get($id);
43
-    }
44
-
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    protected function doContains($id)
49
-    {
50
-        return wincache_ucache_exists($id);
51
-    }
52
-
53
-    /**
54
-     * {@inheritdoc}
55
-     */
56
-    protected function doSave($id, $data, $lifeTime = 0)
57
-    {
58
-        return (bool) wincache_ucache_set($id, $data, (int) $lifeTime);
59
-    }
60
-
61
-    /**
62
-     * {@inheritdoc}
63
-     */
64
-    protected function doDelete($id)
65
-    {
66
-        return wincache_ucache_delete($id);
67
-    }
68
-
69
-    /**
70
-     * {@inheritdoc}
71
-     */
72
-    protected function doFlush()
73
-    {
74
-        return wincache_ucache_clear();
75
-    }
76
-
77
-    /**
78
-     * {@inheritdoc}
79
-     */
80
-    protected function doGetStats()
81
-    {
82
-        $info    = wincache_ucache_info();
83
-        $meminfo = wincache_ucache_meminfo();
84
-
85
-        return array(
86
-            Cache::STATS_HITS              => $info['total_hit_count'],
87
-            Cache::STATS_MISSES            => $info['total_miss_count'],
88
-            Cache::STATS_UPTIME            => $info['total_cache_uptime'],
89
-            Cache::STATS_MEMORY_USAGE      => $meminfo['memory_total'],
90
-            Cache::STATS_MEMORY_AVAILIABLE => $meminfo['memory_free'],
91
-        );
92
-    }
93
-}

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

@@ -1,110 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Cache;
22
-
23
-/**
24
- * Xcache cache driver.
25
- *
26
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
27
- * @link    www.doctrine-project.org
28
- * @since   2.0
29
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
30
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
31
- * @author  Jonathan Wage <jonwage@gmail.com>
32
- * @author  Roman Borschel <roman@code-factory.org>
33
- * @author  David Abdemoulaie <dave@hobodave.com>
34
- */
35
-class XcacheCache extends CacheProvider
36
-{
37
-    /**
38
-     * {@inheritdoc}
39
-     */
40
-    protected function doFetch($id)
41
-    {
42
-        return $this->doContains($id) ? unserialize(xcache_get($id)) : false;
43
-    }
44
-
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    protected function doContains($id)
49
-    {
50
-        return xcache_isset($id);
51
-    }
52
-
53
-    /**
54
-     * {@inheritdoc}
55
-     */
56
-    protected function doSave($id, $data, $lifeTime = 0)
57
-    {
58
-        return xcache_set($id, serialize($data), (int) $lifeTime);
59
-    }
60
-
61
-    /**
62
-     * {@inheritdoc}
63
-     */
64
-    protected function doDelete($id)
65
-    {
66
-        return xcache_unset($id);
67
-    }
68
-
69
-    /**
70
-     * {@inheritdoc}
71
-     */
72
-    protected function doFlush()
73
-    {
74
-        $this->checkAuthorization();
75
-
76
-        xcache_clear_cache(XC_TYPE_VAR, 0);
77
-
78
-        return true;
79
-    }
80
-
81
-    /**
82
-     * Checks that xcache.admin.enable_auth is Off
83
-     *
84
-     * @throws \BadMethodCallException When xcache.admin.enable_auth is On
85
-     * @return void
86
-     */
87
-    protected function checkAuthorization()
88
-    {
89
-        if (ini_get('xcache.admin.enable_auth')) {
90
-            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.');
91
-        }
92
-    }
93
-
94
-    /**
95
-     * {@inheritdoc}
96
-     */
97
-    protected function doGetStats()
98
-    {
99
-        $this->checkAuthorization();
100
-
101
-        $info = xcache_info(XC_TYPE_VAR, 0);
102
-        return array(
103
-            Cache::STATS_HITS   => $info['hits'],
104
-            Cache::STATS_MISSES => $info['misses'],
105
-            Cache::STATS_UPTIME => null,
106
-            Cache::STATS_MEMORY_USAGE       => $info['size'],
107
-            Cache::STATS_MEMORY_AVAILIABLE  => $info['avail'],
108
-        );
109
-    }
110
-}

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

@@ -1,84 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Cache;
21
-
22
-/**
23
- * Zend Data Cache cache driver.
24
- *
25
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
26
- * @link    www.doctrine-project.org
27
- * @since   2.0
28
- * @author  Ralph Schindler <ralph.schindler@zend.com>
29
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
30
- */
31
-class ZendDataCache extends CacheProvider
32
-{
33
-    /**
34
-     * {@inheritdoc}
35
-     */
36
-    protected function doFetch($id)
37
-    {
38
-        return zend_shm_cache_fetch($id);
39
-    }
40
-
41
-    /**
42
-     * {@inheritdoc}
43
-     */
44
-    protected function doContains($id)
45
-    {
46
-        return (false !== zend_shm_cache_fetch($id));
47
-    }
48
-
49
-    /**
50
-     * {@inheritdoc}
51
-     */
52
-    protected function doSave($id, $data, $lifeTime = 0)
53
-    {
54
-        return zend_shm_cache_store($id, $data, $lifeTime);
55
-    }
56
-
57
-    /**
58
-     * {@inheritdoc}
59
-     */
60
-    protected function doDelete($id)
61
-    {
62
-        return zend_shm_cache_delete($id);
63
-    }
64
-
65
-    /**
66
-     * {@inheritdoc}
67
-     */
68
-    protected function doFlush()
69
-    {
70
-        $namespace = $this->getNamespace();
71
-        if (empty($namespace)) {
72
-            return zend_shm_cache_clear();
73
-        }
74
-        return zend_shm_cache_clear($namespace);
75
-    }
76
-
77
-    /**
78
-     * {@inheritdoc}
79
-     */
80
-    protected function doGetStats()
81
-    {
82
-        return null;
83
-    }
84
-}

+ 0 - 263
vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php View File

@@ -1,263 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common;
21
-
22
-/**
23
- * A <tt>ClassLoader</tt> is an autoloader for class files that can be
24
- * installed on the SPL autoload stack. It is a class loader that either loads only classes
25
- * of a specific namespace or all namespaces and it is suitable for working together
26
- * with other autoloaders in the SPL autoload stack.
27
- *
28
- * If no include path is configured through the constructor or {@link setIncludePath}, a ClassLoader
29
- * relies on the PHP <code>include_path</code>.
30
- *
31
- * @author Roman Borschel <roman@code-factory.org>
32
- * @since 2.0
33
- */
34
-class ClassLoader
35
-{
36
-    /**
37
-     * @var string PHP file extension
38
-     */
39
-    protected $fileExtension = '.php';
40
-
41
-    /**
42
-     * @var string Current namespace
43
-     */
44
-    protected $namespace;
45
-
46
-    /**
47
-     * @var string Current include path
48
-     */
49
-    protected $includePath;
50
-
51
-    /**
52
-     * @var string PHP namespace separator
53
-     */
54
-    protected $namespaceSeparator = '\\';
55
-
56
-    /**
57
-     * Creates a new <tt>ClassLoader</tt> that loads classes of the
58
-     * specified namespace from the specified include path.
59
-     *
60
-     * If no include path is given, the ClassLoader relies on the PHP include_path.
61
-     * If neither a namespace nor an include path is given, the ClassLoader will
62
-     * be responsible for loading all classes, thereby relying on the PHP include_path.
63
-     *
64
-     * @param string $ns The namespace of the classes to load.
65
-     * @param string $includePath The base include path to use.
66
-     */
67
-    public function __construct($ns = null, $includePath = null)
68
-    {
69
-        $this->namespace = $ns;
70
-        $this->includePath = $includePath;
71
-    }
72
-
73
-    /**
74
-     * Sets the namespace separator used by classes in the namespace of this ClassLoader.
75
-     *
76
-     * @param string $sep The separator to use.
77
-     */
78
-    public function setNamespaceSeparator($sep)
79
-    {
80
-        $this->namespaceSeparator = $sep;
81
-    }
82
-
83
-    /**
84
-     * Gets the namespace separator used by classes in the namespace of this ClassLoader.
85
-     *
86
-     * @return string
87
-     */
88
-    public function getNamespaceSeparator()
89
-    {
90
-        return $this->namespaceSeparator;
91
-    }
92
-
93
-    /**
94
-     * Sets the base include path for all class files in the namespace of this ClassLoader.
95
-     *
96
-     * @param string $includePath
97
-     */
98
-    public function setIncludePath($includePath)
99
-    {
100
-        $this->includePath = $includePath;
101
-    }
102
-
103
-    /**
104
-     * Gets the base include path for all class files in the namespace of this ClassLoader.
105
-     *
106
-     * @return string
107
-     */
108
-    public function getIncludePath()
109
-    {
110
-        return $this->includePath;
111
-    }
112
-
113
-    /**
114
-     * Sets the file extension of class files in the namespace of this ClassLoader.
115
-     *
116
-     * @param string $fileExtension
117
-     */
118
-    public function setFileExtension($fileExtension)
119
-    {
120
-        $this->fileExtension = $fileExtension;
121
-    }
122
-
123
-    /**
124
-     * Gets the file extension of class files in the namespace of this ClassLoader.
125
-     *
126
-     * @return string
127
-     */
128
-    public function getFileExtension()
129
-    {
130
-        return $this->fileExtension;
131
-    }
132
-
133
-    /**
134
-     * Registers this ClassLoader on the SPL autoload stack.
135
-     */
136
-    public function register()
137
-    {
138
-        spl_autoload_register(array($this, 'loadClass'));
139
-    }
140
-
141
-    /**
142
-     * Removes this ClassLoader from the SPL autoload stack.
143
-     */
144
-    public function unregister()
145
-    {
146
-        spl_autoload_unregister(array($this, 'loadClass'));
147
-    }
148
-
149
-    /**
150
-     * Loads the given class or interface.
151
-     *
152
-     * @param string $className The name of the class to load.
153
-
154
-     * @return boolean TRUE if the class has been successfully loaded, FALSE otherwise.
155
-     */
156
-    public function loadClass($className)
157
-    {
158
-        if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) {
159
-            return false;
160
-        }
161
-
162
-        require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
163
-               . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className)
164
-               . $this->fileExtension;
165
-
166
-        return true;
167
-    }
168
-
169
-    /**
170
-     * Asks this ClassLoader whether it can potentially load the class (file) with
171
-     * the given name.
172
-     *
173
-     * @param string $className The fully-qualified name of the class.
174
-     * @return boolean TRUE if this ClassLoader can load the class, FALSE otherwise.
175
-     */
176
-    public function canLoadClass($className)
177
-    {
178
-        if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) {
179
-            return false;
180
-        }
181
-
182
-        $file = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension;
183
-
184
-        if ($this->includePath !== null) {
185
-            return file_exists($this->includePath . DIRECTORY_SEPARATOR . $file);
186
-        }
187
-
188
-        return (false !== stream_resolve_include_path($file));
189
-    }
190
-
191
-    /**
192
-     * Checks whether a class with a given name exists. A class "exists" if it is either
193
-     * already defined in the current request or if there is an autoloader on the SPL
194
-     * autoload stack that is a) responsible for the class in question and b) is able to
195
-     * load a class file in which the class definition resides.
196
-     *
197
-     * If the class is not already defined, each autoloader in the SPL autoload stack
198
-     * is asked whether it is able to tell if the class exists. If the autoloader is
199
-     * a <tt>ClassLoader</tt>, {@link canLoadClass} is used, otherwise the autoload
200
-     * function of the autoloader is invoked and expected to return a value that
201
-     * evaluates to TRUE if the class (file) exists. As soon as one autoloader reports
202
-     * that the class exists, TRUE is returned.
203
-     *
204
-     * Note that, depending on what kinds of autoloaders are installed on the SPL
205
-     * autoload stack, the class (file) might already be loaded as a result of checking
206
-     * for its existence. This is not the case with a <tt>ClassLoader</tt>, who separates
207
-     * these responsibilities.
208
-     *
209
-     * @param string $className The fully-qualified name of the class.
210
-     * @return boolean TRUE if the class exists as per the definition given above, FALSE otherwise.
211
-     */
212
-    public static function classExists($className)
213
-    {
214
-        if (class_exists($className, false) || interface_exists($className, false)) {
215
-            return true;
216
-        }
217
-
218
-        foreach (spl_autoload_functions() as $loader) {
219
-            if (is_array($loader)) { // array(???, ???)
220
-                if (is_object($loader[0])) {
221
-                    if ($loader[0] instanceof ClassLoader) { // array($obj, 'methodName')
222
-                        if ($loader[0]->canLoadClass($className)) {
223
-                            return true;
224
-                        }
225
-                    } else if ($loader[0]->{$loader[1]}($className)) {
226
-                        return true;
227
-                    }
228
-                } else if ($loader[0]::$loader[1]($className)) { // array('ClassName', 'methodName')
229
-                    return true;
230
-                }
231
-            } else if ($loader instanceof \Closure) { // function($className) {..}
232
-                if ($loader($className)) {
233
-                    return true;
234
-                }
235
-            } else if (is_string($loader) && $loader($className)) { // "MyClass::loadClass"
236
-                return true;
237
-            }
238
-        }
239
-
240
-        return class_exists($className, false) || interface_exists($className, false);
241
-    }
242
-
243
-    /**
244
-     * Gets the <tt>ClassLoader</tt> from the SPL autoload stack that is responsible
245
-     * for (and is able to load) the class with the given name.
246
-     *
247
-     * @param string $className The name of the class.
248
-     * @return ClassLoader The <tt>ClassLoader</tt> for the class or NULL if no such <tt>ClassLoader</tt> exists.
249
-     */
250
-    public static function getClassLoader($className)
251
-    {
252
-         foreach (spl_autoload_functions() as $loader) {
253
-            if (is_array($loader)
254
-                && $loader[0] instanceof ClassLoader
255
-                && $loader[0]->canLoadClass($className)
256
-            ) {
257
-                return $loader[0];
258
-            }
259
-        }
260
-
261
-        return null;
262
-    }
263
-}

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

@@ -1,500 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections;
21
-
22
-use Closure, ArrayIterator;
23
-use Doctrine\Common\Collections\Expr\Expression;
24
-use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor;
25
-
26
-/**
27
- * An ArrayCollection is a Collection implementation that wraps a regular PHP array.
28
- *
29
- * @since   2.0
30
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
31
- * @author  Jonathan Wage <jonwage@gmail.com>
32
- * @author  Roman Borschel <roman@code-factory.org>
33
- */
34
-class ArrayCollection implements Collection, Selectable
35
-{
36
-    /**
37
-     * An array containing the entries of this collection.
38
-     *
39
-     * @var array
40
-     */
41
-    private $_elements;
42
-
43
-    /**
44
-     * Initializes a new ArrayCollection.
45
-     *
46
-     * @param array $elements
47
-     */
48
-    public function __construct(array $elements = array())
49
-    {
50
-        $this->_elements = $elements;
51
-    }
52
-
53
-    /**
54
-     * Gets the PHP array representation of this collection.
55
-     *
56
-     * @return array The PHP array representation of this collection.
57
-     */
58
-    public function toArray()
59
-    {
60
-        return $this->_elements;
61
-    }
62
-
63
-    /**
64
-     * Sets the internal iterator to the first element in the collection and
65
-     * returns this element.
66
-     *
67
-     * @return mixed
68
-     */
69
-    public function first()
70
-    {
71
-        return reset($this->_elements);
72
-    }
73
-
74
-    /**
75
-     * Sets the internal iterator to the last element in the collection and
76
-     * returns this element.
77
-     *
78
-     * @return mixed
79
-     */
80
-    public function last()
81
-    {
82
-        return end($this->_elements);
83
-    }
84
-
85
-    /**
86
-     * Gets the current key/index at the current internal iterator position.
87
-     *
88
-     * @return mixed
89
-     */
90
-    public function key()
91
-    {
92
-        return key($this->_elements);
93
-    }
94
-
95
-    /**
96
-     * Moves the internal iterator position to the next element.
97
-     *
98
-     * @return mixed
99
-     */
100
-    public function next()
101
-    {
102
-        return next($this->_elements);
103
-    }
104
-
105
-    /**
106
-     * Gets the element of the collection at the current internal iterator position.
107
-     *
108
-     * @return mixed
109
-     */
110
-    public function current()
111
-    {
112
-        return current($this->_elements);
113
-    }
114
-
115
-    /**
116
-     * Removes an element with a specific key/index from the collection.
117
-     *
118
-     * @param mixed $key
119
-     * @return mixed The removed element or NULL, if no element exists for the given key.
120
-     */
121
-    public function remove($key)
122
-    {
123
-        if (isset($this->_elements[$key])) {
124
-            $removed = $this->_elements[$key];
125
-            unset($this->_elements[$key]);
126
-
127
-            return $removed;
128
-        }
129
-
130
-        return null;
131
-    }
132
-
133
-    /**
134
-     * Removes the specified element from the collection, if it is found.
135
-     *
136
-     * @param mixed $element The element to remove.
137
-     * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
138
-     */
139
-    public function removeElement($element)
140
-    {
141
-        $key = array_search($element, $this->_elements, true);
142
-
143
-        if ($key !== false) {
144
-            unset($this->_elements[$key]);
145
-
146
-            return true;
147
-        }
148
-
149
-        return false;
150
-    }
151
-
152
-    /**
153
-     * ArrayAccess implementation of offsetExists()
154
-     *
155
-     * @see containsKey()
156
-     *
157
-     * @param mixed $offset
158
-     * @return bool
159
-     */
160
-    public function offsetExists($offset)
161
-    {
162
-        return $this->containsKey($offset);
163
-    }
164
-
165
-    /**
166
-     * ArrayAccess implementation of offsetGet()
167
-     *
168
-     * @see get()
169
-     *
170
-     * @param mixed $offset
171
-     * @return mixed
172
-     */
173
-    public function offsetGet($offset)
174
-    {
175
-        return $this->get($offset);
176
-    }
177
-
178
-    /**
179
-     * ArrayAccess implementation of offsetSet()
180
-     *
181
-     * @see add()
182
-     * @see set()
183
-     *
184
-     * @param mixed $offset
185
-     * @param mixed $value
186
-     * @return bool
187
-     */
188
-    public function offsetSet($offset, $value)
189
-    {
190
-        if ( ! isset($offset)) {
191
-            return $this->add($value);
192
-        }
193
-        return $this->set($offset, $value);
194
-    }
195
-
196
-    /**
197
-     * ArrayAccess implementation of offsetUnset()
198
-     *
199
-     * @see remove()
200
-     *
201
-     * @param mixed $offset
202
-     * @return mixed
203
-     */
204
-    public function offsetUnset($offset)
205
-    {
206
-        return $this->remove($offset);
207
-    }
208
-
209
-    /**
210
-     * Checks whether the collection contains a specific key/index.
211
-     *
212
-     * @param mixed $key The key to check for.
213
-     * @return boolean TRUE if the given key/index exists, FALSE otherwise.
214
-     */
215
-    public function containsKey($key)
216
-    {
217
-        return isset($this->_elements[$key]);
218
-    }
219
-
220
-    /**
221
-     * Checks whether the given element is contained in the collection.
222
-     * Only element values are compared, not keys. The comparison of two elements
223
-     * is strict, that means not only the value but also the type must match.
224
-     * For objects this means reference equality.
225
-     *
226
-     * @param mixed $element
227
-     * @return boolean TRUE if the given element is contained in the collection,
228
-     *          FALSE otherwise.
229
-     */
230
-    public function contains($element)
231
-    {
232
-        foreach ($this->_elements as $collectionElement) {
233
-            if ($element === $collectionElement) {
234
-                return true;
235
-            }
236
-        }
237
-
238
-        return false;
239
-    }
240
-
241
-    /**
242
-     * Tests for the existence of an element that satisfies the given predicate.
243
-     *
244
-     * @param Closure $p The predicate.
245
-     * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
246
-     */
247
-    public function exists(Closure $p)
248
-    {
249
-        foreach ($this->_elements as $key => $element) {
250
-            if ($p($key, $element)) {
251
-                return true;
252
-            }
253
-        }
254
-        return false;
255
-    }
256
-
257
-    /**
258
-     * Searches for a given element and, if found, returns the corresponding key/index
259
-     * of that element. The comparison of two elements is strict, that means not
260
-     * only the value but also the type must match.
261
-     * For objects this means reference equality.
262
-     *
263
-     * @param mixed $element The element to search for.
264
-     * @return mixed The key/index of the element or FALSE if the element was not found.
265
-     */
266
-    public function indexOf($element)
267
-    {
268
-        return array_search($element, $this->_elements, true);
269
-    }
270
-
271
-    /**
272
-     * Gets the element with the given key/index.
273
-     *
274
-     * @param mixed $key The key.
275
-     * @return mixed The element or NULL, if no element exists for the given key.
276
-     */
277
-    public function get($key)
278
-    {
279
-        if (isset($this->_elements[$key])) {
280
-            return $this->_elements[$key];
281
-        }
282
-        return null;
283
-    }
284
-
285
-    /**
286
-     * Gets all keys/indexes of the collection elements.
287
-     *
288
-     * @return array
289
-     */
290
-    public function getKeys()
291
-    {
292
-        return array_keys($this->_elements);
293
-    }
294
-
295
-    /**
296
-     * Gets all elements.
297
-     *
298
-     * @return array
299
-     */
300
-    public function getValues()
301
-    {
302
-        return array_values($this->_elements);
303
-    }
304
-
305
-    /**
306
-     * Returns the number of elements in the collection.
307
-     *
308
-     * Implementation of the Countable interface.
309
-     *
310
-     * @return integer The number of elements in the collection.
311
-     */
312
-    public function count()
313
-    {
314
-        return count($this->_elements);
315
-    }
316
-
317
-    /**
318
-     * Adds/sets an element in the collection at the index / with the specified key.
319
-     *
320
-     * When the collection is a Map this is like put(key,value)/add(key,value).
321
-     * When the collection is a List this is like add(position,value).
322
-     *
323
-     * @param mixed $key
324
-     * @param mixed $value
325
-     */
326
-    public function set($key, $value)
327
-    {
328
-        $this->_elements[$key] = $value;
329
-    }
330
-
331
-    /**
332
-     * Adds an element to the collection.
333
-     *
334
-     * @param mixed $value
335
-     * @return boolean Always TRUE.
336
-     */
337
-    public function add($value)
338
-    {
339
-        $this->_elements[] = $value;
340
-        return true;
341
-    }
342
-
343
-    /**
344
-     * Checks whether the collection is empty.
345
-     *
346
-     * Note: This is preferable over count() == 0.
347
-     *
348
-     * @return boolean TRUE if the collection is empty, FALSE otherwise.
349
-     */
350
-    public function isEmpty()
351
-    {
352
-        return ! $this->_elements;
353
-    }
354
-
355
-    /**
356
-     * Gets an iterator for iterating over the elements in the collection.
357
-     *
358
-     * @return ArrayIterator
359
-     */
360
-    public function getIterator()
361
-    {
362
-        return new ArrayIterator($this->_elements);
363
-    }
364
-
365
-    /**
366
-     * Applies the given function to each element in the collection and returns
367
-     * a new collection with the elements returned by the function.
368
-     *
369
-     * @param Closure $func
370
-     * @return Collection
371
-     */
372
-    public function map(Closure $func)
373
-    {
374
-        return new static(array_map($func, $this->_elements));
375
-    }
376
-
377
-    /**
378
-     * Returns all the elements of this collection that satisfy the predicate p.
379
-     * The order of the elements is preserved.
380
-     *
381
-     * @param Closure $p The predicate used for filtering.
382
-     * @return Collection A collection with the results of the filter operation.
383
-     */
384
-    public function filter(Closure $p)
385
-    {
386
-        return new static(array_filter($this->_elements, $p));
387
-    }
388
-
389
-    /**
390
-     * Applies the given predicate p to all elements of this collection,
391
-     * returning true, if the predicate yields true for all elements.
392
-     *
393
-     * @param Closure $p The predicate.
394
-     * @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
395
-     */
396
-    public function forAll(Closure $p)
397
-    {
398
-        foreach ($this->_elements as $key => $element) {
399
-            if ( ! $p($key, $element)) {
400
-                return false;
401
-            }
402
-        }
403
-
404
-        return true;
405
-    }
406
-
407
-    /**
408
-     * Partitions this collection in two collections according to a predicate.
409
-     * Keys are preserved in the resulting collections.
410
-     *
411
-     * @param Closure $p The predicate on which to partition.
412
-     * @return array An array with two elements. The first element contains the collection
413
-     *               of elements where the predicate returned TRUE, the second element
414
-     *               contains the collection of elements where the predicate returned FALSE.
415
-     */
416
-    public function partition(Closure $p)
417
-    {
418
-        $coll1 = $coll2 = array();
419
-        foreach ($this->_elements as $key => $element) {
420
-            if ($p($key, $element)) {
421
-                $coll1[$key] = $element;
422
-            } else {
423
-                $coll2[$key] = $element;
424
-            }
425
-        }
426
-        return array(new static($coll1), new static($coll2));
427
-    }
428
-
429
-    /**
430
-     * Returns a string representation of this object.
431
-     *
432
-     * @return string
433
-     */
434
-    public function __toString()
435
-    {
436
-        return __CLASS__ . '@' . spl_object_hash($this);
437
-    }
438
-
439
-    /**
440
-     * Clears the collection.
441
-     */
442
-    public function clear()
443
-    {
444
-        $this->_elements = array();
445
-    }
446
-
447
-    /**
448
-     * Extract a slice of $length elements starting at position $offset from the Collection.
449
-     *
450
-     * If $length is null it returns all elements from $offset to the end of the Collection.
451
-     * Keys have to be preserved by this method. Calling this method will only return the
452
-     * selected slice and NOT change the elements contained in the collection slice is called on.
453
-     *
454
-     * @param int $offset
455
-     * @param int $length
456
-     * @return array
457
-     */
458
-    public function slice($offset, $length = null)
459
-    {
460
-        return array_slice($this->_elements, $offset, $length, true);
461
-    }
462
-
463
-    /**
464
-     * Select all elements from a selectable that match the criteria and
465
-     * return a new collection containing these elements.
466
-     *
467
-     * @param  Criteria $criteria
468
-     * @return Collection
469
-     */
470
-    public function matching(Criteria $criteria)
471
-    {
472
-        $expr     = $criteria->getWhereExpression();
473
-        $filtered = $this->_elements;
474
-
475
-        if ($expr) {
476
-            $visitor  = new ClosureExpressionVisitor();
477
-            $filter   = $visitor->dispatch($expr);
478
-            $filtered = array_filter($filtered, $filter);
479
-        }
480
-
481
-        if ($orderings = $criteria->getOrderings()) {
482
-            $next = null;
483
-            foreach (array_reverse($orderings) as $field => $ordering) {
484
-                $next = ClosureExpressionVisitor::sortByField($field, $ordering == 'DESC' ? -1 : 1, $next);
485
-            }
486
-
487
-            usort($filtered, $next);
488
-        }
489
-
490
-        $offset = $criteria->getFirstResult();
491
-        $length = $criteria->getMaxResults();
492
-
493
-        if ($offset || $length) {
494
-            $filtered = array_slice($filtered, (int)$offset, $length);
495
-        }
496
-
497
-        return new static($filtered);
498
-    }
499
-}
500
-

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

@@ -1,243 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections;
21
-
22
-use Closure, Countable, IteratorAggregate, ArrayAccess;
23
-
24
-/**
25
- * The missing (SPL) Collection/Array/OrderedMap interface.
26
- *
27
- * A Collection resembles the nature of a regular PHP array. That is,
28
- * it is essentially an <b>ordered map</b> that can also be used
29
- * like a list.
30
- *
31
- * A Collection has an internal iterator just like a PHP array. In addition,
32
- * a Collection can be iterated with external iterators, which is preferrable.
33
- * To use an external iterator simply use the foreach language construct to
34
- * iterate over the collection (which calls {@link getIterator()} internally) or
35
- * explicitly retrieve an iterator though {@link getIterator()} which can then be
36
- * used to iterate over the collection.
37
- * You can not rely on the internal iterator of the collection being at a certain
38
- * position unless you explicitly positioned it before. Prefer iteration with
39
- * external iterators.
40
- *
41
- * @since   2.0
42
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
43
- * @author  Jonathan Wage <jonwage@gmail.com>
44
- * @author  Roman Borschel <roman@code-factory.org>
45
- */
46
-interface Collection extends Countable, IteratorAggregate, ArrayAccess
47
-{
48
-    /**
49
-     * Adds an element at the end of the collection.
50
-     *
51
-     * @param mixed $element The element to add.
52
-     * @return boolean Always TRUE.
53
-     */
54
-    function add($element);
55
-
56
-    /**
57
-     * Clears the collection, removing all elements.
58
-     */
59
-    function clear();
60
-
61
-    /**
62
-     * Checks whether an element is contained in the collection.
63
-     * This is an O(n) operation, where n is the size of the collection.
64
-     *
65
-     * @param mixed $element The element to search for.
66
-     * @return boolean TRUE if the collection contains the element, FALSE otherwise.
67
-     */
68
-    function contains($element);
69
-
70
-    /**
71
-     * Checks whether the collection is empty (contains no elements).
72
-     *
73
-     * @return boolean TRUE if the collection is empty, FALSE otherwise.
74
-     */
75
-    function isEmpty();
76
-
77
-    /**
78
-     * Removes the element at the specified index from the collection.
79
-     *
80
-     * @param string|integer $key The kex/index of the element to remove.
81
-     * @return mixed The removed element or NULL, if the collection did not contain the element.
82
-     */
83
-    function remove($key);
84
-
85
-    /**
86
-     * Removes the specified element from the collection, if it is found.
87
-     *
88
-     * @param mixed $element The element to remove.
89
-     * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
90
-     */
91
-    function removeElement($element);
92
-
93
-    /**
94
-     * Checks whether the collection contains an element with the specified key/index.
95
-     *
96
-     * @param string|integer $key The key/index to check for.
97
-     * @return boolean TRUE if the collection contains an element with the specified key/index,
98
-     *          FALSE otherwise.
99
-     */
100
-    function containsKey($key);
101
-
102
-    /**
103
-     * Gets the element at the specified key/index.
104
-     *
105
-     * @param string|integer $key The key/index of the element to retrieve.
106
-     * @return mixed
107
-     */
108
-    function get($key);
109
-
110
-    /**
111
-     * Gets all keys/indices of the collection.
112
-     *
113
-     * @return array The keys/indices of the collection, in the order of the corresponding
114
-     *          elements in the collection.
115
-     */
116
-    function getKeys();
117
-
118
-    /**
119
-     * Gets all values of the collection.
120
-     *
121
-     * @return array The values of all elements in the collection, in the order they
122
-     *          appear in the collection.
123
-     */
124
-    function getValues();
125
-
126
-    /**
127
-     * Sets an element in the collection at the specified key/index.
128
-     *
129
-     * @param string|integer $key The key/index of the element to set.
130
-     * @param mixed $value The element to set.
131
-     */
132
-    function set($key, $value);
133
-
134
-    /**
135
-     * Gets a native PHP array representation of the collection.
136
-     *
137
-     * @return array
138
-     */
139
-    function toArray();
140
-
141
-    /**
142
-     * Sets the internal iterator to the first element in the collection and
143
-     * returns this element.
144
-     *
145
-     * @return mixed
146
-     */
147
-    function first();
148
-
149
-    /**
150
-     * Sets the internal iterator to the last element in the collection and
151
-     * returns this element.
152
-     *
153
-     * @return mixed
154
-     */
155
-    function last();
156
-
157
-    /**
158
-     * Gets the key/index of the element at the current iterator position.
159
-     *
160
-     */
161
-    function key();
162
-
163
-    /**
164
-     * Gets the element of the collection at the current iterator position.
165
-     *
166
-     */
167
-    function current();
168
-
169
-    /**
170
-     * Moves the internal iterator position to the next element.
171
-     *
172
-     */
173
-    function next();
174
-
175
-    /**
176
-     * Tests for the existence of an element that satisfies the given predicate.
177
-     *
178
-     * @param Closure $p The predicate.
179
-     * @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
180
-     */
181
-    function exists(Closure $p);
182
-
183
-    /**
184
-     * Returns all the elements of this collection that satisfy the predicate p.
185
-     * The order of the elements is preserved.
186
-     *
187
-     * @param Closure $p The predicate used for filtering.
188
-     * @return Collection A collection with the results of the filter operation.
189
-     */
190
-    function filter(Closure $p);
191
-
192
-    /**
193
-     * Applies the given predicate p to all elements of this collection,
194
-     * returning true, if the predicate yields true for all elements.
195
-     *
196
-     * @param Closure $p The predicate.
197
-     * @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
198
-     */
199
-    function forAll(Closure $p);
200
-
201
-    /**
202
-     * Applies the given function to each element in the collection and returns
203
-     * a new collection with the elements returned by the function.
204
-     *
205
-     * @param Closure $func
206
-     * @return Collection
207
-     */
208
-    function map(Closure $func);
209
-
210
-    /**
211
-     * Partitions this collection in two collections according to a predicate.
212
-     * Keys are preserved in the resulting collections.
213
-     *
214
-     * @param Closure $p The predicate on which to partition.
215
-     * @return array An array with two elements. The first element contains the collection
216
-     *               of elements where the predicate returned TRUE, the second element
217
-     *               contains the collection of elements where the predicate returned FALSE.
218
-     */
219
-    function partition(Closure $p);
220
-
221
-    /**
222
-     * Gets the index/key of a given element. The comparison of two elements is strict,
223
-     * that means not only the value but also the type must match.
224
-     * For objects this means reference equality.
225
-     *
226
-     * @param mixed $element The element to search for.
227
-     * @return mixed The key/index of the element or FALSE if the element was not found.
228
-     */
229
-    function indexOf($element);
230
-
231
-    /**
232
-     * Extract a slice of $length elements starting at position $offset from the Collection.
233
-     *
234
-     * If $length is null it returns all elements from $offset to the end of the Collection.
235
-     * Keys have to be preserved by this method. Calling this method will only return the
236
-     * selected slice and NOT change the elements contained in the collection slice is called on.
237
-     *
238
-     * @param int $offset
239
-     * @param int $length
240
-     * @return array
241
-     */
242
-    function slice($offset, $length = null);
243
-}

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

@@ -1,240 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections;
21
-
22
-use Doctrine\Common\Collections\Expr\Expression;
23
-use Doctrine\Common\Collections\Expr\CompositeExpression;
24
-
25
-/**
26
- * Criteria for filtering Selectable collections.
27
- *
28
- * @author Benjamin Eberlei <kontakt@beberlei.de>
29
- * @since 2.3
30
- */
31
-class Criteria
32
-{
33
-    /**
34
-     * @var string
35
-     */
36
-    const ASC  = 'ASC';
37
-
38
-    /**
39
-     * @var string
40
-     */
41
-    const DESC = 'DESC';
42
-
43
-    /**
44
-     * @var \Doctrine\Common\Collections\ExpressionBuilder
45
-     */
46
-    private static $expressionBuilder;
47
-
48
-    /**
49
-     * @var \Doctrine\Common\Collections\Expr\Expression
50
-     */
51
-    private $expression;
52
-
53
-    /**
54
-     * @var array|null
55
-     */
56
-    private $orderings;
57
-
58
-    /**
59
-     * @var int
60
-     */
61
-    private $firstResult;
62
-
63
-    /**
64
-     * @var int
65
-     */
66
-    private $maxResults;
67
-
68
-    /**
69
-     * Creates an instance of the class.
70
-     *
71
-     * @return Criteria
72
-     */
73
-    public static function create()
74
-    {
75
-        return new static();
76
-    }
77
-
78
-    /**
79
-     * Return the expression builder.
80
-     *
81
-     * @return \Doctrine\Common\Collections\ExpressionBuilder
82
-     */
83
-    public static function expr()
84
-    {
85
-        if (self::$expressionBuilder === null) {
86
-            self::$expressionBuilder = new ExpressionBuilder();
87
-        }
88
-        return self::$expressionBuilder;
89
-    }
90
-
91
-    /**
92
-     * Construct new criteria
93
-     *
94
-     * @param Expression $expression
95
-     * @param array $orderings
96
-     * @param int $firstResult
97
-     * @param int $maxResults
98
-     */
99
-    public function __construct(Expression $expression = null, array $orderings = null, $firstResult = null, $maxResults = null)
100
-    {
101
-        $this->expression  = $expression;
102
-        $this->orderings   = $orderings;
103
-        $this->firstResult = $firstResult;
104
-        $this->maxResults  = $maxResults;
105
-    }
106
-
107
-    /**
108
-     * Set the where expression to evaluate when this criteria is searched for.
109
-     *
110
-     * @param Expression
111
-     * @return Criteria
112
-     */
113
-    public function where(Expression $expression)
114
-    {
115
-        $this->expression = $expression;
116
-        return $this;
117
-    }
118
-
119
-    /**
120
-     * Append the where expression to evaluate when this criteria is searched for
121
-     * using an AND with previous expression.
122
-     *
123
-     * @param Expression
124
-     * @return Criteria
125
-     */
126
-    public function andWhere(Expression $expression)
127
-    {
128
-        if ($this->expression === null) {
129
-            return $this->where($expression);
130
-        }
131
-
132
-        $this->expression = new CompositeExpression(CompositeExpression::TYPE_AND, array(
133
-            $this->expression, $expression
134
-        ));
135
-
136
-        return $this;
137
-    }
138
-
139
-    /**
140
-     * Append the where expression to evaluate when this criteria is searched for
141
-     * using an OR with previous expression.
142
-     *
143
-     * @param Expression
144
-     * @return Criteria
145
-     */
146
-    public function orWhere(Expression $expression)
147
-    {
148
-        if ($this->expression === null) {
149
-            return $this->where($expression);
150
-        }
151
-
152
-        $this->expression = new CompositeExpression(CompositeExpression::TYPE_OR, array(
153
-            $this->expression, $expression
154
-        ));
155
-
156
-        return $this;
157
-    }
158
-
159
-    /**
160
-     * Get the expression attached to this criteria.
161
-     *
162
-     * @return Expression|null
163
-     */
164
-    public function getWhereExpression()
165
-    {
166
-        return $this->expression;
167
-    }
168
-
169
-    /**
170
-     * Get current orderings of this Criteria
171
-     *
172
-     * @return array
173
-     */
174
-    public function getOrderings()
175
-    {
176
-        return $this->orderings;
177
-    }
178
-
179
-    /**
180
-     * Set the ordering of the result of this criteria.
181
-     *
182
-     * Keys are field and values are the order, being either ASC or DESC.
183
-     *
184
-     * @see Criteria::ASC
185
-     * @see Criteria::DESC
186
-     *
187
-     * @param array
188
-     * @return Criteria
189
-     */
190
-    public function orderBy(array $orderings)
191
-    {
192
-        $this->orderings = $orderings;
193
-        return $this;
194
-    }
195
-
196
-    /**
197
-     * Get current first result option of the critera.
198
-     *
199
-     * @return firstResult.
200
-     */
201
-    public function getFirstResult()
202
-    {
203
-        return $this->firstResult;
204
-    }
205
-
206
-    /**
207
-     * Set number of first result that this criteria should return.
208
-     *
209
-     * @param firstResult the value to set.
210
-     * @return Criteria
211
-     */
212
-    public function setFirstResult($firstResult)
213
-    {
214
-        $this->firstResult = $firstResult;
215
-        return $this;
216
-    }
217
-
218
-    /**
219
-     * Get maxResults.
220
-     *
221
-     * @return maxResults.
222
-     */
223
-    public function getMaxResults()
224
-    {
225
-        return $this->maxResults;
226
-    }
227
-
228
-    /**
229
-     * Set maxResults.
230
-     *
231
-     * @param maxResults the value to set.
232
-     * @return Criteria
233
-     */
234
-    public function setMaxResults($maxResults)
235
-    {
236
-        $this->maxResults = $maxResults;
237
-        return $this;
238
-    }
239
-}
240
-

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

@@ -1,195 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections\Expr;
21
-
22
-/**
23
- * Walks an expression graph and turns it into a PHP closure.
24
- *
25
- * This closure can be used with {@Collection#filter()} and is used internally
26
- * by {@ArrayCollection#select()}.
27
- *
28
- * @author Benjamin Eberlei <kontakt@beberlei.de>
29
- * @since 2.3
30
- */
31
-class ClosureExpressionVisitor extends ExpressionVisitor
32
-{
33
-    /**
34
-     * Access the field of a given object. This field has to be public directly
35
-     * or indirectly (through an accessor get* or a magic method, __get, __call).
36
-     *
37
-     * is*() is not supported.
38
-     *
39
-     * @return mixed
40
-     */
41
-    static public function getObjectFieldValue($object, $field)
42
-    {
43
-        $accessor = "get" . $field;
44
-
45
-        if (method_exists($object, $accessor) || method_exists($object, '__call')) {
46
-            return $object->$accessor();
47
-        }
48
-
49
-        if ($object instanceof \ArrayAccess) {
50
-            return $object[$field];
51
-        }
52
-
53
-        return $object->$field;
54
-    }
55
-
56
-    /**
57
-     * Helper for sorting arrays of objects based on multiple fields +
58
-     * orientations.
59
-     *
60
-     * @param string $name
61
-     * @param int $orientation
62
-     * @param Closure $next
63
-     * @return Closure
64
-     */
65
-    static public function sortByField($name, $orientation = 1, \Closure $next = null)
66
-    {
67
-        if (!$next) {
68
-            $next = function() {
69
-                return 0;
70
-            };
71
-        }
72
-
73
-        return function ($a, $b) use ($name, $next, $orientation) {
74
-            $aValue = ClosureExpressionVisitor::getObjectFieldValue($a, $name);
75
-            $bValue = ClosureExpressionVisitor::getObjectFieldValue($b, $name);
76
-
77
-            if ($aValue === $bValue) {
78
-                return $next($a, $b);
79
-            }
80
-
81
-            return (($aValue > $bValue) ? 1 : -1) * $orientation;
82
-        };
83
-    }
84
-
85
-    /**
86
-     * {@inheritDoc}
87
-     */
88
-    public function walkComparison(Comparison $comparison)
89
-    {
90
-        $field = $comparison->getField();
91
-        $value = $comparison->getValue()->getValue(); // shortcut for walkValue()
92
-
93
-        switch ($comparison->getOperator()) {
94
-            case Comparison::EQ:
95
-            case Comparison::IS:
96
-                return function ($object) use ($field, $value) {
97
-                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) === $value;
98
-                };
99
-
100
-            case Comparison::NEQ:
101
-                return function ($object) use ($field, $value) {
102
-                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) !== $value;
103
-                };
104
-
105
-            case Comparison::LT:
106
-                return function ($object) use ($field, $value) {
107
-                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) < $value;
108
-                };
109
-
110
-            case Comparison::LTE:
111
-                return function ($object) use ($field, $value) {
112
-                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) <= $value;
113
-                };
114
-
115
-            case Comparison::GT:
116
-                return function ($object) use ($field, $value) {
117
-                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) > $value;
118
-                };
119
-
120
-            case Comparison::GTE:
121
-                return function ($object) use ($field, $value) {
122
-                    return ClosureExpressionVisitor::getObjectFieldValue($object, $field) >= $value;
123
-                };
124
-
125
-            case Comparison::IN:
126
-                return function ($object) use ($field, $value) {
127
-                    return in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
128
-                };
129
-
130
-            case Comparison::NIN:
131
-                return function ($object) use ($field, $value) {
132
-                    return ! in_array(ClosureExpressionVisitor::getObjectFieldValue($object, $field), $value);
133
-                };
134
-
135
-            default:
136
-                throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator());
137
-        }
138
-    }
139
-
140
-    /**
141
-     * {@inheritDoc}
142
-     */
143
-    public function walkValue(Value $value)
144
-    {
145
-        return $value->getValue();
146
-    }
147
-
148
-    /**
149
-     * {@inheritDoc}
150
-     */
151
-    public function walkCompositeExpression(CompositeExpression $expr)
152
-    {
153
-        $expressionList = array();
154
-
155
-        foreach ($expr->getExpressionList() as $child) {
156
-            $expressionList[] = $this->dispatch($child);
157
-        }
158
-
159
-        switch($expr->getType()) {
160
-            case CompositeExpression::TYPE_AND:
161
-                return $this->andExpressions($expressionList);
162
-
163
-            case CompositeExpression::TYPE_OR:
164
-                return $this->orExpressions($expressionList);
165
-
166
-            default:
167
-                throw new \RuntimeException("Unknown composite " . $expr->getType());
168
-        }
169
-    }
170
-
171
-    private function andExpressions($expressions)
172
-    {
173
-        return function ($object) use ($expressions) {
174
-            foreach ($expressions as $expression) {
175
-                if ( ! $expression($object)) {
176
-                    return false;
177
-                }
178
-            }
179
-            return true;
180
-        };
181
-    }
182
-
183
-    private function orExpressions($expressions)
184
-    {
185
-        return function ($object) use ($expressions) {
186
-            foreach ($expressions as $expression) {
187
-                if ($expression($object)) {
188
-                    return true;
189
-                }
190
-            }
191
-            return false;
192
-        };
193
-    }
194
-}
195
-

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

@@ -1,75 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections\Expr;
21
-
22
-/**
23
- * Comparison of a field with a value by the given operator.
24
- *
25
- * @author Benjamin Eberlei <kontakt@beberlei.de>
26
- * @since 2.3
27
- */
28
-class Comparison implements Expression
29
-{
30
-    const EQ   = '=';
31
-    const NEQ  = '<>';
32
-    const LT   = '<';
33
-    const LTE  = '<=';
34
-    const GT   = '>';
35
-    const GTE  = '>=';
36
-    const IS   = 'IS';
37
-    const IN   = 'IN';
38
-    const NIN  = 'NIN';
39
-
40
-    private $field;
41
-    private $op;
42
-    private $value;
43
-
44
-    public function __construct($field, $operator, $value)
45
-    {
46
-        if ( ! ($value instanceof Value)) {
47
-            $value = new Value($value);
48
-        }
49
-
50
-        $this->field = $field;
51
-        $this->op = $operator;
52
-        $this->value = $value;
53
-    }
54
-
55
-    public function getField()
56
-    {
57
-        return $this->field;
58
-    }
59
-
60
-    public function getValue()
61
-    {
62
-        return $this->value;
63
-    }
64
-
65
-    public function getOperator()
66
-    {
67
-        return $this->op;
68
-    }
69
-
70
-    public function visit(ExpressionVisitor $visitor)
71
-    {
72
-        return $visitor->walkComparison($this);
73
-    }
74
-}
75
-

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

@@ -1,72 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections\Expr;
21
-
22
-/**
23
- * Expression of Expressions combined by AND or OR operation.
24
- *
25
- * @author Benjamin Eberlei <kontakt@beberlei.de>
26
- * @since 2.3
27
- */
28
-class CompositeExpression implements Expression
29
-{
30
-    const TYPE_AND = 'AND';
31
-    const TYPE_OR = 'OR';
32
-
33
-    private $type;
34
-    private $expressions = array();
35
-
36
-    public function __construct($type, array $expressions)
37
-    {
38
-        $this->type = $type;
39
-
40
-        foreach ($expressions as $expr) {
41
-            if ($expr instanceof Value) {
42
-                throw new \RuntimeException("Values are not supported expressions as children of and/or expressions.");
43
-            }
44
-            if ( ! ($expr instanceof Expression)) {
45
-                throw new \RuntimeException("No expression given to CompositeExpression.");
46
-            }
47
-
48
-            $this->expressions[] = $expr;
49
-        }
50
-    }
51
-
52
-    /**
53
-     * Return the list of expressions nested in this composite.
54
-     *
55
-     * @return Expression[]
56
-     */
57
-    public function getExpressionList()
58
-    {
59
-        return $this->expressions;
60
-    }
61
-
62
-    public function getType()
63
-    {
64
-        return $this->type;
65
-    }
66
-
67
-    public function visit(ExpressionVisitor $visitor)
68
-    {
69
-        return $visitor->walkCompositeExpression($this);
70
-    }
71
-}
72
-

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

@@ -1,31 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections\Expr;
21
-
22
-/**
23
- * Expression for the {@link Selectable} interface.
24
- *
25
- * @author Benjamin Eberlei <kontakt@beberlei.de>
26
- */
27
-interface Expression
28
-{
29
-    public function visit(ExpressionVisitor $visitor);
30
-}
31
-

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

@@ -1,81 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections\Expr;
21
-
22
-/**
23
- * An Expression visitor walks a graph of expressions and turns them into a
24
- * query for the underlying implementation.
25
- *
26
- * @author Benjamin Eberlei <kontakt@beberlei.de>
27
- */
28
-abstract class ExpressionVisitor
29
-{
30
-    /**
31
-     * Convert a comparison expression into the target query language output
32
-     *
33
-     * @param Comparison $comparison
34
-     *
35
-     * @return mixed
36
-     */
37
-    abstract public function walkComparison(Comparison $comparison);
38
-
39
-    /**
40
-     * Convert a value expression into the target query language part.
41
-     *
42
-     * @param Value $value
43
-     *
44
-     * @return mixed
45
-     */
46
-    abstract public function walkValue(Value $value);
47
-
48
-    /**
49
-     * Convert a composite expression into the target query language output
50
-     *
51
-     * @param CompositeExpression $expr
52
-     *
53
-     * @return mixed
54
-     */
55
-    abstract public function walkCompositeExpression(CompositeExpression $expr);
56
-
57
-    /**
58
-     * Dispatch walking an expression to the appropriate handler.
59
-     *
60
-     * @param Expression
61
-     *
62
-     * @return mixed
63
-     */
64
-    public function dispatch(Expression $expr)
65
-    {
66
-        switch (true) {
67
-            case ($expr instanceof Comparison):
68
-                return $this->walkComparison($expr);
69
-
70
-            case ($expr instanceof Value):
71
-                return $this->walkValue($expr);
72
-
73
-            case ($expr instanceof CompositeExpression):
74
-                return $this->walkCompositeExpression($expr);
75
-
76
-            default:
77
-                throw new \RuntimeException("Unknown Expression " . get_class($expr));
78
-        }
79
-    }
80
-}
81
-

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

@@ -1,41 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections\Expr;
21
-
22
-class Value implements Expression
23
-{
24
-    private $value;
25
-
26
-    public function __construct($value)
27
-    {
28
-        $this->value = $value;
29
-    }
30
-
31
-    public function getValue()
32
-    {
33
-        return $this->value;
34
-    }
35
-
36
-    public function visit(ExpressionVisitor $visitor)
37
-    {
38
-        return $visitor->walkValue($this);
39
-    }
40
-}
41
-

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

@@ -1,149 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYvalue HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYvalue
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections;
21
-
22
-use Doctrine\Common\Collections\Expr\Comparison;
23
-use Doctrine\Common\Collections\Expr\CompositeExpression;
24
-use Doctrine\Common\Collections\Expr\Value;
25
-
26
-/**
27
- * Builder for Expressions in the {@link Selectable} interface.
28
- *
29
- * @author Benjamin Eberlei <kontakt@beberlei.de>
30
- * @since 2.3
31
- */
32
-class ExpressionBuilder
33
-{
34
-    /**
35
-     * @return CompositeExpression
36
-     */
37
-    public function andX($x = null)
38
-    {
39
-        return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args());
40
-    }
41
-
42
-    /**
43
-     * @return CompositeExpression
44
-     */
45
-    public function orX($x = null)
46
-    {
47
-        return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args());
48
-    }
49
-
50
-    /**
51
-     * @param string $field
52
-     * @param mixed $value
53
-     *
54
-     * @return Comparison
55
-     */
56
-    public function eq($field, $value)
57
-    {
58
-        return new Comparison($field, Comparison::EQ, new Value($value));
59
-    }
60
-
61
-    /**
62
-     * @param string $field
63
-     * @param mixed $value
64
-     *
65
-     * @return Comparison
66
-     */
67
-    public function gt($field, $value)
68
-    {
69
-        return new Comparison($field, Comparison::GT, new Value($value));
70
-    }
71
-
72
-    /**
73
-     * @param string $field
74
-     * @param mixed $value
75
-     *
76
-     * @return Comparison
77
-     */
78
-    public function lt($field, $value)
79
-    {
80
-        return new Comparison($field, Comparison::LT, new Value($value));
81
-    }
82
-
83
-    /**
84
-     * @param string $field
85
-     * @param mixed $value
86
-     *
87
-     * @return Comparison
88
-     */
89
-    public function gte($field, $value)
90
-    {
91
-        return new Comparison($field, Comparison::GTE, new Value($value));
92
-    }
93
-
94
-    /**
95
-     * @param string $field
96
-     * @param mixed $value
97
-     *
98
-     * @return Comparison
99
-     */
100
-    public function lte($field, $value)
101
-    {
102
-        return new Comparison($field, Comparison::LTE, new Value($value));
103
-    }
104
-
105
-    /**
106
-     * @param string $field
107
-     * @param mixed $value
108
-     *
109
-     * @return Comparison
110
-     */
111
-    public function neq($field, $value)
112
-    {
113
-        return new Comparison($field, Comparison::NEQ, new Value($value));
114
-    }
115
-
116
-    /**
117
-     * @param string $field
118
-     * @param mixed $value
119
-     *
120
-     * @return Comparison
121
-     */
122
-    public function isNull($field)
123
-    {
124
-        return new Comparison($field, Comparison::IS, new Value(null));
125
-    }
126
-
127
-    /**
128
-     * @param string $field
129
-     * @param mixed $value
130
-     *
131
-     * @return Comparison
132
-     */
133
-    public function in($field, array $values)
134
-    {
135
-        return new Comparison($field, Comparison::IN, new Value($values));
136
-    }
137
-
138
-    /**
139
-     * @param string $field
140
-     * @param mixed $value
141
-     *
142
-     * @return Comparison
143
-     */
144
-    public function notIn($field, array $values)
145
-    {
146
-        return new Comparison($field, Comparison::NIN, new Value($values));
147
-    }
148
-}
149
-

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

@@ -1,48 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Collections;
21
-
22
-/**
23
- * Interface for collections that allow efficient filtering with an expression API.
24
- *
25
- * Goal of this interface is a backend independent method to fetch elements
26
- * from a collections. {@link Expression} is crafted in a way that you can
27
- * implement queries from both in-memory and database-backed collections.
28
- *
29
- * For database backed collections this allows very efficient access by
30
- * utilizing the query APIs, for example SQL in the ORM. Applications using
31
- * this API can implement efficient database access without having to ask the
32
- * EntityManager or Repositories.
33
- *
34
- * @author Benjamin Eberlei <kontakt@beberlei.de>
35
- * @since 2.3
36
- */
37
-interface Selectable
38
-{
39
-    /**
40
-     * Select all elements from a selectable that match the expression and
41
-     * return a new collection containing these elements.
42
-     *
43
-     * @param Criteria $criteria
44
-     * @return Collection
45
-     */
46
-    function matching(Criteria $criteria);
47
-}
48
-

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

@@ -1,28 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common;
21
-
22
-/**
23
- * Base exception class for package Doctrine\Common
24
- * @author heinrich
25
- *
26
- */
27
-class CommonException extends \Exception {
28
-}

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

@@ -1,49 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-
21
-namespace Doctrine\Common;
22
-
23
-/**
24
- * Comparable interface that allows to compare two value objects to each other for similarity.
25
- *
26
- * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
27
- * @link        www.doctrine-project.com
28
- * @since       2.2
29
- * @author      Benjamin Eberlei <kontakt@beberlei.de>
30
- * @author      Guilherme Blanco <guilhermeblanco@hotmail.com>
31
- */
32
-interface Comparable
33
-{
34
-    /**
35
-     * Compare the current object to the passed $other.
36
-     *
37
-     * Returns 0 if they are semantically equal, 1 if the other object
38
-     * is less than the current one, or -1 if its more than the current one.
39
-     *
40
-     * This method should not check for identity using ===, only for semantical equality for example
41
-     * when two different DateTime instances point to the exact same Date + TZ.
42
-     *
43
-     * @param mixed $other
44
-     *
45
-     * @return int
46
-     */
47
-    public function compareTo($other);
48
-}
49
-

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

@@ -1,67 +0,0 @@
1
-<?php
2
-/*
3
- *  $Id$
4
- *
5
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
- *
17
- * This software consists of voluntary contributions made by many individuals
18
- * and is licensed under the MIT license. For more information, see
19
- * <http://www.doctrine-project.org>.
20
- */
21
-
22
-namespace Doctrine\Common;
23
-
24
-/**
25
- * EventArgs is the base class for classes containing event data.
26
- *
27
- * This class contains no event data. It is used by events that do not pass state
28
- * information to an event handler when an event is raised. The single empty EventArgs
29
- * instance can be obtained through {@link getEmptyInstance}.
30
- *
31
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
32
- * @link    www.doctrine-project.org
33
- * @since   2.0
34
- * @version $Revision: 3938 $
35
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
36
- * @author  Jonathan Wage <jonwage@gmail.com>
37
- * @author  Roman Borschel <roman@code-factory.org>
38
- */
39
-class EventArgs
40
-{
41
-    /**
42
-     * @var EventArgs Single instance of EventArgs
43
-     */
44
-    private static $_emptyEventArgsInstance;
45
-
46
-    /**
47
-     * Gets the single, empty and immutable EventArgs instance.
48
-     *
49
-     * This instance will be used when events are dispatched without any parameter,
50
-     * like this: EventManager::dispatchEvent('eventname');
51
-     *
52
-     * The benefit from this is that only one empty instance is instantiated and shared
53
-     * (otherwise there would be instances for every dispatched in the abovementioned form)
54
-     *
55
-     * @see EventManager::dispatchEvent
56
-     * @link http://msdn.microsoft.com/en-us/library/system.eventargs.aspx
57
-     * @return EventArgs
58
-     */
59
-    public static function getEmptyInstance()
60
-    {
61
-        if ( ! self::$_emptyEventArgsInstance) {
62
-            self::$_emptyEventArgsInstance = new EventArgs;
63
-        }
64
-
65
-        return self::$_emptyEventArgsInstance;
66
-    }
67
-}

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

@@ -1,147 +0,0 @@
1
-<?php
2
-/*
3
- *  $Id$
4
- *
5
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
- *
17
- * This software consists of voluntary contributions made by many individuals
18
- * and is licensed under the MIT license. For more information, see
19
- * <http://www.doctrine-project.org>.
20
- */
21
-
22
-namespace Doctrine\Common;
23
-
24
-/**
25
- * The EventManager is the central point of Doctrine's event listener system.
26
- * Listeners are registered on the manager and events are dispatched through the
27
- * manager.
28
- *
29
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
30
- * @link    www.doctrine-project.org
31
- * @since   2.0
32
- * @version $Revision: 3938 $
33
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
34
- * @author  Jonathan Wage <jonwage@gmail.com>
35
- * @author  Roman Borschel <roman@code-factory.org>
36
- */
37
-class EventManager
38
-{
39
-    /**
40
-     * Map of registered listeners.
41
-     * <event> => <listeners>
42
-     *
43
-     * @var array
44
-     */
45
-    private $_listeners = array();
46
-
47
-    /**
48
-     * Dispatches an event to all registered listeners.
49
-     *
50
-     * @param string $eventName The name of the event to dispatch. The name of the event is
51
-     *                          the name of the method that is invoked on listeners.
52
-     * @param EventArgs $eventArgs The event arguments to pass to the event handlers/listeners.
53
-     *                             If not supplied, the single empty EventArgs instance is used.
54
-     * @return boolean
55
-     */
56
-    public function dispatchEvent($eventName, EventArgs $eventArgs = null)
57
-    {
58
-        if (isset($this->_listeners[$eventName])) {
59
-            $eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs;
60
-
61
-            foreach ($this->_listeners[$eventName] as $listener) {
62
-                $listener->$eventName($eventArgs);
63
-            }
64
-        }
65
-    }
66
-
67
-    /**
68
-     * Gets the listeners of a specific event or all listeners.
69
-     *
70
-     * @param string $event The name of the event.
71
-     * @return array The event listeners for the specified event, or all event listeners.
72
-     */
73
-    public function getListeners($event = null)
74
-    {
75
-        return $event ? $this->_listeners[$event] : $this->_listeners;
76
-    }
77
-
78
-    /**
79
-     * Checks whether an event has any registered listeners.
80
-     *
81
-     * @param string $event
82
-     * @return boolean TRUE if the specified event has any listeners, FALSE otherwise.
83
-     */
84
-    public function hasListeners($event)
85
-    {
86
-        return isset($this->_listeners[$event]) && $this->_listeners[$event];
87
-    }
88
-
89
-    /**
90
-     * Adds an event listener that listens on the specified events.
91
-     *
92
-     * @param string|array $events The event(s) to listen on.
93
-     * @param object $listener The listener object.
94
-     */
95
-    public function addEventListener($events, $listener)
96
-    {
97
-        // Picks the hash code related to that listener
98
-        $hash = spl_object_hash($listener);
99
-
100
-        foreach ((array) $events as $event) {
101
-            // Overrides listener if a previous one was associated already
102
-            // Prevents duplicate listeners on same event (same instance only)
103
-            $this->_listeners[$event][$hash] = $listener;
104
-        }
105
-    }
106
-
107
-    /**
108
-     * Removes an event listener from the specified events.
109
-     *
110
-     * @param string|array $events
111
-     * @param object $listener
112
-     */
113
-    public function removeEventListener($events, $listener)
114
-    {
115
-        // Picks the hash code related to that listener
116
-        $hash = spl_object_hash($listener);
117
-
118
-        foreach ((array) $events as $event) {
119
-            // Check if actually have this listener associated
120
-            if (isset($this->_listeners[$event][$hash])) {
121
-                unset($this->_listeners[$event][$hash]);
122
-            }
123
-        }
124
-    }
125
-
126
-    /**
127
-     * Adds an EventSubscriber. The subscriber is asked for all the events he is
128
-     * interested in and added as a listener for these events.
129
-     *
130
-     * @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
131
-     */
132
-    public function addEventSubscriber(EventSubscriber $subscriber)
133
-    {
134
-        $this->addEventListener($subscriber->getSubscribedEvents(), $subscriber);
135
-    }
136
-	
137
-    /**
138
-     * Removes an EventSubscriber. The subscriber is asked for all the events it is
139
-     * interested in and removed as a listener for these events.
140
-     *
141
-     * @param \Doctrine\Common\EventSubscriber $subscriber The subscriber.
142
-     */
143
-    public function removeEventSubscriber(EventSubscriber $subscriber)
144
-    {
145
-        $this->removeEventListener($subscriber->getSubscribedEvents(), $subscriber);
146
-    } 	
147
-}

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

@@ -1,45 +0,0 @@
1
-<?php
2
-/*
3
- *  $Id: EventListener.php 4653 2008-07-10 17:17:58Z romanb $
4
- *
5
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
- *
17
- * This software consists of voluntary contributions made by many individuals
18
- * and is licensed under the MIT license. For more information, see
19
- * <http://www.doctrine-project.org>.
20
- */
21
-
22
-namespace Doctrine\Common;
23
-
24
-/**
25
- * An EventSubscriber knows himself what events he is interested in.
26
- * If an EventSubscriber is added to an EventManager, the manager invokes
27
- * {@link getSubscribedEvents} and registers the subscriber as a listener for all
28
- * returned events.
29
- *
30
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
31
- * @link    www.doctrine-project.org
32
- * @since   2.0
33
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
34
- * @author  Jonathan Wage <jonwage@gmail.com>
35
- * @author  Roman Borschel <roman@code-factory.org>
36
- */
37
-interface EventSubscriber
38
-{
39
-    /**
40
-     * Returns an array of events this subscriber wants to listen to.
41
-     *
42
-     * @return array
43
-     */
44
-    function getSubscribedEvents();
45
-}

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

@@ -1,266 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common;
21
-
22
-/**
23
- * Base class for writing simple lexers, i.e. for creating small DSLs.
24
- *
25
- * @since   2.0
26
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
27
- * @author  Jonathan Wage <jonwage@gmail.com>
28
- * @author  Roman Borschel <roman@code-factory.org>
29
- * @todo Rename: AbstractLexer
30
- */
31
-abstract class Lexer
32
-{
33
-    /**
34
-     * @var array Array of scanned tokens
35
-     */
36
-    private $tokens = array();
37
-
38
-    /**
39
-     * @var integer Current lexer position in input string
40
-     */
41
-    private $position = 0;
42
-
43
-    /**
44
-     * @var integer Current peek of current lexer position
45
-     */
46
-    private $peek = 0;
47
-
48
-    /**
49
-     * @var array The next token in the input.
50
-     */
51
-    public $lookahead;
52
-
53
-    /**
54
-     * @var array The last matched/seen token.
55
-     */
56
-    public $token;
57
-
58
-    /**
59
-     * Sets the input data to be tokenized.
60
-     *
61
-     * The Lexer is immediately reset and the new input tokenized.
62
-     * Any unprocessed tokens from any previous input are lost.
63
-     *
64
-     * @param string $input The input to be tokenized.
65
-     */
66
-    public function setInput($input)
67
-    {
68
-        $this->tokens = array();
69
-        $this->reset();
70
-        $this->scan($input);
71
-    }
72
-
73
-    /**
74
-     * Resets the lexer.
75
-     */
76
-    public function reset()
77
-    {
78
-        $this->lookahead = null;
79
-        $this->token = null;
80
-        $this->peek = 0;
81
-        $this->position = 0;
82
-    }
83
-
84
-    /**
85
-     * Resets the peek pointer to 0.
86
-     */
87
-    public function resetPeek()
88
-    {
89
-        $this->peek = 0;
90
-    }
91
-
92
-    /**
93
-     * Resets the lexer position on the input to the given position.
94
-     *
95
-     * @param integer $position Position to place the lexical scanner
96
-     */
97
-    public function resetPosition($position = 0)
98
-    {
99
-        $this->position = $position;
100
-    }
101
-
102
-    /**
103
-     * Checks whether a given token matches the current lookahead.
104
-     *
105
-     * @param integer|string $token
106
-     * @return boolean
107
-     */
108
-    public function isNextToken($token)
109
-    {
110
-        return null !== $this->lookahead && $this->lookahead['type'] === $token;
111
-    }
112
-
113
-    /**
114
-     * Checks whether any of the given tokens matches the current lookahead
115
-     *
116
-     * @param array $tokens
117
-     * @return boolean
118
-     */
119
-    public function isNextTokenAny(array $tokens)
120
-    {
121
-        return null !== $this->lookahead && in_array($this->lookahead['type'], $tokens, true);
122
-    }
123
-
124
-    /**
125
-     * Moves to the next token in the input string.
126
-     *
127
-     * A token is an associative array containing three items:
128
-     *  - 'value'    : the string value of the token in the input string
129
-     *  - 'type'     : the type of the token (identifier, numeric, string, input
130
-     *                 parameter, none)
131
-     *  - 'position' : the position of the token in the input string
132
-     *
133
-     * @return array|null the next token; null if there is no more tokens left
134
-     */
135
-    public function moveNext()
136
-    {
137
-        $this->peek = 0;
138
-        $this->token = $this->lookahead;
139
-        $this->lookahead = (isset($this->tokens[$this->position]))
140
-            ? $this->tokens[$this->position++] : null;
141
-
142
-        return $this->lookahead !== null;
143
-    }
144
-
145
-    /**
146
-     * Tells the lexer to skip input tokens until it sees a token with the given value.
147
-     *
148
-     * @param string $type The token type to skip until.
149
-     */
150
-    public function skipUntil($type)
151
-    {
152
-        while ($this->lookahead !== null && $this->lookahead['type'] !== $type) {
153
-            $this->moveNext();
154
-        }
155
-    }
156
-
157
-    /**
158
-     * Checks if given value is identical to the given token
159
-     *
160
-     * @param mixed $value
161
-     * @param integer $token
162
-     * @return boolean
163
-     */
164
-    public function isA($value, $token)
165
-    {
166
-        return $this->getType($value) === $token;
167
-    }
168
-
169
-    /**
170
-     * Moves the lookahead token forward.
171
-     *
172
-     * @return array | null The next token or NULL if there are no more tokens ahead.
173
-     */
174
-    public function peek()
175
-    {
176
-        if (isset($this->tokens[$this->position + $this->peek])) {
177
-            return $this->tokens[$this->position + $this->peek++];
178
-        } else {
179
-            return null;
180
-        }
181
-    }
182
-
183
-    /**
184
-     * Peeks at the next token, returns it and immediately resets the peek.
185
-     *
186
-     * @return array|null The next token or NULL if there are no more tokens ahead.
187
-     */
188
-    public function glimpse()
189
-    {
190
-        $peek = $this->peek();
191
-        $this->peek = 0;
192
-        return $peek;
193
-    }
194
-
195
-    /**
196
-     * Scans the input string for tokens.
197
-     *
198
-     * @param string $input a query string
199
-     */
200
-    protected function scan($input)
201
-    {
202
-        static $regex;
203
-
204
-        if ( ! isset($regex)) {
205
-            $regex = '/(' . implode(')|(', $this->getCatchablePatterns()) . ')|'
206
-                   . implode('|', $this->getNonCatchablePatterns()) . '/i';
207
-        }
208
-
209
-        $flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE;
210
-        $matches = preg_split($regex, $input, -1, $flags);
211
-
212
-        foreach ($matches as $match) {
213
-            // Must remain before 'value' assignment since it can change content
214
-            $type = $this->getType($match[0]);
215
-
216
-            $this->tokens[] = array(
217
-                'value' => $match[0],
218
-                'type'  => $type,
219
-                'position' => $match[1],
220
-            );
221
-        }
222
-    }
223
-
224
-    /**
225
-     * Gets the literal for a given token.
226
-     *
227
-     * @param integer $token
228
-     * @return string
229
-     */
230
-    public function getLiteral($token)
231
-    {
232
-        $className = get_class($this);
233
-        $reflClass = new \ReflectionClass($className);
234
-        $constants = $reflClass->getConstants();
235
-
236
-        foreach ($constants as $name => $value) {
237
-            if ($value === $token) {
238
-                return $className . '::' . $name;
239
-            }
240
-        }
241
-
242
-        return $token;
243
-    }
244
-
245
-    /**
246
-     * Lexical catchable patterns.
247
-     *
248
-     * @return array
249
-     */
250
-    abstract protected function getCatchablePatterns();
251
-
252
-    /**
253
-     * Lexical non-catchable patterns.
254
-     *
255
-     * @return array
256
-     */
257
-    abstract protected function getNonCatchablePatterns();
258
-
259
-    /**
260
-     * Retrieve token type. Also processes the token value if necessary.
261
-     *
262
-     * @param string $value
263
-     * @return integer
264
-     */
265
-    abstract protected function getType(&$value);
266
-}

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

@@ -1,45 +0,0 @@
1
-<?php
2
-/*
3
- *  $Id$
4
- *
5
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
- *
17
- * This software consists of voluntary contributions made by many individuals
18
- * and is licensed under the MIT license. For more information, see
19
- * <http://www.doctrine-project.org>.
20
- */
21
-
22
-namespace Doctrine\Common;
23
-
24
-/**
25
- * Contract for classes that provide the service of notifying listeners of
26
- * changes to their properties.
27
- *
28
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
29
- * @link    www.doctrine-project.org
30
- * @since   2.0
31
- * @version $Revision: 3938 $
32
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
33
- * @author  Jonathan Wage <jonwage@gmail.com>
34
- * @author  Roman Borschel <roman@code-factory.org>
35
- */
36
-interface NotifyPropertyChanged
37
-{
38
-    /**
39
-     * Adds a listener that wants to be notified about property changes.
40
-     *
41
-     * @param PropertyChangedListener $listener
42
-     */
43
-    function addPropertyChangedListener(PropertyChangedListener $listener);
44
-}
45
-

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

@@ -1,259 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Persistence;
22
-
23
-use Doctrine\Common\Persistence\ManagerRegistry;
24
-
25
-/**
26
- * Abstract implementation of the ManagerRegistry contract.
27
- *
28
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
29
- * @link    www.doctrine-project.org
30
- * @since   2.2
31
- * @author  Fabien Potencier <fabien@symfony.com>
32
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
33
- * @author  Lukas Kahwe Smith <smith@pooteeweet.org>
34
- */
35
-abstract class AbstractManagerRegistry implements ManagerRegistry
36
-{
37
-    /**
38
-     * @var string
39
-     */
40
-    private $name;
41
-
42
-    /**
43
-     * @var array
44
-     */
45
-    private $connections;
46
-
47
-    /**
48
-     * @var array
49
-     */
50
-    private $managers;
51
-
52
-    /**
53
-     * @var string
54
-     */
55
-    private $defaultConnection;
56
-
57
-    /**
58
-     * @var string
59
-     */
60
-    private $defaultManager;
61
-
62
-    /**
63
-     * @var string
64
-     */
65
-    private $proxyInterfaceName;
66
-
67
-    /**
68
-     * Constructor
69
-     *
70
-     * @param string $name
71
-     * @param array $connections
72
-     * @param array $managers
73
-     * @param string $defaultConnection
74
-     * @param string $defaultManager
75
-     * @param string $proxyInterfaceName
76
-     */
77
-    public function __construct($name, array $connections, array $managers, $defaultConnection, $defaultManager, $proxyInterfaceName)
78
-    {
79
-        $this->name = $name;
80
-        $this->connections = $connections;
81
-        $this->managers = $managers;
82
-        $this->defaultConnection = $defaultConnection;
83
-        $this->defaultManager = $defaultManager;
84
-        $this->proxyInterfaceName = $proxyInterfaceName;
85
-    }
86
-
87
-    /**
88
-     * Fetches/creates the given services
89
-     *
90
-     * A service in this context is connection or a manager instance
91
-     *
92
-     * @param string $name name of the service
93
-     * @return object instance of the given service
94
-     */
95
-    abstract protected function getService($name);
96
-
97
-    /**
98
-     * Resets the given services
99
-     *
100
-     * A service in this context is connection or a manager instance
101
-     *
102
-     * @param string $name name of the service
103
-     * @return void
104
-     */
105
-    abstract protected function resetService($name);
106
-
107
-    /**
108
-     * Get the name of the registry
109
-     *
110
-     * @return string
111
-     */
112
-    public function getName()
113
-    {
114
-        return $this->name;
115
-    }
116
-
117
-    /**
118
-     * {@inheritdoc}
119
-     */
120
-    public function getConnection($name = null)
121
-    {
122
-        if (null === $name) {
123
-            $name = $this->defaultConnection;
124
-        }
125
-
126
-        if (!isset($this->connections[$name])) {
127
-            throw new \InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name));
128
-        }
129
-
130
-        return $this->getService($this->connections[$name]);
131
-    }
132
-
133
-    /**
134
-     * {@inheritdoc}
135
-     */
136
-    public function getConnectionNames()
137
-    {
138
-        return $this->connections;
139
-    }
140
-
141
-    /**
142
-     * {@inheritdoc}
143
-     */
144
-    public function getConnections()
145
-    {
146
-        $connections = array();
147
-        foreach ($this->connections as $name => $id) {
148
-            $connections[$name] = $this->getService($id);
149
-        }
150
-
151
-        return $connections;
152
-    }
153
-
154
-    /**
155
-     * {@inheritdoc}
156
-     */
157
-    public function getDefaultConnectionName()
158
-    {
159
-        return $this->defaultConnection;
160
-    }
161
-
162
-    /**
163
-     * {@inheritdoc}
164
-     */
165
-    public function getDefaultManagerName()
166
-    {
167
-        return $this->defaultManager;
168
-    }
169
-
170
-    /**
171
-     * {@inheritdoc}
172
-     *
173
-     * @throws \InvalidArgumentException
174
-     */
175
-    public function getManager($name = null)
176
-    {
177
-        if (null === $name) {
178
-            $name = $this->defaultManager;
179
-        }
180
-
181
-        if (!isset($this->managers[$name])) {
182
-            throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
183
-        }
184
-
185
-        return $this->getService($this->managers[$name]);
186
-    }
187
-
188
-    /**
189
-     * {@inheritdoc}
190
-     */
191
-    public function getManagerForClass($class)
192
-    {
193
-        // Check for namespace alias
194
-        if (strpos($class, ':') !== false) {
195
-            list($namespaceAlias, $simpleClassName) = explode(':', $class);
196
-            $class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName;
197
-        }
198
-
199
-        $proxyClass = new \ReflectionClass($class);
200
-        if ($proxyClass->implementsInterface($this->proxyInterfaceName)) {
201
-            $class = $proxyClass->getParentClass()->getName();
202
-        }
203
-
204
-        foreach ($this->managers as $id) {
205
-            $manager = $this->getService($id);
206
-
207
-            if (!$manager->getMetadataFactory()->isTransient($class)) {
208
-                return $manager;
209
-            }
210
-        }
211
-    }
212
-
213
-    /**
214
-     * {@inheritdoc}
215
-     */
216
-    public function getManagerNames()
217
-    {
218
-        return $this->managers;
219
-    }
220
-
221
-    /**
222
-     * {@inheritdoc}
223
-     */
224
-    public function getManagers()
225
-    {
226
-        $dms = array();
227
-        foreach ($this->managers as $name => $id) {
228
-            $dms[$name] = $this->getService($id);
229
-        }
230
-
231
-        return $dms;
232
-    }
233
-
234
-    /**
235
-     * {@inheritdoc}
236
-     */
237
-    public function getRepository($persistentObjectName, $persistentManagerName = null)
238
-    {
239
-        return $this->getManager($persistentManagerName)->getRepository($persistentObjectName);
240
-    }
241
-
242
-    /**
243
-     * {@inheritdoc}
244
-     */
245
-    public function resetManager($name = null)
246
-    {
247
-        if (null === $name) {
248
-            $name = $this->defaultManager;
249
-        }
250
-
251
-        if (!isset($this->managers[$name])) {
252
-            throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
253
-        }
254
-
255
-        // force the creation of a new document manager
256
-        // if the current one is closed
257
-        $this->resetService($this->managers[$name]);
258
-    }
259
-}

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

@@ -1,63 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence;
21
-
22
-/**
23
- * Contract covering connection for a Doctrine persistence layer ManagerRegistry class to implement.
24
- *
25
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
26
- * @link    www.doctrine-project.org
27
- * @since   2.2
28
- * @author  Fabien Potencier <fabien@symfony.com>
29
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
30
- * @author  Lukas Kahwe Smith <smith@pooteeweet.org>
31
- */
32
-interface ConnectionRegistry
33
-{
34
-    /**
35
-     * Gets the default connection name.
36
-     *
37
-     * @return string The default connection name
38
-     */
39
-    function getDefaultConnectionName();
40
-
41
-    /**
42
-     * Gets the named connection.
43
-     *
44
-     * @param string $name The connection name (null for the default one)
45
-     *
46
-     * @return object
47
-     */
48
-    function getConnection($name = null);
49
-
50
-    /**
51
-     * Gets an array of all registered connections
52
-     *
53
-     * @return array An array of Connection instances
54
-     */
55
-    function getConnections();
56
-
57
-    /**
58
-     * Gets all connection names.
59
-     *
60
-     * @return array An array of connection names
61
-     */
62
-    function getConnectionNames();
63
-}

+ 0 - 77
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php View File

@@ -1,77 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
-*/
19
-
20
-namespace Doctrine\Common\Persistence\Event;
21
-
22
-use Doctrine\Common\EventArgs;
23
-use Doctrine\Common\Persistence\ObjectManager;
24
-
25
-/**
26
- * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
27
- * of entities.
28
- *
29
- * @link   www.doctrine-project.org
30
- * @since  2.2
31
- * @author Roman Borschel <roman@code-factory.de>
32
- * @author Benjamin Eberlei <kontakt@beberlei.de>
33
- */
34
-class LifecycleEventArgs extends EventArgs
35
-{
36
-    /**
37
-     * @var ObjectManager
38
-     */
39
-    private $objectManager;
40
-
41
-    /**
42
-     * @var object
43
-     */
44
-    private $entity;
45
-
46
-    /**
47
-     * Constructor
48
-     *
49
-     * @param object $entity
50
-     * @param ObjectManager $objectManager
51
-     */
52
-    public function __construct($entity, ObjectManager $objectManager)
53
-    {
54
-        $this->entity = $entity;
55
-        $this->objectManager = $objectManager;
56
-    }
57
-
58
-    /**
59
-     * Retrieve associated Entity.
60
-     *
61
-     * @return object
62
-     */
63
-    public function getEntity()
64
-    {
65
-        return $this->entity;
66
-    }
67
-
68
-    /**
69
-     * Retrieve associated ObjectManager.
70
-     *
71
-     * @return ObjectManager
72
-     */
73
-    public function getObjectManager()
74
-    {
75
-        return $this->objectManager;
76
-    }
77
-}

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

@@ -1,76 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Event;
21
-
22
-use Doctrine\Common\EventArgs;
23
-use Doctrine\Common\Persistence\ObjectManager;
24
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
25
-
26
-/**
27
- * Class that holds event arguments for a loadMetadata event.
28
- *
29
- * @author Jonathan H. Wage <jonwage@gmail.com>
30
- * @since  2.2
31
- */
32
-class LoadClassMetadataEventArgs extends EventArgs
33
-{
34
-    /**
35
-     * @var ClassMetadata
36
-     */
37
-    private $classMetadata;
38
-
39
-    /**
40
-     * @var ObjectManager
41
-     */
42
-    private $objectManager;
43
-
44
-    /**
45
-     * Constructor.
46
-     *
47
-     * @param ClassMetadata $classMetadata
48
-     * @param ObjectManager $objectManager
49
-     */
50
-    public function __construct(ClassMetadata $classMetadata, ObjectManager $objectManager)
51
-    {
52
-        $this->classMetadata = $classMetadata;
53
-        $this->objectManager = $objectManager;
54
-    }
55
-
56
-    /**
57
-     * Retrieve associated ClassMetadata.
58
-     *
59
-     * @return ClassMetadata
60
-     */
61
-    public function getClassMetadata()
62
-    {
63
-        return $this->classMetadata;
64
-    }
65
-
66
-    /**
67
-     * Retrieve associated ObjectManager.
68
-     *
69
-     * @return ObjectManager
70
-     */
71
-    public function getObjectManager()
72
-    {
73
-        return $this->objectManager;
74
-    }
75
-}
76
-

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

@@ -1,59 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
-*/
19
-
20
-namespace Doctrine\Common\Persistence\Event;
21
-
22
-use Doctrine\Common\Persistence\ObjectManager;
23
-
24
-/**
25
- * Provides event arguments for the preFlush event.
26
- *
27
- * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
28
- * @link        www.doctrine-project.org
29
- * @since       2.2
30
- * @author      Roman Borschel <roman@code-factory.de>
31
- * @author      Benjamin Eberlei <kontakt@beberlei.de>
32
- */
33
-class ManagerEventArgs extends \Doctrine\Common\EventArgs
34
-{
35
-    /**
36
-     * @var ObjectManager
37
-     */
38
-    private $objectManager;
39
-
40
-    /**
41
-     * Constructor.
42
-     *
43
-     * @param ObjectManager $objectManager
44
-     */
45
-    public function __construct(ObjectManager $objectManager)
46
-    {
47
-        $this->objectManager = $objectManager;
48
-    }
49
-
50
-    /**
51
-     * Retrieve associated ObjectManager.
52
-     *
53
-     * @return ObjectManager
54
-     */
55
-    public function getObjectManager()
56
-    {
57
-        return $this->objectManager;
58
-    }
59
-}

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

@@ -1,84 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Event;
21
-
22
-/**
23
- * Provides event arguments for the onClear event.
24
- *
25
- * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
26
- * @link        www.doctrine-project.org
27
- * @since       2.2
28
- * @author      Roman Borschel <roman@code-factory.de>
29
- * @author      Benjamin Eberlei <kontakt@beberlei.de>
30
- */
31
-class OnClearEventArgs extends \Doctrine\Common\EventArgs
32
-{
33
-    /**
34
-     * @var \Doctrine\Common\Persistence\ObjectManager
35
-     */
36
-    private $objectManager;
37
-
38
-    /**
39
-     * @var string
40
-     */
41
-    private $entityClass;
42
-
43
-    /**
44
-     * Constructor.
45
-     *
46
-     * @param \Doctrine\Common\Persistence\ObjectManager $objectManager
47
-     * @param string $entityClass Optional entity class
48
-     */
49
-    public function __construct($objectManager, $entityClass = null)
50
-    {
51
-        $this->objectManager = $objectManager;
52
-        $this->entityClass = $entityClass;
53
-    }
54
-
55
-    /**
56
-     * Retrieve associated ObjectManager.
57
-     *
58
-     * @return \Doctrine\Common\Persistence\ObjectManager
59
-     */
60
-    public function getObjectManager()
61
-    {
62
-        return $this->objectManager;
63
-    }
64
-
65
-    /**
66
-     * Name of the entity class that is cleared, or empty if all are cleared.
67
-     *
68
-     * @return string
69
-     */
70
-    public function getEntityClass()
71
-    {
72
-        return $this->entityClass;
73
-    }
74
-
75
-    /**
76
-     * Check if event clears all entities.
77
-     *
78
-     * @return bool
79
-     */
80
-    public function clearsAllEntities()
81
-    {
82
-        return ($this->entityClass === null);
83
-    }
84
-}

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

@@ -1,133 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Event;
21
-
22
-use Doctrine\Common\EventArgs,
23
-    Doctrine\Common\Persistence\ObjectManager;
24
-
25
-/**
26
- * Class that holds event arguments for a preUpdate event.
27
- *
28
- * @author Guilherme Blanco <guilehrmeblanco@hotmail.com>
29
- * @author Roman Borschel <roman@code-factory.org>
30
- * @author Benjamin Eberlei <kontakt@beberlei.de>
31
- * @since  2.2
32
- */
33
-class PreUpdateEventArgs extends LifecycleEventArgs
34
-{
35
-    /**
36
-     * @var array
37
-     */
38
-    private $entityChangeSet;
39
-
40
-    /**
41
-     * Constructor.
42
-     *
43
-     * @param object $entity
44
-     * @param ObjectManager $objectManager
45
-     * @param array $changeSet
46
-     */
47
-    public function __construct($entity, ObjectManager $objectManager, array &$changeSet)
48
-    {
49
-        parent::__construct($entity, $objectManager);
50
-
51
-        $this->entityChangeSet = &$changeSet;
52
-    }
53
-
54
-    /**
55
-     * Retrieve entity changeset.
56
-     *
57
-     * @return array
58
-     */
59
-    public function getEntityChangeSet()
60
-    {
61
-        return $this->entityChangeSet;
62
-    }
63
-
64
-    /**
65
-     * Check if field has a changeset.
66
-     *
67
-     * @param string $field
68
-     *
69
-     * @return boolean
70
-     */
71
-    public function hasChangedField($field)
72
-    {
73
-        return isset($this->entityChangeSet[$field]);
74
-    }
75
-
76
-    /**
77
-     * Get the old value of the changeset of the changed field.
78
-     *
79
-     * @param  string $field
80
-     * @return mixed
81
-     */
82
-    public function getOldValue($field)
83
-    {
84
-        $this->assertValidField($field);
85
-
86
-        return $this->entityChangeSet[$field][0];
87
-    }
88
-
89
-    /**
90
-     * Get the new value of the changeset of the changed field.
91
-     *
92
-     * @param  string $field
93
-     * @return mixed
94
-     */
95
-    public function getNewValue($field)
96
-    {
97
-        $this->assertValidField($field);
98
-
99
-        return $this->entityChangeSet[$field][1];
100
-    }
101
-
102
-    /**
103
-     * Set the new value of this field.
104
-     *
105
-     * @param string $field
106
-     * @param mixed $value
107
-     */
108
-    public function setNewValue($field, $value)
109
-    {
110
-        $this->assertValidField($field);
111
-
112
-        $this->entityChangeSet[$field][1] = $value;
113
-    }
114
-
115
-    /**
116
-     * Assert the field exists in changeset.
117
-     *
118
-     * @param string $field
119
-     *
120
-     * @throws \InvalidArgumentException
121
-     */
122
-    private function assertValidField($field)
123
-    {
124
-        if ( ! isset($this->entityChangeSet[$field])) {
125
-            throw new \InvalidArgumentException(sprintf(
126
-                'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.',
127
-                $field,
128
-                get_class($this->getEntity())
129
-            ));
130
-        }
131
-    }
132
-}
133
-

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

@@ -1,112 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence;
21
-
22
-/**
23
- * Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement.
24
- *
25
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
26
- * @link    www.doctrine-project.org
27
- * @since   2.2
28
- * @author  Fabien Potencier <fabien@symfony.com>
29
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
30
- * @author  Lukas Kahwe Smith <smith@pooteeweet.org>
31
- */
32
-interface ManagerRegistry extends ConnectionRegistry
33
-{
34
-    /**
35
-     * Gets the default object manager name.
36
-     *
37
-     * @return string The default object manager name
38
-     */
39
-    function getDefaultManagerName();
40
-
41
-    /**
42
-     * Gets a named object manager.
43
-     *
44
-     * @param string $name The object manager name (null for the default one)
45
-     *
46
-     * @return \Doctrine\Common\Persistence\ObjectManager
47
-     */
48
-    function getManager($name = null);
49
-
50
-    /**
51
-     * Gets an array of all registered object managers
52
-     *
53
-     * @return \Doctrine\Common\Persistence\ObjectManager[] An array of ObjectManager instances
54
-     */
55
-    function getManagers();
56
-
57
-    /**
58
-     * Resets a named object manager.
59
-     *
60
-     * This method is useful when an object manager has been closed
61
-     * because of a rollbacked transaction AND when you think that
62
-     * it makes sense to get a new one to replace the closed one.
63
-     *
64
-     * Be warned that you will get a brand new object manager as
65
-     * the existing one is not useable anymore. This means that any
66
-     * other object with a dependency on this object manager will
67
-     * hold an obsolete reference. You can inject the registry instead
68
-     * to avoid this problem.
69
-     *
70
-     * @param string $name The object manager name (null for the default one)
71
-     *
72
-     * @return \Doctrine\Common\Persistence\ObjectManager
73
-     */
74
-    function resetManager($name = null);
75
-
76
-    /**
77
-     * Resolves a registered namespace alias to the full namespace.
78
-     *
79
-     * This method looks for the alias in all registered object managers.
80
-     *
81
-     * @param string $alias The alias
82
-     *
83
-     * @return string The full namespace
84
-     */
85
-    function getAliasNamespace($alias);
86
-
87
-    /**
88
-     * Gets all connection names.
89
-     *
90
-     * @return array An array of connection names
91
-     */
92
-    function getManagerNames();
93
-
94
-    /**
95
-     * Gets the ObjectRepository for an persistent object.
96
-     *
97
-     * @param string $persistentObject        The name of the persistent object.
98
-     * @param string $persistentManagerName The object manager name (null for the default one)
99
-     *
100
-     * @return \Doctrine\Common\Persistence\ObjectRepository
101
-     */
102
-    function getRepository($persistentObject, $persistentManagerName = null);
103
-
104
-    /**
105
-     * Gets the object manager associated with a given class.
106
-     *
107
-     * @param string $class A persistent object class name
108
-     *
109
-     * @return \Doctrine\Common\Persistence\ObjectManager|null
110
-     */
111
-    function getManagerForClass($class);
112
-}

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

@@ -1,383 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping;
21
-
22
-use Doctrine\Common\Cache\Cache,
23
-    Doctrine\Common\Util\ClassUtils;
24
-
25
-/**
26
- * The ClassMetadataFactory is used to create ClassMetadata objects that contain all the
27
- * metadata mapping informations of a class which describes how a class should be mapped
28
- * to a relational database.
29
- *
30
- * This class was abstracted from the ORM ClassMetadataFactory
31
- *
32
- * @since   2.2
33
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
34
- * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
35
- * @author  Jonathan Wage <jonwage@gmail.com>
36
- * @author  Roman Borschel <roman@code-factory.org>
37
- */
38
-abstract class AbstractClassMetadataFactory implements ClassMetadataFactory
39
-{
40
-    /**
41
-     * Salt used by specific Object Manager implementation.
42
-     *
43
-     * @var string
44
-     */
45
-    protected $cacheSalt = "\$CLASSMETADATA";
46
-
47
-    /**
48
-     * @var \Doctrine\Common\Cache\Cache
49
-     */
50
-    private $cacheDriver;
51
-
52
-    /**
53
-     * @var array
54
-     */
55
-    private $loadedMetadata = array();
56
-
57
-    /**
58
-     * @var bool
59
-     */
60
-    protected $initialized = false;
61
-
62
-    /**
63
-     * @var ReflectionService
64
-     */
65
-    private $reflectionService;
66
-
67
-    /**
68
-     * Sets the cache driver used by the factory to cache ClassMetadata instances.
69
-     *
70
-     * @param Doctrine\Common\Cache\Cache $cacheDriver
71
-     */
72
-    public function setCacheDriver(Cache $cacheDriver = null)
73
-    {
74
-        $this->cacheDriver = $cacheDriver;
75
-    }
76
-
77
-    /**
78
-     * Gets the cache driver used by the factory to cache ClassMetadata instances.
79
-     *
80
-     * @return Doctrine\Common\Cache\Cache
81
-     */
82
-    public function getCacheDriver()
83
-    {
84
-        return $this->cacheDriver;
85
-    }
86
-
87
-    /**
88
-     * Return an array of all the loaded metadata currently in memory.
89
-     *
90
-     * @return array
91
-     */
92
-    public function getLoadedMetadata()
93
-    {
94
-        return $this->loadedMetadata;
95
-    }
96
-
97
-    /**
98
-     * Forces the factory to load the metadata of all classes known to the underlying
99
-     * mapping driver.
100
-     *
101
-     * @return array The ClassMetadata instances of all mapped classes.
102
-     */
103
-    public function getAllMetadata()
104
-    {
105
-        if ( ! $this->initialized) {
106
-            $this->initialize();
107
-        }
108
-
109
-        $driver = $this->getDriver();
110
-        $metadata = array();
111
-        foreach ($driver->getAllClassNames() as $className) {
112
-            $metadata[] = $this->getMetadataFor($className);
113
-        }
114
-
115
-        return $metadata;
116
-    }
117
-
118
-    /**
119
-     * Lazy initialization of this stuff, especially the metadata driver,
120
-     * since these are not needed at all when a metadata cache is active.
121
-     *
122
-     * @return void
123
-     */
124
-    abstract protected function initialize();
125
-
126
-    /**
127
-     * Get the fully qualified class-name from the namespace alias.
128
-     *
129
-     * @param string $namespaceAlias
130
-     * @param string $simpleClassName
131
-     * @return string
132
-     */
133
-    abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName);
134
-
135
-    /**
136
-     * Return the mapping driver implementation.
137
-     *
138
-     * @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
139
-     */
140
-    abstract protected function getDriver();
141
-
142
-    /**
143
-     * Wakeup reflection after ClassMetadata gets unserialized from cache.
144
-     *
145
-     * @param ClassMetadata $class
146
-     * @param ReflectionService $reflService
147
-     * @return void
148
-     */
149
-    abstract protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService);
150
-
151
-    /**
152
-     * Initialize Reflection after ClassMetadata was constructed.
153
-     *
154
-     * @param ClassMetadata $class
155
-     * @param ReflectionService $reflService
156
-     * @return void
157
-     */
158
-    abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService);
159
-
160
-    /**
161
-     * Checks whether the class metadata is an entity.
162
-     *
163
-     * This method should false for mapped superclasses or
164
-     * embedded classes.
165
-     *
166
-     * @param ClassMetadata $class
167
-     * @return boolean
168
-     */
169
-    abstract protected function isEntity(ClassMetadata $class);
170
-
171
-    /**
172
-     * Gets the class metadata descriptor for a class.
173
-     *
174
-     * @param string $className The name of the class.
175
-     * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata
176
-     */
177
-    public function getMetadataFor($className)
178
-    {
179
-        if (isset($this->loadedMetadata[$className])) {
180
-            return $this->loadedMetadata[$className];
181
-        }
182
-
183
-        $realClassName = $className;
184
-
185
-        // Check for namespace alias
186
-        if (strpos($className, ':') !== false) {
187
-            list($namespaceAlias, $simpleClassName) = explode(':', $className);
188
-            $realClassName = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName);
189
-        } else {
190
-            $realClassName = ClassUtils::getRealClass($realClassName);
191
-        }
192
-
193
-        if (isset($this->loadedMetadata[$realClassName])) {
194
-            // We do not have the alias name in the map, include it
195
-            $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
196
-
197
-            return $this->loadedMetadata[$realClassName];
198
-        }
199
-
200
-        if ($this->cacheDriver) {
201
-            if (($cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt)) !== false) {
202
-                $this->loadedMetadata[$realClassName] = $cached;
203
-                $this->wakeupReflection($cached, $this->getReflectionService());
204
-            } else {
205
-                foreach ($this->loadMetadata($realClassName) as $loadedClassName) {
206
-                    $this->cacheDriver->save(
207
-                        $loadedClassName . $this->cacheSalt, $this->loadedMetadata[$loadedClassName], null
208
-                    );
209
-                }
210
-            }
211
-        } else {
212
-            $this->loadMetadata($realClassName);
213
-        }
214
-
215
-        if ($className != $realClassName) {
216
-            // We do not have the alias name in the map, include it
217
-            $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName];
218
-        }
219
-
220
-        return $this->loadedMetadata[$className];
221
-    }
222
-
223
-    /**
224
-     * Checks whether the factory has the metadata for a class loaded already.
225
-     *
226
-     * @param string $className
227
-     * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
228
-     */
229
-    public function hasMetadataFor($className)
230
-    {
231
-        return isset($this->loadedMetadata[$className]);
232
-    }
233
-
234
-    /**
235
-     * Sets the metadata descriptor for a specific class.
236
-     *
237
-     * NOTE: This is only useful in very special cases, like when generating proxy classes.
238
-     *
239
-     * @param string $className
240
-     * @param ClassMetadata $class
241
-     */
242
-    public function setMetadataFor($className, $class)
243
-    {
244
-        $this->loadedMetadata[$className] = $class;
245
-    }
246
-
247
-    /**
248
-     * Get array of parent classes for the given entity class
249
-     *
250
-     * @param string $name
251
-     * @return array $parentClasses
252
-     */
253
-    protected function getParentClasses($name)
254
-    {
255
-        // Collect parent classes, ignoring transient (not-mapped) classes.
256
-        $parentClasses = array();
257
-        foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) {
258
-            if ( ! $this->getDriver()->isTransient($parentClass)) {
259
-                $parentClasses[] = $parentClass;
260
-            }
261
-        }
262
-        return $parentClasses;
263
-    }
264
-
265
-    /**
266
-     * Loads the metadata of the class in question and all it's ancestors whose metadata
267
-     * is still not loaded.
268
-     *
269
-     * @param string $name The name of the class for which the metadata should get loaded.
270
-     *
271
-     * @return array
272
-     */
273
-    protected function loadMetadata($name)
274
-    {
275
-        if ( ! $this->initialized) {
276
-            $this->initialize();
277
-        }
278
-
279
-        $loaded = array();
280
-
281
-        $parentClasses = $this->getParentClasses($name);
282
-        $parentClasses[] = $name;
283
-
284
-        // Move down the hierarchy of parent classes, starting from the topmost class
285
-        $parent = null;
286
-        $rootEntityFound = false;
287
-        $visited = array();
288
-        $reflService = $this->getReflectionService();
289
-        foreach ($parentClasses as $className) {
290
-            if (isset($this->loadedMetadata[$className])) {
291
-                $parent = $this->loadedMetadata[$className];
292
-                if ($this->isEntity($parent)) {
293
-                    $rootEntityFound = true;
294
-                    array_unshift($visited, $className);
295
-                }
296
-                continue;
297
-            }
298
-
299
-            $class = $this->newClassMetadataInstance($className);
300
-            $this->initializeReflection($class, $reflService);
301
-
302
-            $this->doLoadMetadata($class, $parent, $rootEntityFound, $visited);
303
-
304
-            $this->loadedMetadata[$className] = $class;
305
-
306
-            $parent = $class;
307
-
308
-            if ($this->isEntity($class)) {
309
-                $rootEntityFound = true;
310
-                array_unshift($visited, $className);
311
-            }
312
-
313
-            $this->wakeupReflection($class, $reflService);
314
-
315
-            $loaded[] = $className;
316
-        }
317
-
318
-        return $loaded;
319
-    }
320
-
321
-    /**
322
-     * Actually load the metadata from the underlying metadata
323
-     *
324
-     * @param ClassMetadata $class
325
-     * @param ClassMetadata|null $parent
326
-     * @param bool $rootEntityFound
327
-     * @param array $nonSuperclassParents classnames all parent classes that are not marked as mapped superclasses
328
-     * @return void
329
-     */
330
-    abstract protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents);
331
-
332
-    /**
333
-     * Creates a new ClassMetadata instance for the given class name.
334
-     *
335
-     * @param string $className
336
-     * @return ClassMetadata
337
-     */
338
-    abstract protected function newClassMetadataInstance($className);
339
-
340
-    /**
341
-     * Check if this class is mapped by this Object Manager + ClassMetadata configuration
342
-     *
343
-     * @param $class
344
-     * @return bool
345
-     */
346
-    public function isTransient($class)
347
-    {
348
-        if ( ! $this->initialized) {
349
-            $this->initialize();
350
-        }
351
-
352
-        // Check for namespace alias
353
-        if (strpos($class, ':') !== false) {
354
-            list($namespaceAlias, $simpleClassName) = explode(':', $class);
355
-            $class = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName);
356
-        }
357
-
358
-        return $this->getDriver()->isTransient($class);
359
-    }
360
-
361
-    /**
362
-     * Set reflectionService.
363
-     *
364
-     * @param ReflectionService $reflectionService
365
-     */
366
-    public function setReflectionService(ReflectionService $reflectionService)
367
-    {
368
-        $this->reflectionService = $reflectionService;
369
-    }
370
-
371
-    /**
372
-     * Get the reflection service associated with this metadata factory.
373
-     *
374
-     * @return ReflectionService
375
-     */
376
-    public function getReflectionService()
377
-    {
378
-        if ($this->reflectionService === null) {
379
-            $this->reflectionService = new RuntimeReflectionService();
380
-        }
381
-        return $this->reflectionService;
382
-    }
383
-}

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

@@ -1,165 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping;
21
-
22
-/**
23
- * Contract for a Doctrine persistence layer ClassMetadata class to implement.
24
- *
25
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
26
- * @link    www.doctrine-project.org
27
- * @since   2.1
28
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
29
- * @author  Jonathan Wage <jonwage@gmail.com>
30
- */
31
-interface ClassMetadata
32
-{
33
-    /**
34
-     * Get fully-qualified class name of this persistent class.
35
-     *
36
-     * @return string
37
-     */
38
-    function getName();
39
-
40
-    /**
41
-     * Gets the mapped identifier field name.
42
-     *
43
-     * The returned structure is an array of the identifier field names.
44
-     *
45
-     * @return array
46
-     */
47
-    function getIdentifier();
48
-
49
-    /**
50
-     * Gets the ReflectionClass instance for this mapped class.
51
-     *
52
-     * @return \ReflectionClass
53
-     */
54
-    function getReflectionClass();
55
-
56
-    /**
57
-     * Checks if the given field name is a mapped identifier for this class.
58
-     *
59
-     * @param string $fieldName
60
-     * @return boolean
61
-     */
62
-    function isIdentifier($fieldName);
63
-
64
-    /**
65
-     * Checks if the given field is a mapped property for this class.
66
-     *
67
-     * @param string $fieldName
68
-     * @return boolean
69
-     */
70
-    function hasField($fieldName);
71
-
72
-    /**
73
-     * Checks if the given field is a mapped association for this class.
74
-     *
75
-     * @param string $fieldName
76
-     * @return boolean
77
-     */
78
-    function hasAssociation($fieldName);
79
-
80
-    /**
81
-     * Checks if the given field is a mapped single valued association for this class.
82
-     *
83
-     * @param string $fieldName
84
-     * @return boolean
85
-     */
86
-    function isSingleValuedAssociation($fieldName);
87
-
88
-    /**
89
-     * Checks if the given field is a mapped collection valued association for this class.
90
-     *
91
-     * @param string $fieldName
92
-     * @return boolean
93
-     */
94
-    function isCollectionValuedAssociation($fieldName);
95
-
96
-    /**
97
-     * A numerically indexed list of field names of this persistent class.
98
-     *
99
-     * This array includes identifier fields if present on this class.
100
-     *
101
-     * @return array
102
-     */
103
-    function getFieldNames();
104
-
105
-    /**
106
-     * Returns an array of identifier field names numerically indexed.
107
-     *
108
-     * @return array
109
-     */
110
-    function getIdentifierFieldNames();
111
-
112
-    /**
113
-     * A numerically indexed list of association names of this persistent class.
114
-     *
115
-     * This array includes identifier associations if present on this class.
116
-     *
117
-     * @return array
118
-     */
119
-    function getAssociationNames();
120
-
121
-    /**
122
-     * Returns a type name of this field.
123
-     *
124
-     * This type names can be implementation specific but should at least include the php types:
125
-     * integer, string, boolean, float/double, datetime.
126
-     *
127
-     * @param string $fieldName
128
-     * @return string
129
-     */
130
-    function getTypeOfField($fieldName);
131
-
132
-    /**
133
-     * Returns the target class name of the given association.
134
-     *
135
-     * @param string $assocName
136
-     * @return string
137
-     */
138
-    function getAssociationTargetClass($assocName);
139
-
140
-    /**
141
-     * Checks if the association is the inverse side of a bidirectional association
142
-     *
143
-     * @param string $assocName
144
-     * @return boolean
145
-     */
146
-    function isAssociationInverseSide($assocName);
147
-
148
-    /**
149
-     * Returns the target field of the owning side of the association
150
-     *
151
-     * @param string $assocName
152
-     * @return string
153
-     */
154
-    function getAssociationMappedByTargetField($assocName);
155
-
156
-    /**
157
-     * Return the identifier of this object as an array with field name as key.
158
-     *
159
-     * Has to return an empty array if no identifier isset.
160
-     *
161
-     * @param object $object
162
-     * @return array
163
-     */
164
-    function getIdentifierValues($object);
165
-}

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

@@ -1,74 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping;
21
-
22
-/**
23
- * Contract for a Doctrine persistence layer ClassMetadata class to implement.
24
- *
25
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
26
- * @link    www.doctrine-project.org
27
- * @since   2.1
28
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
29
- * @author  Jonathan Wage <jonwage@gmail.com>
30
- */
31
-interface ClassMetadataFactory
32
-{
33
-    /**
34
-     * Forces the factory to load the metadata of all classes known to the underlying
35
-     * mapping driver.
36
-     *
37
-     * @return array The ClassMetadata instances of all mapped classes.
38
-     */
39
-    function getAllMetadata();
40
-
41
-    /**
42
-     * Gets the class metadata descriptor for a class.
43
-     *
44
-     * @param string $className The name of the class.
45
-     * @return ClassMetadata
46
-     */
47
-    function getMetadataFor($className);
48
-
49
-    /**
50
-     * Checks whether the factory has the metadata for a class loaded already.
51
-     *
52
-     * @param string $className
53
-     * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
54
-     */
55
-    function hasMetadataFor($className);
56
-
57
-    /**
58
-     * Sets the metadata descriptor for a specific class.
59
-     *
60
-     * @param string $className
61
-     * @param ClassMetadata $class
62
-     */
63
-    function setMetadataFor($className, $class);
64
-
65
-    /**
66
-     * Whether the class with the specified name should have its metadata loaded.
67
-     * This is only the case if it is either mapped directly or as a
68
-     * MappedSuperclass.
69
-     *
70
-     * @param string $className
71
-     * @return boolean
72
-     */
73
-    function isTransient($className);
74
-}

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

@@ -1,214 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-use Doctrine\Common\Cache\ArrayCache,
23
-    Doctrine\Common\Annotations\AnnotationReader,
24
-    Doctrine\Common\Annotations\AnnotationRegistry,
25
-    Doctrine\Common\Persistence\Mapping\MappingException;
26
-
27
-/**
28
- * The AnnotationDriver reads the mapping metadata from docblock annotations.
29
- *
30
- * @since 2.2
31
- * @author Benjamin Eberlei <kontakt@beberlei.de>
32
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
33
- * @author Jonathan H. Wage <jonwage@gmail.com>
34
- * @author Roman Borschel <roman@code-factory.org>
35
- */
36
-abstract class AnnotationDriver implements MappingDriver
37
-{
38
-    /**
39
-     * The AnnotationReader.
40
-     *
41
-     * @var AnnotationReader
42
-     */
43
-    protected $reader;
44
-
45
-    /**
46
-     * The paths where to look for mapping files.
47
-     *
48
-     * @var array
49
-     */
50
-    protected $paths = array();
51
-
52
-    /**
53
-     * The file extension of mapping documents.
54
-     *
55
-     * @var string
56
-     */
57
-    protected $fileExtension = '.php';
58
-
59
-    /**
60
-     * Cache for AnnotationDriver#getAllClassNames()
61
-     *
62
-     * @var array
63
-     */
64
-    protected $classNames;
65
-
66
-    /**
67
-     * Name of the entity annotations as keys
68
-     *
69
-     * @var array
70
-     */
71
-    protected $entityAnnotationClasses = array();
72
-
73
-    /**
74
-     * Initializes a new AnnotationDriver that uses the given AnnotationReader for reading
75
-     * docblock annotations.
76
-     *
77
-     * @param AnnotationReader $reader The AnnotationReader to use, duck-typed.
78
-     * @param string|array $paths One or multiple paths where mapping classes can be found.
79
-     */
80
-    public function __construct($reader, $paths = null)
81
-    {
82
-        $this->reader = $reader;
83
-        if ($paths) {
84
-            $this->addPaths((array) $paths);
85
-        }
86
-    }
87
-
88
-    /**
89
-     * Append lookup paths to metadata driver.
90
-     *
91
-     * @param array $paths
92
-     */
93
-    public function addPaths(array $paths)
94
-    {
95
-        $this->paths = array_unique(array_merge($this->paths, $paths));
96
-    }
97
-
98
-    /**
99
-     * Retrieve the defined metadata lookup paths.
100
-     *
101
-     * @return array
102
-     */
103
-    public function getPaths()
104
-    {
105
-        return $this->paths;
106
-    }
107
-
108
-    /**
109
-     * Retrieve the current annotation reader
110
-     *
111
-     * @return AnnotationReader
112
-     */
113
-    public function getReader()
114
-    {
115
-        return $this->reader;
116
-    }
117
-
118
-    /**
119
-     * Get the file extension used to look for mapping files under
120
-     *
121
-     * @return string
122
-     */
123
-    public function getFileExtension()
124
-    {
125
-        return $this->fileExtension;
126
-    }
127
-
128
-    /**
129
-     * Set the file extension used to look for mapping files under
130
-     *
131
-     * @param string $fileExtension The file extension to set
132
-     * @return void
133
-     */
134
-    public function setFileExtension($fileExtension)
135
-    {
136
-        $this->fileExtension = $fileExtension;
137
-    }
138
-
139
-    /**
140
-     * Whether the class with the specified name is transient. Only non-transient
141
-     * classes, that is entities and mapped superclasses, should have their metadata loaded.
142
-     *
143
-     * A class is non-transient if it is annotated with an annotation
144
-     * from the {@see AnnotationDriver::entityAnnotationClasses}.
145
-     *
146
-     * @param string $className
147
-     * @return boolean
148
-     */
149
-    public function isTransient($className)
150
-    {
151
-        $classAnnotations = $this->reader->getClassAnnotations(new \ReflectionClass($className));
152
-
153
-        foreach ($classAnnotations as $annot) {
154
-            if (isset($this->entityAnnotationClasses[get_class($annot)])) {
155
-                return false;
156
-            }
157
-        }
158
-        return true;
159
-    }
160
-
161
-    /**
162
-     * {@inheritDoc}
163
-     */
164
-    public function getAllClassNames()
165
-    {
166
-        if ($this->classNames !== null) {
167
-            return $this->classNames;
168
-        }
169
-
170
-        if (!$this->paths) {
171
-            throw MappingException::pathRequired();
172
-        }
173
-
174
-        $classes = array();
175
-        $includedFiles = array();
176
-
177
-        foreach ($this->paths as $path) {
178
-            if ( ! is_dir($path)) {
179
-                throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
180
-            }
181
-
182
-            $iterator = new \RegexIterator(
183
-                new \RecursiveIteratorIterator(
184
-                    new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS),
185
-                    \RecursiveIteratorIterator::LEAVES_ONLY
186
-                ),
187
-                '/^.+' . str_replace('.', '\.', $this->fileExtension) . '$/i',
188
-                \RecursiveRegexIterator::GET_MATCH
189
-            );
190
-
191
-            foreach ($iterator as $file) {
192
-                $sourceFile = realpath($file[0]);
193
-
194
-                require_once $sourceFile;
195
-
196
-                $includedFiles[] = $sourceFile;
197
-            }
198
-        }
199
-
200
-        $declared = get_declared_classes();
201
-
202
-        foreach ($declared as $className) {
203
-            $rc = new \ReflectionClass($className);
204
-            $sourceFile = $rc->getFileName();
205
-            if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) {
206
-                $classes[] = $className;
207
-            }
208
-        }
209
-
210
-        $this->classNames = $classes;
211
-
212
-        return $classes;
213
-    }
214
-}

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

@@ -1,170 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
-*/
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-use Doctrine\Common\Persistence\Mapping\MappingException;
23
-
24
-/**
25
- * Locate the file that contains the metadata information for a given class name.
26
- *
27
- * This behavior is inpependent of the actual content of the file. It just detects
28
- * the file which is responsible for the given class name.
29
- *
30
- * @author Benjamin Eberlei <kontakt@beberlei.de>
31
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
32
- */
33
-class DefaultFileLocator implements FileLocator
34
-{
35
-    /**
36
-     * The paths where to look for mapping files.
37
-     *
38
-     * @var array
39
-     */
40
-    protected $paths = array();
41
-
42
-    /**
43
-     * The file extension of mapping documents.
44
-     *
45
-     * @var string
46
-     */
47
-    protected $fileExtension;
48
-
49
-    /**
50
-     * Initializes a new FileDriver that looks in the given path(s) for mapping
51
-     * documents and operates in the specified operating mode.
52
-     *
53
-     * @param string|array $paths One or multiple paths where mapping documents can be found.
54
-     * @param string|null $fileExtension
55
-     */
56
-    public function __construct($paths, $fileExtension = null)
57
-    {
58
-        $this->addPaths((array) $paths);
59
-        $this->fileExtension = $fileExtension;
60
-    }
61
-
62
-    /**
63
-     * Append lookup paths to metadata driver.
64
-     *
65
-     * @param array $paths
66
-     */
67
-    public function addPaths(array $paths)
68
-    {
69
-        $this->paths = array_unique(array_merge($this->paths, $paths));
70
-    }
71
-
72
-    /**
73
-     * Retrieve the defined metadata lookup paths.
74
-     *
75
-     * @return array
76
-     */
77
-    public function getPaths()
78
-    {
79
-        return $this->paths;
80
-    }
81
-
82
-    /**
83
-     * Get the file extension used to look for mapping files under
84
-     *
85
-     * @return string
86
-     */
87
-    public function getFileExtension()
88
-    {
89
-        return $this->fileExtension;
90
-    }
91
-
92
-    /**
93
-     * Set the file extension used to look for mapping files under
94
-     *
95
-     * @param string $fileExtension The file extension to set
96
-     * @return void
97
-     */
98
-    public function setFileExtension($fileExtension)
99
-    {
100
-        $this->fileExtension = $fileExtension;
101
-    }
102
-
103
-    /**
104
-     * {@inheritDoc}
105
-     */
106
-    public function findMappingFile($className)
107
-    {
108
-        $fileName = str_replace('\\', '.', $className) . $this->fileExtension;
109
-
110
-        // Check whether file exists
111
-        foreach ($this->paths as $path) {
112
-            if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {
113
-                return $path . DIRECTORY_SEPARATOR . $fileName;
114
-            }
115
-        }
116
-
117
-        throw MappingException::mappingFileNotFound($className, $fileName);
118
-    }
119
-
120
-    /**
121
-     * {@inheritDoc}
122
-     */
123
-    public function getAllClassNames($globalBasename)
124
-    {
125
-        $classes = array();
126
-
127
-        if ($this->paths) {
128
-            foreach ($this->paths as $path) {
129
-                if ( ! is_dir($path)) {
130
-                    throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
131
-                }
132
-
133
-                $iterator = new \RecursiveIteratorIterator(
134
-                    new \RecursiveDirectoryIterator($path),
135
-                    \RecursiveIteratorIterator::LEAVES_ONLY
136
-                );
137
-
138
-                foreach ($iterator as $file) {
139
-                    $fileName = $file->getBasename($this->fileExtension);
140
-
141
-                    if ($fileName == $file->getBasename() || $fileName == $globalBasename) {
142
-                        continue;
143
-                    }
144
-
145
-                    // NOTE: All files found here means classes are not transient!
146
-                    $classes[] = str_replace('.', '\\', $fileName);
147
-                }
148
-            }
149
-        }
150
-
151
-        return $classes;
152
-    }
153
-
154
-    /**
155
-     * {@inheritDoc}
156
-     */
157
-    public function fileExists($className)
158
-    {
159
-        $fileName = str_replace('\\', '.', $className) . $this->fileExtension;
160
-
161
-        // Check whether file exists
162
-        foreach ((array) $this->paths as $path) {
163
-            if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {
164
-                return true;
165
-            }
166
-        }
167
-
168
-        return false;
169
-    }
170
-}

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

@@ -1,214 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-use Doctrine\Common\Persistence\Mapping\MappingException;
23
-
24
-/**
25
- * Base driver for file-based metadata drivers.
26
- *
27
- * A file driver operates in a mode where it loads the mapping files of individual
28
- * classes on demand. This requires the user to adhere to the convention of 1 mapping
29
- * file per class and the file names of the mapping files must correspond to the full
30
- * class name, including namespace, with the namespace delimiters '\', replaced by dots '.'.
31
- *
32
- * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
33
- * @link        www.doctrine-project.com
34
- * @since       2.2
35
- * @author      Benjamin Eberlei <kontakt@beberlei.de>
36
- * @author      Guilherme Blanco <guilhermeblanco@hotmail.com>
37
- * @author      Jonathan H. Wage <jonwage@gmail.com>
38
- * @author      Roman Borschel <roman@code-factory.org>
39
- */
40
-abstract class FileDriver implements MappingDriver
41
-{
42
-    /**
43
-     * @var FileLocator
44
-     */
45
-    protected $locator;
46
-
47
-    /**
48
-     * @var array
49
-     */
50
-    protected $classCache;
51
-
52
-    /**
53
-     * @var string
54
-     */
55
-    protected $globalBasename;
56
-
57
-    /**
58
-     * Initializes a new FileDriver that looks in the given path(s) for mapping
59
-     * documents and operates in the specified operating mode.
60
-     *
61
-     * @param string|array|FileLocator $locator A FileLocator or one/multiple paths where mapping documents can be found.
62
-     * @param string $fileExtension
63
-     */
64
-    public function __construct($locator, $fileExtension = null)
65
-    {
66
-        if ($locator instanceof FileLocator) {
67
-            $this->locator = $locator;
68
-        } else {
69
-            $this->locator = new DefaultFileLocator((array)$locator, $fileExtension);
70
-        }
71
-    }
72
-
73
-    /**
74
-     * Set global basename
75
-     *
76
-     * @param string $file
77
-     */
78
-    public function setGlobalBasename($file)
79
-    {
80
-        $this->globalBasename = $file;
81
-    }
82
-
83
-    /**
84
-     * Retrieve global basename
85
-     *
86
-     * @return string
87
-     */
88
-    public function getGlobalBasename()
89
-    {
90
-        return $this->globalBasename;
91
-    }
92
-
93
-    /**
94
-     * Get the element of schema meta data for the class from the mapping file.
95
-     * This will lazily load the mapping file if it is not loaded yet
96
-     *
97
-     * @param string $className
98
-     *
99
-     * @throws MappingException
100
-     * @return array The element of schema meta data
101
-     */
102
-    public function getElement($className)
103
-    {
104
-        if ($this->classCache === null) {
105
-            $this->initialize();
106
-        }
107
-
108
-        if (isset($this->classCache[$className])) {
109
-            return $this->classCache[$className];
110
-        }
111
-
112
-        $result = $this->loadMappingFile($this->locator->findMappingFile($className));
113
-        if (!isset($result[$className])) {
114
-            throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension());
115
-        }
116
-
117
-        return $result[$className];
118
-    }
119
-
120
-    /**
121
-     * Whether the class with the specified name should have its metadata loaded.
122
-     * This is only the case if it is either mapped as an Entity or a
123
-     * MappedSuperclass.
124
-     *
125
-     * @param string $className
126
-     * @return boolean
127
-     */
128
-    public function isTransient($className)
129
-    {
130
-        if ($this->classCache === null) {
131
-            $this->initialize();
132
-        }
133
-
134
-        if (isset($this->classCache[$className])) {
135
-            return false;
136
-        }
137
-
138
-        return !$this->locator->fileExists($className);
139
-    }
140
-
141
-    /**
142
-     * Gets the names of all mapped classes known to this driver.
143
-     *
144
-     * @return array The names of all mapped classes known to this driver.
145
-     */
146
-    public function getAllClassNames()
147
-    {
148
-        if ($this->classCache === null) {
149
-            $this->initialize();
150
-        }
151
-
152
-        $classNames = (array)$this->locator->getAllClassNames($this->globalBasename);
153
-        if ($this->classCache) {
154
-            $classNames = array_merge(array_keys($this->classCache), $classNames);
155
-        }
156
-        return $classNames;
157
-    }
158
-
159
-    /**
160
-     * Loads a mapping file with the given name and returns a map
161
-     * from class/entity names to their corresponding file driver elements.
162
-     *
163
-     * @param string $file The mapping file to load.
164
-     * @return array
165
-     */
166
-    abstract protected function loadMappingFile($file);
167
-
168
-    /**
169
-     * Initialize the class cache from all the global files.
170
-     *
171
-     * Using this feature adds a substantial performance hit to file drivers as
172
-     * more metadata has to be loaded into memory than might actually be
173
-     * necessary. This may not be relevant to scenarios where caching of
174
-     * metadata is in place, however hits very hard in scenarios where no
175
-     * caching is used.
176
-     *
177
-     * @return void
178
-     */
179
-    protected function initialize()
180
-    {
181
-        $this->classCache = array();
182
-        if (null !== $this->globalBasename) {
183
-            foreach ($this->locator->getPaths() as $path) {
184
-                $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension();
185
-                if (is_file($file)) {
186
-                    $this->classCache = array_merge(
187
-                        $this->classCache,
188
-                        $this->loadMappingFile($file)
189
-                    );
190
-                }
191
-            }
192
-        }
193
-    }
194
-
195
-    /**
196
-     * Retrieve the locator used to discover mapping files by className
197
-     *
198
-     * @return FileLocator
199
-     */
200
-    public function getLocator()
201
-    {
202
-        return $this->locator;
203
-    }
204
-
205
-    /**
206
-     * Set the locator used to discover mapping files by className
207
-     *
208
-     * @param FileLocator $locator
209
-     */
210
-    public function setLocator(FileLocator $locator)
211
-    {
212
-        $this->locator = $locator;
213
-    }
214
-}

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

@@ -1,71 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
-*/
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-/**
23
- * Locate the file that contains the metadata information for a given class name.
24
- *
25
- * This behavior is independent of the actual content of the file. It just detects
26
- * the file which is responsible for the given class name.
27
- *
28
- * @author Benjamin Eberlei <kontakt@beberlei.de>
29
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
30
- */
31
-interface FileLocator
32
-{
33
-    /**
34
-     * Locate mapping file for the given class name.
35
-     *
36
-     * @param string $className
37
-     * @return string
38
-     */
39
-    function findMappingFile($className);
40
-
41
-    /**
42
-     * Get all class names that are found with this file locator.
43
-     *
44
-     * @param string $globalBasename Passed to allow excluding the basename
45
-     * @return array
46
-     */
47
-    function getAllClassNames($globalBasename);
48
-
49
-    /**
50
-     * Check if a file can be found for this class name.
51
-     *
52
-     * @param string $className
53
-     *
54
-     * @return bool
55
-     */
56
-    function fileExists($className);
57
-
58
-    /**
59
-     * Get all the paths that this file locator looks for mapping files.
60
-     *
61
-     * @return array
62
-     */
63
-    function getPaths();
64
-
65
-    /**
66
-     * Get the file extension that mapping files are suffixed with.
67
-     *
68
-     * @return string
69
-     */
70
-    function getFileExtension();
71
-}

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

@@ -1,56 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
23
-
24
-/**
25
- * Contract for metadata drivers.
26
- *
27
- * @since 2.2
28
- * @author Jonathan H. Wage <jonwage@gmail.com>
29
- */
30
-interface MappingDriver
31
-{
32
-    /**
33
-     * Loads the metadata for the specified class into the provided container.
34
-     *
35
-     * @param string $className
36
-     * @param ClassMetadata $metadata
37
-     */
38
-    function loadMetadataForClass($className, ClassMetadata $metadata);
39
-
40
-    /**
41
-     * Gets the names of all mapped classes known to this driver.
42
-     *
43
-     * @return array The names of all mapped classes known to this driver.
44
-     */
45
-    function getAllClassNames();
46
-
47
-    /**
48
-     * Whether the class with the specified name should have its metadata loaded.
49
-     * This is only the case if it is either mapped as an Entity or a
50
-     * MappedSuperclass.
51
-     *
52
-     * @param string $className
53
-     * @return boolean
54
-     */
55
-    function isTransient($className);
56
-}

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

@@ -1,168 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver,
23
-    Doctrine\Common\Persistence\Mapping\ClassMetadata,
24
-    Doctrine\Common\Persistence\Mapping\MappingException;
25
-
26
-/**
27
- * The DriverChain allows you to add multiple other mapping drivers for
28
- * certain namespaces
29
- *
30
- * @since  2.2
31
- * @author Benjamin Eberlei <kontakt@beberlei.de>
32
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
33
- * @author Jonathan H. Wage <jonwage@gmail.com>
34
- * @author Roman Borschel <roman@code-factory.org>
35
- */
36
-class MappingDriverChain implements MappingDriver
37
-{
38
-    /**
39
-     * The default driver
40
-     *
41
-     * @var MappingDriver
42
-     */
43
-    private $defaultDriver;
44
-
45
-    /**
46
-     * @var array
47
-     */
48
-    private $drivers = array();
49
-
50
-    /**
51
-     * Get the default driver.
52
-     *
53
-     * @return MappingDriver|null
54
-     */
55
-    public function getDefaultDriver()
56
-    {
57
-        return $this->defaultDriver;
58
-    }
59
-
60
-    /**
61
-     * Set the default driver.
62
-     *
63
-     * @param MappingDriver $driver
64
-     */
65
-    public function setDefaultDriver(MappingDriver $driver)
66
-    {
67
-        $this->defaultDriver = $driver;
68
-    }
69
-
70
-    /**
71
-     * Add a nested driver.
72
-     *
73
-     * @param MappingDriver $nestedDriver
74
-     * @param string $namespace
75
-     */
76
-    public function addDriver(MappingDriver $nestedDriver, $namespace)
77
-    {
78
-        $this->drivers[$namespace] = $nestedDriver;
79
-    }
80
-
81
-    /**
82
-     * Get the array of nested drivers.
83
-     *
84
-     * @return array $drivers
85
-     */
86
-    public function getDrivers()
87
-    {
88
-        return $this->drivers;
89
-    }
90
-
91
-    /**
92
-     * Loads the metadata for the specified class into the provided container.
93
-     *
94
-     * @param string $className
95
-     * @param ClassMetadata $metadata
96
-     *
97
-     * @throws MappingException
98
-     */
99
-    public function loadMetadataForClass($className, ClassMetadata $metadata)
100
-    {
101
-        /* @var $driver MappingDriver */
102
-        foreach ($this->drivers as $namespace => $driver) {
103
-            if (strpos($className, $namespace) === 0) {
104
-                $driver->loadMetadataForClass($className, $metadata);
105
-                return;
106
-            }
107
-        }
108
-
109
-        if (null !== $this->defaultDriver) {
110
-            $this->defaultDriver->loadMetadataForClass($className, $metadata);
111
-            return;
112
-        }
113
-
114
-        throw MappingException::classNotFoundInNamespaces($className, array_keys($this->drivers));
115
-    }
116
-
117
-    /**
118
-     * Gets the names of all mapped classes known to this driver.
119
-     *
120
-     * @return array The names of all mapped classes known to this driver.
121
-     */
122
-    public function getAllClassNames()
123
-    {
124
-        $classNames = array();
125
-        $driverClasses = array();
126
-
127
-        /* @var $driver MappingDriver */
128
-        foreach ($this->drivers AS $namespace => $driver) {
129
-            $oid = spl_object_hash($driver);
130
-
131
-            if (!isset($driverClasses[$oid])) {
132
-                $driverClasses[$oid] = $driver->getAllClassNames();
133
-            }
134
-
135
-            foreach ($driverClasses[$oid] AS $className) {
136
-                if (strpos($className, $namespace) === 0) {
137
-                    $classNames[$className] = true;
138
-                }
139
-            }
140
-        }
141
-
142
-        return array_keys($classNames);
143
-    }
144
-
145
-    /**
146
-     * Whether the class with the specified name should have its metadata loaded.
147
-     *
148
-     * This is only the case for non-transient classes either mapped as an Entity or MappedSuperclass.
149
-     *
150
-     * @param string $className
151
-     * @return boolean
152
-     */
153
-    public function isTransient($className)
154
-    {
155
-        /* @var $driver MappingDriver */
156
-        foreach ($this->drivers AS $namespace => $driver) {
157
-            if (strpos($className, $namespace) === 0) {
158
-                return $driver->isTransient($className);
159
-            }
160
-        }
161
-
162
-        if ($this->defaultDriver !== null) {
163
-            return $this->defaultDriver->isTransient($className);
164
-        }
165
-
166
-        return true;
167
-    }
168
-}

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

@@ -1,72 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
23
-
24
-/**
25
- * The PHPDriver includes php files which just populate ClassMetadataInfo
26
- * instances with plain php code
27
- *
28
- * @license 	http://www.opensource.org/licenses/lgpl-license.php LGPL
29
- * @link    	www.doctrine-project.org
30
- * @since   	2.0
31
- * @version     $Revision$
32
- * @author      Benjamin Eberlei <kontakt@beberlei.de>
33
- * @author      Guilherme Blanco <guilhermeblanco@hotmail.com>
34
- * @author      Jonathan H. Wage <jonwage@gmail.com>
35
- * @author      Roman Borschel <roman@code-factory.org>
36
- */
37
-class PHPDriver extends FileDriver
38
-{
39
-    /**
40
-     * {@inheritdoc}
41
-     */
42
-    protected $metadata;
43
-
44
-    /**
45
-     * {@inheritDoc}
46
-     */
47
-    public function __construct($locator, $fileExtension = null)
48
-    {
49
-        $fileExtension = ".php";
50
-        parent::__construct($locator, $fileExtension);
51
-    }
52
-
53
-    /**
54
-     * {@inheritdoc}
55
-     */
56
-    public function loadMetadataForClass($className, ClassMetadata $metadata)
57
-    {
58
-        $this->metadata = $metadata;
59
-        $this->loadMappingFile($this->locator->findMappingFile($className));
60
-    }
61
-
62
-    /**
63
-     * {@inheritdoc}
64
-     */
65
-    protected function loadMappingFile($file)
66
-    {
67
-        $metadata = $this->metadata;
68
-        include $file;
69
-
70
-        return array($metadata->getName() => $metadata);
71
-    }
72
-}

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

@@ -1,141 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
23
-use Doctrine\Common\Persistence\Mapping\MappingException;
24
-
25
-/**
26
- * The StaticPHPDriver calls a static loadMetadata() method on your entity
27
- * classes where you can manually populate the ClassMetadata instance.
28
- *
29
- * @license 	http://www.opensource.org/licenses/lgpl-license.php LGPL
30
- * @link    	www.doctrine-project.org
31
- * @since   	2.2
32
- * @author      Benjamin Eberlei <kontakt@beberlei.de>
33
- * @author      Guilherme Blanco <guilhermeblanco@hotmail.com>
34
- * @author      Jonathan H. Wage <jonwage@gmail.com>
35
- * @author      Roman Borschel <roman@code-factory.org>
36
- */
37
-class StaticPHPDriver implements MappingDriver
38
-{
39
-    /**
40
-     * Paths of entity directories.
41
-     *
42
-     * @var array
43
-     */
44
-    private $paths = array();
45
-
46
-    /**
47
-     * Map of all class names.
48
-     *
49
-     * @var array
50
-     */
51
-    private $classNames;
52
-
53
-    /**
54
-     * Constructor
55
-     *
56
-     * @param array|string $paths
57
-     */
58
-    public function __construct($paths)
59
-    {
60
-        $this->addPaths((array) $paths);
61
-    }
62
-
63
-    /**
64
-     * Add paths
65
-     *
66
-     * @param array $paths
67
-     */
68
-    public function addPaths(array $paths)
69
-    {
70
-        $this->paths = array_unique(array_merge($this->paths, $paths));
71
-    }
72
-
73
-    /**
74
-     * {@inheritdoc}
75
-     */
76
-    public function loadMetadataForClass($className, ClassMetadata $metadata)
77
-    {
78
-        $className::loadMetadata($metadata);
79
-    }
80
-
81
-    /**
82
-     * {@inheritDoc}
83
-     * @todo Same code exists in AnnotationDriver, should we re-use it somehow or not worry about it?
84
-     */
85
-    public function getAllClassNames()
86
-    {
87
-        if ($this->classNames !== null) {
88
-            return $this->classNames;
89
-        }
90
-
91
-        if (!$this->paths) {
92
-            throw MappingException::pathRequired();
93
-        }
94
-
95
-        $classes = array();
96
-        $includedFiles = array();
97
-
98
-        foreach ($this->paths as $path) {
99
-            if (!is_dir($path)) {
100
-                throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
101
-            }
102
-
103
-            $iterator = new \RecursiveIteratorIterator(
104
-                new \RecursiveDirectoryIterator($path),
105
-                \RecursiveIteratorIterator::LEAVES_ONLY
106
-            );
107
-
108
-            foreach ($iterator as $file) {
109
-                if ($file->getBasename('.php') == $file->getBasename()) {
110
-                    continue;
111
-                }
112
-
113
-                $sourceFile = realpath($file->getPathName());
114
-                require_once $sourceFile;
115
-                $includedFiles[] = $sourceFile;
116
-            }
117
-        }
118
-
119
-        $declared = get_declared_classes();
120
-
121
-        foreach ($declared as $className) {
122
-            $rc = new \ReflectionClass($className);
123
-            $sourceFile = $rc->getFileName();
124
-            if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) {
125
-                $classes[] = $className;
126
-            }
127
-        }
128
-
129
-        $this->classNames = $classes;
130
-
131
-        return $classes;
132
-    }
133
-
134
-    /**
135
-     * {@inheritdoc}
136
-     */
137
-    public function isTransient($className)
138
-    {
139
-        return ! method_exists($className, 'loadMetadata');
140
-    }
141
-}

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

@@ -1,214 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
-*/
19
-
20
-namespace Doctrine\Common\Persistence\Mapping\Driver;
21
-
22
-use Doctrine\Common\Persistence\Mapping\MappingException;
23
-
24
-/**
25
- * The Symfony File Locator makes a simplifying assumptions compared
26
- * to the DefaultFileLocator. By assuming paths only contain entities of a certain
27
- * namespace the mapping files consists of the short classname only.
28
- *
29
- * @author Fabien Potencier <fabien@symfony.com>
30
- * @author Benjamin Eberlei <kontakt@beberlei.de>
31
- * @license MIT
32
- */
33
-class SymfonyFileLocator implements FileLocator
34
-{
35
-    /**
36
-     * The paths where to look for mapping files.
37
-     *
38
-     * @var array
39
-     */
40
-    protected $paths = array();
41
-
42
-    /**
43
-     * A map of mapping directory path to namespace prefix used to expand class shortnames.
44
-     *
45
-     * @var array
46
-     */
47
-    protected $prefixes = array();
48
-
49
-    /**
50
-     * File extension that is searched for.
51
-     *
52
-     * @var string
53
-     */
54
-    protected $fileExtension;
55
-
56
-    /**
57
-     * Constructor
58
-     *
59
-     * @param array $prefixes
60
-     * @param string|null $fileExtension
61
-     */
62
-    public function __construct(array $prefixes, $fileExtension = null)
63
-    {
64
-        $this->addNamespacePrefixes($prefixes);
65
-        $this->fileExtension = $fileExtension;
66
-    }
67
-
68
-    /**
69
-     * Add Namespace Prefixes
70
-     *
71
-     * @param array $prefixes
72
-     */
73
-    public function addNamespacePrefixes(array $prefixes)
74
-    {
75
-        $this->prefixes = array_merge($this->prefixes, $prefixes);
76
-        $this->paths = array_merge($this->paths, array_keys($prefixes));
77
-    }
78
-
79
-    /**
80
-     * Get Namespace Prefixes
81
-     *
82
-     * @return array
83
-     */
84
-    public function getNamespacePrefixes()
85
-    {
86
-        return $this->prefixes;
87
-    }
88
-
89
-    /**
90
-     * {@inheritDoc}
91
-     */
92
-    public function getPaths()
93
-    {
94
-        return $this->paths;
95
-    }
96
-
97
-    /**
98
-     * {@inheritDoc}
99
-     */
100
-    public function getFileExtension()
101
-    {
102
-        return $this->fileExtension;
103
-    }
104
-
105
-    /**
106
-     * Set the file extension used to look for mapping files under
107
-     *
108
-     * @param string $fileExtension The file extension to set
109
-     * @return void
110
-     */
111
-    public function setFileExtension($fileExtension)
112
-    {
113
-        $this->fileExtension = $fileExtension;
114
-    }
115
-
116
-    /**
117
-     * {@inheritDoc}
118
-     */
119
-    public function fileExists($className)
120
-    {
121
-        $defaultFileName = str_replace('\\', '.', $className).$this->fileExtension;
122
-        foreach ($this->paths as $path) {
123
-            if (!isset($this->prefixes[$path])) {
124
-                // global namespace class
125
-                if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) {
126
-                    return true;
127
-                }
128
-
129
-                continue;
130
-            }
131
-
132
-            $prefix = $this->prefixes[$path];
133
-
134
-            if (0 !== strpos($className, $prefix.'\\')) {
135
-                continue;
136
-            }
137
-
138
-            $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->fileExtension;
139
-            return is_file($filename);
140
-        }
141
-
142
-        return false;
143
-    }
144
-
145
-    /**
146
-     * {@inheritDoc}
147
-     */
148
-    public function getAllClassNames($globalBasename = null)
149
-    {
150
-        $classes = array();
151
-
152
-        if ($this->paths) {
153
-            foreach ((array) $this->paths as $path) {
154
-                if (!is_dir($path)) {
155
-                    throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
156
-                }
157
-
158
-                $iterator = new \RecursiveIteratorIterator(
159
-                    new \RecursiveDirectoryIterator($path),
160
-                    \RecursiveIteratorIterator::LEAVES_ONLY
161
-                );
162
-
163
-                foreach ($iterator as $file) {
164
-                    $fileName = $file->getBasename($this->fileExtension);
165
-
166
-                    if ($fileName == $file->getBasename() || $fileName == $globalBasename) {
167
-                        continue;
168
-                    }
169
-
170
-                    // NOTE: All files found here means classes are not transient!
171
-                    if (isset($this->prefixes[$path])) {
172
-                        $classes[] = $this->prefixes[$path].'\\'.str_replace('.', '\\', $fileName);
173
-                    } else {
174
-                        $classes[] = str_replace('.', '\\', $fileName);
175
-                    }
176
-                }
177
-            }
178
-        }
179
-
180
-        return $classes;
181
-    }
182
-
183
-    /**
184
-     * {@inheritDoc}
185
-     */
186
-    public function findMappingFile($className)
187
-    {
188
-        $defaultFileName = str_replace('\\', '.', $className).$this->fileExtension;
189
-        foreach ($this->paths as $path) {
190
-            if (!isset($this->prefixes[$path])) {
191
-                if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) {
192
-                    return $path.DIRECTORY_SEPARATOR.$defaultFileName;
193
-                }
194
-
195
-                continue;
196
-            }
197
-
198
-            $prefix = $this->prefixes[$path];
199
-
200
-            if (0 !== strpos($className, $prefix.'\\')) {
201
-                continue;
202
-            }
203
-
204
-            $filename = $path.'/'.strtr(substr($className, strlen($prefix)+1), '\\', '.').$this->fileExtension;
205
-            if (is_file($filename)) {
206
-                return $filename;
207
-            }
208
-
209
-            throw MappingException::mappingFileNotFound($className, $filename);
210
-        }
211
-
212
-        throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension);
213
-    }
214
-}

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

@@ -1,86 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.phpdoctrine.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping;
21
-
22
-/**
23
- * A MappingException indicates that something is wrong with the mapping setup.
24
- *
25
- * @since 2.2
26
- */
27
-class MappingException extends \Exception
28
-{
29
-    /**
30
-     *
31
-     * @param string $className
32
-     * @param array $namespaces
33
-     *
34
-     * @return MappingException
35
-     */
36
-    public static function classNotFoundInNamespaces($className, $namespaces)
37
-    {
38
-        return new self("The class '" . $className . "' was not found in the ".
39
-            "chain configured namespaces " . implode(", ", $namespaces));
40
-    }
41
-
42
-    /**
43
-     * @return MappingException
44
-     */
45
-    public static function pathRequired()
46
-    {
47
-        return new self("Specifying the paths to your entities is required ".
48
-            "in the AnnotationDriver to retrieve all class names.");
49
-    }
50
-
51
-    /**
52
-     * @param string|null $path
53
-     * @return MappingException
54
-     */
55
-    public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null)
56
-    {
57
-        if ( ! empty($path)) {
58
-            $path = '[' . $path . ']';
59
-        }
60
-
61
-        return new self(
62
-            'File mapping drivers must have a valid directory path, ' .
63
-            'however the given path ' . $path . ' seems to be incorrect!'
64
-        );
65
-    }
66
-
67
-    /**
68
-     * @param string $entityName
69
-     * @param string $fileName
70
-     * @return MappingException
71
-     */
72
-    public static function mappingFileNotFound($entityName, $fileName)
73
-    {
74
-        return new self("No mapping file found named '$fileName' for class '$entityName'.");
75
-    }
76
-
77
-    /**
78
-     * @param string $entityName
79
-     * @param string $fileName
80
-     * @return MappingException
81
-     */
82
-    public static function invalidMappingFile($entityName, $fileName)
83
-    {
84
-        return new self("Invalid mapping file '$fileName' for class '$entityName'.");
85
-    }
86
-}

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

@@ -1,80 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping;
21
-
22
-/**
23
- * Very simple reflection service abstraction.
24
- *
25
- * This is required inside metadata layers that may require either
26
- * static or runtime reflection.
27
- *
28
- * @author Benjamin Eberlei <kontakt@beberlei.de>
29
- */
30
-interface ReflectionService
31
-{
32
-    /**
33
-     * Return an array of the parent classes (not interfaces) for the given class.
34
-     *
35
-     * @param string $class
36
-     * @return array
37
-     */
38
-    function getParentClasses($class);
39
-
40
-    /**
41
-     * Return the shortname of a class.
42
-     *
43
-     * @param string $class
44
-     * @return string
45
-     */
46
-    function getClassShortName($class);
47
-
48
-    /**
49
-     * @param string $class
50
-     * @return string
51
-     */
52
-    function getClassNamespace($class);
53
-
54
-    /**
55
-     * Return a reflection class instance or null
56
-     *
57
-     * @param string $class
58
-     * @return \ReflectionClass|null
59
-     */
60
-    function getClass($class);
61
-
62
-    /**
63
-     * Return an accessible property (setAccessible(true)) or null.
64
-     *
65
-     * @param string $class
66
-     * @param string $property
67
-     * @return \ReflectionProperty|null
68
-     */
69
-    function getAccessibleProperty($class, $property);
70
-
71
-    /**
72
-     * Check if the class have a public method with the given name.
73
-     *
74
-     * @param mixed $class
75
-     * @param mixed $method
76
-     * @return bool
77
-     */
78
-    function hasPublicMethod($class, $method);
79
-}
80
-

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

@@ -1,102 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping;
21
-
22
-use ReflectionClass;
23
-use ReflectionProperty;
24
-
25
-/**
26
- * PHP Runtime Reflection Service
27
- *
28
- * @author Benjamin Eberlei <kontakt@beberlei.de>
29
- */
30
-class RuntimeReflectionService implements ReflectionService
31
-{
32
-    /**
33
-     * Return an array of the parent classes (not interfaces) for the given class.
34
-     *
35
-     * @param string $class
36
-     * @return array
37
-     */
38
-    public function getParentClasses($class)
39
-    {
40
-        return class_parents($class);
41
-    }
42
-
43
-    /**
44
-     * Return the shortname of a class.
45
-     *
46
-     * @param string $class
47
-     * @return string
48
-     */
49
-    public function getClassShortName($class)
50
-    {
51
-        $r = new ReflectionClass($class);
52
-        return $r->getShortName();
53
-    }
54
-
55
-    /**
56
-     * @param string $class
57
-     * @return string
58
-     */
59
-    public function getClassNamespace($class)
60
-    {
61
-        $r = new ReflectionClass($class);
62
-        return $r->getNamespaceName();
63
-    }
64
-
65
-    /**
66
-     * Return a reflection class instance or null
67
-     *
68
-     * @param string $class
69
-     * @return ReflectionClass|null
70
-     */
71
-    public function getClass($class)
72
-    {
73
-        return new ReflectionClass($class);
74
-    }
75
-
76
-    /**
77
-     * Return an accessible property (setAccessible(true)) or null.
78
-     *
79
-     * @param string $class
80
-     * @param string $property
81
-     * @return ReflectionProperty|null
82
-     */
83
-    public function getAccessibleProperty($class, $property)
84
-    {
85
-        $property = new ReflectionProperty($class, $property);
86
-        $property->setAccessible(true);
87
-        return $property;
88
-    }
89
-
90
-    /**
91
-     * Check if the class have a public method with the given name.
92
-     *
93
-     * @param mixed $class
94
-     * @param mixed $method
95
-     * @return bool
96
-     */
97
-    public function hasPublicMethod($class, $method)
98
-    {
99
-        return method_exists($class, $method) && is_callable(array($class, $method));
100
-    }
101
-}
102
-

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

@@ -1,107 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence\Mapping;
21
-
22
-use ReflectionClass;
23
-use ReflectionProperty;
24
-
25
-/**
26
- * PHP Runtime Reflection Service
27
- *
28
- * @author Benjamin Eberlei <kontakt@beberlei.de>
29
- */
30
-class StaticReflectionService implements ReflectionService
31
-{
32
-    /**
33
-     * Return an array of the parent classes (not interfaces) for the given class.
34
-     *
35
-     * @param string $class
36
-     * @return array
37
-     */
38
-    public function getParentClasses($class)
39
-    {
40
-        return array();
41
-    }
42
-
43
-    /**
44
-     * Return the shortname of a class.
45
-     *
46
-     * @param string $className
47
-     * @return string
48
-     */
49
-    public function getClassShortName($className)
50
-    {
51
-        if (strpos($className, '\\') !== false) {
52
-            $className = substr($className, strrpos($className, "\\")+1);
53
-        }
54
-        return $className;
55
-    }
56
-
57
-    /**
58
-     * Return the namespace of a class.
59
-     *
60
-     * @param string $className
61
-     * @return string
62
-     */
63
-    public function getClassNamespace($className)
64
-    {
65
-        $namespace = '';
66
-        if (strpos($className, '\\') !== false) {
67
-            $namespace = strrev(substr( strrev($className), strpos(strrev($className), '\\')+1 ));
68
-        }
69
-        return $namespace;
70
-    }
71
-
72
-    /**
73
-     * Return a reflection class instance or null
74
-     *
75
-     * @param string $class
76
-     * @return ReflectionClass|null
77
-     */
78
-    public function getClass($class)
79
-    {
80
-        return null;
81
-    }
82
-
83
-    /**
84
-     * Return an accessible property (setAccessible(true)) or null.
85
-     *
86
-     * @param string $class
87
-     * @param string $property
88
-     * @return ReflectionProperty|null
89
-     */
90
-    public function getAccessibleProperty($class, $property)
91
-    {
92
-        return null;
93
-    }
94
-
95
-    /**
96
-     * Check if the class have a public method with the given name.
97
-     *
98
-     * @param mixed $class
99
-     * @param mixed $method
100
-     * @return bool
101
-     */
102
-    public function hasPublicMethod($class, $method)
103
-    {
104
-        return method_exists($class, $method) && is_callable(array($class, $method));
105
-    }
106
-}
107
-

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

@@ -1,152 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence;
21
-
22
-/**
23
- * Contract for a Doctrine persistence layer ObjectManager class to implement.
24
- *
25
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
26
- * @link    www.doctrine-project.org
27
- * @since   2.1
28
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
29
- * @author  Jonathan Wage <jonwage@gmail.com>
30
- */
31
-interface ObjectManager
32
-{
33
-    /**
34
-     * Finds a object by its identifier.
35
-     *
36
-     * This is just a convenient shortcut for getRepository($className)->find($id).
37
-     *
38
-     * @param string
39
-     * @param mixed
40
-     * @return object
41
-     */
42
-    function find($className, $id);
43
-
44
-    /**
45
-     * Tells the ObjectManager to make an instance managed and persistent.
46
-     *
47
-     * The object will be entered into the database as a result of the flush operation.
48
-     *
49
-     * NOTE: The persist operation always considers objects that are not yet known to
50
-     * this ObjectManager as NEW. Do not pass detached objects to the persist operation.
51
-     *
52
-     * @param object $object The instance to make managed and persistent.
53
-     */
54
-    function persist($object);
55
-
56
-    /**
57
-     * Removes an object instance.
58
-     *
59
-     * A removed object will be removed from the database as a result of the flush operation.
60
-     *
61
-     * @param object $object The object instance to remove.
62
-     */
63
-    function remove($object);
64
-
65
-    /**
66
-     * Merges the state of a detached object into the persistence context
67
-     * of this ObjectManager and returns the managed copy of the object.
68
-     * The object passed to merge will not become associated/managed with this ObjectManager.
69
-     *
70
-     * @param object $object
71
-     * @return object
72
-     */
73
-    function merge($object);
74
-
75
-    /**
76
-     * Clears the ObjectManager. All objects that are currently managed
77
-     * by this ObjectManager become detached.
78
-     *
79
-     * @param string $objectName if given, only objects of this type will get detached
80
-     */
81
-    function clear($objectName = null);
82
-
83
-    /**
84
-     * Detaches an object from the ObjectManager, causing a managed object to
85
-     * become detached. Unflushed changes made to the object if any
86
-     * (including removal of the object), will not be synchronized to the database.
87
-     * Objects which previously referenced the detached object will continue to
88
-     * reference it.
89
-     *
90
-     * @param object $object The object to detach.
91
-     */
92
-    function detach($object);
93
-
94
-    /**
95
-     * Refreshes the persistent state of an object from the database,
96
-     * overriding any local changes that have not yet been persisted.
97
-     *
98
-     * @param object $object The object to refresh.
99
-     */
100
-    function refresh($object);
101
-
102
-    /**
103
-     * Flushes all changes to objects that have been queued up to now to the database.
104
-     * This effectively synchronizes the in-memory state of managed objects with the
105
-     * database.
106
-     */
107
-    function flush();
108
-
109
-    /**
110
-     * Gets the repository for a class.
111
-     *
112
-     * @param string $className
113
-     * @return \Doctrine\Common\Persistence\ObjectRepository
114
-     */
115
-    function getRepository($className);
116
-
117
-    /**
118
-     * Returns the ClassMetadata descriptor for a class.
119
-     *
120
-     * The class name must be the fully-qualified class name without a leading backslash
121
-     * (as it is returned by get_class($obj)).
122
-     *
123
-     * @param string $className
124
-     * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata
125
-     */
126
-    function getClassMetadata($className);
127
-
128
-    /**
129
-     * Gets the metadata factory used to gather the metadata of classes.
130
-     *
131
-     * @return \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
132
-     */
133
-    function getMetadataFactory();
134
-
135
-    /**
136
-     * Helper method to initialize a lazy loading proxy or persistent collection.
137
-     *
138
-     * This method is a no-op for other objects.
139
-     *
140
-     * @param object $obj
141
-     */
142
-    function initializeObject($obj);
143
-
144
-    /**
145
-     * Check if the object is part of the current UnitOfWork and therefore
146
-     * managed.
147
-     *
148
-     * @param object $object
149
-     * @return bool
150
-     */
151
-    function contains($object);
152
-}

+ 0 - 49
vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php View File

@@ -1,49 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence;
21
-
22
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
23
-
24
-/**
25
- * Makes a Persistent Objects aware of its own object-manager.
26
- *
27
- * Using this interface the managing object manager and class metadata instances
28
- * are injected into the persistent object after construction. This allows
29
- * you to implement ActiveRecord functionality on top of the persistance-ignorance
30
- * that Doctrine propagates.
31
- *
32
- * Word of Warning: This is a very powerful hook to change how you can work with your domain models.
33
- * Using this hook will break the Single Responsibility Principle inside your Domain Objects
34
- * and increase the coupling of database and objects.
35
- *
36
- * Every ObjectManager has to implement this functionality itself.
37
- *
38
- * @author Benjamin Eberlei <kontakt@beberlei.de>
39
- */
40
-interface ObjectManagerAware
41
-{
42
-    /**
43
-     * Injects responsible ObjectManager and the ClassMetadata into this persistent object.
44
-     *
45
-     * @param ObjectManager $objectManager
46
-     * @param ClassMetadata $classMetadata
47
-     */
48
-    public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata);
49
-}

+ 0 - 78
vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php View File

@@ -1,78 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence;
21
-
22
-/**
23
- * Contract for a Doctrine persistence layer ObjectRepository class to implement.
24
- *
25
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
26
- * @link    www.doctrine-project.org
27
- * @since   2.1
28
- * @author  Benjamin Eberlei <kontakt@beberlei.de>
29
- * @author  Jonathan Wage <jonwage@gmail.com>
30
- */
31
-interface ObjectRepository
32
-{
33
-    /**
34
-     * Finds an object by its primary key / identifier.
35
-     *
36
-     * @param int $id The identifier.
37
-     * @return object The object.
38
-     */
39
-    function find($id);
40
-
41
-    /**
42
-     * Finds all objects in the repository.
43
-     *
44
-     * @return mixed The objects.
45
-     */
46
-    function findAll();
47
-
48
-    /**
49
-     * Finds objects by a set of criteria.
50
-     *
51
-     * Optionally sorting and limiting details can be passed. An implementation may throw
52
-     * an UnexpectedValueException if certain values of the sorting or limiting details are
53
-     * not supported.
54
-     *
55
-     * @throws \UnexpectedValueException
56
-     * @param array $criteria
57
-     * @param array|null $orderBy
58
-     * @param int|null $limit
59
-     * @param int|null $offset
60
-     * @return mixed The objects.
61
-     */
62
-    function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null);
63
-
64
-    /**
65
-     * Finds a single object by a set of criteria.
66
-     *
67
-     * @param array $criteria
68
-     * @return object The object.
69
-     */
70
-    function findOneBy(array $criteria);
71
-
72
-    /**
73
-     * Returns the class name of the object managed by the repository
74
-     *
75
-     * @return string
76
-     */
77
-    function getClassName();
78
-}

+ 0 - 244
vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php View File

@@ -1,244 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-namespace Doctrine\Common\Persistence;
21
-
22
-use Doctrine\Common\Persistence\Mapping\ClassMetadata;
23
-use Doctrine\Common\Collections\ArrayCollection;
24
-use Doctrine\Common\Collections\Collection;
25
-
26
-/**
27
- * PersistentObject base class that implements getter/setter methods for all mapped fields and associations
28
- * by overriding __call.
29
- *
30
- * This class is a forward compatible implementation of the PersistentObject trait.
31
- *
32
- *
33
- * Limitations:
34
- *
35
- * 1. All persistent objects have to be associated with a single ObjectManager, multiple
36
- *    ObjectManagers are not supported. You can set the ObjectManager with `PersistentObject#setObjectManager()`.
37
- * 2. Setters and getters only work if a ClassMetadata instance was injected into the PersistentObject.
38
- *    This is either done on `postLoad` of an object or by accessing the global object manager.
39
- * 3. There are no hooks for setters/getters. Just implement the method yourself instead of relying on __call().
40
- * 4. Slower than handcoded implementations: An average of 7 method calls per access to a field and 11 for an association.
41
- * 5. Only the inverse side associations get autoset on the owning side aswell. Setting objects on the owning side
42
- *    will not set the inverse side associations.
43
- *
44
- * @example
45
- *
46
- *  PersistentObject::setObjectManager($em);
47
- *
48
- *  class Foo extends PersistentObject
49
- *  {
50
- *      private $id;
51
- *  }
52
- *
53
- *  $foo = new Foo();
54
- *  $foo->getId(); // method exists through __call
55
- *
56
- * @author Benjamin Eberlei <kontakt@beberlei.de>
57
- */
58
-abstract class PersistentObject implements ObjectManagerAware
59
-{
60
-    /**
61
-     * @var ObjectManager
62
-     */
63
-    private static $objectManager;
64
-
65
-    /**
66
-     * @var ClassMetadata
67
-     */
68
-    private $cm;
69
-
70
-    /**
71
-     * Set the object manager responsible for all persistent object base classes.
72
-     *
73
-     * @param ObjectManager $objectManager
74
-     */
75
-    static public function setObjectManager(ObjectManager $objectManager = null)
76
-    {
77
-        self::$objectManager = $objectManager;
78
-    }
79
-
80
-    /**
81
-     * @return ObjectManager
82
-     */
83
-    static public function getObjectManager()
84
-    {
85
-        return self::$objectManager;
86
-    }
87
-
88
-    /**
89
-     * Inject Doctrine Object Manager
90
-     *
91
-     * @param ObjectManager $objectManager
92
-     * @param ClassMetadata $classMetadata
93
-     *
94
-     * @throws \RuntimeException
95
-     */
96
-    public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata)
97
-    {
98
-        if ($objectManager !== self::$objectManager) {
99
-            throw new \RuntimeException("Trying to use PersistentObject with different ObjectManager instances. " .
100
-                "Was PersistentObject::setObjectManager() called?");
101
-        }
102
-
103
-        $this->cm = $classMetadata;
104
-    }
105
-
106
-    /**
107
-     * Sets a persistent fields value.
108
-     *
109
-     * @param string $field
110
-     * @param array $args
111
-     *
112
-     * @throws \BadMethodCallException - When no persistent field exists by that name.
113
-     * @throws \InvalidArgumentException - When the wrong target object type is passed to an association
114
-     * @return void
115
-     */
116
-    private function set($field, $args)
117
-    {
118
-        $this->initializeDoctrine();
119
-
120
-        if ($this->cm->hasField($field) && !$this->cm->isIdentifier($field)) {
121
-            $this->$field = $args[0];
122
-        } else if ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) {
123
-            $targetClass = $this->cm->getAssociationTargetClass($field);
124
-            if (!($args[0] instanceof $targetClass) && $args[0] !== null) {
125
-                throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'");
126
-            }
127
-            $this->$field = $args[0];
128
-            $this->completeOwningSide($field, $targetClass, $args[0]);
129
-        } else {
130
-            throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'");
131
-        }
132
-    }
133
-
134
-    /**
135
-     * Get persistent field value.
136
-     *
137
-     *
138
-     * @param string $field
139
-     *
140
-     * @throws \BadMethodCallException - When no persistent field exists by that name.
141
-     * @return mixed
142
-     */
143
-    private function get($field)
144
-    {
145
-        $this->initializeDoctrine();
146
-
147
-        if ( $this->cm->hasField($field) || $this->cm->hasAssociation($field) ) {
148
-            return $this->$field;
149
-        } else {
150
-            throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'");
151
-        }
152
-    }
153
-
154
-    /**
155
-     * If this is an inverse side association complete the owning side.
156
-     *
157
-     * @param string $field
158
-     * @param ClassMetadata $targetClass
159
-     * @param object $targetObject
160
-     */
161
-    private function completeOwningSide($field, $targetClass, $targetObject)
162
-    {
163
-        // add this object on the owning side aswell, for obvious infinite recursion
164
-        // reasons this is only done when called on the inverse side.
165
-        if ($this->cm->isAssociationInverseSide($field)) {
166
-            $mappedByField = $this->cm->getAssociationMappedByTargetField($field);
167
-            $targetMetadata = self::$objectManager->getClassMetadata($targetClass);
168
-
169
-            $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? "add" : "set").$mappedByField;
170
-            $targetObject->$setter($this);
171
-        }
172
-    }
173
-
174
-    /**
175
-     * Add an object to a collection
176
-     *
177
-     * @param string $field
178
-     * @param array $args
179
-     *
180
-     * @throws \BadMethodCallException
181
-     * @throws \InvalidArgumentException
182
-     */
183
-    private function add($field, $args)
184
-    {
185
-        $this->initializeDoctrine();
186
-
187
-        if ($this->cm->hasAssociation($field) && $this->cm->isCollectionValuedAssociation($field)) {
188
-            $targetClass = $this->cm->getAssociationTargetClass($field);
189
-            if (!($args[0] instanceof $targetClass)) {
190
-                throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'");
191
-            }
192
-            if (!($this->$field instanceof Collection)) {
193
-                $this->$field = new ArrayCollection($this->$field ?: array());
194
-            }
195
-            $this->$field->add($args[0]);
196
-            $this->completeOwningSide($field, $targetClass, $args[0]);
197
-        } else {
198
-            throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getName());
199
-        }
200
-    }
201
-
202
-    /**
203
-     * Initialize Doctrine Metadata for this class.
204
-     *
205
-     * @throws \RuntimeException
206
-     * @return void
207
-     */
208
-    private function initializeDoctrine()
209
-    {
210
-        if ($this->cm !== null) {
211
-            return;
212
-        }
213
-
214
-        if (!self::$objectManager) {
215
-            throw new \RuntimeException("No runtime object manager set. Call PersistentObject#setObjectManager().");
216
-        }
217
-
218
-        $this->cm = self::$objectManager->getClassMetadata(get_class($this));
219
-    }
220
-
221
-    /**
222
-     * Magic method that implements
223
-     *
224
-     * @param string $method
225
-     * @param array $args
226
-     *
227
-     * @throws \BadMethodCallException
228
-     * @return mixed
229
-     */
230
-    public function __call($method, $args)
231
-    {
232
-        $command = substr($method, 0, 3);
233
-        $field = lcfirst(substr($method, 3));
234
-        if ($command == "set") {
235
-            $this->set($field, $args);
236
-        } else if ($command == "get") {
237
-            return $this->get($field);
238
-        } else if ($command == "add") {
239
-            $this->add($field, $args);
240
-        } else {
241
-            throw new \BadMethodCallException("There is no method ".$method." on ".$this->cm->getName());
242
-        }
243
-    }
244
-}

+ 0 - 60
vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php View File

@@ -1,60 +0,0 @@
1
-<?php
2
-
3
-/*
4
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
- *
16
- * This software consists of voluntary contributions made by many individuals
17
- * and is licensed under the MIT license. For more information, see
18
- * <http://www.doctrine-project.org>.
19
- */
20
-
21
-namespace Doctrine\Common\Persistence;
22
-
23
-/**
24
- * Interface for proxy classes.
25
- *
26
- * @author Roman Borschel <roman@code-factory.org>
27
- * @since 2.2
28
- */
29
-interface Proxy
30
-{
31
-    /**
32
-     * Marker for Proxy class names.
33
-     *
34
-     * @var string
35
-     */
36
-    const MARKER = '__CG__';
37
-
38
-    /**
39
-     * Length of the proxy marker
40
-     *
41
-     * @var int
42
-     */
43
-    const MARKER_LENGTH = 6;
44
-
45
-    /**
46
-     * Initialize this proxy if its not yet initialized.
47
-     *
48
-     * Acts as a no-op if already initialized.
49
-     *
50
-     * @return void
51
-     */
52
-    public function __load();
53
-
54
-    /**
55
-     * Is this proxy initialized or not.
56
-     *
57
-     * @return bool
58
-     */
59
-    public function __isInitialized();
60
-}

+ 0 - 0
vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php View File


Some files were not shown because too many files changed in this diff