Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Directory structure reorganization.

Vendors dependencies are no longer included.
Example ZF application now included under sandbox directory.
  • Loading branch information...
commit 51f8b194d33040312541d54d11d431d3aac35ddc 1 parent d3cb615
@loicfrering authored
Showing with 45 additions and 30,948 deletions.
  1. +1 −0  .gitignore
  2. +0 −64 .zfproject.xml
  3. +19 −0 LICENSE
  4. +25 −0 README
  5. +0 −81 library/Doctrine/Common/Annotations/Annotation.php
  6. +0 −59 library/Doctrine/Common/Annotations/AnnotationException.php
  7. +0 −204 library/Doctrine/Common/Annotations/AnnotationReader.php
  8. +0 −156 library/Doctrine/Common/Annotations/Lexer.php
  9. +0 −445 library/Doctrine/Common/Annotations/Parser.php
  10. 0  library/Doctrine/Common/Annotations/README.markdown
  11. +0 −214 library/Doctrine/Common/Cache/AbstractCache.php
  12. +0 −87 library/Doctrine/Common/Cache/ApcCache.php
  13. +0 −88 library/Doctrine/Common/Cache/ArrayCache.php
  14. +0 −71 library/Doctrine/Common/Cache/Cache.php
  15. +0 −123 library/Doctrine/Common/Cache/MemcacheCache.php
  16. +0 −102 library/Doctrine/Common/Cache/XcacheCache.php
  17. +0 −147 library/Doctrine/Common/ClassLoader.php
  18. +0 −423 library/Doctrine/Common/Collections/ArrayCollection.php
  19. +0 −230 library/Doctrine/Common/Collections/Collection.php
  20. +0 −11 library/Doctrine/Common/CommonException.php
  21. +0 −24 library/Doctrine/Common/Comparable.php
  22. +0 −24 library/Doctrine/Common/Equatable.php
  23. +0 −69 library/Doctrine/Common/EventArgs.php
  24. +0 −138 library/Doctrine/Common/EventManager.php
  25. +0 −45 library/Doctrine/Common/EventSubscriber.php
  26. +0 −255 library/Doctrine/Common/Lexer.php
  27. +0 −45 library/Doctrine/Common/NotifyPropertyChanged.php
  28. +0 −48 library/Doctrine/Common/PropertyChangedListener.php
  29. +0 −131 library/Doctrine/Common/Util/Debug.php
  30. +0 −72 library/Doctrine/Common/Util/Inflector.php
  31. +0 −55 library/Doctrine/Common/Version.php
  32. +0 −64 library/Doctrine/DBAL/Configuration.php
  33. +0 −914 library/Doctrine/DBAL/Connection.php
  34. +0 −44 library/Doctrine/DBAL/ConnectionException.php
  35. +0 −88 library/Doctrine/DBAL/DBALException.php
  36. +0 −55 library/Doctrine/DBAL/Driver.php
  37. +0 −44 library/Doctrine/DBAL/Driver/Connection.php
  38. +0 −93 library/Doctrine/DBAL/Driver/OCI8/Driver.php
  39. +0 −108 library/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
  40. +0 −30 library/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php
  41. +0 −199 library/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
  42. +0 −40 library/Doctrine/DBAL/Driver/PDOConnection.php
  43. +0 −60 library/Doctrine/DBAL/Driver/PDOMsSql/Connection.php
  44. +0 −84 library/Doctrine/DBAL/Driver/PDOMsSql/Driver.php
  45. +0 −97 library/Doctrine/DBAL/Driver/PDOMySql/Driver.php
  46. +0 −88 library/Doctrine/DBAL/Driver/PDOOracle/Driver.php
  47. +0 −70 library/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
  48. +0 −118 library/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
  49. +0 −33 library/Doctrine/DBAL/Driver/PDOStatement.php
  50. +0 −200 library/Doctrine/DBAL/Driver/Statement.php
  51. +0 −160 library/Doctrine/DBAL/DriverManager.php
  52. +0 −79 library/Doctrine/DBAL/Event/ConnectionEventArgs.php
  53. +0 −75 library/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php
  54. +0 −82 library/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php
  55. +0 −43 library/Doctrine/DBAL/Events.php
  56. +0 −54 library/Doctrine/DBAL/Logging/DebugStack.php
  57. +0 −49 library/Doctrine/DBAL/Logging/EchoSQLLogger.php
  58. +0 −45 library/Doctrine/DBAL/Logging/SQLLogger.php
  59. +0 −1,846 library/Doctrine/DBAL/Platforms/AbstractPlatform.php
  60. +0 −486 library/Doctrine/DBAL/Platforms/MsSqlPlatform.php
  61. +0 −669 library/Doctrine/DBAL/Platforms/MySqlPlatform.php
  62. +0 −653 library/Doctrine/DBAL/Platforms/OraclePlatform.php
  63. +0 −640 library/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
  64. +0 −431 library/Doctrine/DBAL/Platforms/SqlitePlatform.php
  65. 0  library/Doctrine/DBAL/README.markdown
  66. +0 −32 library/Doctrine/DBAL/SQLQuery.php
  67. +0 −86 library/Doctrine/DBAL/Schema/AbstractAsset.php
  68. +0 −774 library/Doctrine/DBAL/Schema/AbstractSchemaManager.php
  69. +0 −331 library/Doctrine/DBAL/Schema/Column.php
  70. +0 −58 library/Doctrine/DBAL/Schema/ColumnDiff.php
  71. +0 −395 library/Doctrine/DBAL/Schema/Comparator.php
  72. +0 −38 library/Doctrine/DBAL/Schema/Constraint.php
  73. +0 −164 library/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
  74. +0 −109 library/Doctrine/DBAL/Schema/Index.php
  75. +0 −399 library/Doctrine/DBAL/Schema/MsSqlSchemaManager.php
  76. +0 −272 library/Doctrine/DBAL/Schema/MySqlSchemaManager.php
  77. +0 −280 library/Doctrine/DBAL/Schema/OracleSchemaManager.php
  78. +0 −332 library/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
  79. +0 −327 library/Doctrine/DBAL/Schema/Schema.php
  80. +0 −76 library/Doctrine/DBAL/Schema/SchemaConfig.php
  81. +0 −176 library/Doctrine/DBAL/Schema/SchemaDiff.php
  82. +0 −126 library/Doctrine/DBAL/Schema/SchemaException.php
  83. +0 −77 library/Doctrine/DBAL/Schema/Sequence.php
  84. +0 −265 library/Doctrine/DBAL/Schema/SqliteSchemaManager.php
  85. +0 −645 library/Doctrine/DBAL/Schema/Table.php
  86. +0 −139 library/Doctrine/DBAL/Schema/TableDiff.php
  87. +0 −53 library/Doctrine/DBAL/Schema/View.php
  88. +0 −145 library/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
  89. +0 −146 library/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php
  90. +0 −82 library/Doctrine/DBAL/Schema/Visitor/FixSchema.php
  91. +0 −75 library/Doctrine/DBAL/Schema/Visitor/Visitor.php
  92. +0 −230 library/Doctrine/DBAL/Statement.php
  93. +0 −127 library/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php
  94. +0 −86 library/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
  95. +0 −74 library/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php
  96. +0 −50 library/Doctrine/DBAL/Types/ArrayType.php
  97. +0 −48 library/Doctrine/DBAL/Types/BigIntType.php
  98. +0 −57 library/Doctrine/DBAL/Types/BooleanType.php
  99. +0 −54 library/Doctrine/DBAL/Types/DateTimeType.php
  100. +0 −54 library/Doctrine/DBAL/Types/DateType.php
  101. +0 −47 library/Doctrine/DBAL/Types/DecimalType.php
  102. +0 −53 library/Doctrine/DBAL/Types/IntegerType.php
  103. +0 −31 library/Doctrine/DBAL/Types/ObjectType.php
  104. +0 −52 library/Doctrine/DBAL/Types/SmallIntType.php
  105. +0 −50 library/Doctrine/DBAL/Types/StringType.php
  106. +0 −43 library/Doctrine/DBAL/Types/TextType.php
  107. +0 −63 library/Doctrine/DBAL/Types/TimeType.php
  108. +0 −226 library/Doctrine/DBAL/Types/Type.php
  109. +0 −572 library/Doctrine/ORM/AbstractQuery.php
  110. +0 −465 library/Doctrine/ORM/Configuration.php
  111. +0 −615 library/Doctrine/ORM/EntityManager.php
  112. +0 −34 library/Doctrine/ORM/EntityNotFoundException.php
  113. +0 −203 library/Doctrine/ORM/EntityRepository.php
  114. +0 −60 library/Doctrine/ORM/Event/LifecycleEventArgs.php
  115. +0 −27 library/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php
  116. +0 −78 library/Doctrine/ORM/Event/OnFlushEventArgs.php
  117. +0 −98 library/Doctrine/ORM/Event/PreUpdateEventArgs.php
  118. +0 −122 library/Doctrine/ORM/Events.php
  119. +0 −48 library/Doctrine/ORM/Id/AbstractIdGenerator.php
  120. +0 −69 library/Doctrine/ORM/Id/AssignedGenerator.php
  121. +0 −46 library/Doctrine/ORM/Id/IdentityGenerator.php
  122. +0 −103 library/Doctrine/ORM/Id/SequenceGenerator.php
  123. +0 −46 library/Doctrine/ORM/Id/SequenceIdentityGenerator.php
  124. +0 −79 library/Doctrine/ORM/Id/TableGenerator.php
  125. +0 −118 library/Doctrine/ORM/Internal/CommitOrderCalculator.php
  126. +0 −270 library/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
  127. +0 −235 library/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php
  128. +0 −17 library/Doctrine/ORM/Internal/Hydration/HydrationException.php
  129. +0 −104 library/Doctrine/ORM/Internal/Hydration/IterableResult.php
  130. +0 −422 library/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
  131. +0 −50 library/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php
  132. +0 −49 library/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php
  133. +0 −398 library/Doctrine/ORM/Mapping/AssociationMapping.php
  134. +0 −376 library/Doctrine/ORM/Mapping/ClassMetadata.php
  135. +0 −407 library/Doctrine/ORM/Mapping/ClassMetadataFactory.php
  136. +0 −1,269 library/Doctrine/ORM/Mapping/ClassMetadataInfo.php
  137. +0 −210 library/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php
  138. +0 −489 library/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
  139. +0 −168 library/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
  140. +0 −137 library/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php
  141. +0 −59 library/Doctrine/ORM/Mapping/Driver/Driver.php
  142. +0 −115 library/Doctrine/ORM/Mapping/Driver/DriverChain.php
  143. +0 −71 library/Doctrine/ORM/Mapping/Driver/PHPDriver.php
  144. +0 −122 library/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php
  145. +0 −480 library/Doctrine/ORM/Mapping/Driver/XmlDriver.php
  146. +0 −444 library/Doctrine/ORM/Mapping/Driver/YamlDriver.php
  147. +0 −177 library/Doctrine/ORM/Mapping/ManyToManyMapping.php
  148. +0 −202 library/Doctrine/ORM/Mapping/MappingException.php
  149. +0 −144 library/Doctrine/ORM/Mapping/OneToManyMapping.php
  150. +0 −165 library/Doctrine/ORM/Mapping/OneToOneMapping.php
  151. +0 −73 library/Doctrine/ORM/NativeQuery.php
  152. +0 −34 library/Doctrine/ORM/NoResultException.php
  153. +0 −28 library/Doctrine/ORM/NonUniqueResultException.php
  154. +0 −125 library/Doctrine/ORM/ORMException.php
  155. +0 −34 library/Doctrine/ORM/OptimisticLockException.php
  156. +0 −652 library/Doctrine/ORM/PersistentCollection.php
  157. +0 −164 library/Doctrine/ORM/Persisters/AbstractCollectionPersister.php
  158. +0 −103 library/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php
  159. +0 −1,080 library/Doctrine/ORM/Persisters/BasicEntityPersister.php
  160. +0 −33 library/Doctrine/ORM/Persisters/ElementCollectionPersister.php
  161. +0 −388 library/Doctrine/ORM/Persisters/JoinedSubclassPersister.php
  162. +0 −176 library/Doctrine/ORM/Persisters/ManyToManyPersister.php
  163. +0 −119 library/Doctrine/ORM/Persisters/OneToManyPersister.php
  164. +0 −114 library/Doctrine/ORM/Persisters/SingleTablePersister.php
  165. +0 −8 library/Doctrine/ORM/Persisters/UnionSubclassPersister.php
  166. +0 −30 library/Doctrine/ORM/Proxy/Proxy.php
  167. +0 −43 library/Doctrine/ORM/Proxy/ProxyException.php
  168. +0 −282 library/Doctrine/ORM/Proxy/ProxyFactory.php
