Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initial import

  • Loading branch information...
commit a5ded4aaa825525f44db1023bfdf6d6ddb9777a2 1 parent c23d890
Sun Feng authored
Showing with 32,763 additions and 0 deletions.
  1. +15 −0 .gitignore
  2. +1 −0  app/.htaccess
  3. +9 −0 app/AppCache.php
  4. +38 −0 app/AppKernel.php
  5. +13 −0 app/Resources/views/base.html.twig
  6. +646 −0 app/SymfonyRequirements.php
  7. +16 −0 app/autoload.php
  8. +1,717 −0 app/bootstrap.php.cache
  9. 0  app/cache/.gitkeep
  10. +55 −0 app/check.php
  11. +59 −0 app/config/config.yml
  12. +26 −0 app/config/config_dev.yml
  13. +19 −0 app/config/config_prod.yml
  14. +14 −0 app/config/config_test.yml
  15. +15 −0 app/config/parameters.yml
  16. +4 −0 app/config/routing.yml
  17. +27 −0 app/config/routing_dev.yml
  18. +43 −0 app/config/security.yml
  19. +22 −0 app/console
  20. 0  app/logs/.gitkeep
  21. +41 −0 app/phpunit.xml.dist
  22. +41 −0 composer.json
  23. +1,212 −0 composer.lock
  24. +1 −0  src/.htaccess
  25. +9 −0 src/Acme/DemoBundle/AcmeDemoBundle.php
  26. +57 −0 src/Acme/DemoBundle/Controller/DemoController.php
  27. +69 −0 src/Acme/DemoBundle/Controller/SecuredController.php
  28. +18 −0 src/Acme/DemoBundle/Controller/WelcomeController.php
  29. +22 −0 src/Acme/DemoBundle/DependencyInjection/AcmeDemoExtension.php
  30. +25 −0 src/Acme/DemoBundle/EventListener/ControllerListener.php
  31. +20 −0 src/Acme/DemoBundle/Form/ContactType.php
  32. +18 −0 src/Acme/DemoBundle/Resources/config/services.xml
  33. +294 −0 src/Acme/DemoBundle/Resources/public/css/demo.css
  34. BIN  src/Acme/DemoBundle/Resources/public/images/blue-arrow.png
  35. BIN  src/Acme/DemoBundle/Resources/public/images/field-background.gif
  36. BIN  src/Acme/DemoBundle/Resources/public/images/logo.gif
  37. BIN  src/Acme/DemoBundle/Resources/public/images/search.png
  38. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-configure.gif
  39. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-demo.gif
  40. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-quick-tour.gif
  41. +15 −0 src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig
  42. +9 −0 src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig
  43. +14 −0 src/Acme/DemoBundle/Resources/views/Demo/index.html.twig
  44. +11 −0 src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig
  45. +9 −0 src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig
  46. +6 −0 src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig
  47. +29 −0 src/Acme/DemoBundle/Resources/views/Secured/login.html.twig
  48. +65 −0 src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig
  49. +49 −0 src/Acme/DemoBundle/Resources/views/layout.html.twig
  50. +17 −0 src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php
  51. +80 −0 src/Acme/DemoBundle/Twig/Extension/DemoExtension.php
  52. +7 −0 vendor/autoload.php
  53. +207 −0 vendor/composer/ClassLoader.php
  54. +9 −0 vendor/composer/autoload_classmap.php
  55. +31 −0 vendor/composer/autoload_namespaces.php
  56. +46 −0 vendor/composer/autoload_real.php
  57. +1,221 −0 vendor/composer/installed.json
  58. +10 −0 vendor/doctrine/common/.travis.yml
  59. +19 −0 vendor/doctrine/common/LICENSE
  60. +12 −0 vendor/doctrine/common/README.md
  61. +39 −0 vendor/doctrine/common/UPGRADE_TO_2_1
  62. +61 −0 vendor/doctrine/common/UPGRADE_TO_2_2
  63. +141 −0 vendor/doctrine/common/bin/travis-setup.php
  64. +26 −0 vendor/doctrine/common/composer.json
  65. +79 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php
  66. +47 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php
  67. +37 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php
  68. +54 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
  69. +33 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php
  70. +107 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php
  71. +127 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php
  72. +310 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php
  73. +139 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php
  74. +250 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php
  75. +132 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php
  76. +988 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
  77. +258 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php
  78. +141 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php
  79. +80 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php
  80. +67 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php
  81. +157 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php
  82. +175 −0 vendor/doctrine/common/lib/Doctrine/Common/Annotations/TokenParser.php
  83. +93 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php
  84. +96 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php
  85. +102 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php
  86. +231 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php
  87. +132 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/FileCache.php
  88. +114 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/FilesystemCache.php
  89. +121 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php
  90. +124 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php
  91. +108 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/PhpFileCache.php
  92. +119 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/RedisCache.php
  93. +93 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php
  94. +110 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php
  95. +84 −0 vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php
  96. +263 −0 vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php
  97. +500 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php
  98. +243 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php
  99. +240 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Criteria.php
  100. +195 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php
  101. +75 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php
  102. +72 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php
  103. +31 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Expression.php
  104. +81 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php
  105. +41 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Value.php
  106. +149 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/ExpressionBuilder.php
  107. +48 −0 vendor/doctrine/common/lib/Doctrine/Common/Collections/Selectable.php
  108. +28 −0 vendor/doctrine/common/lib/Doctrine/Common/CommonException.php
  109. +49 −0 vendor/doctrine/common/lib/Doctrine/Common/Comparable.php
  110. +67 −0 vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php
  111. +147 −0 vendor/doctrine/common/lib/Doctrine/Common/EventManager.php
  112. +45 −0 vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php
  113. +266 −0 vendor/doctrine/common/lib/Doctrine/Common/Lexer.php
  114. +45 −0 vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php
  115. +259 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
  116. +63 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php
  117. +77 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
  118. +76 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
  119. +59 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
  120. +84 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
  121. +133 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
  122. +112 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php
  123. +383 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
  124. +165 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php
  125. +74 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php
  126. +214 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php
  127. +170 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php
  128. +214 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php
  129. +71 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php
  130. +56 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php
  131. +168 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php
  132. +72 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php
  133. +141 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php
  134. +214 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php
  135. +86 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php
  136. +80 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php
  137. +102 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php
  138. +107 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php
  139. +152 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php
  140. +49 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php
  141. +78 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php
  142. +244 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php
  143. +60 −0 vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php
  144. +48 −0 vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php
  145. +38 −0 vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php
  146. +83 −0 vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php
  147. +45 −0 vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php
  148. +112 −0 vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php
  149. +103 −0 vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php
  150. +282 −0 vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php
  151. +77 −0 vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php
  152. +103 −0 vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php
  153. +135 −0 vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php
  154. +72 −0 vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php
  155. +55 −0 vendor/doctrine/common/lib/Doctrine/Common/Version.php
  156. +31 −0 vendor/doctrine/common/phpunit.xml.dist
  157. +22 −0 vendor/doctrine/dbal/.travis.yml
  158. +19 −0 vendor/doctrine/dbal/LICENSE
  159. +14 −0 vendor/doctrine/dbal/README.md
  160. +148 −0 vendor/doctrine/dbal/UPGRADE
  161. +26 −0 vendor/doctrine/dbal/composer.json
  162. +94 −0 vendor/doctrine/dbal/docs/design/AZURE_FEDERATIONS.md
  163. +74 −0 vendor/doctrine/dbal/docs/design/SHARDING.md
  164. +26 −0 vendor/doctrine/dbal/docs/examples/sharding/README.md
  165. +26 −0 vendor/doctrine/dbal/docs/examples/sharding/bootstrap.php
  166. +6 −0 vendor/doctrine/dbal/docs/examples/sharding/composer.json
  167. +51 −0 vendor/doctrine/dbal/docs/examples/sharding/create_schema.php
  168. +132 −0 vendor/doctrine/dbal/docs/examples/sharding/insert_data.php
  169. +27 −0 vendor/doctrine/dbal/docs/examples/sharding/insert_data_aftersplit.php
  170. +8 −0 vendor/doctrine/dbal/docs/examples/sharding/query_filtering_off.php
  171. +9 −0 vendor/doctrine/dbal/docs/examples/sharding/query_filtering_on.php
  172. +5 −0 vendor/doctrine/dbal/docs/examples/sharding/split_federation.php
  173. +8 −0 vendor/doctrine/dbal/docs/examples/sharding/view_federation_members.php
  174. +103 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php
  175. +37 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php
  176. +131 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
  177. +239 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
  178. +113 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php
  179. +1,308 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
  180. +54 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php
  181. +353 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
  182. +106 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php
  183. +72 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver.php
  184. +42 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Connection.php
  185. +41 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php
  186. +99 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php
  187. +115 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php
  188. +111 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php
  189. +27 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php
  190. +214 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
  191. +69 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php
  192. +146 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
  193. +26 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php
  194. +342 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
  195. +99 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php
  196. +200 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
  197. +30 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php
  198. +268 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
  199. +40 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
  200. +126 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php
  201. +102 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
  202. +98 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php
  203. +70 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
  204. +116 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
  205. +45 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php
  206. +87 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php
  207. +50 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php
  208. +93 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ResultStatement.php
  209. +72 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php
  210. +42 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php
  211. +161 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php
  212. +43 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
  213. +251 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
  214. +125 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php
  215. +176 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php
  216. +79 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php
  217. +74 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php
  218. +80 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php
  219. +63 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php
  220. +114 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php
  221. +114 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php
  222. +99 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php
  223. +114 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php
  224. +129 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php
  225. +137 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php
  226. +114 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php
  227. +128 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php
  228. +98 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php
  229. +56 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaEventArgs.php
  230. +122 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php
  231. +48 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Events.php
  232. +160 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGenerator.php
  233. +90 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php
  234. +42 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php
  235. +69 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php
  236. +61 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php
  237. +64 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php
  238. +54 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php
  239. +2,854 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
  240. +545 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php
  241. +495 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
  242. +438 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php
  243. +340 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php
  244. +63 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php
  245. +243 −0 vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php
Sorry, we could not display the entire diff because too many files (4,420) changed.
View
15 .gitignore
@@ -0,0 +1,15 @@
+# ignore svn
+.svn
+
+# ignore zendstudio and netbeans
+.settings
+.buildpath
+.project
+nbproject
+
+# ignore reports for report
+assets/*
+protected/runtime/*
+protected/config/db.php
+
+/.metadata/
View
1  app/.htaccess
@@ -0,0 +1 @@
+deny from all
View
9 app/AppCache.php
@@ -0,0 +1,9 @@
+<?php
+
+require_once __DIR__.'/AppKernel.php';
+
+use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
+
+class AppCache extends HttpCache
+{
+}
View
38 app/AppKernel.php
@@ -0,0 +1,38 @@
+<?php
+
+use Symfony\Component\HttpKernel\Kernel;
+use Symfony\Component\Config\Loader\LoaderInterface;
+
+class AppKernel extends Kernel
+{
+ public function registerBundles()
+ {
+ $bundles = array(
+ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
+ new Symfony\Bundle\SecurityBundle\SecurityBundle(),
+ new Symfony\Bundle\TwigBundle\TwigBundle(),
+ new Symfony\Bundle\MonologBundle\MonologBundle(),
+ new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
+ new Symfony\Bundle\AsseticBundle\AsseticBundle(),
+ new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
+ new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
+ new JMS\AopBundle\JMSAopBundle(),
+ new JMS\DiExtraBundle\JMSDiExtraBundle($this),
+ new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
+ );
+
+ if (in_array($this->getEnvironment(), array('dev', 'test'))) {
+ $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
+ $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
+ $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
+ $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
+ }
+
+ return $bundles;
+ }
+
+ public function registerContainerConfiguration(LoaderInterface $loader)
+ {
+ $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
+ }
+}
View
13 app/Resources/views/base.html.twig
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8" />
+ <title>{% block title %}Welcome!{% endblock %}</title>
+ {% block stylesheets %}{% endblock %}
+ <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
+ </head>
+ <body>
+ {% block body %}{% endblock %}
+ {% block javascripts %}{% endblock %}
+ </body>
+</html>
View
646 app/SymfonyRequirements.php
@@ -0,0 +1,646 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/*
+ * Users of PHP 5.2 should be able to run the requirements checks.
+ * This is why the file and all classes must be compatible with PHP 5.2+
+ * (e.g. not using namespaces and closures).
+ *
+ * ************** CAUTION **************
+ *
+ * DO NOT EDIT THIS FILE as it will be overriden by Composer as part of
+ * the installation/update process. The original file resides in the
+ * SensioDistributionBundle.
+ *
+ * ************** CAUTION **************
+ */
+
+/**
+ * Represents a single PHP requirement, e.g. an installed extension.
+ * It can be a mandatory requirement or an optional recommendation.
+ * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class Requirement
+{
+ private $fulfilled;
+ private $testMessage;
+ private $helpText;
+ private $helpHtml;
+ private $optional;
+
+ /**
+ * Constructor that initializes the requirement.
+ *
+ * @param Boolean $fulfilled Whether the requirement is fulfilled
+ * @param string $testMessage The message for testing the requirement
+ * @param string $helpHtml The help text formatted in HTML for resolving the problem
+ * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+ * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
+ */
+ public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
+ {
+ $this->fulfilled = (Boolean) $fulfilled;
+ $this->testMessage = (string) $testMessage;
+ $this->helpHtml = (string) $helpHtml;
+ $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText;
+ $this->optional = (Boolean) $optional;
+ }
+
+ /**
+ * Returns whether the requirement is fulfilled.
+ *
+ * @return Boolean true if fulfilled, otherwise false
+ */
+ public function isFulfilled()
+ {
+ return $this->fulfilled;
+ }
+
+ /**
+ * Returns the message for testing the requirement.
+ *
+ * @return string The test message
+ */
+ public function getTestMessage()
+ {
+ return $this->testMessage;
+ }
+
+ /**
+ * Returns the help text for resolving the problem
+ *
+ * @return string The help text
+ */
+ public function getHelpText()
+ {
+ return $this->helpText;
+ }
+
+ /**
+ * Returns the help text formatted in HTML.
+ *
+ * @return string The HTML help
+ */
+ public function getHelpHtml()
+ {
+ return $this->helpHtml;
+ }
+
+ /**
+ * Returns whether this is only an optional recommendation and not a mandatory requirement.
+ *
+ * @return Boolean true if optional, false if mandatory
+ */
+ public function isOptional()
+ {
+ return $this->optional;
+ }
+}
+
+/**
+ * Represents a PHP requirement in form of a php.ini configuration.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class PhpIniRequirement extends Requirement
+{
+ /**
+ * Constructor that initializes the requirement.
+ *
+ * @param string $cfgName The configuration name used for ini_get()
+ * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+ or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+ * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+ This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+ Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+ * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+ * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+ * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+ * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
+ */
+ public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
+ {
+ $cfgValue = ini_get($cfgName);
+
+ if (is_callable($evaluation)) {
+ if (null === $testMessage || null === $helpHtml) {
+ throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
+ }
+
+ $fulfilled = call_user_func($evaluation, $cfgValue);
+ } else {
+ if (null === $testMessage) {
+ $testMessage = sprintf('%s %s be %s in php.ini',
+ $cfgName,
+ $optional ? 'should' : 'must',
+ $evaluation ? 'enabled' : 'disabled'
+ );
+ }
+
+ if (null === $helpHtml) {
+ $helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.',
+ $cfgName,
+ $evaluation ? 'on' : 'off'
+ );
+ }
+
+ $fulfilled = $evaluation == $cfgValue;
+ }
+
+ parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional);
+ }
+}
+
+/**
+ * A RequirementCollection represents a set of Requirement instances.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class RequirementCollection implements IteratorAggregate
+{
+ private $requirements = array();
+
+ /**
+ * Gets the current RequirementCollection as an Iterator.
+ *
+ * @return Traversable A Traversable interface
+ */
+ public function getIterator()
+ {
+ return new ArrayIterator($this->requirements);
+ }
+
+ /**
+ * Adds a Requirement.
+ *
+ * @param Requirement $requirement A Requirement instance
+ */
+ public function add(Requirement $requirement)
+ {
+ $this->requirements[] = $requirement;
+ }
+
+ /**
+ * Adds a mandatory requirement.
+ *
+ * @param Boolean $fulfilled Whether the requirement is fulfilled
+ * @param string $testMessage The message for testing the requirement
+ * @param string $helpHtml The help text formatted in HTML for resolving the problem
+ * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+ */
+ public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
+ {
+ $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false));
+ }
+
+ /**
+ * Adds an optional recommendation.
+ *
+ * @param Boolean $fulfilled Whether the recommendation is fulfilled
+ * @param string $testMessage The message for testing the recommendation
+ * @param string $helpHtml The help text formatted in HTML for resolving the problem
+ * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+ */
+ public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null)
+ {
+ $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true));
+ }
+
+ /**
+ * Adds a mandatory requirement in form of a php.ini configuration.
+ *
+ * @param string $cfgName The configuration name used for ini_get()
+ * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+ or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+ * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+ This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+ Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+ * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+ * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+ * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+ */
+ public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
+ {
+ $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
+ }
+
+ /**
+ * Adds an optional recommendation in form of a php.ini configuration.
+ *
+ * @param string $cfgName The configuration name used for ini_get()
+ * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+ or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+ * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+ This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+ Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+ * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+ * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+ * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+ */
+ public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
+ {
+ $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
+ }
+
+ /**
+ * Adds a requirement collection to the current set of requirements.
+ *
+ * @param RequirementCollection $collection A RequirementCollection instance
+ */
+ public function addCollection(RequirementCollection $collection)
+ {
+ $this->requirements = array_merge($this->requirements, $collection->all());
+ }
+
+ /**
+ * Returns both requirements and recommendations.
+ *
+ * @return array Array of Requirement instances
+ */
+ public function all()
+ {
+ return $this->requirements;
+ }
+
+ /**
+ * Returns all mandatory requirements.
+ *
+ * @return array Array of Requirement instances
+ */
+ public function getRequirements()
+ {
+ $array = array();
+ foreach ($this->requirements as $req) {
+ if (!$req->isOptional()) {
+ $array[] = $req;
+ }
+ }
+
+ return $array;
+ }
+
+ /**
+ * Returns the mandatory requirements that were not met.
+ *
+ * @return array Array of Requirement instances
+ */
+ public function getFailedRequirements()
+ {
+ $array = array();
+ foreach ($this->requirements as $req) {
+ if (!$req->isFulfilled() && !$req->isOptional()) {
+ $array[] = $req;
+ }
+ }
+
+ return $array;
+ }
+
+ /**
+ * Returns all optional recommmendations.
+ *
+ * @return array Array of Requirement instances
+ */
+ public function getRecommendations()
+ {
+ $array = array();
+ foreach ($this->requirements as $req) {
+ if ($req->isOptional()) {
+ $array[] = $req;
+ }
+ }
+
+ return $array;
+ }
+
+ /**
+ * Returns the recommendations that were not met.
+ *
+ * @return array Array of Requirement instances
+ */
+ public function getFailedRecommendations()
+ {
+ $array = array();
+ foreach ($this->requirements as $req) {
+ if (!$req->isFulfilled() && $req->isOptional()) {
+ $array[] = $req;
+ }
+ }
+
+ return $array;
+ }
+
+ /**
+ * Returns whether a php.ini configuration is not correct.
+ *
+ * @return Boolean php.ini configuration problem?
+ */
+ public function hasPhpIniConfigIssue()
+ {
+ foreach ($this->requirements as $req) {
+ if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the PHP configuration file (php.ini) path.
+ *
+ * @return string|false php.ini file path
+ */
+ public function getPhpIniConfigPath()
+ {
+ return get_cfg_var('cfg_file_path');
+ }
+}
+
+/**
+ * This class specifies all requirements and optional recommendations that
+ * are necessary to run the Symfony Standard Edition.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class SymfonyRequirements extends RequirementCollection
+{
+ const REQUIRED_PHP_VERSION = '5.3.3';
+
+ /**
+ * Constructor that initializes the requirements.
+ */
+ public function __construct()
+ {
+ /* mandatory requirements follow */
+
+ $installedPhpVersion = phpversion();
+
+ $this->addRequirement(
+ version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='),
+ sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion),
+ sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
+ Before using Symfony, upgrade your PHP installation, preferably to the latest version.',
+ $installedPhpVersion, self::REQUIRED_PHP_VERSION),
+ sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion)
+ );
+
+ $this->addRequirement(
+ version_compare($installedPhpVersion, '5.3.16', '!='),
+ 'PHP version must not be 5.3.16 as Symfony won\'t work properly with it',
+ 'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)'
+ );
+
+ $this->addRequirement(
+ is_dir(__DIR__.'/../vendor/composer'),
+ 'Vendor libraries must be installed',
+ 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. ' .
+ 'Then run "<strong>php composer.phar install</strong>" to install them.'
+ );
+
+ $baseDir = basename(__DIR__);
+
+ $this->addRequirement(
+ is_writable(__DIR__.'/cache'),
+ "$baseDir/cache/ directory must be writable",
+ "Change the permissions of the \"<strong>$baseDir/cache/</strong>\" directory so that the web server can write into it."
+ );
+
+ $this->addRequirement(
+ is_writable(__DIR__.'/logs'),
+ "$baseDir/logs/ directory must be writable",
+ "Change the permissions of the \"<strong>$baseDir/logs/</strong>\" directory so that the web server can write into it."
+ );
+
+ $this->addPhpIniRequirement(
+ 'date.timezone', true, false,
+ 'date.timezone setting must be set',
+ 'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
+ );
+
+ if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) {
+ $this->addRequirement(
+ (in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers())),
+ sprintf('Configured default timezone "%s" must be supported by your installation of PHP', date_default_timezone_get()),
+ 'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
+ );
+ }
+
+ $this->addRequirement(
+ function_exists('json_encode'),
+ 'json_encode() must be available',
+ 'Install and enable the <strong>JSON</strong> extension.'
+ );
+
+ $this->addRequirement(
+ function_exists('session_start'),
+ 'session_start() must be available',
+ 'Install and enable the <strong>session</strong> extension.'
+ );
+
+ $this->addRequirement(
+ function_exists('ctype_alpha'),
+ 'ctype_alpha() must be available',
+ 'Install and enable the <strong>ctype</strong> extension.'
+ );
+
+ $this->addRequirement(
+ function_exists('token_get_all'),
+ 'token_get_all() must be available',
+ 'Install and enable the <strong>Tokenizer</strong> extension.'
+ );
+
+ $this->addRequirement(
+ function_exists('simplexml_import_dom'),
+ 'simplexml_import_dom() must be available',
+ 'Install and enable the <strong>SimpleXML</strong> extension.'
+ );
+
+ if (function_exists('apc_store') && ini_get('apc.enabled')) {
+ $this->addRequirement(
+ version_compare(phpversion('apc'), '3.0.17', '>='),
+ 'APC version must be at least 3.0.17',
+ 'Upgrade your <strong>APC</strong> extension (3.0.17+).'
+ );
+ }
+
+ $this->addPhpIniRequirement('detect_unicode', false);
+
+ if (extension_loaded('suhosin')) {
+ $this->addPhpIniRequirement(
+ 'suhosin.executor.include.whitelist',
+ create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'),
+ false,
+ 'suhosin.executor.include.whitelist must be configured correctly in php.ini',
+ 'Add "<strong>phar</strong>" to <strong>suhosin.executor.include.whitelist</strong> in php.ini<a href="#phpini">*</a>.'
+ );
+ }
+
+ if (extension_loaded('xdebug')) {
+ $this->addPhpIniRequirement(
+ 'xdebug.show_exception_trace', false, true
+ );
+
+ $this->addPhpIniRequirement(
+ 'xdebug.scream', false, true
+ );
+ }
+
+ $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null;
+
+ $this->addRequirement(
+ null !== $pcreVersion,
+ 'PCRE extension must be available',
+ 'Install the <strong>PCRE</strong> extension (version 8.0+).'
+ );
+
+ /* optional recommendations follow */
+
+ $this->addRecommendation(
+ file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'),
+ 'Requirements file should be up-to-date',
+ 'Your requirements file is outdated. Run composer install and re-check your configuration.'
+ );
+
+ $this->addRecommendation(
+ version_compare($installedPhpVersion, '5.3.4', '>='),
+ 'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions',
+ 'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.'
+ );
+
+ $this->addRecommendation(
+ version_compare($installedPhpVersion, '5.3.8', '>='),
+ 'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156',
+ 'Install PHP 5.3.8 or newer if your project uses annotations.'
+ );
+
+ $this->addRecommendation(
+ version_compare($installedPhpVersion, '5.4.0', '!='),
+ 'You should not use PHP 5.4.0 due to the PHP bug #61453',
+ 'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.'
+ );
+
+ if (null !== $pcreVersion) {
+ $this->addRecommendation(
+ $pcreVersion >= 8.0,
+ sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion),
+ '<strong>PCRE 8.0+</strong> is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.'
+ );
+ }
+
+ $this->addRecommendation(
+ class_exists('DomDocument'),
+ 'PHP-XML module should be installed',
+ 'Install and enable the <strong>PHP-XML</strong> module.'
+ );
+
+ $this->addRecommendation(
+ function_exists('mb_strlen'),
+ 'mb_strlen() should be available',
+ 'Install and enable the <strong>mbstring</strong> extension.'
+ );
+
+ $this->addRecommendation(
+ function_exists('iconv'),
+ 'iconv() should be available',
+ 'Install and enable the <strong>iconv</strong> extension.'
+ );
+
+ $this->addRecommendation(
+ function_exists('utf8_decode'),
+ 'utf8_decode() should be available',
+ 'Install and enable the <strong>XML</strong> extension.'
+ );
+
+ if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
+ $this->addRecommendation(
+ function_exists('posix_isatty'),
+ 'posix_isatty() should be available',
+ 'Install and enable the <strong>php_posix</strong> extension (used to colorize the CLI output).'
+ );
+ }
+
+ $this->addRecommendation(
+ class_exists('Locale'),
+ 'intl extension should be available',
+ 'Install and enable the <strong>intl</strong> extension (used for validators).'
+ );
+
+ if (class_exists('Collator')) {
+ $this->addRecommendation(
+ null !== new Collator('fr_FR'),
+ 'intl extension should be correctly configured',
+ 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.'
+ );
+ }
+
+ if (class_exists('Locale')) {
+ if (defined('INTL_ICU_VERSION')) {
+ $version = INTL_ICU_VERSION;
+ } else {
+ $reflector = new ReflectionExtension('intl');
+
+ ob_start();
+ $reflector->info();
+ $output = strip_tags(ob_get_clean());
+
+ preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches);
+ $version = $matches[1];
+ }
+
+ $this->addRecommendation(
+ version_compare($version, '4.0', '>='),
+ 'intl ICU version should be at least 4+',
+ 'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
+ );
+ }
+
+ $accelerator =
+ (function_exists('apc_store') && ini_get('apc.enabled'))
+ ||
+ function_exists('eaccelerator_put') && ini_get('eaccelerator.enable')
+ ||
+ function_exists('xcache_set')
+ ;
+
+ $this->addRecommendation(
+ $accelerator,
+ 'a PHP accelerator should be installed',
+ 'Install and enable a <strong>PHP accelerator</strong> like APC (highly recommended).'
+ );
+
+ $this->addPhpIniRecommendation('short_open_tag', false);
+
+ $this->addPhpIniRecommendation('magic_quotes_gpc', false, true);
+
+ $this->addPhpIniRecommendation('register_globals', false, true);
+
+ $this->addPhpIniRecommendation('session.auto_start', false);
+
+ $this->addRecommendation(
+ class_exists('PDO'),
+ 'PDO should be installed',
+ 'Install <strong>PDO</strong> (mandatory for Doctrine).'
+ );
+
+ if (class_exists('PDO')) {
+ $drivers = PDO::getAvailableDrivers();
+ $this->addRecommendation(
+ count($drivers),
+ sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'),
+ 'Install <strong>PDO drivers</strong> (mandatory for Doctrine).'
+ );
+ }
+ }
+}
View
16 app/autoload.php
@@ -0,0 +1,16 @@
+<?php
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
+$loader = require __DIR__.'/../vendor/autoload.php';
+
+// intl
+if (!function_exists('intl_get_error_code')) {
+ require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
+
+ $loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
+}
+
+AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
+
+return $loader;
View
1,717 app/bootstrap.php.cache
@@ -0,0 +1,1717 @@
+<?php
+
+namespace { $loader = require_once __DIR__.'/autoload.php'; }
+
+
+
+
+
+namespace Symfony\Component\DependencyInjection
+{
+
+
+interface ContainerAwareInterface
+{
+
+ public function setContainer(ContainerInterface $container = null);
+}
+}
+
+
+
+
+namespace Symfony\Component\DependencyInjection
+{
+
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
+
+
+interface ContainerInterface
+{
+ const EXCEPTION_ON_INVALID_REFERENCE = 1;
+ const NULL_ON_INVALID_REFERENCE = 2;
+ const IGNORE_ON_INVALID_REFERENCE = 3;
+ const SCOPE_CONTAINER = 'container';
+ const SCOPE_PROTOTYPE = 'prototype';
+
+
+ public function set($id, $service, $scope = self::SCOPE_CONTAINER);
+
+
+ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
+
+
+ public function has($id);
+
+
+ public function getParameter($name);
+
+
+ public function hasParameter($name);
+
+
+ public function setParameter($name, $value);
+
+
+ public function enterScope($name);
+
+
+ public function leaveScope($name);
+
+
+ public function addScope(ScopeInterface $scope);
+
+
+ public function hasScope($name);
+
+
+ public function isScopeActive($name);
+}
+}
+
+
+
+
+namespace Symfony\Component\DependencyInjection
+{
+
+
+interface IntrospectableContainerInterface extends ContainerInterface
+{
+
+ public function initialized($id);
+
+}
+}
+
+
+
+
+namespace Symfony\Component\DependencyInjection
+{
+
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
+
+
+class Container implements IntrospectableContainerInterface
+{
+ protected $parameterBag;
+ protected $services;
+ protected $scopes;
+ protected $scopeChildren;
+ protected $scopedServices;
+ protected $scopeStacks;
+ protected $loading = array();
+
+
+ public function __construct(ParameterBagInterface $parameterBag = null)
+ {
+ $this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag;
+
+ $this->services = array();
+ $this->scopes = array();
+ $this->scopeChildren = array();
+ $this->scopedServices = array();
+ $this->scopeStacks = array();
+
+ $this->set('service_container', $this);
+ }
+
+
+ public function compile()
+ {
+ $this->parameterBag->resolve();
+
+ $this->parameterBag = new FrozenParameterBag($this->parameterBag->all());
+ }
+
+
+ public function isFrozen()
+ {
+ return $this->parameterBag instanceof FrozenParameterBag;
+ }
+
+
+ public function getParameterBag()
+ {
+ return $this->parameterBag;
+ }
+
+
+ public function getParameter($name)
+ {
+ return $this->parameterBag->get($name);
+ }
+
+
+ public function hasParameter($name)
+ {
+ return $this->parameterBag->has($name);
+ }
+
+
+ public function setParameter($name, $value)
+ {
+ $this->parameterBag->set($name, $value);
+ }
+
+
+ public function set($id, $service, $scope = self::SCOPE_CONTAINER)
+ {
+ if (self::SCOPE_PROTOTYPE === $scope) {
+ throw new InvalidArgumentException('You cannot set services of scope "prototype".');
+ }
+
+ $id = strtolower($id);
+
+ if (self::SCOPE_CONTAINER !== $scope) {
+ if (!isset($this->scopedServices[$scope])) {
+ throw new RuntimeException('You cannot set services of inactive scopes.');
+ }
+
+ $this->scopedServices[$scope][$id] = $service;
+ }
+
+ $this->services[$id] = $service;
+ }
+
+
+ public function has($id)
+ {
+ $id = strtolower($id);
+
+ return isset($this->services[$id]) || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service');
+ }
+
+
+ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
+ {
+ $id = strtolower($id);
+
+ if (isset($this->services[$id])) {
+ return $this->services[$id];
+ }
+
+ if (isset($this->loading[$id])) {
+ throw new ServiceCircularReferenceException($id, array_keys($this->loading));
+ }
+
+ if (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')) {
+ $this->loading[$id] = true;
+
+ try {
+ $service = $this->$method();
+ } catch (\Exception $e) {
+ unset($this->loading[$id]);
+
+ if (isset($this->services[$id])) {
+ unset($this->services[$id]);
+ }
+
+ throw $e;
+ }
+
+ unset($this->loading[$id]);
+
+ return $service;
+ }
+
+ if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
+ throw new ServiceNotFoundException($id);
+ }
+ }
+
+
+ public function initialized($id)
+ {
+ return isset($this->services[strtolower($id)]);
+ }
+
+
+ public function getServiceIds()
+ {
+ $ids = array();
+ $r = new \ReflectionClass($this);
+ foreach ($r->getMethods() as $method) {
+ if (preg_match('/^get(.+)Service$/', $method->name, $match)) {
+ $ids[] = self::underscore($match[1]);
+ }
+ }
+
+ return array_unique(array_merge($ids, array_keys($this->services)));
+ }
+
+
+ public function enterScope($name)
+ {
+ if (!isset($this->scopes[$name])) {
+ throw new InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name));
+ }
+
+ if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) {
+ throw new RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name]));
+ }
+
+ if (isset($this->scopedServices[$name])) {
+ $services = array($this->services, $name => $this->scopedServices[$name]);
+ unset($this->scopedServices[$name]);
+
+ foreach ($this->scopeChildren[$name] as $child) {
+ $services[$child] = $this->scopedServices[$child];
+ unset($this->scopedServices[$child]);
+ }
+
+ $this->services = call_user_func_array('array_diff_key', $services);
+ array_shift($services);
+
+ if (!isset($this->scopeStacks[$name])) {
+ $this->scopeStacks[$name] = new \SplStack();
+ }
+ $this->scopeStacks[$name]->push($services);
+ }
+
+ $this->scopedServices[$name] = array();
+ }
+
+
+ public function leaveScope($name)
+ {
+ if (!isset($this->scopedServices[$name])) {
+ throw new InvalidArgumentException(sprintf('The scope "%s" is not active.', $name));
+ }
+
+ $services = array($this->services, $this->scopedServices[$name]);
+ unset($this->scopedServices[$name]);
+ foreach ($this->scopeChildren[$name] as $child) {
+ if (!isset($this->scopedServices[$child])) {
+ continue;
+ }
+
+ $services[] = $this->scopedServices[$child];
+ unset($this->scopedServices[$child]);
+ }
+ $this->services = call_user_func_array('array_diff_key', $services);
+
+ if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) {
+ $services = $this->scopeStacks[$name]->pop();
+ $this->scopedServices += $services;
+
+ array_unshift($services, $this->services);
+ $this->services = call_user_func_array('array_merge', $services);
+ }
+ }
+
+
+ public function addScope(ScopeInterface $scope)
+ {
+ $name = $scope->getName();
+ $parentScope = $scope->getParentName();
+
+ if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) {
+ throw new InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name));
+ }
+ if (isset($this->scopes[$name])) {
+ throw new InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name));
+ }
+ if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) {
+ throw new InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope));
+ }
+
+ $this->scopes[$name] = $parentScope;
+ $this->scopeChildren[$name] = array();
+
+ while ($parentScope !== self::SCOPE_CONTAINER) {
+ $this->scopeChildren[$parentScope][] = $name;
+ $parentScope = $this->scopes[$parentScope];
+ }
+ }
+
+
+ public function hasScope($name)
+ {
+ return isset($this->scopes[$name]);
+ }
+
+
+ public function isScopeActive($name)
+ {
+ return isset($this->scopedServices[$name]);
+ }
+
+
+ public static function camelize($id)
+ {
+ return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id);
+ }
+
+
+ public static function underscore($id)
+ {
+ return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.')));
+ }
+}
+}
+
+
+
+
+namespace Symfony\Component\HttpKernel
+{
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+
+interface HttpKernelInterface
+{
+ const MASTER_REQUEST = 1;
+ const SUB_REQUEST = 2;
+
+
+ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
+}
+}
+
+
+
+
+namespace Symfony\Component\HttpKernel
+{
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\Config\Loader\LoaderInterface;
+
+
+interface KernelInterface extends HttpKernelInterface, \Serializable
+{
+
+ public function registerBundles();
+
+
+ public function registerContainerConfiguration(LoaderInterface $loader);
+
+
+ public function boot();
+
+
+ public function shutdown();
+
+
+ public function getBundles();
+
+
+ public function isClassInActiveBundle($class);
+
+
+ public function getBundle($name, $first = true);
+
+
+ public function locateResource($name, $dir = null, $first = true);
+
+
+ public function getName();
+
+
+ public function getEnvironment();
+
+
+ public function isDebug();
+
+
+ public function getRootDir();
+
+
+ public function getContainer();
+
+
+ public function getStartTime();
+
+
+ public function getCacheDir();
+
+
+ public function getLogDir();
+
+
+ public function getCharset();
+}
+}
+
+
+
+
+namespace Symfony\Component\HttpKernel
+{
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+
+interface TerminableInterface
+{
+
+ public function terminate(Request $request, Response $response);
+}
+}
+
+
+
+
+namespace Symfony\Component\HttpKernel
+{
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
+use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
+use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\HttpKernel\Config\FileLocator;
+use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
+use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass;
+use Symfony\Component\HttpKernel\Debug\ErrorHandler;
+use Symfony\Component\HttpKernel\Debug\ExceptionHandler;
+use Symfony\Component\Config\Loader\LoaderResolver;
+use Symfony\Component\Config\Loader\DelegatingLoader;
+use Symfony\Component\Config\ConfigCache;
+use Symfony\Component\ClassLoader\ClassCollectionLoader;
+use Symfony\Component\ClassLoader\DebugClassLoader;
+
+
+abstract class Kernel implements KernelInterface, TerminableInterface
+{
+ protected $bundles;
+ protected $bundleMap;
+ protected $container;
+ protected $rootDir;
+ protected $environment;
+ protected $debug;
+ protected $booted;
+ protected $name;
+ protected $startTime;
+ protected $classes;
+ protected $errorReportingLevel;
+
+ const VERSION = '2.1.4';
+ const VERSION_ID = '20104';
+ const MAJOR_VERSION = '2';
+ const MINOR_VERSION = '1';
+ const RELEASE_VERSION = '4';
+ const EXTRA_VERSION = '';
+
+
+ public function __construct($environment, $debug)
+ {
+ $this->environment = $environment;
+ $this->debug = (Boolean) $debug;
+ $this->booted = false;
+ $this->rootDir = $this->getRootDir();
+ $this->name = $this->getName();
+ $this->classes = array();
+
+ if ($this->debug) {
+ $this->startTime = microtime(true);
+ }
+
+ $this->init();
+ }
+
+ public function init()
+ {
+ if ($this->debug) {
+ ini_set('display_errors', 1);
+ error_reporting(-1);
+
+ DebugClassLoader::enable();
+ ErrorHandler::register($this->errorReportingLevel);
+ if ('cli' !== php_sapi_name()) {
+ ExceptionHandler::register();
+ }
+ } else {
+ ini_set('display_errors', 0);
+ }
+ }
+
+ public function __clone()
+ {
+ if ($this->debug) {
+ $this->startTime = microtime(true);
+ }
+
+ $this->booted = false;
+ $this->container = null;
+ }
+
+
+ public function boot()
+ {
+ if (true === $this->booted) {
+ return;
+ }
+
+ $this->initializeBundles();
+
+ $this->initializeContainer();
+
+ foreach ($this->getBundles() as $bundle) {
+ $bundle->setContainer($this->container);
+ $bundle->boot();
+ }
+
+ $this->booted = true;
+ }
+
+
+ public function terminate(Request $request, Response $response)
+ {
+ if (false === $this->booted) {
+ return;
+ }
+
+ if ($this->getHttpKernel() instanceof TerminableInterface) {
+ $this->getHttpKernel()->terminate($request, $response);
+ }
+ }
+
+
+ public function shutdown()
+ {
+ if (false === $this->booted) {
+ return;
+ }
+
+ $this->booted = false;
+
+ foreach ($this->getBundles() as $bundle) {
+ $bundle->shutdown();
+ $bundle->setContainer(null);
+ }
+
+ $this->container = null;
+ }
+
+
+ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+ {
+ if (false === $this->booted) {
+ $this->boot();
+ }
+
+ return $this->getHttpKernel()->handle($request, $type, $catch);
+ }
+
+
+ protected function getHttpKernel()
+ {
+ return $this->container->get('http_kernel');
+ }
+
+
+ public function getBundles()
+ {
+ return $this->bundles;
+ }
+
+
+ public function isClassInActiveBundle($class)
+ {
+ foreach ($this->getBundles() as $bundle) {
+ if (0 === strpos($class, $bundle->getNamespace())) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ public function getBundle($name, $first = true)
+ {
+ if (!isset($this->bundleMap[$name])) {
+ throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, get_class($this)));
+ }
+
+ if (true === $first) {
+ return $this->bundleMap[$name][0];
+ }
+
+ return $this->bundleMap[$name];
+ }
+
+
+ public function locateResource($name, $dir = null, $first = true)
+ {
+ if ('@' !== $name[0]) {
+ throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));
+ }
+
+ if (false !== strpos($name, '..')) {
+ throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name));
+ }
+
+ $bundleName = substr($name, 1);
+ $path = '';
+ if (false !== strpos($bundleName, '/')) {
+ list($bundleName, $path) = explode('/', $bundleName, 2);
+ }
+
+ $isResource = 0 === strpos($path, 'Resources') && null !== $dir;
+ $overridePath = substr($path, 9);
+ $resourceBundle = null;
+ $bundles = $this->getBundle($bundleName, false);
+ $files = array();
+
+ foreach ($bundles as $bundle) {
+ if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) {
+ if (null !== $resourceBundle) {
+ throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.',
+ $file,
+ $resourceBundle,
+ $dir.'/'.$bundles[0]->getName().$overridePath
+ ));
+ }
+
+ if ($first) {
+ return $file;
+ }
+ $files[] = $file;
+ }
+
+ if (file_exists($file = $bundle->getPath().'/'.$path)) {
+ if ($first && !$isResource) {
+ return $file;
+ }
+ $files[] = $file;
+ $resourceBundle = $bundle->getName();
+ }
+ }
+
+ if (count($files) > 0) {
+ return $first && $isResource ? $files[0] : $files;
+ }
+
+ throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name));
+ }
+
+
+ public function getName()
+ {
+ if (null === $this->name) {
+ $this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
+ }
+
+ return $this->name;
+ }
+
+
+ public function getEnvironment()
+ {
+ return $this->environment;
+ }
+
+
+ public function isDebug()
+ {
+ return $this->debug;
+ }
+
+
+ public function getRootDir()
+ {
+ if (null === $this->rootDir) {
+ $r = new \ReflectionObject($this);
+ $this->rootDir = str_replace('\\', '/', dirname($r->getFileName()));
+ }
+
+ return $this->rootDir;
+ }
+
+
+ public function getContainer()
+ {
+ return $this->container;
+ }
+
+
+ public function loadClassCache($name = 'classes', $extension = '.php')
+ {
+ if (!$this->booted && is_file($this->getCacheDir().'/classes.map')) {
+ ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension);
+ }
+ }
+
+
+ public function setClassCache(array $classes)
+ {
+ file_put_contents($this->getCacheDir().'/classes.map', sprintf('<?php return %s;', var_export($classes, true)));
+ }
+
+
+ public function getStartTime()
+ {
+ return $this->debug ? $this->startTime : -INF;
+ }
+
+
+ public function getCacheDir()
+ {
+ return $this->rootDir.'/cache/'.$this->environment;
+ }
+
+
+ public function getLogDir()
+ {
+ return $this->rootDir.'/logs';
+ }
+
+
+ public function getCharset()
+ {
+ return 'UTF-8';
+ }
+
+
+ protected function initializeBundles()
+ {
+ $this->bundles = array();
+ $topMostBundles = array();
+ $directChildren = array();
+
+ foreach ($this->registerBundles() as $bundle) {
+ $name = $bundle->getName();
+ if (isset($this->bundles[$name])) {
+ throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name));
+ }
+ $this->bundles[$name] = $bundle;
+
+ if ($parentName = $bundle->getParent()) {
+ if (isset($directChildren[$parentName])) {
+ throw new \LogicException(sprintf('Bundle "%s" is directly extended by two bundles "%s" and "%s".', $parentName, $name, $directChildren[$parentName]));
+ }
+ if ($parentName == $name) {
+ throw new \LogicException(sprintf('Bundle "%s" can not extend itself.', $name));
+ }
+ $directChildren[$parentName] = $name;
+ } else {
+ $topMostBundles[$name] = $bundle;
+ }
+ }
+
+ if (count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {
+ throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
+ }
+
+ $this->bundleMap = array();
+ foreach ($topMostBundles as $name => $bundle) {
+ $bundleMap = array($bundle);
+ $hierarchy = array($name);
+
+ while (isset($directChildren[$name])) {
+ $name = $directChildren[$name];
+ array_unshift($bundleMap, $this->bundles[$name]);
+ $hierarchy[] = $name;
+ }
+
+ foreach ($hierarchy as $bundle) {
+ $this->bundleMap[$bundle] = $bundleMap;
+ array_pop($bundleMap);
+ }
+ }
+
+ }
+
+
+ protected function getContainerClass()
+ {
+ return $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer';
+ }
+
+
+ protected function getContainerBaseClass()
+ {
+ return 'Container';
+ }
+
+
+ protected function initializeContainer()
+ {
+ $class = $this->getContainerClass();
+ $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
+ $fresh = true;
+ if (!$cache->isFresh()) {
+ $container = $this->buildContainer();
+ $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
+
+ $fresh = false;
+ }
+
+ require_once $cache;
+
+ $this->container = new $class();
+ $this->container->set('kernel', $this);
+
+ if (!$fresh && $this->container->has('cache_warmer')) {
+ $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
+ }
+ }
+
+
+ protected function getKernelParameters()
+ {
+ $bundles = array();
+ foreach ($this->bundles as $name => $bundle) {
+ $bundles[$name] = get_class($bundle);
+ }
+
+ return array_merge(
+ array(
+ 'kernel.root_dir' => $this->rootDir,
+ 'kernel.environment' => $this->environment,
+ 'kernel.debug' => $this->debug,
+ 'kernel.name' => $this->name,
+ 'kernel.cache_dir' => $this->getCacheDir(),
+ 'kernel.logs_dir' => $this->getLogDir(),
+ 'kernel.bundles' => $bundles,
+ 'kernel.charset' => $this->getCharset(),
+ 'kernel.container_class' => $this->getContainerClass(),
+ ),
+ $this->getEnvParameters()
+ );
+ }
+
+
+ protected function getEnvParameters()
+ {
+ $parameters = array();
+ foreach ($_SERVER as $key => $value) {
+ if (0 === strpos($key, 'SYMFONY__')) {
+ $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;
+ }
+ }
+
+ return $parameters;
+ }
+
+
+ protected function buildContainer()
+ {
+ foreach (array('cache' => $this->getCacheDir(), 'logs' => $this->getLogDir()) as $name => $dir) {
+ if (!is_dir($dir)) {
+ if (false === @mkdir($dir, 0777, true)) {
+ throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir));
+ }
+ } elseif (!is_writable($dir)) {
+ throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir));
+ }
+ }
+
+ $container = $this->getContainerBuilder();
+ $extensions = array();
+ foreach ($this->bundles as $bundle) {
+ if ($extension = $bundle->getContainerExtension()) {
+ $container->registerExtension($extension);
+ $extensions[] = $extension->getAlias();
+ }
+
+ if ($this->debug) {
+ $container->addObjectResource($bundle);
+ }
+ }
+ foreach ($this->bundles as $bundle) {
+ $bundle->build($container);
+ }
+
+ $container->addObjectResource($this);
+
+ $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions));
+
+ if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) {
+ $container->merge($cont);
+ }
+
+ $container->addCompilerPass(new AddClassesToCachePass($this));
+ $container->compile();
+
+ return $container;
+ }
+
+
+ protected function getContainerBuilder()
+ {
+ return new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
+ }
+
+
+ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass)
+ {
+ $dumper = new PhpDumper($container);
+ $content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass));
+ if (!$this->debug) {
+ $content = self::stripComments($content);
+ }
+
+ $cache->write($content, $container->getResources());
+ }
+
+
+ protected function getContainerLoader(ContainerInterface $container)
+ {
+ $locator = new FileLocator($this);
+ $resolver = new LoaderResolver(array(
+ new XmlFileLoader($container, $locator),
+ new YamlFileLoader($container, $locator),
+ new IniFileLoader($container, $locator),
+ new PhpFileLoader($container, $locator),
+ new ClosureLoader($container),
+ ));
+
+ return new DelegatingLoader($resolver);
+ }
+
+
+ public static function stripComments($source)
+ {
+ if (!function_exists('token_get_all')) {
+ return $source;
+ }
+
+ $output = '';
+ foreach (token_get_all($source) as $token) {
+ if (is_string($token)) {
+ $output .= $token;
+ } elseif (!in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
+ $output .= $token[1];
+ }
+ }
+
+ $output = preg_replace(array('/\s+$/Sm', '/\n+/S'), "\n", $output);
+
+ return $output;
+ }
+
+ public function serialize()
+ {
+ return serialize(array($this->environment, $this->debug));
+ }
+
+ public function unserialize($data)
+ {
+ list($environment, $debug) = unserialize($data);
+
+ $this->__construct($environment, $debug);
+ }
+}
+}
+
+
+
+
+namespace Symfony\Component\ClassLoader
+{
+
+
+class ApcClassLoader
+{
+ private $prefix;
+ private $classFinder;
+
+
+ public function __construct($prefix, $classFinder)
+ {
+ if (!extension_loaded('apc')) {
+ throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.');
+ }
+
+ if (!method_exists($classFinder, 'findFile')) {
+ throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
+ }
+
+ $this->prefix = $prefix;
+ $this->classFinder = $classFinder;
+ }
+
+
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+ }
+
+
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+ }
+
+
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ require $file;
+
+ return true;
+ }
+ }
+
+
+ public function findFile($class)
+ {
+ if (false === $file = apc_fetch($this->prefix.$class)) {
+ apc_store($this->prefix.$class, $file = $this->classFinder->findFile($class));
+ }
+
+ return $file;
+ }
+}
+}
+
+
+
+
+namespace Symfony\Component\HttpKernel\Bundle
+{
+
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
+
+
+interface BundleInterface extends ContainerAwareInterface
+{
+
+ public function boot();
+
+
+ public function shutdown();
+
+
+ public function build(ContainerBuilder $container);
+
+
+ public function getContainerExtension();
+
+
+ public function getParent();
+
+
+ public function getName();
+
+
+ public function getNamespace();
+
+
+ public function getPath();
+}
+}
+
+
+
+
+namespace Symfony\Component\DependencyInjection
+{
+
+
+abstract class ContainerAware implements ContainerAwareInterface
+{
+
+ protected $container;
+
+
+ public function setContainer(ContainerInterface $container = null)
+ {
+ $this->container = $container;
+ }
+}
+}
+
+
+
+
+namespace Symfony\Component\HttpKernel\Bundle
+{
+
+use Symfony\Component\DependencyInjection\ContainerAware;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Container;
+use Symfony\Component\Console\Application;
+use Symfony\Component\Finder\Finder;
+
+
+abstract class Bundle extends ContainerAware implements BundleInterface
+{
+ protected $name;
+ protected $reflected;
+ protected $extension;
+
+
+ public function boot()
+ {
+ }
+
+
+ public function shutdown()
+ {
+ }
+
+
+ public function build(ContainerBuilder $container)
+ {
+ }
+
+
+ public function getContainerExtension()
+ {
+ if (null === $this->extension) {
+ $basename = preg_replace('/Bundle$/', '', $this->getName());
+
+ $class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension';
+ if (class_exists($class)) {
+ $extension = new $class();
+
+ $expectedAlias = Container::underscore($basename);
+ if ($expectedAlias != $extension->getAlias()) {
+ throw new \LogicException(sprintf(
+ 'The extension alias for the default extension of a '.
+ 'bundle must be the underscored version of the '.
+ 'bundle name ("%s" instead of "%s")',
+ $expectedAlias, $extension->getAlias()
+ ));
+ }
+
+ $this->extension = $extension;
+ } else {
+ $this->extension = false;
+ }
+ }
+
+ if ($this->extension) {
+ return $this->extension;
+ }
+ }
+
+
+ public function getNamespace()
+ {
+ if (null === $this->reflected) {
+ $this->reflected = new \ReflectionObject($this);
+ }
+
+ return $this->reflected->getNamespaceName();
+ }
+
+
+ public function getPath()
+ {
+ if (null === $this->reflected) {
+ $this->reflected = new \ReflectionObject($this);
+ }
+
+ return dirname($this->reflected->getFileName());
+ }
+
+
+ public function getParent()
+ {
+ return null;
+ }
+
+
+ final public function getName()
+ {
+ if (null !== $this->name) {
+ return $this->name;
+ }
+
+ $name = get_class($this);
+ $pos = strrpos($name, '\\');
+
+ return $this->name = false === $pos ? $name : substr($name, $pos + 1);
+ }
+
+
+ public function registerCommands(Application $application)
+ {
+ if (!$dir = realpath($this->getPath().'/Command')) {
+ return;
+ }
+
+ $finder = new Finder();
+ $finder->files()->name('*Command.php')->in($dir);
+
+ $prefix = $this->getNamespace().'\\Command';
+ foreach ($finder as $file) {
+ $ns = $prefix;
+ if ($relativePath = $file->getRelativePath()) {
+ $ns .= '\\'.strtr($relativePath, '/', '\\');
+ }
+ $r = new \ReflectionClass($ns.'\\'.$file->getBasename('.php'));
+ if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract()) {
+ $application->add($r->newInstance());
+ }
+ }
+ }
+}
+}
+
+
+
+
+namespace Symfony\Component\Config
+{
+
+
+class ConfigCache
+{
+ private $debug;
+ private $file;
+
+
+ public function __construct($file, $debug)
+ {
+ $this->file = $file;
+ $this->debug = (Boolean) $debug;
+ }
+
+
+ public function __toString()
+ {
+ return $this->file;
+ }
+
+
+ public function isFresh()
+ {
+ if (!is_file($this->file)) {
+ return false;
+ }
+
+ if (!$this->debug) {
+ return true;
+ }
+
+ $metadata = $this->file.'.meta';
+ if (!is_file($metadata)) {
+ return false;
+ }
+
+ $time = filemtime($this->file);
+ $meta = unserialize(file_get_contents($metadata));
+ foreach ($meta as $resource) {
+ if (!$resource->isFresh($time)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+
+ public function write($content, array $metadata = null)
+ {
+ $dir = dirname($this->file);
+ if (!is_dir($dir)) {
+ if (false === @mkdir($dir, 0777, true)) {
+ throw new \RuntimeException(sprintf('Unable to create the %s directory', $dir));
+ }
+ } elseif (!is_writable($dir)) {
+ throw new \RuntimeException(sprintf('Unable to write in the %s directory', $dir));
+ }
+
+ $tmpFile = tempnam(dirname($this->file), basename($this->file));
+ if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $this->file)) {
+ @chmod($this->file, 0666 & ~umask());
+ } else {
+ throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $this->file));
+ }
+
+ if (null !== $metadata && true === $this->debug) {
+ $file = $this->file.'.meta';
+ $tmpFile = tempnam(dirname($file), basename($file));
+ if (false !== @file_put_contents($tmpFile, serialize($metadata)) && @rename($tmpFile, $file)) {
+ @chmod($file, 0666 & ~umask());
+ }
+ }
+ }
+}
+}
+
+
+
+
+namespace Symfony\Component\HttpKernel
+{
+
+use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
+use Symfony\Component\HttpKernel\Event\PostResponseEvent;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+
+
+class HttpKernel implements HttpKernelInterface, TerminableInterface
+{
+ protected $dispatcher;
+ protected $resolver;
+
+
+ public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver)
+ {
+ $this->dispatcher = $dispatcher;
+ $this->resolver = $resolver;
+ }
+
+
+ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+ {
+ try {
+ return $this->handleRaw($request, $type);
+ } catch (\Exception $e) {
+ if (false === $catch) {
+ throw $e;
+ }
+
+ return $this->handleException($e, $request, $type);
+ }
+ }
+
+
+ public function terminate(Request $request, Response $response)
+ {
+ $this->dispatcher->dispatch(KernelEvents::TERMINATE, new PostResponseEvent($this, $request, $response));
+ }
+
+
+ private function handleRaw(Request $request, $type = self::MASTER_REQUEST)
+ {
+ $event = new GetResponseEvent($this, $request, $type);
+ $this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
+
+ if ($event->hasResponse()) {
+ return $this->filterResponse($event->getResponse(), $request, $type);
+ }
+
+ if (false === $controller = $this->resolver->getController($request)) {
+ throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". Maybe you forgot to add the matching route in your routing configuration?', $request->getPathInfo()));
+ }
+
+ $event = new FilterControllerEvent($this, $controller, $request, $type);
+ $this->dispatcher->dispatch(KernelEvents::CONTROLLER, $event);
+ $controller = $event->getController();
+
+ $arguments = $this->resolver->getArguments($request, $controller);
+
+ $response = call_user_func_array($controller, $arguments);
+
+ if (!$response instanceof Response) {
+ $event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
+ $this->dispatcher->dispatch(KernelEvents::VIEW, $event);
+
+ if ($event->hasResponse()) {
+ $response = $event->getResponse();
+ }
+
+ if (!$response instanceof Response) {
+ $msg = sprintf('The controller must return a response (%s given).', $this->varToString($response));
+
+ if (null === $response) {
+ $msg .= ' Did you forget to add a return statement somewhere in your controller?';
+ }
+ throw new \LogicException($msg);
+ }
+ }
+
+ return $this->filterResponse($response, $request, $type);
+ }
+
+
+ private function filterResponse(Response $response, Request $request, $type)
+ {
+ $event = new FilterResponseEvent($this, $request, $type, $response);
+
+ $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
+
+ return $event->getResponse();
+ }
+
+
+ private function handleException(\Exception $e, $request, $type)
+ {
+ $event = new GetResponseForExceptionEvent($this, $request, $type, $e);
+ $this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event);
+
+ $e = $event->getException();
+
+ if (!$event->hasResponse()) {
+ throw $e;
+ }
+
+ $response = $event->getResponse();
+
+ if ($response->headers->has('X-Status-Code')) {
+ $response->setStatusCode($response->headers->get('X-Status-Code'));
+
+ $response->headers->remove('X-Status-Code');
+ } elseif (!$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) {
+ if ($e instanceof HttpExceptionInterface) {
+ $response->setStatusCode($e->getStatusCode());
+ $response->headers->add($e->getHeaders());
+ } else {
+ $response->setStatusCode(500);
+ }
+ }
+
+ try {
+ return $this->filterResponse($response, $request, $type);
+ } catch (\Exception $e) {
+ return $response;
+ }
+ }
+
+ private function varToString($var)
+ {
+ if (is_object($var)) {
+ return sprintf('Object(%s)', get_class($var));
+ }
+
+ if (is_array($var)) {
+ $a = array();
+ foreach ($var as $k => $v) {
+ $a[] = sprintf('%s => %s', $k, $this->varToString($v));
+ }
+
+ return sprintf("Array(%s)", implode(', ', $a));
+ }
+
+ if (is_resource($var)) {
+ return sprintf('Resource(%s)', get_resource_type($var));
+ }
+
+ if (null === $var) {
+ return 'null';
+ }
+
+ if (false === $var) {
+ return 'false';
+ }
+