Sorry, we could not display the entire diff because too many files (3,243) changed.
View
1  .gitignore
@@ -1 +1,2 @@
nbproject/
+sandbox/library/
View
64 .zfproject.xml
@@ -1,64 +0,0 @@
-<?xml version="1.0"?>
-<projectProfile>
- <projectDirectory>
- <projectProfileFile/>
- <applicationDirectory classNamePrefix="Application_">
- <apisDirectory enabled="false"/>
- <configsDirectory>
- <applicationConfigFile type="ini"/>
- </configsDirectory>
- <controllersDirectory>
- <controllerFile controllerName="Index">
- <actionMethod actionName="index"/>
- </controllerFile>
- <controllerFile controllerName="Error"/>
- </controllersDirectory>
- <formsDirectory enabled="false"/>
- <layoutsDirectory enabled="false"/>
- <modelsDirectory/>
- <modulesDirectory enabled="false"/>
- <viewsDirectory>
- <viewScriptsDirectory>
- <viewControllerScriptsDirectory forControllerName="Index">
- <viewScriptFile forActionName="index"/>
- </viewControllerScriptsDirectory>
- <viewControllerScriptsDirectory forControllerName="Error">
- <viewScriptFile forActionName="error"/>
- </viewControllerScriptsDirectory>
- </viewScriptsDirectory>
- <viewHelpersDirectory/>
- <viewFiltersDirectory enabled="false"/>
- </viewsDirectory>
- <bootstrapFile/>
- </applicationDirectory>
- <dataDirectory enabled="false">
- <cacheDirectory enabled="false"/>
- <searchIndexesDirectory enabled="false"/>
- <localesDirectory enabled="false"/>
- <logsDirectory enabled="false"/>
- <sessionsDirectory enabled="false"/>
- <uploadsDirectory enabled="false"/>
- </dataDirectory>
- <libraryDirectory>
- <zfStandardLibraryDirectory enabled="false"/>
- </libraryDirectory>
- <publicDirectory>
- <publicStylesheetsDirectory enabled="false"/>
- <publicScriptsDirectory enabled="false"/>
- <publicImagesDirectory enabled="false"/>
- <publicIndexFile/>
- <htaccessFile/>
- </publicDirectory>
- <projectProvidersDirectory enabled="false"/>
- <temporaryDirectory enabled="false"/>
- <testsDirectory>
- <testPHPUnitConfigFile/>
- <testApplicationDirectory>
- <testApplicationBootstrapFile/>
- </testApplicationDirectory>
- <testLibraryDirectory>
- <testLibraryBootstrapFile/>
- </testLibraryDirectory>
- </testsDirectory>
- </projectDirectory>
-</projectProfile>
View
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Loïc Frering
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
25 README
@@ -0,0 +1,25 @@
+README
+======
+
+What is LoSoLib?
+----------------
+
+LoSoLib provides a collection of components for Zend Framework applications which allows to build solid multi-layered architectures.
+
+It particularly contains:
+
+* A Symfony Dependency Injection container integration
+* An annotation loader for Symfony Dependency Injection Container
+* A Doctrine 2 integration
+* Other useful components
+
+Requirements
+------------
+
+LoSoLib requires PHP 5.3 or later.
+
+License
+-------
+
+The files in this archive are released under the MIT license.
+You can find a copy of this license in the LICENSE file.
View
0  application/Bootstrap.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/configs/application.ini
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/configs/services.yml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/controllers/DiController.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/controllers/ErrorController.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/controllers/IndexController.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/controllers/UserController.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/dao/Doctrine/UserDao.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/doctrine/mapping/Application_Model_User.dcm.yml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/forms/User.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/layouts/scripts/layout.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/models/User.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/Bootstrap.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/controllers/PostController.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/dao/Doctrine/PostDao.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/doctrine/mapping/Scaffold_Model_Post.dcm.yml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/forms/Post.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/models/Post.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/services/Doctrine/PostService.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/views/scripts/post/delete.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/views/scripts/post/edit.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/views/scripts/post/list.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/views/scripts/post/new.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/views/scripts/post/partialPost.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/modules/scaffold/views/scripts/post/show.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/services/Doctrine/UserService.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/services/TestService.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/services/TestService2.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/views/scripts/di/index.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/views/scripts/error/error.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/views/scripts/index/index.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/views/scripts/user/hello.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  application/views/scripts/user/index.phtml
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0  languages/en/post.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
81 library/Doctrine/Common/Annotations/Annotation.php
@@ -1,81 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations;
-
-/**
- * Annotations class
- *
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision$
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- */
-class Annotation
-{
- /**
- * Value property. Common among all derived classes.
- *
- * @var string
- */
- public $value;
-
- /**
- * Constructor
- *
- * @param array $data Key-value for properties to be defined in this class
- */
- public final function __construct(array $data)
- {
- foreach ($data as $key => $value) {
- $this->$key = $value;
- }
- }
-
- /**
- * Error handler for unknown property accessor in Annotation class.
- *
- * @param string $name Unknown property name
- */
- public function __get($name)
- {
- throw new \BadMethodCallException(
- sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
- );
- }
-
- /**
- * Error handler for unknown property mutator in Annotation class.
- *
- * @param string $name Unkown property name
- * @param mixed $value Property value
- */
- public function __set($name, $value)
- {
- throw new \BadMethodCallException(
- sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
- );
- }
-}
View
59 library/Doctrine/Common/Annotations/AnnotationException.php
@@ -1,59 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations;
-
-/**
- * Description of AnnotationException
- *
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision$
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- */
-class AnnotationException extends \Exception
-{
- /**
- * Creates a new AnnotationException describing a Syntax error.
- *
- * @param string $message Exception message
- * @return AnnotationException
- */
- public static function syntaxError($message)
- {
- return new self('[Syntax Error] ' . $message);
- }
-
- /**
- * Creates a new AnnotationException describing a Semantical error.
- *
- * @param string $message Exception message
- * @return AnnotationException
- */
- public static function semanticalError($message)
- {
- return new self('[Semantical Error] ' . $message);
- }
-}
View
204 library/Doctrine/Common/Annotations/AnnotationReader.php
@@ -1,204 +0,0 @@
-<?php
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations;
-
-use \ReflectionClass,
- \ReflectionMethod,
- \ReflectionProperty,
- Doctrine\Common\Cache\Cache;
-
-/**
- * A reader for docblock annotations.
- *
- * @since 2.0
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- */
-class AnnotationReader
-{
- /**
- * Cache salt
- *
- * @var string
- * @static
- */
- private static $CACHE_SALT = '@<Annot>';
-
- /**
- * Annotations Parser
- *
- * @var Doctrine\Common\Annotations\Parser
- */
- private $_parser;
-
- /**
- * Cache mechanism to store processed Annotations
- *
- * @var Doctrine\Common\Cache\Cache
- */
- private $_cache;
-
- /**
- * Constructor. Initializes a new AnnotationReader that uses the given Cache provider.
- *
- * @param Cache $cache The cache provider to use. If none is provided, ArrayCache is used.
- */
- public function __construct(Cache $cache = null)
- {
- $this->_parser = new Parser;
- $this->_cache = $cache ?: new \Doctrine\Common\Cache\ArrayCache;
- }
-
- /**
- * Sets the default namespace that the AnnotationReader should assume for annotations
- * with not fully qualified names.
- *
- * @param string $defaultNamespace
- */
- public function setDefaultAnnotationNamespace($defaultNamespace)
- {
- $this->_parser->setDefaultAnnotationNamespace($defaultNamespace);
- }
-
- /**
- * Sets an alias for an annotation namespace.
- *
- * @param $namespace
- * @param $alias
- */
- public function setAnnotationNamespaceAlias($namespace, $alias)
- {
- $this->_parser->setAnnotationNamespaceAlias($namespace, $alias);
- }
-
- /**
- * Gets the annotations applied to a class.
- *
- * @param string|ReflectionClass $class The name or ReflectionClass of the class from which
- * the class annotations should be read.
- * @return array An array of Annotations.
- */
- public function getClassAnnotations(ReflectionClass $class)
- {
- $cacheKey = $class->getName() . self::$CACHE_SALT;
-
- // Attempt to grab data from cache
- if (($data = $this->_cache->fetch($cacheKey)) !== false) {
- return $data;
- }
-
- $annotations = $this->_parser->parse($class->getDocComment(), 'class ' . $class->getName());
- $this->_cache->save($cacheKey, $annotations, null);
-
- return $annotations;
- }
-
- /**
- * Gets a class annotation.
- *
- * @param $class
- * @param string $annotation The name of the annotation.
- * @return The Annotation or NULL, if the requested annotation does not exist.
- */
- public function getClassAnnotation(ReflectionClass $class, $annotation)
- {
- $annotations = $this->getClassAnnotations($class);
-
- return isset($annotations[$annotation]) ? $annotations[$annotation] : null;
- }
-
- /**
- * Gets the annotations applied to a property.
- *
- * @param string|ReflectionClass $class The name or ReflectionClass of the class that owns the property.
- * @param string|ReflectionProperty $property The name or ReflectionProperty of the property
- * from which the annotations should be read.
- * @return array An array of Annotations.
- */
- public function getPropertyAnnotations(ReflectionProperty $property)
- {
- $cacheKey = $property->getDeclaringClass()->getName() . '$' . $property->getName() . self::$CACHE_SALT;
-
- // Attempt to grab data from cache
- if (($data = $this->_cache->fetch($cacheKey)) !== false) {
- return $data;
- }
-
- $context = 'property ' . $property->getDeclaringClass()->getName() . "::\$" . $property->getName();
- $annotations = $this->_parser->parse($property->getDocComment(), $context);
- $this->_cache->save($cacheKey, $annotations, null);
-
- return $annotations;
- }
-
- /**
- * Gets a property annotation.
- *
- * @param ReflectionProperty $property
- * @param string $annotation The name of the annotation.
- * @return The Annotation or NULL, if the requested annotation does not exist.
- */
- public function getPropertyAnnotation(ReflectionProperty $property, $annotation)
- {
- $annotations = $this->getPropertyAnnotations($property);
-
- return isset($annotations[$annotation]) ? $annotations[$annotation] : null;
- }
-
- /**
- * Gets the annotations applied to a method.
- *
- * @param string|ReflectionClass $class The name or ReflectionClass of the class that owns the method.
- * @param string|ReflectionMethod $property The name or ReflectionMethod of the method from which
- * the annotations should be read.
- * @return array An array of Annotations.
- */
- public function getMethodAnnotations(ReflectionMethod $method)
- {
- $cacheKey = $method->getDeclaringClass()->getName() . '#' . $method->getName() . self::$CACHE_SALT;
-
- // Attempt to grab data from cache
- if (($data = $this->_cache->fetch($cacheKey)) !== false) {
- return $data;
- }
-
- $context = 'method ' . $method->getDeclaringClass()->getName() . '::' . $method->getName() . '()';
- $annotations = $this->_parser->parse($method->getDocComment(), $context);
- $this->_cache->save($cacheKey, $annotations, null);
-
- return $annotations;
- }
-
- /**
- * Gets a method annotation.
- *
- * @param ReflectionMethod $method
- * @param string $annotation The name of the annotation.
- * @return The Annotation or NULL, if the requested annotation does not exist.
- */
- public function getMethodAnnotation(ReflectionMethod $method, $annotation)
- {
- $annotations = $this->getMethodAnnotations($method);
-
- return isset($annotations[$annotation]) ? $annotations[$annotation] : null;
- }
-}
View
156 library/Doctrine/Common/Annotations/Lexer.php
@@ -1,156 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations;
-
-/**
- * Simple lexer for docblock annotations.
- *
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision$
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- */
-class Lexer extends \Doctrine\Common\Lexer
-{
- const T_NONE = 1;
- const T_IDENTIFIER = 2;
- const T_INTEGER = 3;
- const T_STRING = 4;
- const T_FLOAT = 5;
-
- const T_AT = 101;
- const T_CLOSE_CURLY_BRACES = 102;
- const T_CLOSE_PARENTHESIS = 103;
- const T_COMMA = 104;
- const T_EQUALS = 105;
- const T_FALSE = 106;
- const T_NAMESPACE_SEPARATOR = 107;
- const T_OPEN_CURLY_BRACES = 108;
- const T_OPEN_PARENTHESIS = 109;
- const T_TRUE = 110;
-
- /**
- * @inheritdoc
- */
- protected function getCatchablePatterns()
- {
- return array(
- '[a-z_][a-z0-9_:]*',
- '(?:[0-9]+(?:[\.][0-9]+)*)(?:e[+-]?[0-9]+)?',
- '"(?:[^"]|"")*"'
- );
- }
-
- /**
- * @inheritdoc
- */
- protected function getNonCatchablePatterns()
- {
- return array('\s+', '\*+', '(.)');
- }
-
- /**
- * @inheritdoc
- */
- protected function _getType(&$value)
- {
- $type = self::T_NONE;
- $newVal = $this->_getNumeric($value);
-
- // Checking numeric value
- if ($newVal !== false) {
- $value = $newVal;
-
- return (strpos($value, '.') !== false || stripos($value, 'e') !== false)
- ? self::T_FLOAT : self::T_INTEGER;
- }
-
- if ($value[0] === '"') {
- $value = str_replace('""', '"', substr($value, 1, strlen($value) - 2));
-
- return self::T_STRING;
- } else {
- switch (strtolower($value)) {
- case '@':
- return self::T_AT;
-
- case ',':
- return self::T_COMMA;
-
- case '(':
- return self::T_OPEN_PARENTHESIS;
-
- case ')':
- return self::T_CLOSE_PARENTHESIS;
-
- case '{':
- return self::T_OPEN_CURLY_BRACES;
-
- case '}': return self::T_CLOSE_CURLY_BRACES;
- case '=':
- return self::T_EQUALS;
-
- case '\\':
- return self::T_NAMESPACE_SEPARATOR;
-
- case 'true':
- return self::T_TRUE;
-
- case 'false':
- return self::T_FALSE;
-
- default:
- if (ctype_alpha($value[0]) || $value[0] === '_') {
- return self::T_IDENTIFIER;
- }
-
- break;
- }
- }
-
- return $type;
- }
-
- /**
- * Checks if a value is numeric or not
- *
- * @param mixed $value Value to be inspected
- * @return boolean|integer|float Processed value
- */
- private function _getNumeric($value)
- {
- if ( ! is_scalar($value)) {
- return false;
- }
-
- // Checking for valid numeric numbers: 1.234, -1.234e-2
- if (is_numeric($value)) {
- return $value;
- }
-
- return false;
- }
-}
View
445 library/Doctrine/Common/Annotations/Parser.php
@@ -1,445 +0,0 @@
-<?php
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Annotations;
-
-/**
- * A simple parser for docblock annotations.
- *
- * @since 2.0
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- */
-class Parser
-{
- /**
- * Tags that are stripped prior to parsing in order to reduce parsing overhead.
- *
- * @var array
- */
- private static $_strippedInlineTags = array(
- "{@example", "{@id", "{@internal", "{@inheritdoc",
- "{@link", "{@source", "{@toc", "{@tutorial", "*/"
- );
-
- /**
- * The lexer.
- *
- * @var Doctrine\Common\Annotations\Lexer
- */
- private $_lexer;
-
- /**
- * Flag to control if the current Annotation is nested or not.
- *
- * @var boolean
- */
- private $_isNestedAnnotation = false;
-
- /**
- * Default namespace for Annotations.
- *
- * @var string
- */
- private $_defaultAnnotationNamespace = '';
-
- /**
- * Hashmap to store namespace aliases.
- *
- * @var array
- */
- private $_namespaceAliases = array();
-
- /**
- * @var string
- */
- private $_context = '';
-
- /**
- * Constructs a new AnnotationParser.
- *
- */
- public function __construct()
- {
- $this->_lexer = new Lexer;
- }
-
- /**
- * Sets the default namespace that is assumed for an annotation that does not
- * define a namespace prefix.
- *
- * @param $defaultNamespace
- */
- public function setDefaultAnnotationNamespace($defaultNamespace)
- {
- $this->_defaultAnnotationNamespace = $defaultNamespace;
- }
-
- /**
- * Sets an alias for an annotation namespace.
- *
- * @param $namespace
- * @param $alias
- */
- public function setAnnotationNamespaceAlias($namespace, $alias)
- {
- $this->_namespaceAliases[$alias] = $namespace;
- }
-
- /**
- * Parses the given docblock string for annotations.
- *
- * @param string $docBlockString
- * @param string $context
- * @return array Array of Annotations. If no annotations are found, an empty array is returned.
- */
- public function parse($docBlockString, $context='')
- {
- $this->_context = $context;
-
- // Strip out some known inline tags.
- $input = str_replace(self::$_strippedInlineTags, '', $docBlockString);
-
- // Cut of the beginning of the input until the first '@'.
- $input = substr($input, strpos($input, '@'));
-
- $this->_lexer->reset();
- $this->_lexer->setInput(trim($input, '* /'));
- $this->_lexer->moveNext();
-
- if ($this->_lexer->isNextToken(Lexer::T_AT)) {
- return $this->Annotations();
- }
-
- return array();
- }
-
- /**
- * Attempts to match the given token with the current lookahead token.
- * If they match, updates the lookahead token; otherwise raises a syntax error.
- *
- * @param int|string token type or value
- * @return bool True if tokens match; false otherwise.
- */
- public function match($token)
- {
- if ( ! ($this->_lexer->lookahead['type'] === $token)) {
- $this->syntaxError($this->_lexer->getLiteral($token));
- }
- $this->_lexer->moveNext();
- }
-
- /**
- * Generates a new syntax error.
- *
- * @param string $expected Expected string.
- * @param array $token Optional token.
- * @throws AnnotationException
- */
- private function syntaxError($expected, $token = null)
- {
- if ($token === null) {
- $token = $this->_lexer->lookahead;
- }
-
- $message = "Expected {$expected}, got ";
-
- if ($this->_lexer->lookahead === null) {
- $message .= 'end of string';
- } else {
- $message .= "'{$token['value']}' at position {$token['position']}";
- }
-
- if (strlen($this->_context)) {
- $message .= ' in ' . $this->_context;
- }
-
- $message .= '.';
-
- throw AnnotationException::syntaxError($message);
- }
-
- /**
- * Annotations ::= Annotation {[ "*" ]* [Annotation]}*
- *
- * @return array
- */
- public function Annotations()
- {
- $this->_isNestedAnnotation = false;
-
- $annotations = array();
- $annot = $this->Annotation();
-
- if ($annot !== false) {
- $annotations[get_class($annot)] = $annot;
- }
-
- while ($this->_lexer->lookahead !== null && $this->_lexer->isNextToken(Lexer::T_AT)) {
- $this->_isNestedAnnotation = false;
-
- $annot = $this->Annotation();
-
- if ($annot !== false) {
- $annotations[get_class($annot)] = $annot;
- }
- }
-
- return $annotations;
- }
-
- /**
- * Annotation ::= "@" AnnotationName ["(" [Values] ")"]
- * AnnotationName ::= QualifiedName | SimpleName | AliasedName
- * QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName
- * AliasedName ::= Alias ":" SimpleName
- * NameSpacePart ::= identifier
- * SimpleName ::= identifier
- * Alias ::= identifier
- *
- * @return mixed False if it is not a valid Annotation; instance of Annotation subclass otherwise.
- */
- public function Annotation()
- {
- $values = array();
- $nameParts = array();
-
- $this->match(Lexer::T_AT);
- $this->match(Lexer::T_IDENTIFIER);
- $nameParts[] = $this->_lexer->token['value'];
-
- while ($this->_lexer->isNextToken(Lexer::T_NAMESPACE_SEPARATOR)) {
- $this->match(Lexer::T_NAMESPACE_SEPARATOR);
- $this->match(Lexer::T_IDENTIFIER);
- $nameParts[] = $this->_lexer->token['value'];
- }
-
- // Effectively pick the name of the class (append default NS if none, grab from NS alias, etc)
- if (count($nameParts) == 1) {
- if (strpos($nameParts[0], ':')) {
- list ($alias, $simpleName) = explode(':', $nameParts[0]);
- $name = $this->_namespaceAliases[$alias] . $simpleName;
- } else {
- $name = $this->_defaultAnnotationNamespace . $nameParts[0];
- }
- } else {
- $name = implode('\\', $nameParts);
- }
-
- // Is it really an annotation class?
- if (
- ( ! $this->_isNestedAnnotation && $this->_lexer->lookahead != null &&
- ! $this->_lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS) &&
- ! $this->_lexer->isNextToken(Lexer::T_AT)) ||
- ! class_exists($name, false)
- ) {
- $this->_lexer->skipUntil(Lexer::T_AT);
-
- return false;
- }
-
- // Next will be nested
- $this->_isNestedAnnotation = true;
-
- if ($this->_lexer->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
- $this->match(Lexer::T_OPEN_PARENTHESIS);
-
- if ( ! $this->_lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) {
- $values = $this->Values();
- }
-
- $this->match(Lexer::T_CLOSE_PARENTHESIS);
- }
-
- return new $name($values);
- }
-
- /**
- * Values ::= Array | Value {"," Value}*
- *
- * @return array
- */
- public function Values()
- {
- $values = array();
-
- // Handle the case of a single array as value, i.e. @Foo({....})
- if ($this->_lexer->isNextToken(Lexer::T_OPEN_CURLY_BRACES)) {
- $values['value'] = $this->Value();
- return $values;
- }
-
- $values[] = $this->Value();
-
- while ($this->_lexer->isNextToken(Lexer::T_COMMA)) {
- $this->match(Lexer::T_COMMA);
- $value = $this->Value();
-
- if ( ! is_array($value)) {
- $this->syntaxError('Value', $value);
- }
-
- $values[] = $value;
- }
-
- foreach ($values as $k => $value) {
- if (is_array($value) && is_string(key($value))) {
- $key = key($value);
- $values[$key] = $value[$key];
- } else {
- $values['value'] = $value;
- }
-
- unset($values[$k]);
- }
-
- return $values;
- }
-
- /**
- * Value ::= PlainValue | FieldAssignment
- *
- * @return mixed
- */
- public function Value()
- {
- $peek = $this->_lexer->glimpse();
-
- if ($peek['value'] === '=') {
- return $this->FieldAssignment();
- }
-
- return $this->PlainValue();
- }
-
- /**
- * PlainValue ::= integer | string | float | boolean | Array | Annotation
- *
- * @return mixed
- */
- public function PlainValue()
- {
- if ($this->_lexer->isNextToken(Lexer::T_OPEN_CURLY_BRACES)) {
- return $this->Arrayx();
- }
-
- if ($this->_lexer->isNextToken(Lexer::T_AT)) {
- return $this->Annotation();
- }
-
- switch ($this->_lexer->lookahead['type']) {
- case Lexer::T_STRING:
- $this->match(Lexer::T_STRING);
- return $this->_lexer->token['value'];
-
- case Lexer::T_INTEGER:
- $this->match(Lexer::T_INTEGER);
- return $this->_lexer->token['value'];
-
- case Lexer::T_FLOAT:
- $this->match(Lexer::T_FLOAT);
- return $this->_lexer->token['value'];
-
- case Lexer::T_TRUE:
- $this->match(Lexer::T_TRUE);
- return true;
-
- case Lexer::T_FALSE:
- $this->match(Lexer::T_FALSE);
- return false;
-
- default:
- $this->syntaxError('PlainValue');
- }
- }
-
- /**
- * FieldAssignment ::= FieldName "=" PlainValue
- * FieldName ::= identifier
- *
- * @return array
- */
- public function FieldAssignment()
- {
- $this->match(Lexer::T_IDENTIFIER);
- $fieldName = $this->_lexer->token['value'];
- $this->match(Lexer::T_EQUALS);
-
- return array($fieldName => $this->PlainValue());
- }
-
- /**
- * Array ::= "{" ArrayEntry {"," ArrayEntry}* "}"
- *
- * @return array
- */
- public function Arrayx()
- {
- $array = $values = array();
-
- $this->match(Lexer::T_OPEN_CURLY_BRACES);
- $values[] = $this->ArrayEntry();
-
- while ($this->_lexer->isNextToken(Lexer::T_COMMA)) {
- $this->match(Lexer::T_COMMA);
- $values[] = $this->ArrayEntry();
- }
-
- $this->match(Lexer::T_CLOSE_CURLY_BRACES);
-
- foreach ($values as $value) {
- list ($key, $val) = $value;
-
- if ($key !== null) {
- $array[$key] = $val;
- } else {
- $array[] = $val;
- }
- }
-
- return $array;
- }
-
- /**
- * ArrayEntry ::= Value | KeyValuePair
- * KeyValuePair ::= Key "=" PlainValue
- * Key ::= string | integer
- *
- * @return array
- */
- public function ArrayEntry()
- {
- $peek = $this->_lexer->glimpse();
-
- if ($peek['value'] == '=') {
- $this->match(
- $this->_lexer->isNextToken(Lexer::T_INTEGER) ? Lexer::T_INTEGER : Lexer::T_STRING
- );
-
- $key = $this->_lexer->token['value'];
- $this->match(Lexer::T_EQUALS);
-
- return array($key, $this->PlainValue());
- }
-
- return array(null, $this->Value());
- }
-}
View
0  library/Doctrine/Common/Annotations/README.markdown
No changes.
View
214 library/Doctrine/Common/Cache/AbstractCache.php
@@ -1,214 +0,0 @@
-<?php
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Cache;
-
-/**
- * Base class for cache driver implementations.
- *
- * @since 2.0
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- */
-abstract class AbstractCache implements Cache
-{
- /** @var string The cache id to store the index of cache ids under */
- private $_cacheIdsIndexId = 'doctrine_cache_ids';
-
- /** @var string The namespace to prefix all cache ids with */
- private $_namespace = null;
-
- /**
- * Set the namespace to prefix all cache ids with.
- *
- * @param string $namespace
- * @return void
- */
- public function setNamespace($namespace)
- {
- $this->_namespace = $namespace;
- }
-
- /**
- * {@inheritdoc}
- */
- public function fetch($id)
- {
- return $this->_doFetch($this->_getNamespacedId($id));
- }
-
- /**
- * {@inheritdoc}
- */
- public function contains($id)
- {
- return $this->_doContains($this->_getNamespacedId($id));
- }
-
- /**
- * {@inheritdoc}
- */
- public function save($id, $data, $lifeTime = 0)
- {
- $id = $this->_getNamespacedId($id);
- return $this->_doSave($id, $data, $lifeTime);
- }
-
- /**
- * {@inheritdoc}
- */
- public function delete($id)
- {
- $id = $this->_getNamespacedId($id);
-
- if (strpos($id, '*') !== false) {
- return $this->deleteByRegex('/' . str_replace('*', '.*', $id) . '/');
- }
-
- return $this->_doDelete($id);
- }
-
- /**
- * Delete all cache entries.
- *
- * @return array $deleted Array of the deleted cache ids
- */
- public function deleteAll()
- {
- $ids = $this->getIds();
- foreach ($ids as $id) {
- $this->delete($id);
- }
- return $ids;
- }
-
- /**
- * Delete cache entries where the id matches a PHP regular expressions
- *
- * @param string $regex
- * @return array $deleted Array of the deleted cache ids
- */
- public function deleteByRegex($regex)
- {
- $deleted = array();
- $ids = $this->getIds();
- foreach ($ids as $id) {
- if (preg_match($regex, $id)) {
- $this->delete($id);
- $deleted[] = $id;
- }
- }
- return $deleted;
- }
-
- /**
- * Delete cache entries where the id has the passed prefix
- *
- * @param string $prefix
- * @return array $deleted Array of the deleted cache ids
- */
- public function deleteByPrefix($prefix)
- {
- $deleted = array();
- $ids = $this->getIds();
- foreach ($ids as $id) {
- if (strpos($id, $prefix) === 0) {
- $this->delete($id);
- $deleted[] = $id;
- }
- }
- return $deleted;
- }
-
- /**
- * Delete cache entries where the id has the passed suffix
- *
- * @param string $suffix
- * @return array $deleted Array of the deleted cache ids
- */
- public function deleteBySuffix($suffix)
- {
- $deleted = array();
- $ids = $this->getIds();
- foreach ($ids as $id) {
- if (substr($id, -1 * strlen($suffix)) === $suffix) {
- $this->delete($id);
- $deleted[] = $id;
- }
- }
- return $deleted;
- }
-
- /**
- * Prefix the passed id with the configured namespace value
- *
- * @param string $id The id to namespace
- * @return string $id The namespaced id
- */
- private function _getNamespacedId($id)
- {
- if ( ! $this->_namespace || strpos($id, $this->_namespace) === 0) {
- return $id;
- } else {
- return $this->_namespace . $id;
- }
- }
-
- /**
- * Fetches an entry from the cache.
- *
- * @param string $id cache id The id of the cache entry to fetch.
- * @return string The cached data or FALSE, if no cache entry exists for the given id.
- */
- abstract protected function _doFetch($id);
-
- /**
- * Test if an entry exists in the cache.
- *
- * @param string $id cache id The cache id of the entry to check for.
- * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.
- */
- abstract protected function _doContains($id);
-
- /**
- * Puts data into the cache.
- *
- * @param string $id The cache id.
- * @param string $data The cache entry/data.
- * @param int $lifeTime The lifetime. If != false, sets a specific lifetime for this cache entry (null => infinite lifeTime).
- * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
- */
- abstract protected function _doSave($id, $data, $lifeTime = false);
-
- /**
- * Deletes a cache entry.
- *
- * @param string $id cache id
- * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
- */
- abstract protected function _doDelete($id);
-
- /**
- * Get an array of all the cache ids stored
- *
- * @return array $ids
- */
- abstract public function getIds();
-}
View
87 library/Doctrine/Common/Cache/ApcCache.php
@@ -1,87 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Cache;
-
-/**
- * APC cache driver.
- *
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision$
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- * @author David Abdemoulaie <dave@hobodave.com>
- * @todo Rename: APCCache
- */
-class ApcCache extends AbstractCache
-{
- /**
- * {@inheritdoc}
- */
- public function getIds()
- {
- $ci = apc_cache_info('user');
- $keys = array();
-
- foreach ($ci['cache_list'] as $entry) {
- $keys[] = $entry['info'];
- }
- return $keys;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doFetch($id)
- {
- return apc_fetch($id);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doContains($id)
- {
- $found = false;
- apc_fetch($id, $found);
- return $found;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doSave($id, $data, $lifeTime = 0)
- {
- return (bool) apc_store($id, $data, (int) $lifeTime);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doDelete($id)
- {
- return apc_delete($id);
- }
-}
View
88 library/Doctrine/Common/Cache/ArrayCache.php
@@ -1,88 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Cache;
-
-/**
- * Array cache driver.
- *
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision: 3938 $
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- * @author David Abdemoulaie <dave@hobodave.com>
- */
-class ArrayCache extends AbstractCache
-{
- /**
- * @var array $data
- */
- private $data = array();
-
- /**
- * {@inheritdoc}
- */
- public function getIds()
- {
- return array_keys($this->data);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doFetch($id)
- {
- if (isset($this->data[$id])) {
- return $this->data[$id];
- }
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doContains($id)
- {
- return isset($this->data[$id]);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doSave($id, $data, $lifeTime = 0)
- {
- $this->data[$id] = $data;
- return true;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doDelete($id)
- {
- unset($this->data[$id]);
- return true;
- }
-}
View
71 library/Doctrine/Common/Cache/Cache.php
@@ -1,71 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Cache;
-
-/**
- * Interface for cache drivers.
- *
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision: 3938 $
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- */
-interface Cache
-{
- /**
- * Fetches an entry from the cache.
- *
- * @param string $id cache id The id of the cache entry to fetch.
- * @return string The cached data or FALSE, if no cache entry exists for the given id.
- */
- function fetch($id);
-
- /**
- * Test if an entry exists in the cache.
- *
- * @param string $id cache id The cache id of the entry to check for.
- * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.
- */
- function contains($id);
-
- /**
- * Puts data into the cache.
- *
- * @param string $id The cache id.
- * @param string $data The cache entry/data.
- * @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
- * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
- */
- function save($id, $data, $lifeTime = 0);
-
- /**
- * Deletes a cache entry.
- *
- * @param string $id cache id
- * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
- */
- function delete($id);
-}
View
123 library/Doctrine/Common/Cache/MemcacheCache.php
@@ -1,123 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Cache;
-
-use \Memcache;
-
-/**
- * Memcache cache driver.
- *
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision: 3938 $
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- * @author David Abdemoulaie <dave@hobodave.com>
- */
-class MemcacheCache extends AbstractCache
-{
- /**
- * @var Memcache
- */
- private $_memcache;
-
- /**
- * Sets the memcache instance to use.
- *
- * @param Memcache $memcache
- */
- public function setMemcache(Memcache $memcache)
- {
- $this->_memcache = $memcache;
- }
-
- /**
- * Gets the memcache instance used by the cache.
- *
- * @return Memcache
- */
- public function getMemcache()
- {
- return $this->_memcache;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getIds()
- {
- $keys = array();
- $allSlabs = $this->_memcache->getExtendedStats('slabs');
-
- foreach ($allSlabs as $server => $slabs) {
- if (is_array($slabs)) {
- foreach (array_keys($slabs) as $slabId) {
- $dump = $this->_memcache->getExtendedStats('cachedump', (int) $slabId);
-
- if ($dump) {
- foreach ($dump as $entries) {
- if ($entries) {
- $keys = array_merge($keys, array_keys($entries));
- }
- }
- }
- }
- }
- }
- return $keys;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doFetch($id)
- {
- return $this->_memcache->get($id);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doContains($id)
- {
- return (bool) $this->_memcache->get($id);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doSave($id, $data, $lifeTime = 0)
- {
- return $this->_memcache->set($id, $data, 0, (int) $lifeTime);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doDelete($id)
- {
- return $this->_memcache->delete($id);
- }
-}
View
102 library/Doctrine/Common/Cache/XcacheCache.php
@@ -1,102 +0,0 @@
-<?php
-/*
- * $Id$
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common\Cache;
-
-/**
- * Xcache cache driver.
- *
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @link www.doctrine-project.org
- * @since 2.0
- * @version $Revision: 3938 $
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
- * @author Jonathan Wage <jonwage@gmail.com>
- * @author Roman Borschel <roman@code-factory.org>
- * @author David Abdemoulaie <dave@hobodave.com>
- */
-class XcacheCache extends AbstractCache
-{
- /**
- * {@inheritdoc}
- */
- public function getIds()
- {
- $this->_checkAuth();
- $keys = array();
- for ($i = 0, $count = xcache_count(XC_TYPE_VAR); $i < $count; $i++) {
- $entries = xcache_list(XC_TYPE_VAR, $i);
- if (is_array($entries['cache_list'])) {
- foreach ($entries['cache_list'] as $entry) {
- $keys[] = $entry['name'];
- }
- }
- }
- return $keys;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doFetch($id)
- {
- return $this->_doContains($id) ? unserialize( xcache_get($id) ) : false;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doContains($id)
- {
- return xcache_isset($id);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doSave($id, $data, $lifeTime = 0)
- {
- return xcache_set($id, serialize($data), (int) $lifeTime);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _doDelete($id)
- {
- return xcache_unset($id);
- }
-
-
- /**
- * Checks that xcache.admin.enable_auth is Off
- *
- * @throws \BadMethodCallException When xcache.admin.enable_auth is On
- * @return void
- */
- protected function _checkAuth()
- {
- if (ini_get('xcache.admin.enable_auth')) {
- throw new \BadMethodCallException('To use all features of \Doctrine\Common\Cache\XcacheCache, you must set "xcache.admin.enable_auth" to "Off" in your php.ini.');
- }
- }
-}
View
147 library/Doctrine/Common/ClassLoader.php
@@ -1,147 +0,0 @@
-<?php
-/*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information, see
- * <http://www.doctrine-project.org>.
- */
-
-namespace Doctrine\Common;
-
-/**
- * A <tt>ClassLoader</tt> is an autoloader for class files that can be
- * installed on the SPL autoload stack. It is a class loader that loads only classes
- * of a specific namespace or all namespaces and is suitable for working together
- * with other autoloaders in the SPL autoload stack.
- *
- * If no include path is configured through {@link setIncludePath}, a ClassLoader
- * relies on the PHP include_path.
- *
- * @author Roman Borschel <roman@code-factory.org>
- * @since 2.0
- */
-class ClassLoader
-{
- private $_fileExtension = '.php';
- private $_namespace;
- private $_includePath;
- private $_namespaceSeparator = '\\';
-
- /**
- * Creates a new <tt>ClassLoader</tt> that loads classes of the
- * specified namespace.
- *
- * @param string $ns The namespace to use.
- */
- public function __construct($ns = null, $includePath = null)
- {
- $this->_namespace = $ns;
- $this->_includePath = $includePath;
- }
-
- /**
- * Sets the namespace separator used by classes in the namespace of this class loader.
- *
- * @param string $sep The separator to use.
- */
- public function setNamespaceSeparator($sep)
- {
- $this->_namespaceSeparator = $sep;
- }
-
- /**
- * Gets the namespace separator used by classes in the namespace of this class loader.
- *
- * @return string
- */
- public function getNamespaceSeparator()
- {
- return $this->_namespaceSeparator;
- }
-
- /**
- * Sets the base include path for all class files in the namespace of this class loader.
- *
- * @param string $includePath
- */
- public function setIncludePath($includePath)
- {
- $this->_includePath = $includePath;
- }
-
- /**
- * Gets the base include path for all class files in the namespace of this class loader.
- *
- * @return string
- */
- public function getIncludePath()
- {
- return $this->_includePath;
- }
-
- /**
- * Sets the file extension of class files in the namespace of this class loader.
- *
- * @param string $fileExtension
-